diff --git a/superset-frontend/src/dashboard/actions/hydrate.js b/superset-frontend/src/dashboard/actions/hydrate.js index 7b0e0ae144b1e..9c524e2d05be4 100644 --- a/superset-frontend/src/dashboard/actions/hydrate.js +++ b/superset-frontend/src/dashboard/actions/hydrate.js @@ -371,8 +371,8 @@ export const hydrateDashboard = (dashboardData, chartData) => ( // only persistent refreshFrequency will be saved to backend shouldPersistRefreshFrequency: false, css: dashboardData.css || '', - colorNamespace: metadata?.color_namespace, - colorScheme: metadata?.color_scheme, + colorNamespace: metadata?.color_namespace || null, + colorScheme: metadata?.color_scheme || null, editMode: canEdit && editMode, isPublished: dashboardData.published, hasUnsavedChanges: false, diff --git a/superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts b/superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts index 2587588eac0c3..ea5ef7b3aa0ea 100644 --- a/superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts +++ b/superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import { isEqual } from 'lodash'; import { CategoricalColorNamespace, DataRecordFilters, @@ -71,9 +70,15 @@ export default function getFormDataWithExtraFilters({ const cachedFormData = cachedFormdataByChart[sliceId]; if ( cachedFiltersByChart[sliceId] === filters && - cachedFormData?.color_scheme === colorScheme && - cachedFormData?.color_namespace === colorNamespace && - isEqual(cachedFormData?.label_colors, labelColors) && + areObjectsEqual(cachedFormData?.color_scheme, colorScheme, { + ignoreUndefined: true, + }) && + areObjectsEqual(cachedFormData?.color_namespace, colorNamespace, { + ignoreUndefined: true, + }) && + areObjectsEqual(cachedFormData?.label_colors, labelColors, { + ignoreUndefined: true, + }) && !!cachedFormData && areObjectsEqual(cachedFormData?.dataMask, dataMask, { ignoreUndefined: true, @@ -110,7 +115,7 @@ export default function getFormDataWithExtraFilters({ ...extraData, }; cachedFiltersByChart[sliceId] = filters; - cachedFormdataByChart[sliceId] = formData; + cachedFormdataByChart[sliceId] = { ...formData, dataMask }; return formData; }