Skip to content

Feat: #11527 Add the tabbed view for the dashboard - #11572

Merged
allyoucanmap merged 16 commits into
geosolutions-it:masterfrom
subashtiwari1010:feat/tabbed-dashboard-11527
Nov 13, 2025
Merged

allyoucanmap merged 16 commits into
geosolutions-it:masterfrom
subashtiwari1010:feat/tabbed-dashboard-11527

Conversation

@subashtiwari1010

Copy link
Copy Markdown
Contributor

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)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

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)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@subashtiwari1010 subashtiwari1010 added this to the 2025.02.00 milestone Oct 9, 2025
@subashtiwari1010 subashtiwari1010 self-assigned this Oct 9, 2025
@subashtiwari1010 subashtiwari1010 added the New Feature used for new functionalities label Oct 9, 2025
@subashtiwari1010 subashtiwari1010 linked an issue Oct 9, 2025 that may be closed by this pull request
3 tasks
@subashtiwari1010 subashtiwari1010 changed the title Feat/tabbed dashboard 11527 Feat: #11527 Add the tabbed view for the dashboard Oct 9, 2025
@tdipisa tdipisa modified the milestones: 2025.02.00, 2026.01.00 Oct 10, 2025
@allyoucanmap
allyoucanmap requested review from dsuren1 and removed request for allyoucanmap November 4, 2025 10:43
@allyoucanmap allyoucanmap assigned dsuren1 and unassigned allyoucanmap Nov 4, 2025
@allyoucanmap
allyoucanmap removed the request for review from dsuren1 November 11, 2025 16:04
@allyoucanmap
allyoucanmap self-requested a review November 11, 2025 16:04
@allyoucanmap allyoucanmap assigned allyoucanmap and unassigned dsuren1 Nov 11, 2025

@allyoucanmap allyoucanmap left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • the tab menu should no be visible for user without edit permissions when there is only the default view

const [scrollRef, showButtons, isLeftDisabled, isRightDisabled, scroll] = useCheckScroll({ data: layouts });

return (
<FlexBox gap="xs" centerChildrenVertically className="_margin-tb-xs _margin-r-xs view-switcher-container">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please remove the margin classes are generating a margin to the bottom

{canEdit && (
<Button
onClick={onAdd}
className="square-button-md _margin-l-xs"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's add also _margin-tb-xs

<Dropdown
dropup
bsStyle="default"
id="split-button-dropup-pull-right"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please remove all the classes

<Dropdown.Toggle
onClick={handleToggleClick}
noCaret
className="square-button-md dashboard-view-actions _relative _padding-tb-sm _padding-r-sm"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets' remove all the classes

</div>
</Dropdown.Toggle>
)}
<Dropdown.Menu className="_fixed" style={{ left: `${position.left}px`, bottom: `${position.bottom}px` }}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should find a way to pull the menu with right alignement when crossing the half with of the page

image

Comment on lines +61 to +125
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;
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]);
            }
        }
    }
}

@allyoucanmap
allyoucanmap merged commit 3986dec into geosolutions-it:master Nov 13, 2025
@allyoucanmap

Copy link
Copy Markdown
Contributor

@ElenaGallo please test this enhancement on dev, thanks

@subashtiwari1010

Copy link
Copy Markdown
Contributor Author

The legend widget is not visible in the Add widget modal in the dashboard. The issue is introduced from this PR.

@allyoucanmap

Copy link
Copy Markdown
Contributor

@subashtiwari1010 please describe here steps to reproduce for all problems you found to properly address what included in this PR #11715

  • steps to reproduces the legend problem
  • steps to reproduce the maximized problem
  • problem related to save mentioned in the PR description

@subashtiwari1010

Copy link
Copy Markdown
Contributor Author

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

  • Create a new dashboard
  • Click the add widget button
  • Add a map widget with a layer in the dashboard
  • Again, go to add widget modal
  • There is no options to add the legend widget even though there is map
image

Maximize widget issue

  • Create a new dashboard
  • Click the add widget button
  • Add a widget in the dashboard
  • Click the maximize button in the widget image
  • Nothing will be displayed in the view
image

Problem related to saving

  • Create a new dashboard
  • Click the add widget button
  • Add a widget in the dashboard
  • Save the dashboard
  • Add a new view in the dashboard
  • The pending state does not gets triggered even though new layout view has been added.
  • The similar issue appear when the view name and color is configured.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Feature used for new functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement layout for tabbed view

4 participants