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 18:55:46 UTC

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

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


##########
superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx:
##########
@@ -314,7 +311,7 @@ class HeaderActionsDropdown extends React.PureComponent {
           <Menu.Item key={MENU_KEYS.EDIT_CSS}>
             <CssEditor
               triggerNode={<span>{t('Edit CSS')}</span>}
-              initialCss={this.state.css}
+              initialCss={customCss}

Review Comment:
   @prosdev0107 did you check how `initialCss` works? 
   I believe `initialCss` is required in mounting only, not in every rendering. If we use props value directly, `intialCss` will be defined every rendering, which is not its purpose. 
   
   What about the following?
   ```
   componentDidMount() {
      this.setState({
          css: this.props.customCss
      });
   }
   ...
   ...
   <CssEditor
       initialCss={this.state.css}
       ...
   />
   ```
   What do you think @diegomedina248 ?



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