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:05:56 UTC

[GitHub] [superset] prosdev0107 opened a new pull request, #19840: fix(dashboard-css): make to load saved css template

prosdev0107 opened a new pull request, #19840:
URL: https://github.com/apache/superset/pull/19840

   ### SUMMARY
   CSS template not saving
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   BEFORE:
   ![CSS template not saving](https://user-images.githubusercontent.com/47900232/165147303-ce288f35-bb7d-4d06-b560-ac26944f2b3e.gif)
   
   AFTER:
   Uploading screen-css-template.mov…
   
   ### TESTING INSTRUCTIONS
   **How to reproduce issues**
   
   1. Create a dashboard
   2. Edit CSS and load a CSS template, for instance the one that shows up by default
   3. Save the changes to the dashboard
   4. Reload the page
   5. Edit the dashboard again
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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


[GitHub] [superset] codecov[bot] commented on pull request #19840: fix(dashboard-css): make to load saved css template

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #19840:
URL: https://github.com/apache/superset/pull/19840#issuecomment-1108958349

   # [Codecov](https://codecov.io/gh/apache/superset/pull/19840?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#19840](https://codecov.io/gh/apache/superset/pull/19840?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (71edb8f) into [master](https://codecov.io/gh/apache/superset/commit/523bd8b79cfd48d1cb3a94f89c8095976844ce59?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (523bd8b) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 71edb8f differs from pull request most recent head 965944d. Consider uploading reports for the commit 965944d to get more accurate results
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #19840   +/-   ##
   =======================================
     Coverage   66.55%   66.55%           
   =======================================
     Files        1692     1692           
     Lines       64802    64802           
     Branches     6657     6657           
   =======================================
     Hits        43129    43129           
     Misses      19973    19973           
     Partials     1700     1700           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/19840?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../components/Header/HeaderActionsDropdown/index.jsx](https://codecov.io/gh/apache/superset/pull/19840/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci9IZWFkZXJBY3Rpb25zRHJvcGRvd24vaW5kZXguanN4) | `67.79% <ø> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19840?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19840?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [523bd8b...965944d](https://codecov.io/gh/apache/superset/pull/19840?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [superset] rusackas merged pull request #19840: fix(dashboard-css): make to load saved css template

Posted by GitBox <gi...@apache.org>.
rusackas merged PR #19840:
URL: https://github.com/apache/superset/pull/19840


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


[GitHub] [superset] github-actions[bot] commented on pull request #19840: fix(dashboard-css): make to load saved css template

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #19840:
URL: https://github.com/apache/superset/pull/19840#issuecomment-1110238253

   @rusackas Ephemeral environment spinning up at http://54.203.4.231:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


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


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

Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #19840:
URL: https://github.com/apache/superset/pull/19840#issuecomment-1110236675

   /testenv up


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


[GitHub] [superset] github-actions[bot] commented on pull request #19840: fix(dashboard-css): make to load saved css template

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #19840:
URL: https://github.com/apache/superset/pull/19840#issuecomment-1111278463

   Ephemeral environment shutdown and build artifacts deleted.


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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19840:
URL: https://github.com/apache/superset/pull/19840#discussion_r857934499


##########
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:
   I tried to resolve it with componentDidMount but it doesn't work.



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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19840:
URL: https://github.com/apache/superset/pull/19840#discussion_r857960418


##########
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:
   I resolved this with componentWillReceiveProps.



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