diff --git a/app/hooks/cost-surface/index.ts b/app/hooks/cost-surface/index.ts index 4bd03899dd..e69927f0ed 100644 --- a/app/hooks/cost-surface/index.ts +++ b/app/hooks/cost-surface/index.ts @@ -19,16 +19,19 @@ export function useProjectCostSurfaces( { id: 'gfehrtf22534geyg', name: 'Cost Surface Rwanda A', + isCustom: true, scenarioUsageCount: 3, }, { id: 'rfjghhrtersdtbkjshfw', name: 'Cost Surface Rwanda B', + isCustom: true, scenarioUsageCount: 0, }, { id: '23275455HGVVCMSJHDFk', name: 'Cost Surface Rwanda C', + isCustom: true, scenarioUsageCount: 0, }, ]; diff --git a/app/layout/project/sidebar/project/inventory-panel/components/inventory-table/types.ts b/app/layout/project/sidebar/project/inventory-panel/components/inventory-table/types.ts index 87b464baed..55942fbe87 100644 --- a/app/layout/project/sidebar/project/inventory-panel/components/inventory-table/types.ts +++ b/app/layout/project/sidebar/project/inventory-panel/components/inventory-table/types.ts @@ -6,7 +6,7 @@ export type DataItem = { scenarios: number; tag?: string; isVisibleOnMap: boolean; - isCustom: boolean; + isCustom?: boolean; }; export type InventoryTable = { diff --git a/app/layout/project/sidebar/project/inventory-panel/cost-surfaces/index.tsx b/app/layout/project/sidebar/project/inventory-panel/cost-surfaces/index.tsx index 616cdb7ad5..003b2d1fd1 100644 --- a/app/layout/project/sidebar/project/inventory-panel/cost-surfaces/index.tsx +++ b/app/layout/project/sidebar/project/inventory-panel/cost-surfaces/index.tsx @@ -45,6 +45,7 @@ const InventoryPanelCostSurface = ({ noData: noDataMessage }: { noData: string } data?.map((cs) => ({ id: cs.id, name: cs.name, + isCustom: cs.isCustom, scenarioUsageCount: cs.scenarioUsageCount, })), keepPreviousData: true, @@ -106,11 +107,12 @@ const InventoryPanelCostSurface = ({ noData: noDataMessage }: { noData: string } const displayBulkActions = selectedCostSurfaceIds.length > 0; - const data: DataItem[] = allProjectCostSurfacesQuery.data?.map((wdpa) => ({ - ...wdpa, - name: wdpa.name, - scenarios: wdpa.scenarioUsageCount, - isVisibleOnMap: visibleCostSurfaces?.includes(wdpa.id), + const data: DataItem[] = allProjectCostSurfacesQuery.data?.map((cs) => ({ + ...cs, + name: cs.name, + scenarios: cs.scenarioUsageCount, + isCustom: cs.isCustom, + isVisibleOnMap: visibleCostSurfaces?.includes(cs.id), })); return ( diff --git a/app/types/api/cost-surface.ts b/app/types/api/cost-surface.ts index 5fe2235785..7390ea12ba 100644 --- a/app/types/api/cost-surface.ts +++ b/app/types/api/cost-surface.ts @@ -1,5 +1,6 @@ export interface CostSurface { id: string; name: string; + isCustom: boolean; scenarioUsageCount: number; }