From 15ebfdf0e93b228613557ebf95a027c563d58b03 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 30 Oct 2024 14:56:11 +0000 Subject: [PATCH 1/2] Fix settings added and removed by conditions not triggering component refresh --- packages/client/src/components/Component.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte index 9c8aada1bc..7a1341c67c 100644 --- a/packages/client/src/components/Component.svelte +++ b/packages/client/src/components/Component.svelte @@ -554,7 +554,12 @@ cachedSettings = { ...allSettings } initialSettings = cachedSettings } else { - Object.keys(allSettings).forEach(key => { + // We need to compare all keys from both the current and previous settings, as + // keys may have disappeared in the current set which would otherwise be ignored + // if we only checked the current set keys + const keys = new Set(Object.keys(allSettings)) + Object.keys(cachedSettings).forEach(key => keys.add(key)) + keys.forEach(key => { const same = propsAreSame(allSettings[key], cachedSettings[key]) if (!same) { // Updated cachedSettings (which is assigned by reference to From 67a988ae2184f4025d62f0addea66462c54a8be4 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 30 Oct 2024 15:05:06 +0000 Subject: [PATCH 2/2] Automatically refresh datasources after executing row actions via a button action --- packages/client/src/utils/buttonActions.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 847a32116d..e2b0071042 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -500,6 +500,10 @@ const rowActionHandler = async action => { sourceId: resourceId, rowId, }) + // Refresh related datasources + await dataSourceStore.actions.invalidateDataSource(resourceId, { + invalidateRelationships: true, + }) } const handlerMap = {