Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found: New inputs with useful data at the bottom of each page. How to use? #173

Closed
plocket opened this issue Mar 15, 2021 · 2 comments
Closed

Comments

@plocket
Copy link
Collaborator

plocket commented Mar 15, 2021

Found hidden input elements at the bottom of the page. It's not clear how much use the data can be to us, but it does have the sought var for #158 at the very least. They come in name/value attributes. I've noted them below with an example and some notes. [The below is an example of the direct standard fields testing page, I think, and what those nodes look like and how they might correspond to data we need on the page.]

name = _checkboxes:

value =
'eyJZMmhsWTJ0aWIzaGxjMTk1WlhOdWJ3IjogIkZhbHNlIiwgIlkyaGxZMnRpYjNobGMxOXZkR2hsY2x0Q0oxa3lhR3haTW5ScFlqTm9abUl6VW05YVdFcG1Zak5DTUZoNlJTZGQiOiAiRmFsc2UiLCAiWTJobFkydGliM2hsYzE5dmRHaGxjbHRDSjFreWFHeFpNblJwWWpOb1ptSXpVbTlhV0VwbVlqTkNNRmg2U1NkZCI6ICJGYWxzZSIsICJZMmhsWTJ0aWIzaGxjMTl2ZEdobGNsdENKMWt5YUd4Wk1uUnBZak5vWm1JelVtOWFXRXBtWWpOQ01GaDZUU2RkIjogIkZhbHNlIiwgImNtRmthVzlmZVdWemJtOCI6ICJGYWxzZSJ9'

'{"Y2hlY2tib3hlc195ZXNubw": "False", "Y2hlY2tib3hlc19vdGhlcltCJ1kyaGxZMnRpYjNoZmIzUm9aWEpmYjNCMFh6RSdd": "False", "Y2hlY2tib3hlc19vdGhlcltCJ1kyaGxZMnRpYjNoZmIzUm9aWEpmYjNCMFh6SSdd": "False", "Y2hlY2tib3hlc19vdGhlcltCJ1kyaGxZMnRpYjNoZmIzUm9aWEpmYjNCMFh6TSdd": "False", "cmFkaW9feWVzbm8": "False"}'
checkboxes_yesno: 'False'
checkboxes_other[B'Y2hlY2tib3hfb3RoZXJfb3B0XzE']: 'False'
checkbox_other_opt_1
checkboxes_other[B'Y2hlY2tib3hfb3RoZXJfb3B0XzI']: 'False'
checkbox_other_opt_2
checkboxes_other[B'Y2hlY2tib3hfb3RoZXJfb3B0XzM']: 'False'
checkbox_other_opt_3
radio_yesno: 'False'

name = _event:

value =
'WyJ0aGluZ3NbMF0iXQ'
'["things[0]"]'

name = _question_name:

value =
'ID direct standard fields'

name = _tracker:

value =
5

name = _datatypes:

value =
'eyJaR2x5WldOMFgzTjBZVzVrWVhKa1gyWnBaV3hrY3ciOiAiYm9vbGVhbiIsICJkR2hwYm1kelcybGQiOiAidGV4dCIsICJZMmhsWTJ0aWIzaGxjMTk1WlhOdWJ3IjogImJvb2xlYW4iLCAiWTJobFkydGliM2hsYzE5dmRHaGxjZyI6ICJjaGVja2JveGVzIiwgImNtRmthVzlmZVdWemJtOCI6ICJib29sZWFuIiwgImNtRmthVzlmYjNSb1pYSSI6ICJ0ZXh0IiwgImRHVjRkRjlwYm5CMWRBIjogInRleHQiLCAiZEdWNGRHRnlaV0UiOiAidGV4dCIsICJaSEp2Y0dSdmQyNWZkR1Z6ZEEiOiAiZHJvcGRvd24ifQ'

'{"ZGlyZWN0X3N0YW5kYXJkX2ZpZWxkcw": "boolean", "dGhpbmdzW2ld": "text", "Y2hlY2tib3hlc195ZXNubw": "boolean", "Y2hlY2tib3hlc19vdGhlcg": "checkboxes", "cmFkaW9feWVzbm8": "boolean", "cmFkaW9fb3RoZXI": "text", "dGV4dF9pbnB1dA": "text", "dGV4dGFyZWE": "text", "ZHJvcGRvd25fdGVzdA": "dropdown"}'

direct_standard_fields: 'boolean'
things[i]: 'text'
checkboxes_yesno: 'boolean'
checkboxes_other: 'checkboxes'
radio_yesno: 'boolean'
radio_other: 'text'
text_input: 'text'
textarea: 'text'
dropdown_test: 'dropdown'

name = _varnames:

