diff --git a/app/layout/project/sidebar/scenario/grid-setup/features/modals/split/index.tsx b/app/layout/project/sidebar/scenario/grid-setup/features/modals/split/index.tsx index ef9b8d4040..839c3b80a0 100644 --- a/app/layout/project/sidebar/scenario/grid-setup/features/modals/split/index.tsx +++ b/app/layout/project/sidebar/scenario/grid-setup/features/modals/split/index.tsx @@ -91,7 +91,7 @@ const SplitModal = ({ selectedFeaturesMutation.mutate( { - id: `${sid}`, + id: sid, data: { status: 'draft', features: selectedFeaturesQuery.data.map((sf) => { @@ -204,7 +204,10 @@ const SplitModal = ({ clearSelectionLabel="Clear selection" selected={values.splitOption} options={SPLIT_OPTIONS} - onChange={fprops.input.onChange} + onChange={(v) => { + fprops.input.onChange(v); + setSplitFeaturesSelected([]); + }} /> @@ -223,7 +226,7 @@ const SplitModal = ({ (sfs) => sfs.id === `${value.name}` ); return ( -
+
{data.map((item) => ( {name} - {isCustom && scenarioUsageCount && ( + {Boolean(isCustom && scenarioUsageCount) && (
Currently in use in{' '} diff --git a/app/layout/project/sidebar/scenario/grid-setup/features/target-spf/targets-spf-table/types.ts b/app/layout/project/sidebar/scenario/grid-setup/features/target-spf/targets-spf-table/types.ts index 06e024c841..bd33d51a84 100644 --- a/app/layout/project/sidebar/scenario/grid-setup/features/target-spf/targets-spf-table/types.ts +++ b/app/layout/project/sidebar/scenario/grid-setup/features/target-spf/targets-spf-table/types.ts @@ -12,6 +12,7 @@ export type DataItem = { isVisibleOnMap: boolean; isCustom?: boolean; type: Feature['tag']; + splitted: boolean; marxanSettings: Record<'prop' | 'spf', number>; splitOptions: { key: string; label: string; values: { id: string; name: string }[] }[]; value?: string;