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.
Add color, icon and defaultVISTheme for workspace (#36)
* feat: add color, icon and defaultVISTheme field for workspace saved object Signed-off-by: Lin Wang <wonglam@amazon.com> * add new fields to workspace form Signed-off-by: Lin Wang <wonglam@amazon.com> * feat: remove feature or group name hack Signed-off-by: Lin Wang <wonglam@amazon.com> --------- Signed-off-by: Lin Wang <wonglam@amazon.com>
- Loading branch information
Showing
5 changed files
with
171 additions
and
77 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
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
36 changes: 36 additions & 0 deletions
36
src/plugins/workspace/public/components/workspace_creator/workspace_icon_selector.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,36 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; | ||
|
||
const icons = ['glasses', 'search', 'bell']; | ||
|
||
export const WorkspaceIconSelector = ({ | ||
color, | ||
value, | ||
onChange, | ||
}: { | ||
color?: string; | ||
value?: string; | ||
onChange: (value: string) => void; | ||
}) => { | ||
return ( | ||
<EuiFlexGroup> | ||
{icons.map((item) => ( | ||
<EuiFlexItem | ||
key={item} | ||
onClick={() => { | ||
onChange(item); | ||
}} | ||
grow={false} | ||
> | ||
<EuiIcon size="l" type={item} color={value === item ? color : undefined} /> | ||
</EuiFlexItem> | ||
))} | ||
</EuiFlexGroup> | ||
); | ||
}; |