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

refactor: Removes hard coded colors #11977

Merged
merged 3 commits into from
Dec 10, 2020

Conversation

michael-s-molina
Copy link
Member

@michael-s-molina michael-s-molina commented Dec 9, 2020

SUMMARY

Removes hard coded colors defined in src/components/styles.ts. The colors defined in this file were used only in the Select component so they were migrated to src/components/Select/styles.tsx and adjusted to conform to the theme colors.

Here is the theme color palette and the corresponding mapping:

Screen Shot 2020-12-09 at 11 33 21 AM

Here are some screenshots of Select component:

Screen Shot 2020-12-10 at 9 04 21 AM

Screen Shot 2020-12-10 at 10 02 38 AM

Screen Shot 2020-12-10 at 10 00 27 AM

Screen Shot 2020-12-10 at 9 03 18 AM

TEST PLAN

You can view the select component inside Storybooks.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

Removes hard coded colors defined in src/components/styles.ts. The colors defined in this file were used only in the Select component so they were migrated to src/components/Select/styles.tsx and ajusted to conform to the theme colors.
@junlincc
Copy link
Member

junlincc commented Dec 9, 2020

welcome on board Michael! thanks for the first PR!! @michael-s-molina

@codecov-io
Copy link

codecov-io commented Dec 9, 2020

Codecov Report

Merging #11977 (a484e36) into master (cc44a2c) will decrease coverage by 2.63%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11977      +/-   ##
==========================================
- Coverage   66.26%   63.62%   -2.64%     
==========================================
  Files         941      941              
  Lines       45715    45826     +111     
  Branches     4395     4398       +3     
==========================================
- Hits        30293    29159    -1134     
- Misses      15287    16491    +1204     
- Partials      135      176      +41     
Flag Coverage Δ
cypress ?
javascript 62.69% <85.71%> (+0.01%) ⬆️
python 64.18% <ø> (-0.08%) ⬇️

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

Impacted Files Coverage Δ
superset-frontend/src/components/Select/styles.tsx 63.88% <75.00%> (-29.07%) ⬇️
...end/src/components/Select/SupersetStyledSelect.tsx 88.17% <100.00%> (-1.94%) ⬇️
superset-frontend/src/explore/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/setup/setupColors.js 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/chart/ChartContainer.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/reducers/index.js 0.00% <0.00%> (-100.00%) ⬇️
...et-frontend/src/dashboard/containers/Dashboard.jsx 0.00% <0.00%> (-100.00%) ⬇️
... and 148 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc44a2c...a484e36. Read the comment docs.

@michael-s-molina michael-s-molina changed the title Removes hard coded colors refactor: Removes hard coded colors Dec 9, 2020
@michael-s-molina
Copy link
Member Author

welcome on board Michael! thanks for the first PR!! @michael-s-molina

@junlincc Thanks! I'm very excited to work with you.

@ktmud
Copy link
Member

ktmud commented Dec 9, 2020

Welcome onboard, @michael-s-molina ! Thanks for working on this.

Could you also add a screenshot of Select component in real action just for sanity check?

@rusackas
Copy link
Member

rusackas commented Dec 9, 2020

I think the scope of this PR is great, but I'm hoping we can use the theme context via the <ThemeProvider> rather than importing/using the supersetTheme directly from superset-ui

@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 10, 2020
@michael-s-molina
Copy link
Member Author

Welcome onboard, @michael-s-molina ! Thanks for working on this.

Could you also add a screenshot of Select component in real action just for sanity check?

@ktmud Thanks! I added the screenshots as requested.

@rusackas All styles are now coming from <ThemeProvider>.

The Select component uses a combination of style sources (react-select theme, default theme and theme props). If we have the intention on unifying all this then we should do it in another PR because we may need a bunch of refactoring.

@ktmud
Copy link
Member

ktmud commented Dec 10, 2020

I think current approach makes sense, given how react-select structures its styling. With #11916 in the work, I wouldn't invest too much in the refactoring.

@ktmud
Copy link
Member

ktmud commented Dec 10, 2020

Tested locally and everything looks great.

@ktmud ktmud merged commit 3a62541 into apache:master Dec 10, 2020
@rusackas
Copy link
Member

Congrats on the first merge! Welcome to the community!

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.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/L 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants