forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Multiple Datasource] Fix style of data source option inside popover …
…for data source selector, selectable, multi select components (opensearch-project#6438) * adjust style Signed-off-by: Lu Yu <[email protected]> * fix style for data source components Signed-off-by: Lu Yu <[email protected]> * clean up Signed-off-by: Lu Yu <[email protected]> * add change log Signed-off-by: Lu Yu <[email protected]> * remove unused style prop Signed-off-by: Lu Yu <[email protected]> * fix snapshot Signed-off-by: Lu Yu <[email protected]> --------- Signed-off-by: Lu Yu <[email protected]>
- Loading branch information
Showing
15 changed files
with
123 additions
and
111 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
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
28 changes: 28 additions & 0 deletions
28
src/plugins/data_source_management/public/components/data_source_item/data_source_item.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,28 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import React from 'react'; | ||
import { EuiBadge, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; | ||
import { DataSourceOption } from '../data_source_menu/types'; | ||
|
||
interface DataSourceItemProps { | ||
className: string; | ||
option: DataSourceOption[]; | ||
defaultDataSource: string | null; | ||
} | ||
|
||
export const DataSourceItem = ({ className, option, defaultDataSource }: DataSourceItemProps) => { | ||
return ( | ||
<EuiFlexGroup justifyContent="spaceBetween" className={`${className}OuiFlexGroup`}> | ||
<EuiFlexItem className={`${className}OuiFlexItem`} grow={false}> | ||
{option.label || ''} | ||
</EuiFlexItem> | ||
{option.id === defaultDataSource && ( | ||
<EuiFlexItem grow={false}> | ||
<EuiBadge iconSide="left">Default</EuiBadge> | ||
</EuiFlexItem> | ||
)} | ||
</EuiFlexGroup> | ||
); | ||
}; |
6 changes: 6 additions & 0 deletions
6
src/plugins/data_source_management/public/components/data_source_item/index.ts
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,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { DataSourceItem } from './data_source_item'; |
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
27 changes: 10 additions & 17 deletions
27
...ponents/data_source_multi_selectable/__snapshots__/data_source_filter_group.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...e_management/public/components/data_source_multi_selectable/data_source_filter_group.scss
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,13 @@ | ||
.dataSourceFilterGroupItems { | ||
overflow: scroll; | ||
max-width: 300px; | ||
|
||
.dataSourceFilterGroupOuiFlexGroup { | ||
.dataSourceFilterGroupOuiFlexItem { | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
display: inline-block; | ||
} | ||
} | ||
} |
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
29 changes: 0 additions & 29 deletions
29
src/plugins/data_source_management/public/components/data_source_option.tsx
This file was deleted.
Oops, something went wrong.
21 changes: 4 additions & 17 deletions
21
...blic/components/data_source_selectable/__snapshots__/data_source_selectable.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...ta_source_management/public/components/data_source_selectable/data_source_selectable.scss
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,12 @@ | ||
.dataSourceSelectableOuiPanel { | ||
width: 300px; | ||
|
||
.dataSourceSelectableOuiFlexGroup { | ||
.dataSourceSelectableOuiFlexItem { | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
display: inline-block; | ||
} | ||
} | ||
} |
Oops, something went wrong.