value =
'eyJYMlpwWld4a1h6QSI6ICJkR2hwYm1kelcybGQiLCAiWDJacFpXeGtYekUiOiAiWTJobFkydGliM2hsYzE5NVpYTnVidyIsICJYMlpwWld4a1h6SSI6ICJZMmhsWTJ0aWIzaGxjMTl2ZEdobGNnIiwgIlgyWnBaV3hrWHpNIjogImNtRmthVzlmZVdWemJtOCIsICJYMlpwWld4a1h6USI6ICJjbUZrYVc5ZmIzUm9aWEkiLCAiWDJacFpXeGtYelUiOiAiZEdWNGRGOXBibkIxZEEiLCAiWDJacFpXeGtYelkiOiAiZEdWNGRHRnlaV0UiLCAiWDJacFpXeGtYemMiOiAiWkhKdmNHUnZkMjVmZEdWemRBIn0'

'{"X2ZpZWxkXzA": "dGhpbmdzW2ld", "X2ZpZWxkXzE": "Y2hlY2tib3hlc195ZXNubw", "X2ZpZWxkXzI": "Y2hlY2tib3hlc19vdGhlcg", "X2ZpZWxkXzM": "cmFkaW9feWVzbm8", "X2ZpZWxkXzQ": "cmFkaW9fb3RoZXI", "X2ZpZWxkXzU": "dGV4dF9pbnB1dA", "X2ZpZWxkXzY": "dGV4dGFyZWE", "X2ZpZWxkXzc": "ZHJvcGRvd25fdGVzdA"}'
_field_0: 'things[i]'
_field_1: 'checkboxes_yesno'
_field_2: 'checkboxes_other'
_field_3: 'radio_yesno'
_field_4: 'radio_other'
_field_5: 'text_input'
_field_6: 'textarea'
_field_7: 'dropdown_test'

Not all of the above are actually on the page. E.g. "X2ZpZWxkXzA" is not directly in the DOM in any other way. It could be hidden inside a name attribute on show if nodes. It might only be on some elements, like checkbox choices. We may or may not end up using that, but we can look at the DOM more closely when we get there.

Question YAML:

id: direct standard fields
continue button field: direct_standard_fields
question: |
  Direct standard fields
subquestion: |
  One proxy vars (e.g. x, i, j, etc.) for testing.
fields:
  - something: things[i]
  - checkboxes (yesno): checkboxes_yesno
    datatype: yesno
  - checkboxes (other): checkboxes_other
    datatype: checkboxes
    choices: 
       - checkboxes opt 1: checkbox_other_opt_1
       - checkboxes opt 2: checkbox_other_opt_2
       - checkboxes opt 3: checkbox_other_opt_3
  - radio (yesno): radio_yesno
    datatype: yesnoradio
  - radio (other): radio_other
    datatype: radio
    choices: 
      - radio opt 1: radio_other_opt_1
      - radio opt 2: radio_other_opt_2
      - radio opt 3: radio_other_opt_3
  - text input: text_input
  - textarea: textarea
    input type: area
  - dropdown: dropdown_test
    datatype: dropdown
    choices:
      - dropdown opt 1: dropdown_opt_1
      - dropdown opt 2: dropdown_opt_2
      - dropdown opt 3: dropdown_opt_3

Vars and their corresponding new node data:

real var_name name in new nodes notes
direct standard fields _question_name YAML question id
direct_standard_fields _datatypes cont button
things[0] _event sought var as ["things[0]"]
things[0] _datatypes, _varnames as "things[i]", _varnames is _field_0
checkboxes_yesno _checkboxes, _datatypes, _varnames _varnames is _field_1
checkboxes_other _checkboxes, _datatypes, _varnames _varnames is _field_2
checkbox_other_opt_1 _checkboxes double encoded
checkbox_other_opt_2 _checkboxes double encoded
checkbox_other_opt_3 _checkboxes double encoded
radio_yesno _checkboxes, _datatypes, _varnames _varnames is _field_3
radio_other _datatypes, _varnames _varnames is _field_4
radio_other_opt_1
radio_other_opt_2
radio_other_opt_3
text_input _datatypes, _varnames _varnames is _field_5
textarea _datatypes, _varnames _varnames is _field_6
dropdown_test _datatypes, _varnames _varnames is _field_7
dropdown_opt_1
dropdown_opt_2
dropdown_opt_3
@plocket
Copy link
Collaborator Author

plocket commented Mar 15, 2021

Things we can get:

  1. sought var
  2. If input pattern matches _field_n, look in _varnames for matching actual var name. Will these ever be double encoded? Every field has a corresponding _field_n, even if that's not used to denote the variable name in the DOM. It'll show up encoded in the ids, but I'm not sure how to make that useful to us. Do we even need to find out the matching _field_n? No, we just need to translate from _field_n into the var name if the DOM is only supplying a _field_n. We don't need to match the other way around. Ok, this is doable, though I think I'm doing a bad job of articulating it.
  3. More?

@plocket
Copy link
Collaborator Author

plocket commented Jun 17, 2021

We are using things. I believe _event and _varnames, but these are going to change soon. _event might go away, so the devs will have to make sure the name of the sought var is on the page. This is discussed in other issues.

@plocket plocket closed this as completed Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant