-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config layer basic component (#54)
Signed-off-by: Junqiu Lei <[email protected]>
- Loading branch information
1 parent
74f01cb
commit 9d8b5a1
Showing
15 changed files
with
257 additions
and
79 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
src/plugins/maps_dashboards/public/components/add_layer_panel/add_layer_panel.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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
.addLayer__button { | ||
padding: $euiSizeM $euiSizeM | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/plugins/maps_dashboards/public/components/layer_config/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 { LayerConfigPanel } from './layer_config_panel'; |
48 changes: 48 additions & 0 deletions
48
src/plugins/maps_dashboards/public/components/layer_config/layer_config_panel.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,48 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { | ||
EuiButton, | ||
EuiFlyout, | ||
EuiFlyoutBody, | ||
EuiFlyoutFooter, | ||
EuiFlyoutHeader, | ||
EuiCodeBlock, | ||
EuiTitle, | ||
} from '@elastic/eui'; | ||
import { ILayerConfig } from '../../model/ILayerConfig'; | ||
|
||
interface Props { | ||
setIsLayerConfigVisible: Function; | ||
selectedLayerConfig: ILayerConfig; | ||
} | ||
|
||
export const LayerConfigPanel = ({ setIsLayerConfigVisible, selectedLayerConfig }: Props) => { | ||
return ( | ||
<EuiFlyout type="push" size="s" onClose={() => setIsLayerConfigVisible(false)}> | ||
<EuiFlyoutHeader hasBorder> | ||
<EuiTitle size="m"> | ||
<h2>{selectedLayerConfig.name}</h2> | ||
</EuiTitle> | ||
</EuiFlyoutHeader> | ||
<EuiFlyoutBody> | ||
<EuiCodeBlock | ||
language="js" | ||
fontSize="m" | ||
paddingSize="m" | ||
color="dark" | ||
overflowHeight={300} | ||
isCopyable | ||
> | ||
{JSON.stringify(selectedLayerConfig)} | ||
</EuiCodeBlock> | ||
</EuiFlyoutBody> | ||
<EuiFlyoutFooter> | ||
<EuiButton onClick={() => setIsLayerConfigVisible(false)}>Close</EuiButton> | ||
</EuiFlyoutFooter> | ||
</EuiFlyout> | ||
); | ||
}; |
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.