-
Notifications
You must be signed in to change notification settings - Fork 915
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
Add set default datasource #6186
Add set default datasource #6186
Conversation
Looks like there are some lint issues (see Build and test / Build and Verify on Linux CI). Can you fix those please? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6186 +/- ##
=======================================
Coverage 67.24% 67.25%
=======================================
Files 3345 3345
Lines 64826 64840 +14
Branches 10432 10435 +3
=======================================
+ Hits 43595 43606 +11
- Misses 18689 18690 +1
- Partials 2542 2544 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
const setDefaultAriaLabel = i18n.translate( | ||
'dataSourcesManagement.editDataSource.setDefaultDataSource', | ||
{ | ||
defaultMessage: 'Set as default Data Source.', | ||
} | ||
); |
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.
nit: Set as default data source
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.
Will do
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.
+1
...ugins/data_source_management/public/components/edit_data_source/components/header/header.tsx
Outdated
Show resolved
Hide resolved
@@ -144,6 +174,8 @@ export const Header = ({ | |||
{/* Right side buttons */} | |||
<EuiFlexItem grow={false}> | |||
<EuiFlexGroup alignItems="baseline" gutterSize="m" responsive={false}> | |||
{/* Test defaultn button */} |
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.
nit: spelling mistake
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.
Will change it
Is this option only going to be on edit screen? What about while creating data source? Can we set default data source while creating data source? Just to avoid multiple clicks and rendering multiple forms to set default data source. |
CHANGELOG.md
Outdated
@@ -117,6 +117,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
- [Discover] Enhanced the data source selector with added sorting functionality ([#5609](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5609)) | |||
- [Multiple Datasource] Add datasource picker component and use it in devtools and tutorial page when multiple datasource is enabled ([#5756](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5756)) | |||
- [Multiple Datasource] Add datasource picker to import saved object flyout when multiple data source is enabled ([#5781](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5781)) | |||
- [Multiple Datasource] Add default functionality for customer to choose default datasource ([#6058](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/6058)) |
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.
we should put the change log in the unreleased enhancement section above, this section is for previous 2.12 release
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.
Will do
} | ||
|
||
isDefault = () => { | ||
return this.props.isDefault; |
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.
looks like this function only exists to return the prop, then do we need it? Can we just use the prop value?
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.
+1
const setDefaultAriaLabel = i18n.translate( | ||
'dataSourcesManagement.editDataSource.setDefaultDataSource', | ||
{ | ||
defaultMessage: 'Set as default Data Source.', | ||
} | ||
); |
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.
+1
@@ -128,7 +135,9 @@ export const EditDataSource: React.FunctionComponent<RouteComponentProps<{ id: s | |||
<EditDataSourceForm |
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.
can we add tests for this component?
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.
added!
CHANGELOG.md
Outdated
@@ -12,6 +12,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
|
|||
- Support dynamic CSP rules to mitigate Clickjacking https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5641 | |||
- [CVE-2020-36604] Employ a patched version of hoek `6.1.3` ([#6148](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6148)) | |||
- [CVE-2023-45857] Bump `axios` from `0.27.2` to `1.6.1` ([#5470](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5470)) |
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.
changelog updates should not contain other PRs. probably just need a rebase.
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.
Will do
@zhyuanqi |
Currently, we don't support set default data source while creating data source. I believe it is the same as index pattern as they don't support set as default during creation. Maybe we can add this in the feature |
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
05fb380
to
2e66cf9
Compare
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
LGTM, just curious - |
meanwhile picking up the latest from main and re-running all the checks |
So we always want customer to have a default datasource. Although customer can not undefault datasource, they can default other datasource in order to undefault the previous one.
|
* Add set default datasource Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * Fix typo Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * change on this.props.isDefault Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * add unit test Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * set data_source to false Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * add more unit test Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * fix lint error Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * edit one more unit test Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * Fix another typo Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> --------- Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> Co-authored-by: ZilongX <[email protected]> (cherry picked from commit d2347ca) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* Add set default datasource Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * Fix typo Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * change on this.props.isDefault Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * add unit test Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * set data_source to false Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * add more unit test Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * fix lint error Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * edit one more unit test Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> * Fix another typo Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> --------- Signed-off-by: Yuanqi(Ella) Zhu <[email protected]> Co-authored-by: ZilongX <[email protected]> (cherry picked from commit d2347ca) 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
Add the default datasource. So after customer sets the datasource, this will store in the Kibana config
For overview default datasource, it should have feature below:
Issues Resolved
#6058
Screenshot
Screen.Recording.2024-03-18.at.2.17.02.PM.mov
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration