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

feat(components): Add static class name with button style #26639

Merged
merged 1 commit into from
Feb 1, 2024
Merged

feat(components): Add static class name with button style #26639

merged 1 commit into from
Feb 1, 2024

Conversation

mskelton
Copy link
Contributor

SUMMARY

Adds a static class name to buttons based on their style (e.g. primary, secondary, etc.) to more easily allow custom CSS styling of buttons.

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@john-bodley
Copy link
Member

Thanks @mskelton for the change. Given that we're changing the button class is there expected to be any UI changes? If so would you mind including before/after screenshots.

@mskelton
Copy link
Contributor Author

@john-bodley This PR adds a new class, it doesn't change or remove any existing classes, so there are no expected UI changes.

@mistercrunch
Copy link
Member

Seems superset-frontend/package-lock.json should not be affected by this PR, mind pulling it out?

@rusackas
Copy link
Member

Can you explain the use case for the class? We're a little nervous about adding code that serves no purpose to most folks.

If this is to support CSS templates at the dashboard level (where you can add custom CSS) that's one thing... we would just want to annotate the lines of code serving this purpose.

If this is to customize the button for an entire Superset installation, the correct way would be to edit the Emotion based styling in the Button component, rather than adding hooks to layer on additional CSS files. CSS and LESS have been deprecated in favor of Emotion, and we'd rather see changes made on those grounds, or even steer toward more proper Emotion-based theming.

@mskelton
Copy link
Contributor Author

@rusackas The purpose is to support custom CSS for embedded dashboards. The use case I have is to customize the controls in the dashboard (e.g. buttons, checkbox, dropdowns, etc. to align more closely with the app we are embedding superset in. Most controls I'm able to use class names from the Ant components (e.g. .ant-menu-item), but buttons are styled differently based on the style, however there isn't an associated class to allow me to control that.

Happy to add a comment to the line explaining the purpose of the class name.

@mskelton
Copy link
Contributor Author

@mistercrunch The package-lock.json was committed by mistake, I've reverted it.

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7fccea1) 69.04% compared to head (165dfe9) 69.07%.
Report is 179 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26639      +/-   ##
==========================================
+ Coverage   69.04%   69.07%   +0.02%     
==========================================
  Files        1931     1932       +1     
  Lines       75327    78860    +3533     
  Branches     8429     9511    +1082     
==========================================
+ Hits        52013    54475    +2462     
- Misses      21167    22056     +889     
- Partials     2147     2329     +182     
Flag Coverage Δ
javascript 57.47% <ø> (+0.98%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rusackas
Copy link
Member

closing/reopening to kick CI.

@rusackas rusackas closed this Jan 31, 2024
@rusackas rusackas reopened this Jan 31, 2024
@mistercrunch mistercrunch merged commit 959a5a5 into apache:master Feb 1, 2024
60 of 62 checks passed
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.0.0 labels Apr 17, 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 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants