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: toggle fullscreen on the dashboard #14979

Merged
merged 3 commits into from
Jun 4, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,12 @@ class HeaderActionsDropdown extends React.PureComponent {
break;
}
case MENU_KEYS.TOGGLE_FULLSCREEN: {
const hasStandalone = !!getUrlParam(URL_PARAMS.standalone);
const url = getDashboardUrl(
window.location.pathname,
getActiveFilters(),
window.location.hash,
getUrlParam(URL_PARAMS.standalone),
!hasStandalone,
Copy link
Member

Choose a reason for hiding this comment

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

This comes down to taste, but I think the double bang could be done directly here (seems clear enough).

Copy link
Member Author

Choose a reason for hiding this comment

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

the "negation" is needed here, the hasStandalone has been boolean type.

Copy link
Member

Choose a reason for hiding this comment

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

Right, gotcha 👍

Copy link
Member

Choose a reason for hiding this comment

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

I suppose it would also be correct to do

!getUrlParam(URL_PARAMS.standalone)

here?

Copy link
Member Author

@zhaoyongjie zhaoyongjie Jun 4, 2021

Choose a reason for hiding this comment

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

right, but I feel weird to do "negation" after returning a number type or null type.

);
window.location.replace(url);
break;
Expand Down