-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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(style): hide dashboard header by url parameter #12918
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12918 +/- ##
==========================================
+ Coverage 53.06% 61.89% +8.83%
==========================================
Files 489 547 +58
Lines 17314 20173 +2859
Branches 4482 5282 +800
==========================================
+ Hits 9187 12486 +3299
+ Misses 8127 7475 -652
- Partials 0 212 +212
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
thanks for the PR @simcha90 ! User will still be able to add filters after hiding header and edit button since the actions take place in the view mode. is this intentional? |
Why not call the parameter |
@ktmud I think it dependent on user needs we need give both options to manage dashboard view |
Why would you want to keep Superset navs while hiding dashboard title? Wouldn't users be able to navigate to other Superset pages in the embedded dashboard? I'm finding it hard to imagine a scenario where this would be desired. |
@ktmud I agree that the use-case of standalone=false and hide_dashboard_hide=true does not exist
I can agree that by just setting hide_dashboard_hide=true we can enable standalone but not sure we must enforce it |
How about we introduce two "standalone modes"?
Let's not give users the choice to hide just the dashboard title. If the request comes back up with a reasonable business need to support it, then we can add it as |
done |
…rset into hide_header
� Conflicts: � superset-frontend/src/explore/components/ExploreViewContainer.jsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some code style suggestions, most are non-blocking.
export function getUrlParam(paramName: string, type: 'string'): string; | ||
export function getUrlParam(paramName: string, type: 'number'): number; | ||
export function getUrlParam(paramName: string, type: 'boolean'): boolean; | ||
export function getUrlParam(paramName: string, type: UrlParamType): unknown { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feel like a useful general util. Maybe move to src/commons/utils/getUrlPram.ts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved it here: superset-frontend/src/utils/common.ts
superset-frontend/src/dashboard/components/DashboardBuilder.jsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schema: any; | ||
autorun: any; | ||
sql: any; | ||
}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
superset/superset-frontend/src/SqlLab/components/ShareSqlLabQuery.jsx
Lines 34 to 41 in 9997abe
queryEditor: PropTypes.shape({ | |
dbId: PropTypes.number, | |
title: PropTypes.string, | |
schema: PropTypes.string, | |
autorun: PropTypes.bool, | |
sql: PropTypes.string, | |
remoteId: PropTypes.number, | |
}).isRequired, |
Maybe make the typing consistent with here?
To avoid having to update typing for all other util functions, you may also create getParamFromQuery
as its own file. I think in general we should welcome smaller util files so it's easier to maintain and search (to find a specific util function you can just search by file name instead of search file content).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 did as second proposal, created file for urlUtils
@ktmud 👍 good catch about UI bug, fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one last suggestion.
Thanks for all the iterations!
cc @junlincc if you want to do a final round of QA & product sign-off. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few non blocking nits
superset-frontend/spec/javascripts/dashboard/util/getDashboardUrl_spec.js
Outdated
Show resolved
Hide resolved
superset-frontend/spec/javascripts/explore/components/EmbedCodeButton_spec.jsx
Outdated
Show resolved
Hide resolved
* feat(native-filters): hide dashboard header bu url parameter * lint: fix lint * test: add tests * test: fix test * refactor: upgrade standalone param * fix: pre-commit and extract to method is_standalone_mode * test: fix tests * test: fix tests * fix: fix standalone statement * refactor: fix CR notes * chore: pre-commit * fix: fix sticky tabs + update CR notes * lint: fix lint * lint: fix lint * fix: fix CR notes * fix: fix CR notes * lint: fix lint * refactor: fix cr notes Co-authored-by: amitmiran137 <amit.miran@nielsen.com>
* master: (30 commits) refactor(native-filters): decouple params from filter config modal (first phase) (apache#13021) fix(native-filters): set currentValue null when empty (apache#13000) Custom superset_config.py + secret envs (apache#13096) Update http error code from 400 to 403 (apache#13061) feat(native-filters): add storybook entry for select filter (apache#13005) feat(native-filters): Time native filter (apache#12992) Force pod restart on config changes (apache#13056) feat(cross-filters): add cross filters (apache#12662) fix(explore): Enable selecting an option not included in suggestions (apache#13029) Improves RTL configuration (apache#13079) Added a note about the ! prefix for breaking changes to CONTRIBUTING.md (apache#13083) chore: lock down npm to v6 (apache#13069) fix: API tests, make them possible to run independently again (apache#13076) fix: add config to disable dataset ownership on the old api (apache#13051) add required * indicator to message content/notif method (apache#12931) fix: Retroactively add granularity param to charts (apache#12960) fix(ci): multiline regex in change detection (apache#13075) feat(style): hide dashboard header by url parameter (apache#12918) fix(explore): pie chart label bugs (apache#13052) fix: Disabled state button transition time (apache#13008) ...
SUMMARY
standalone
e.g. http://localhost:8088/superset/dashboard/11/?standalone=true
Here supported options (according proposal of @ktmud ):
a.
standalone=true
(for backward compatibility) orstandalone=1
hide only navbarb.
standalone=2
hide navbar and titlec.
standalone=false
(for backward compatibility) orno param
show allReason for PR: When dashboard is embedded as standalone there is also a use-case to hide the dashboard header
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2021-02-07.at.10.31.56.mov
TEST PLAN
ADDITIONAL INFORMATION