-
Notifications
You must be signed in to change notification settings - Fork 917
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] Integrate workspace front end with data connection type saved object #8013
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a137624
feat: integrate workspace with data connections
raintygao 4771d37
update workspace pages and hooks to integrate with data connection
raintygao 5136db1
Changeset file for PR #8013 created/updated
opensearch-changeset-bot[bot] 7af04ca
remove extra comments
raintygao 2e303f1
update data source import
raintygao c628a36
test: update tests
raintygao 78629d7
Changeset file for PR #8013 created/updated
opensearch-changeset-bot[bot] e4d1916
unify connection type icon and connectionType
raintygao c4ae001
test: add tests
raintygao a78d01a
display text directly instead of link for data connection in table
raintygao db41ee2
Apply suggestions from code review
raintygao c87b2d8
update
raintygao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
imo this could be cleaned up with using the data structures https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/plugins/data/common/datasets/types.ts#L75.
where we have the information about the icon and type
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, will take a look.
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 checked the interface of this data structure and haven't seen any related integration with data-connection type object. I suppose this is still in progress?