You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/10/22 14:18:11 UTC

[GitHub] [superset] michael-s-molina commented on a change in pull request #17089: fix: Color consistency

michael-s-molina commented on a change in pull request #17089:
URL: https://github.com/apache/superset/pull/17089#discussion_r734570809



##########
File path: superset-frontend/src/dashboard/actions/dashboardInfo.ts
##########
@@ -17,13 +17,32 @@
  * under the License.
  */
 import { Dispatch } from 'redux';
-import { makeApi } from '@superset-ui/core';
+import { makeApi, CategoricalColorNamespace } from '@superset-ui/core';
+import { isString } from 'lodash';
 import { ChartConfiguration, DashboardInfo } from '../reducers/types';
 
 export const DASHBOARD_INFO_UPDATED = 'DASHBOARD_INFO_UPDATED';
 
 // updates partially changed dashboard info
 export function dashboardInfoChanged(newInfo: { metadata: any }) {
+  const { metadata } = newInfo;
+  const { color_namespace: namespace, label_colors: labelColors } = metadata;
+
+  const categoricalNamespace = CategoricalColorNamespace.getNamespace(
+    namespace,
+  );
+
+  categoricalNamespace.resetColors();

Review comment:
       I noticed that in `superset-frontend/src/dashboard/actions/hydrate.js` you're not calling `resetColors` before setting the colors. Is it ok or do we need to change something?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org