From 850a2fd1bc569f0b3790393e2e9b9d784a9eb1e0 Mon Sep 17 00:00:00 2001 From: Rohit Kandimalla Date: Tue, 21 Jan 2025 10:21:34 -0500 Subject: [PATCH] MAT-7968 re-rendering the UI builder tables when a measure is drafted from Edit Page --- src/CqlBuilderPanel/Includes/Results/Results.tsx | 2 +- src/CqlBuilderPanel/Parameters/SavedParameters.tsx | 2 +- .../savedCodesSubSection/SavedCodesSubSection.tsx | 4 +++- .../definitionsSection/definitions/Definitions.tsx | 2 +- src/CqlBuilderPanel/functionsSection/functions/Functions.tsx | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CqlBuilderPanel/Includes/Results/Results.tsx b/src/CqlBuilderPanel/Includes/Results/Results.tsx index d7ac3ece..de4a3221 100644 --- a/src/CqlBuilderPanel/Includes/Results/Results.tsx +++ b/src/CqlBuilderPanel/Includes/Results/Results.tsx @@ -277,7 +277,7 @@ const Results = ({ ...columnDefs, ] : columnDefs; - }, [cqlLibraries, isCQLUnchanged]); + }, [canEdit, cqlLibraries, isCQLUnchanged]); const table = useReactTable({ data, diff --git a/src/CqlBuilderPanel/Parameters/SavedParameters.tsx b/src/CqlBuilderPanel/Parameters/SavedParameters.tsx index eaa73c90..b772b112 100644 --- a/src/CqlBuilderPanel/Parameters/SavedParameters.tsx +++ b/src/CqlBuilderPanel/Parameters/SavedParameters.tsx @@ -148,7 +148,7 @@ const SavedParameters = ({ }, }, ], - [parameters, isCQLUnchanged] + [canEdit, parameters, isCQLUnchanged] ); const table = useReactTable({ diff --git a/src/CqlBuilderPanel/codesSection/codesSubSection/savedCodesSubSection/SavedCodesSubSection.tsx b/src/CqlBuilderPanel/codesSection/codesSubSection/savedCodesSubSection/SavedCodesSubSection.tsx index 13963466..b82f59f3 100644 --- a/src/CqlBuilderPanel/codesSection/codesSubSection/savedCodesSubSection/SavedCodesSubSection.tsx +++ b/src/CqlBuilderPanel/codesSection/codesSubSection/savedCodesSubSection/SavedCodesSubSection.tsx @@ -169,6 +169,8 @@ export default function SavedCodesSubSection({ setTotalPages, ]); + console.log("canEdit in saved components", canEdit); + const TH = tw.th`p-3 text-left text-sm font-bold capitalize`; const columns = useMemo[]>( () => [ @@ -246,7 +248,7 @@ export default function SavedCodesSubSection({ ), }, ], - [isCQLUnchanged] + [canEdit, isCQLUnchanged, measureModel] ); const table = useReactTable({ diff --git a/src/CqlBuilderPanel/definitionsSection/definitions/Definitions.tsx b/src/CqlBuilderPanel/definitionsSection/definitions/Definitions.tsx index ec7f88f5..56ccec31 100644 --- a/src/CqlBuilderPanel/definitionsSection/definitions/Definitions.tsx +++ b/src/CqlBuilderPanel/definitionsSection/definitions/Definitions.tsx @@ -190,7 +190,7 @@ const Definitions = ({ }, }, ], - [definitions] + [canEdit, definitions] ); const table = useReactTable({ diff --git a/src/CqlBuilderPanel/functionsSection/functions/Functions.tsx b/src/CqlBuilderPanel/functionsSection/functions/Functions.tsx index 7a515751..0545244f 100644 --- a/src/CqlBuilderPanel/functionsSection/functions/Functions.tsx +++ b/src/CqlBuilderPanel/functionsSection/functions/Functions.tsx @@ -189,7 +189,7 @@ const Functions = ({ }, }, ], - [functions, isCQLUnchanged] + [canEdit, functions, isCQLUnchanged] ); const table = useReactTable({