Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
[chore] drill disabled prop to layer-type-selector (#2274)
Igor D5bae745b6a2f
diff --git a/src/components/src/index.ts b/src/components/src/index.tsindex 703f6870b..e0ac62703 100644--- a/src/components/src/index.ts+++ b/src/components/src/index.ts@@ -76,6 +76,7 @@ export {default as LayerConfiguratorFactory,LayerColorRangeSelector,getLayerConfiguratorProps,+ getLayerDataset,getVisConfiguratorProps,ArcLayerColorSelector,LayerColorSelectordiff --git a/src/components/src/side-panel/layer-panel/layer-configurator.tsx b/src/components/src/side-panel/layer-panel/layer-configurator.tsxindex e920632fa..ad678a1c1 100644--- a/src/components/src/side-panel/layer-panel/layer-configurator.tsx+++ b/src/components/src/side-panel/layer-panel/layer-configurator.tsx@@ -68,6 +68,7 @@ type LayerConfiguratorProps = {) => void;updateLayerColorUI: (prop: string, newConfig: NestedPartial<ColorUI>) => void;updateLayerTextLabel: (idx: number | 'all', prop: string, value: any) => void;+ disableTypeSelect?: boolean;};type LayerColorSelectorProps = {@@ -138,7 +139,8 @@ const StyledLayerVisualConfigurator = styled.div.attrs({export const getLayerFields = (datasets: Datasets, layer: Layer) =>layer.config?.dataId && datasets[layer.config.dataId] ? datasets[layer.config.dataId].fields : [];-export const getLayerDataset = (datasets: Datasets, layer: Layer) =>+/** Return any to be able to customize the Dataset entity */+export const getLayerDataset = (datasets: Datasets, layer: Layer): any =>layer.config?.dataId && datasets[layer.config.dataId] ? datasets[layer.config.dataId] : null;export const getLayerConfiguratorProps = (props: LayerConfiguratorProps) => ({@@ -1051,7 +1053,14 @@ export default function LayerConfiguratorFactory(}render() {- const {layer, datasets, updateLayerConfig, layerTypeOptions, updateLayerType} = this.props;+ const {+ layer,+ datasets,+ updateLayerConfig,+ layerTypeOptions,+ updateLayerType,+ disableTypeSelect = false+ } = this.props;const {fields = [], fieldPairs = undefined} = layer.config.dataId? datasets[layer.config.dataId]: {};@@ -1071,6 +1080,7 @@ export default function LayerConfiguratorFactory(<LayerConfigGroup label={'layer.basic'} collapsible expanded={!layer.hasAllColumns()}><LayerTypeSelectorselected={layer.type}+ disabled={disableTypeSelect}options={layerTypeOptions}// @ts-ignoreonSelect={updateLayerType}diff --git a/src/components/src/side-panel/layer-panel/layer-type-selector.tsx b/src/components/src/side-panel/layer-panel/layer-type-selector.tsxindex 9f9aeb3b2..7c18c4cc1 100644--- a/src/components/src/side-panel/layer-panel/layer-type-selector.tsx+++ b/src/components/src/side-panel/layer-panel/layer-type-selector.tsx@@ -48,6 +48,7 @@ export type LayerTypeSelectorProps = {options: LayerTypeOption[];// TODO add correct type after Theme typingtheme: Record<string, string>;+ disabled: boolean;};const StyledLayerTypeSelector = styled.div`@@ -65,7 +66,12 @@ function LayerTypeSelectorFactory(LayerTypeListItem: ReturnType<typeof LayerTypeListItemFactory>,LayerTypeDropdownList: ReturnType<typeof LayerTypeDropdownListFactory>) {- const LayerTypeSelector: React.FC<LayerTypeSelectorProps> = ({selected, options, onSelect}) => {+ const LayerTypeSelector: React.FC<LayerTypeSelectorProps> = ({+ selected,+ options,+ onSelect,+ disabled+ }) => {const selectedItems = useMemo(() => options.find(op => op.id === selected), [options,selected@@ -78,6 +84,7 @@ function LayerTypeSelectorFactory(selectedItems={selectedItems}options={options}multiSelect={false}+ disabled={disabled}placeholder="placeholder.selectType"onChange={onSelect}getOptionValue={getOptionValue}