-
Notifications
You must be signed in to change notification settings - Fork 935
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
[Workspace] Refactor data source association panel #8383
Changes from 5 commits
0b2bb1b
0c5b90f
2165f38
bb2363e
3aeff67
57bcdff
892fe16
416d935
b768623
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Refactor data source association panel ([#8383](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8383)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,15 @@ | |
*/ | ||
|
||
import React, { useCallback, useRef } from 'react'; | ||
import { EuiSpacer, EuiTitle, EuiForm, EuiText, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; | ||
import { | ||
EuiSpacer, | ||
EuiTitle, | ||
EuiForm, | ||
EuiText, | ||
EuiFlexItem, | ||
EuiFlexGroup, | ||
EuiPanel, | ||
} from '@elastic/eui'; | ||
import { i18n } from '@osd/i18n'; | ||
import { | ||
useWorkspaceForm, | ||
|
@@ -110,29 +118,31 @@ export const WorkspaceCreatorForm = (props: WorkspaceCreatorFormProps) => { | |
{/* SelectDataSourcePanel is only visible for dashboard admin and when data source is enabled*/} | ||
{isDashboardAdmin && isDataSourceEnabled && ( | ||
<> | ||
<EuiTitle | ||
{...generateRightSidebarScrollProps(RightSidebarScrollField.DataSource)} | ||
size="s" | ||
> | ||
<h3> | ||
{i18n.translate('workspace.creator.form.associateDataSourceTitle', { | ||
defaultMessage: 'Associate data sources', | ||
<EuiPanel> | ||
<EuiTitle | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
{...generateRightSidebarScrollProps(RightSidebarScrollField.DataSource)} | ||
size="s" | ||
> | ||
<h2> | ||
{i18n.translate('workspace.creator.form.associateDataSourceTitle', { | ||
defaultMessage: 'Associate data sources', | ||
})} | ||
</h2> | ||
</EuiTitle> | ||
<EuiText size="xs"> | ||
{i18n.translate('workspace.creator.form.associateDataSourceDescription', { | ||
defaultMessage: | ||
'Add at least one data source that will be available in the workspace. If a selected OpenSearch connection has related Direct Query connections, they will also be available in the workspace.', | ||
})} | ||
</h3> | ||
</EuiTitle> | ||
<EuiText size="xs"> | ||
{i18n.translate('workspace.creator.form.associateDataSourceDescription', { | ||
defaultMessage: | ||
'Add data sources that will be available in the workspace. If a selected OpenSearch connection has embedded Direct Query connection, they will also be available in the workspace.', | ||
})} | ||
</EuiText> | ||
<SelectDataSourcePanel | ||
onChange={setSelectedDataSourceConnections} | ||
savedObjects={savedObjects} | ||
assignedDataSourceConnections={formData.selectedDataSourceConnections} | ||
data-test-subj={`workspaceForm-dataSourcePanel`} | ||
showDataSourceManagement={true} | ||
/> | ||
</EuiText> | ||
<SelectDataSourcePanel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need more spacing between description and SelectDataSourcePanel? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In SelectDataSourcePanel, there's already a |
||
onChange={setSelectedDataSourceConnections} | ||
savedObjects={savedObjects} | ||
assignedDataSourceConnections={formData.selectedDataSourceConnections} | ||
data-test-subj={`workspaceForm-dataSourcePanel`} | ||
showDataSourceManagement={true} | ||
/> | ||
</EuiPanel> | ||
<EuiSpacer size="s" /> | ||
<EuiSpacer size="s" /> | ||
</> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Kapian1234 I think this file should not be included in this PR. Can we remove it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
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 keep this fragment?
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.
ok