-
Notifications
You must be signed in to change notification settings - Fork 916
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
[Multiple DataSource] DataSourceSelectable support to render label by getting it from dataSourceOptions #6358
[Multiple DataSource] DataSourceSelectable support to render label by getting it from dataSourceOptions #6358
Conversation
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6358 +/- ##
=======================================
Coverage 67.56% 67.56%
=======================================
Files 3379 3379
Lines 65894 65897 +3
Branches 10660 10655 -5
=======================================
+ Hits 44522 44526 +4
- Misses 18774 18776 +2
+ Partials 2598 2595 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
...s/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx
Outdated
Show resolved
Hide resolved
...s/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx
Outdated
Show resolved
Hide resolved
...s/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx
Outdated
Show resolved
Hide resolved
...s/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx
Outdated
Show resolved
Hide resolved
...s/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx
Outdated
Show resolved
Hide resolved
...s/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
...s/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Can we double check the test case 3? Based on the implementation, it should not be the case |
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
synced with @BionIT offline, we do not need to take care this case in DataSourceSelectable, since we do not have a placeholder |
if (!hideLocalCluster) { | ||
// console.log("hideLocalCluster", hideLocalCluster) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, is this for debugging? can we remove?
}, | ||
]; | ||
} | ||
// console.log("defaultDataSourceAfterCheck", defaultDataSourceAfterCheck) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, is this for debugging? can we remove?
@@ -43,7 +43,7 @@ interface DataSourceSelectableState { | |||
dataSourceOptions: SelectedDataSourceOption[]; | |||
isPopoverOpen: boolean; | |||
selectedOption?: SelectedDataSourceOption[]; | |||
defaultDataSource: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we need this union type since we set it like const defaultDataSource = this.props.uiSettings?.get('defaultDataSource', null) ?? null;
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
LGTM, rerunning skipped ciGroup5 before merging into |
… getting it from dataSourceOptions (#6358) * get label from dataSourceOptions Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update dataSourceOptions Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update changelog Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * fix failed test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * address comments and fix test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update selected option checked status and udpate snapshot Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update selectable test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * revert example code Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * revern config file Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * push the utils Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * udpate snapshot Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * remove console log Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * udate default data source Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * remove unnessary check for empty input Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * fix failed test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * fix failed test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> --------- Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> (cherry picked from commit 85df662) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
… getting it from dataSourceOptions (#6358) (#6382) * get label from dataSourceOptions Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update dataSourceOptions Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update changelog Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * fix failed test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * address comments and fix test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update selected option checked status and udpate snapshot Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update selectable test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * revert example code Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * revern config file Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * push the utils Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * udpate snapshot Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * remove console log Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * udate default data source Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * remove unnessary check for empty input Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * fix failed test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * fix failed test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> --------- Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> (cherry picked from commit 85df662) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Today the datasource menu does not populate the label of the datasource based on the datasourceId. This can be confusing to users, who may not know what human-readable datasource they are looking at.
This PR is going to resolve: when only given the dataSourceId to
DataSourceSelectable
, the component can get the label from existingdataSourceIdToLabel
mapIssues Resolved
Screenshot
Testing the changes
test cases:
activeOption={[{id: ''}]}
hideLocalCluster={true} // need to set in the
opensearc_dashboards.yml
there are ds options, even not pass in activeOptions, display the default options
please also refer to case 9
activeOption={[]}
hideLocalCluster={true} //does not matter
// not filter out default
we do not need this case for DataSourceSelectable
selectedOption={[{id: 'invalid'}]}
hideLocalCluster={false}
selectedOption={[{id: ''}]}
hideLocalCluster={false}
hideLocalCluster={true}
Check List
yarn test:jest
yarn test:jest_integration