Skip to content

Commit

Permalink
fix(dashboard): label colors included in explore url (apache#16621)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent aca35d2 commit 2957167
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions superset-frontend/src/dashboard/actions/hydrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import { isEqual } from 'lodash';
import {
CategoricalColorNamespace,
DataRecordFilters,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -110,7 +115,7 @@ export default function getFormDataWithExtraFilters({
...extraData,
};
cachedFiltersByChart[sliceId] = filters;
cachedFormdataByChart[sliceId] = formData;
cachedFormdataByChart[sliceId] = { ...formData, dataMask };

return formData;
}

0 comments on commit 2957167

Please sign in to comment.