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] Support APP_ICON_WIDTH configuration parameter in SPA menu #9666

Merged
merged 2 commits into from
Apr 28, 2020

Conversation

nruhe
Copy link
Contributor

@nruhe nruhe commented Apr 28, 2020

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

The SPA menu component was relying on a hardcoded icon width of 126. This change exposes the config.py APP_ICON_WIDTH property to the frontend through the apps bootstrapping process and alters the SPA menu component to consume this value as the logo image width.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

n/a

TEST PLAN

Set APP_ICON_WIDTH property to a value other than 126 and observe the SPA and template version of the header have matching logo sizes.

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

REVIEWERS

@codecov-io
Copy link

codecov-io commented Apr 28, 2020

Codecov Report

Merging #9666 into master will increase coverage by 6.49%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9666      +/-   ##
==========================================
+ Coverage   64.03%   70.52%   +6.49%     
==========================================
  Files         532      581      +49     
  Lines       28897    30216    +1319     
  Branches     2758     3072     +314     
==========================================
+ Hits        18503    21311    +2808     
+ Misses      10211     8793    -1418     
+ Partials      183      112      -71     
Flag Coverage Δ
#cypress 53.62% <ø> (-0.04%) ⬇️
#javascript 58.75% <ø> (?)
#python 70.62% <ø> (+0.05%) ⬆️
Impacted Files Coverage Δ
superset-frontend/src/components/Menu/Menu.jsx 87.50% <ø> (ø)
superset/views/base.py 72.35% <ø> (ø)
superset-frontend/src/setup/setupPlugins.ts 7.27% <0.00%> (-92.73%) ⬇️
superset-frontend/src/setup/setupApp.ts 24.13% <0.00%> (-2.79%) ⬇️
superset/db_engine_specs/mssql.py 93.02% <0.00%> (-1.10%) ⬇️
superset-frontend/src/featureFlags.ts 100.00% <0.00%> (ø)
superset-frontend/src/SqlLab/utils/sqlKeywords.ts 100.00% <0.00%> (ø)
...rontend/src/messageToasts/enhancers/withToasts.tsx 100.00% <0.00%> (ø)
...rset-frontend/src/components/StackTraceMessage.jsx
superset-frontend/src/welcome/App.jsx 0.00% <0.00%> (ø)
... and 183 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 5e4c291...8d81db3. Read the comment docs.

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

could you set the width in the config file to 126? Then we'll both have documentation of the config var existing, and can replace the config.get with a config["APP_ICON_WIDTH"] because we can always assume it exists

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

LGTM

@rusackas
Copy link
Member

rusackas commented Apr 28, 2020

could you set the width in the config file to 126? Then we'll both have documentation of the config var existing, and can replace the config.get with a config["APP_ICON_WIDTH"] because we can always assume it exists

It appears APP_ICON_WIDTH is already set to 126 in config.py.

There are a handful of other config.get instances that pull in existing vars from config.py - I'm not sure how big an issue one more is.

@etr2460
Copy link
Member

etr2460 commented Apr 28, 2020

We've tried to standardize around config[] over config.get in the past, so I think it's better to keep going in that direction. see #8454

…of .get and adjust Menu proptypes to be required.
Copy link
Member

@etr2460 etr2460 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 for the fix!

@rusackas rusackas merged commit 9d755bc into apache:master Apr 28, 2020
@rusackas rusackas deleted the natalie/PS-90-logo-width branch April 28, 2020 20:17
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.0 labels Feb 28, 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.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants