Skip to content

Commit

Permalink
Update layer type UI on config panel (opensearch-project#188)
Browse files Browse the repository at this point in the history
Signed-off-by: Junqiu Lei <[email protected]>
  • Loading branch information
junqiu-lei authored Jan 10, 2023
1 parent f4dc5d3 commit 19b4761
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
8 changes: 0 additions & 8 deletions public/components/layer_config/layer_basic_settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ export const LayerBasicSettings = ({
</EuiTitle>
<EuiSpacer size="m" />
<EuiForm>
<EuiFormRow label="Type" fullWidth={true}>
<EuiFieldText
name="layerType"
value={layersTypeNameMap[selectedLayerConfig.type]}
readOnly={true}
fullWidth={true}
/>
</EuiFormRow>
<EuiFormRow label="Name" error={errors} isInvalid={invalid} fullWidth={true}>
<EuiFieldText
name="layerName"
Expand Down
11 changes: 9 additions & 2 deletions public/components/layer_config/layer_config_panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiIcon,
EuiSpacer,
} from '@elastic/eui';

import { MapLayerSpecification } from '../../model/mapLayerType';
import { BaseMapLayerConfigPanel } from './index';
import { DASHBOARDS_MAPS_LAYER_TYPE } from '../../../common';
import { DocumentLayerConfigPanel } from './documents_config/document_layer_config_panel';
import { layersTypeIconMap } from '../../model/layersFunctions';
import { layersTypeIconMap, layersTypeNameMap } from '../../model/layersFunctions';
import { CustomMapConfigPanel } from './custom_map_config/custom_map_config_panel';

interface Props {
Expand Down Expand Up @@ -104,14 +105,20 @@ export const LayerConfigPanel = ({
className="layerConfigPanel"
>
<EuiFlyoutHeader hasBorder={true}>
<EuiFlexGroup gutterSize="s" justifyContent="spaceAround">
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiIcon type={layersTypeIconMap[selectedLayerConfig.type]} size="m" />
</EuiFlexItem>
<EuiFlexItem>
<strong>{selectedLayerConfig.name}</strong>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="s" />
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<small>Type: {layersTypeNameMap[selectedLayerConfig.type]}</small>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlyoutHeader>
<EuiFlyoutBody>
<EuiFlexGroup className="layerBasicSettings" direction="column">
Expand Down

0 comments on commit 19b4761

Please sign in to comment.