Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: saving custom CSS correctly from dashboard editor #10289

Merged
merged 1 commit into from
Jul 13, 2020

Conversation

rusackas
Copy link
Member

SUMMARY

A fix was made to the save as modal that wasn't applied to the method called by the save as button after editing the custom CSS. This fixes the parameter name (which was changed to avoid a collision with Emotion props).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

ADDITIONAL INFORMATION

Copy link

@graceguo-supercat graceguo-supercat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks!

@rusackas rusackas merged commit 93753cf into apache:master Jul 13, 2020
@rusackas rusackas deleted the css-saving-fix branch July 13, 2020 04:14
@PowerPlop
Copy link

When editing a dashboard and applying a custom css template, the change is not saved when pressing 'save changes' . You need to explicitly select 'Save As' + 'Overwrite' to keep the css change. Is this expected behavior?

@avicenteg
Copy link

Hello,

Altough it save the changes, when closing the dashboard and reopening it, it doesn't charge the custom CSS.

It is happening to anyone?

@avicenteg
Copy link

@rusackas @junlincc
Can you check my previous comment?
When I save my changes in the custom CSS, it is stored, but not charged when rendering again the dashboard.
For example:
image
image
I refresh the page and:
image

If I inspect the page, it is like if the css template were overwrited by the default css.
image

Do you have any clue of what can be happening?

@rusackas
Copy link
Member Author

rusackas commented Nov 1, 2020

I haven't tried to replicate this exactly, but my guess would be that your CSS selector, and the one built into the column.less file are the same specificity, so they "tie" with the win going to the one that is loaded last by the browser. I might try to find some time to make sure that user-generated styles are loaded last (or feel free to help, if you're so inclined). For an easy way out, though, you probably just need to add to the selector to give it a slightly higher specificity. Even something silly like like adding body, e.g. body .grid-column > ... should do the trick.

@avicenteg
Copy link

@rusackas I'll try your advice. Also I'll check if I can find a way for loading the custom css first, if I find some solution I'll let you know.

auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[dashboard] Custom CSS stopped working
5 participants