Repository navigation
Feat: #11527 Add the tabbed view for the dashboard - #11572
allyoucanmap merged 16 commits into
Conversation
…at/tabbed-dashboard-11527
| const [scrollRef, showButtons, isLeftDisabled, isRightDisabled, scroll] = useCheckScroll({ data: layouts }); | ||
|
|
||
| return ( | ||
| <FlexBox gap="xs" centerChildrenVertically className="_margin-tb-xs _margin-r-xs view-switcher-container"> |
There was a problem hiding this comment.
please remove the margin classes are generating a margin to the bottom
| {canEdit && ( | ||
| <Button | ||
| onClick={onAdd} | ||
| className="square-button-md _margin-l-xs" |
There was a problem hiding this comment.
let's add also _margin-tb-xs
| <Dropdown | ||
| dropup | ||
| bsStyle="default" | ||
| id="split-button-dropup-pull-right" |
There was a problem hiding this comment.
if we are using an id this should be unique, let's use also the id of the view
| dropup | ||
| bsStyle="default" | ||
| id="split-button-dropup-pull-right" | ||
| className={`${isSelected ? "is-selected " : ""}layout-views _relative`} |
There was a problem hiding this comment.
please remove _relative, for this specific case we will use the custom class .layout-views already added.
Let's also rename it in ms-layout-view, usually we add the ms- prefix and in this case it would be better to use singular view
| > | ||
| <Button | ||
| onClick={() => handleSelect(id)} | ||
| bsStyle="default" className="layout-views-dropdown _padding-tb-sm" |
There was a problem hiding this comment.
please remove all the classes
| <Dropdown.Toggle | ||
| onClick={handleToggleClick} | ||
| noCaret | ||
| className="square-button-md dashboard-view-actions _relative _padding-tb-sm _padding-r-sm" |
There was a problem hiding this comment.
lets' remove all the classes
| </div> | ||
| </Dropdown.Toggle> | ||
| )} | ||
| <Dropdown.Menu className="_fixed" style={{ left: `${position.left}px`, bottom: `${position.bottom}px` }}> |
| button.dashboard-view-actions.btn { | ||
| border: none; | ||
| background: inherit; | ||
| height: 2.125rem; | ||
| width: 1.25rem; | ||
| padding: 0; | ||
| margin-left: 0.25rem !important; | ||
| } | ||
|
|
||
| .dashboard-color-picker { | ||
| width: 50px; | ||
| } | ||
|
|
||
| .view-switcher-container { | ||
| height: @square-btn-size; | ||
| width: 100%; | ||
| border-top: 1px solid @ms-main-border-color; | ||
|
|
||
| .view-switcher-tabs::-webkit-scrollbar { | ||
| display: none; | ||
| } | ||
|
|
||
| button.layout-views-dropdown { | ||
| padding: 0; | ||
| background: none; | ||
| border: none; | ||
| height: 100%; | ||
| padding-left: 0.5rem; | ||
| &:hover, &:focus { | ||
| outline: none; | ||
| background: none; | ||
| border: none; | ||
| } | ||
| &:active { | ||
| box-shadow: none; | ||
| } | ||
| } | ||
|
|
||
| .layout-views { | ||
| cursor: pointer; | ||
| height: calc(@square-btn-size - 2px); | ||
| border: 1px solid @ms-main-border-color; | ||
| background-color: @ms-main-bg; | ||
| min-width: fit-content !important; | ||
| margin-top: -1px; | ||
|
|
||
| &.is-selected { | ||
| background-color: @ms-main-border-color; | ||
| } | ||
| &:hover:not(.is-selected) { | ||
| background-color: @ms-focus-color; | ||
| } | ||
| } | ||
|
|
||
| .view-scroll-buttons { | ||
| border-left: 1px solid @ms-main-border-color; | ||
| margin-left: 0.25rem; | ||
| padding-left: 0.25rem; | ||
| height: @square-btn-size; | ||
|
|
||
| button { | ||
| border-radius: @border-radius-base; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
please change the style as follow:
.dashboard-color-picker {
width: 100px;
}
.view-switcher-container {
width: 100%;
border-top: 1px solid transparent;
min-height: 40px;
.ms-layout-view {
display: flex;
min-width: fit-content;
}
.ms-layout-view,
.ms-layout-view > button {
height: 100%;
position: relative;
border-top: none;
border-bottom: none;
}
.ms-layout-view .dropdown-toggle {
padding: 0.25rem;
}
.ms-layout-view:first-child > .dropdown-toggle,
.ms-layout-view + .ms-layout-view > button {
border-left: none;
}
.view-switcher-tabs::-webkit-scrollbar {
display: none;
}
}for colors and themes we should use the mixins instead of less variables, the mixins will apply also css variables. We can add it at the top inside the #ms-components-theme(@theme-vars) functions:
#ms-components-theme(@theme-vars) {
// ... other selectors
.view-switcher-container {
.border-color-var(@theme-vars[main-border-color]);
}
.ms-layout-view {
&.is-selected {
> button {
.background-color-var(@theme-vars[selected-bg]);
}
}
&:hover:not(.is-selected) {
> button {
.background-color-var(@theme-vars[selected-hover-bg]);
}
}
}
}|
@ElenaGallo please test this enhancement on dev, thanks |
|
The legend widget is not visible in the Add widget modal in the dashboard. The issue is introduced from this PR. |
|
@subashtiwari1010 please describe here steps to reproduce for all problems you found to properly address what included in this PR #11715
|
|
There were some issues that were encountered after updating the dashboard to have the tabbed views. These issues have been resolved in the PR: #11715. The issues can be reproduced using the following steps: Legend issue
Maximize widget issue
Problem related to saving
|




Description
This PR adds the tabbed view for the dashboard #11527.
It introduces a tab system inside the dashboard viewer to be able to view multiple dashboards inside the same context. The toolbar section is added at the bottom that will have add dashboard view button as well as all the views. Each views will have settings from where the views can be removed, moved and configured.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
The dashboard have the single view where the widgets are added.
#11527
What is the new behavior?
The dashboard viewer now supports multiple dashboards through a tab system, where users with edit permissions can add, configure, move, or remove dashboard views, and users without edit permissions can switch between existing views.
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information