Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: Multi-org dropdown shouldn't show typeahead if only one account/org #794

Merged
merged 10 commits into from
Jul 6, 2022

Conversation

wdoconnell
Copy link
Contributor

@wdoconnell wdoconnell commented Jul 1, 2022

Per UI 4047 and UI 4051, the multi-org dropdown:

  1. Should not display the 'switch account' or 'switch org' menu if there's only one account or org.
  2. Should check for the currently 'selected' account or org's id after converting to a string: Org arrays have string ids, but account arrays have number ids.

EDIT: Removed prior change involving sorting selected item to first part of the array. That is easier to handle in a sort in the UI.

Checklist

Check all that apply

  • Updated documentation to reflect changes [N/A]
  • Added entry to top of Changelog with link to PR (not issue)
  • Tests pass
  • Peer reviewed and approved
  • Signed CLA (if not already signed) [N/A - InfluxData employee)

@wdoconnell wdoconnell requested a review from a team July 1, 2022 15:51
@ChitlangeSahas ChitlangeSahas self-requested a review July 1, 2022 16:42
@wdoconnell wdoconnell changed the title fix: multiorg dropdown displays selected item first, doesnt offer opt… fix: Multi-org dropdown shouldn't show typeahead if only one account/org Jul 6, 2022
selected={value.id === selectedItem?.id}
/* Values need to be compared as string because account items have number ids*/
selected={
value.id.toString() === selectedItem?.id.toString()
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@wdoconnell wdoconnell merged commit d43f2b5 into master Jul 6, 2022
@wdoconnell wdoconnell deleted the billOC_multiOrg_sync_fixes branch July 6, 2022 17:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants