From b69495b07de19ef4a2c594988486b6315a8bf8c1 Mon Sep 17 00:00:00 2001 From: Patrick Segura Date: Thu, 5 Dec 2024 09:49:47 -0600 Subject: [PATCH] Added cache key, removed toggle icon if no children --- src/app/index.tsx | 3 +++ .../ModelToOperations/_components/Table/columns.tsx | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/app/index.tsx b/src/app/index.tsx index 391ea34693..878b5fc008 100644 --- a/src/app/index.tsx +++ b/src/app/index.tsx @@ -126,6 +126,9 @@ const client = new ApolloClient({ OperationalSolution: { keyFields: ['key', 'nameOther', 'id'] }, + MTOSubcategory: { + keyFields: ['milestones'] + }, LockableSectionLockStatus: { keyFields: ['lockedByUserAccount', ['id'], 'section', 'modelPlanID'] } diff --git a/src/features/ModelPlan/ModelToOperations/_components/Table/columns.tsx b/src/features/ModelPlan/ModelToOperations/_components/Table/columns.tsx index e1412398a6..61783cc68f 100644 --- a/src/features/ModelPlan/ModelToOperations/_components/Table/columns.tsx +++ b/src/features/ModelPlan/ModelToOperations/_components/Table/columns.tsx @@ -133,6 +133,14 @@ export const columns: ColumnType[] = [ Cell: ({ row, rowType, expanded }: RowProps) => { const { riskIndicator } = row; + if ('subCategories' in row) { + if (row.subCategories.length === 0) return <>; + } + + if ('milestones' in row) { + if (row.milestones.length === 0) return <>; + } + if (rowType !== 'milestone') return (