-
Notifications
You must be signed in to change notification settings - Fork 893
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
[Discover-next] add datasource container #7157
[Discover-next] add datasource container #7157
Conversation
Enables the editor to let plugins to mount their own data source component to the data source container. Issue partially resolved: opensearch-project#7129 Signed-off-by: Kawika Avilla <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7157 +/- ##
========================================
Coverage 67.47% 67.48%
========================================
Files 3451 3468 +17
Lines 68060 68372 +312
Branches 11068 11111 +43
========================================
+ Hits 45926 46143 +217
- Misses 19455 19529 +74
- Partials 2679 2700 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
just some questions
this.setState({ isDataSetsVisible: enhancement?.searchBar?.showDataSetsSelector ?? true }); | ||
this.setState({ | ||
isDataSourcesVisible: enhancement?.searchBar?.showDataSourcesSelector ?? true, | ||
}); |
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.
is it better to combine the setStates into one call? I forgot if react optimizes this
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.
you're right that would be the better approach i'll fast follow
@@ -280,6 +296,11 @@ export default class QueryEditorUI extends Component<Props, State> { | |||
<EuiFlexItem grow={false}> | |||
<EuiFlexGroup gutterSize="xs" alignItems="center" className={`${className}__wrapper`}> | |||
<EuiFlexItem grow={false}>{this.props.prepend}</EuiFlexItem> | |||
{this.state.isDataSourcesVisible && ( | |||
<EuiFlexItem grow={false} className={`${className}__dataSourceWrapper`}> | |||
<div ref={this.props.dataSourceContainerRef} /> |
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.
what's the consideration to expose a ref rather than directly rendering the component here?
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.
thanks for asking this one:
i'm using the data source management plugin for that component. so to avoid a circular dependency and not introduce datasourcemanagements as a required bundle. i do it in the query enhancements which can take that optional depedency
@@ -288,8 +309,8 @@ export default class QueryEditorUI extends Component<Props, State> { | |||
appName={this.services.appName} | |||
/> | |||
</EuiFlexItem> | |||
{this.state.isDataSourcesVisible && ( | |||
<EuiFlexItem grow={false} className={`${className}__dataSourceWrapper`}> | |||
{this.state.isDataSetsVisible && ( |
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.
should this be isDataSetVisible
? I see some are plural some are singular, do we plan to allow multiple dataSets/dataSources on UI or just one?
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.
scared me. had to check. yeah i modified it for this because plural makes sense for me like its the selector which can select multiple datasets. But tbh, I was on the fence too. I just wanted to updated in this file so its both plural.
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.
got it, it's minor but i wasn't sure if it's on purpose. if it's plural should it be areDataSetsVisible
or dataSetsVisible
?
} | ||
|
||
div:is([class$="--group"]) { | ||
padding: 0 !important; |
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 see !important
is used in many places already, is it avoidable?
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.
it's actually the OUI combo box. I would like to avoid it but some of the classes everywhere have like added padded so this is to avoid the height of the flex box getting pushed around
Added data source selector that pulls from saved objects and also added a connections service and passing it with the dataframe. Related to: opensearch-project/OpenSearch-Dashboards#7157
* [Discover-next] add datasource container Enables the editor to let plugins to mount their own data source component to the data source container. Issue partially resolved: #7129 Signed-off-by: Kawika Avilla <[email protected]> * Changeset file for PR #7157 created/updated --------- Signed-off-by: Kawika Avilla <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit e1c5cfd) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* [Discover-next] add datasource container Enables the editor to let plugins to mount their own data source component to the data source container. Issue partially resolved: #7129 * Changeset file for PR #7157 created/updated --------- (cherry picked from commit e1c5cfd) Signed-off-by: Kawika Avilla <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
…pensearch-project#7164) * [Discover-next] add datasource container Enables the editor to let plugins to mount their own data source component to the data source container. Issue partially resolved: opensearch-project#7129 * Changeset file for PR opensearch-project#7157 created/updated --------- (cherry picked from commit e1c5cfd) Signed-off-by: Kawika Avilla <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
Enables the editor to let plugins to mount their own data source component to the data source container.
Related to:
kavilla/queryEnhancements#29
Issues Partially Resolved
#7129
Screenshot
Testing the changes
yarn start:enhancements
Changelog
Check List
yarn test:jest
yarn test:jest_integration