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 2022/04/25 19:38:20 UTC

[GitHub] [superset] diegomedina248 commented on a diff in pull request #19840: fix(dashboard-css): make to load saved css template

diegomedina248 commented on code in PR #19840:
URL: https://github.com/apache/superset/pull/19840#discussion_r857964867


##########
superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx:
##########
@@ -136,6 +136,12 @@ class HeaderActionsDropdown extends React.PureComponent {
       });
   }
 
+  UNSAFE_componentWillReceiveProps(nextProps) {
+    if (this.props.customCss !== nextProps.customCss) {
+      this.setState({ css: nextProps.customCss });

Review Comment:
   seems like `customCss` comes from redux store, which is updated via `updateCss`.
   Maybe we can try removing the following from `changeCss`, and inject the custom css after saving it here?:
   ```js
   this.setState({ css }, () => {
     injectCustomCss(css);
   });
   ```
   
   That would leave us with a single source of truth, which is better (if it works as desired)



-- 
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