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

fix: Map type Variables selector shows keys, not values #15354

Merged
merged 1 commit into from
Oct 8, 2019

Conversation

hoorayimhelping
Copy link
Contributor

@hoorayimhelping hoorayimhelping commented Oct 8, 2019

Closes #14054

Map variable types are key-value pairs. Previously, the dashboard variable dropdown showed the keys (correct behavior), but the query variable dropdown would show values. Both now show keys.

Testing instructions (assuming you have variables):

  1. Click data explorer
  2. Change to script editor mode
  3. Click variables tab
  4. Click on your map variable type
  5. It should show the key, not the value.

@hoorayimhelping hoorayimhelping requested a review from a team October 8, 2019 19:56
@ghost ghost requested review from zoesteinkamp and removed request for a team October 8, 2019 19:56

expect(dropdownItems.length).toBe(Object.keys(values).length)
expect(dropdownItems).toEqual(Object.keys(values))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

fireEvent.click(getByLabelText('Value'))
fireEvent.click(getByTestId('dropdown--button'))
Object.keys(variableValues).forEach(variableKey => {
expect(getByText(variableKey)).toBeTruthy()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@ebb-tide ebb-tide requested review from zoesteinkamp and removed request for zoesteinkamp October 8, 2019 21:42
Copy link
Contributor

@zoesteinkamp zoesteinkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great :)

Copy link
Contributor

@ebb-tide ebb-tide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hoorayimhelping
Copy link
Contributor Author

Thanks y'all!

@hoorayimhelping hoorayimhelping changed the title Show the keys of map type variables, not values fix: Map type Variables selector shows keys, not values Oct 8, 2019
@hoorayimhelping hoorayimhelping force-pushed the bucky_variable_show_keys branch from 6dbcbda to fb65f5c Compare October 8, 2019 22:33
@hoorayimhelping hoorayimhelping changed the title fix: Map type Variables selector shows keys, not values fix: Map type Variables selector shows keys, not values (#14054) Oct 8, 2019
@hoorayimhelping hoorayimhelping changed the title fix: Map type Variables selector shows keys, not values (#14054) fix: Map type Variables selector shows keys, not values Oct 8, 2019
add test for hydrateVars

dashboard variable dropdown test: inspect values, not just array length

add RTL test for variable dropdown changes

lint

fix: Disable saving threshold check if no threshold selected (#15348)

* Prevent check saving if no thresholds

* Add tests

* Add changes to changelog

* make optional props optional

* use false instead of null for boolean

changelog

fix(ui): ignore false change events in VariableForm (#15317)

closes #15059

the issue is to persist user data across variable type selection interfaces within the variable editor. this commit pushes all of the variable editor information down to redux to allow persistence outside of the view state until the user clicks "cancel" or "create" in the interface.
@hoorayimhelping hoorayimhelping force-pushed the bucky_variable_show_keys branch from fb65f5c to 78244ce Compare October 8, 2019 22:52
@hoorayimhelping hoorayimhelping merged commit e90ab6e into master Oct 8, 2019
@hoorayimhelping hoorayimhelping deleted the bucky_variable_show_keys branch October 8, 2019 23:06
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

Successfully merging this pull request may close these issues.

Map variable type should show the keys in the dropdown not the values
3 participants