Skip to content

Commit

Permalink
feat(monitoraggio-caricamenti): modifica visiibilita opzioni menu hea…
Browse files Browse the repository at this point in the history
…der 20241021
  • Loading branch information
federico-tocci-dxc committed Oct 21, 2024
1 parent d3869a4 commit 1f639da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion fe-piattaforma/src/components/HeaderMenu/headerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ const HeaderMenu: React.FC<HeaderMenuI> = (props) => {
);
};

const filteredMenuRoutes = menuRoutes.filter(({ visible = [] }) => hasUserPermission(visible)).some(route => route.path === '/area-dati')
? menuRoutes.filter(route => route.path !== '/area-dati/report-dati')
: menuRoutes;

return (
<nav
className={clsx(
Expand All @@ -130,7 +134,7 @@ const HeaderMenu: React.FC<HeaderMenuI> = (props) => {
tabIndex={-1}
>
<ul className='d-flex align-items-end mb-0' role='menu'>
{menuRoutes
{filteredMenuRoutes
.filter(({ visible = [] }) => hasUserPermission(visible))
.map((li) => (
<li
Expand Down
8 changes: 7 additions & 1 deletion fe-piattaforma/src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const MenuRoutes = [
label: 'Area dati',
path: '/area-dati',
id: 'tab-dashboard',
visible: ['tab.dshb'],
visible: ['vis.mntr'],
subRoutes: [
newMenuItem({
label: 'Report dati',
Expand All @@ -244,6 +244,12 @@ export const MenuRoutes = [
})
],
}),
newMenuItem({
label: 'Report dati',
path: '/area-dati/report-dati',
id: 'tab-report',
visible: ['tab.dshb'],
}),
newMenuItem({
label: 'Bacheca',
path: '/bacheca',
Expand Down

0 comments on commit 1f639da

Please sign in to comment.