From cc2334e58c023ee4e67bc5747cec81d2e1013397 Mon Sep 17 00:00:00 2001 From: "JUST.in DO IT" Date: Sat, 26 Nov 2022 03:44:27 -0800 Subject: [PATCH] chore(dashboard): Ignore empty json value for overwrite confirm (#22214) --- 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 5301cb03a..7492b8aea 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) || '',