Skip to content

Commit

Permalink
chore: Remove logo forced width (#19049)
Browse files Browse the repository at this point in the history
* Remove logo forced width

* improve styling

* improve paddings

* Update UPDATING.md

* Fixes a typo

* Add fixed height

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
  • Loading branch information
3 people committed Mar 21, 2022
1 parent 72b9a7f commit 9ae51f7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ assists people when migrating to a new version.

### Breaking Changes

- [19049](https://github.com/apache/superset/pull/19049): APP_ICON_WIDTH has been removed from the config. Superset should now be able to handle different logo sizes without having to explicitly set an APP_ICON_WIDTH. This might affect the size of existing custom logos as the UI will now resize them according to the specified space of maximum 148px and not according to the value of APP_ICON_WIDTH.
- [19274](https://github.com/apache/superset/pull/19274): The `PUBLIC_ROLE_LIKE_GAMMA` config key has been removed, set `PUBLIC_ROLE_LIKE` = "Gamma" to have the same functionality.
- [19273](https://github.com/apache/superset/pull/19273): The `SUPERSET_CELERY_WORKERS` and `SUPERSET_WORKERS` config keys has been removed. Configure celery directly using `CELERY_CONFIG` on Superset
- [19231](https://github.com/apache/superset/pull/19231): The `ENABLE_REACT_CRUD_VIEWS` feature flag has been removed (permanently enabled). Any deployments which had set this flag to false will need to verify that the React views support their use case.
Expand Down
15 changes: 13 additions & 2 deletions superset-frontend/src/views/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ interface BrandProps {
path: string;
icon: string;
alt: string;
width: string | number;
tooltip: string;
text: string;
}
Expand Down Expand Up @@ -97,6 +96,18 @@ const StyledHeader = styled.header`
display: flex;
flex-direction: column;
justify-content: center;
/* must be exactly the height of the Antd navbar */
min-height: 50px;
padding: ${({ theme }) =>
`${theme.gridUnit}px ${theme.gridUnit * 2}px ${theme.gridUnit}px ${
theme.gridUnit * 4
}px`};
max-width: ${({ theme }) => `${theme.gridUnit * 37}px`};
img {
height: 100%;
object-fit: contain;
}
}
.navbar-brand-text {
border-left: 1px solid ${({ theme }) => theme.colors.grayscale.light2};
Expand Down Expand Up @@ -273,7 +284,7 @@ export function Menu({
arrowPointAtCenter
>
<a className="navbar-brand" href={brand.path}>
<img width={brand.width} src={brand.icon} alt={brand.alt} />
<img src={brand.icon} alt={brand.alt} />
</a>
</Tooltip>
{brand.text && (
Expand Down
1 change: 0 additions & 1 deletion superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:

# Specify the App icon
APP_ICON = "/static/assets/images/superset-logo-horiz.png"
APP_ICON_WIDTH = 126

# Specify where clicking the logo would take the user
# e.g. setting it to '/' would take the user to '/superset/welcome/'
Expand Down
1 change: 0 additions & 1 deletion superset/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ def menu_data() -> Dict[str, Any]:
"path": appbuilder.app.config["LOGO_TARGET_PATH"] or "/",
"icon": appbuilder.app_icon,
"alt": appbuilder.app_name,
"width": appbuilder.app.config["APP_ICON_WIDTH"],
"tooltip": appbuilder.app.config["LOGO_TOOLTIP"],
"text": brand_text,
},
Expand Down

0 comments on commit 9ae51f7

Please sign in to comment.