-
Notifications
You must be signed in to change notification settings - Fork 867
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Workspace] Integrate workspace front end with data connection type s…
…aved object (#8013) (#8269) * feat: integrate workspace with data connections * update workspace pages and hooks to integrate with data connection * Changeset file for PR #8013 created/updated * remove extra comments * update data source import * test: update tests * Changeset file for PR #8013 created/updated * unify connection type icon and connectionType * test: add tests * display text directly instead of link for data connection in table * Apply suggestions from code review * update --------- (cherry picked from commit c894584) Signed-off-by: tygao <[email protected]> Signed-off-by: Tianyu Gao <[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> Co-authored-by: SuZhou-Joe <[email protected]>
- Loading branch information
1 parent
6971d8b
commit 6ea0cb4
Showing
18 changed files
with
485 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Integrate workspace with data connections in front end ([#8013](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8013)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...rkspace/public/components/workspace_form/__snapshots__/connection_type_icon.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
src/plugins/workspace/public/components/workspace_form/connection_type_icon.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
|
||
import { ConnectionTypeIcon } from './connection_type_icon'; | ||
|
||
describe('ConnectionTypeIcon', () => { | ||
it('should render normally', () => { | ||
expect(mount(<ConnectionTypeIcon />)).toMatchSnapshot(); | ||
expect(mount(<ConnectionTypeIcon type="Amazon S3" />)).toMatchSnapshot(); | ||
}); | ||
}); |
29 changes: 29 additions & 0 deletions
29
src/plugins/workspace/public/components/workspace_form/connection_type_icon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiIcon } from '@elastic/eui'; | ||
|
||
import prometheusLogo from '../../assets/prometheus_logo.svg'; | ||
import s3Logo from '../../assets/s3_logo.svg'; | ||
import cloudWatchLogo from '../../assets/cloudwatch_logo.svg'; | ||
import securityLakeLogo from '../../assets/security_lake_logo.svg'; | ||
import { DataConnectionType } from '../../../../data_source/common/'; | ||
|
||
// Direct query connection and data connection both have different types, each type has a corresponding icon | ||
export const ConnectionTypeIcon = ({ type }: { type?: string }) => { | ||
switch (type) { | ||
case 'Amazon S3': | ||
return <EuiIcon type={s3Logo} />; | ||
case 'Prometheus': | ||
return <EuiIcon type={prometheusLogo} />; | ||
case DataConnectionType.CloudWatch: | ||
return <EuiIcon type={cloudWatchLogo} />; | ||
case DataConnectionType.SecurityLake: | ||
return <EuiIcon type={securityLakeLogo} />; | ||
default: | ||
return null; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
src/plugins/workspace/public/components/workspace_form/direct_query_connection_icon.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.