From 265564ccbfc578aaec8f0c624c89d99e70453f32 Mon Sep 17 00:00:00 2001 From: justin-park Date: Wed, 23 Nov 2022 16:01:30 -0800 Subject: [PATCH] chore(dashboard): Ignore empty json value for overwrite confirm --- superset-frontend/src/dashboard/util/getOverwriteItems.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/dashboard/util/getOverwriteItems.ts b/superset-frontend/src/dashboard/util/getOverwriteItems.ts index 5301cb03af4de..7492b8aeacf71 100644 --- a/superset-frontend/src/dashboard/util/getOverwriteItems.ts +++ b/superset-frontend/src/dashboard/util/getOverwriteItems.ts @@ -33,8 +33,10 @@ export default function getOverwriteItems(prev: JsonObject, next: JsonObject) { keyPath, ...(keyPath.split('.').find(key => JSON_KEYS.has(key)) ? { - oldValue: JSON.stringify(extractValue(prev, keyPath), null, 2) || '', - newValue: JSON.stringify(extractValue(next, keyPath), null, 2) || '', + oldValue: + JSON.stringify(extractValue(prev, keyPath), null, 2) || '{}', + newValue: + JSON.stringify(extractValue(next, keyPath), null, 2) || '{}', } : { oldValue: extractValue(prev, keyPath) || '',