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 2019/03/27 23:17:30 UTC

[GitHub] [incubator-superset] graceguo-supercat commented on a change in pull request #7135: Enable color consistency in a dashboard

graceguo-supercat commented on a change in pull request #7135: Enable color consistency in a dashboard
URL: https://github.com/apache/incubator-superset/pull/7135#discussion_r269807363
 
 

 ##########
 File path: superset/assets/src/dashboard/actions/dashboardState.js
 ##########
 @@ -261,6 +261,18 @@ export function removeSliceFromDashboard(id) {
   };
 }
 
+export const SET_COLOR_SCHEME = 'SET_COLOR_SCHEME';
+export function setColorScheme(colorScheme) {
+  return { type: SET_COLOR_SCHEME, colorScheme };
+}
+
+export function setColorSchemeAndUnsavedChanges(colorScheme) {
+  return dispatch => {
+    dispatch(setColorScheme(colorScheme));
+    dispatch(setUnsavedChanges(true));
 
 Review comment:
   setUnsavedChanges (and `hasUnsavedChanges` state) is shared with dashboard's layout change. If you change color scheme,  change dashboard layout, then undo a all dashboard layout change, the hasUnsavedChanges flag will be reset. 
   you probably have to add some logic to make sure this flag carries changes from both.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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