1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-04 21:35:23 +02:00

feat(sidebar): update menu structure [EE-5666] (#10418)

This commit is contained in:
Ali 2023-10-09 19:23:12 +01:00 committed by GitHub
parent b468070945
commit a0dbabcc5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 519 additions and 146 deletions

View file

@ -22,6 +22,7 @@ import { useApiVersion } from '@/react/docker/proxy/queries/useVersion';
import { SidebarItem } from './SidebarItem';
import { DashboardLink } from './items/DashboardLink';
import { VolumesLink } from './items/VolumesLink';
import { SidebarParent } from './SidebarItem/SidebarParent';
interface Props {
environmentId: EnvironmentId;
@ -72,21 +73,29 @@ export function DockerSidebar({ environmentId, environment }: Props) {
platformPath="docker"
data-cy="dockerSidebar-dashboard"
/>
<SidebarItem
label="App Templates"
<SidebarParent
icon={Edit}
label="Templates"
to="docker.templates"
params={{ endpointId: environmentId }}
data-cy="portainerSidebar-appTemplates"
data-cy="portainerSidebar-templates"
>
<SidebarItem
label="Custom Templates"
label="Application"
to="docker.templates"
ignorePaths={['docker.templates.custom']}
params={{ endpointId: environmentId }}
isSubMenu
data-cy="portainerSidebar-appTemplates"
/>
<SidebarItem
label="Custom"
to="docker.templates.custom"
params={{ endpointId: environmentId }}
isSubMenu
data-cy="dockerSidebar-customTemplates"
/>
</SidebarItem>
</SidebarParent>
{areStacksVisible && (
<SidebarItem
@ -168,31 +177,42 @@ export function DockerSidebar({ environmentId, environment }: Props) {
/>
)}
<SidebarItem
<SidebarParent
label={setupSubMenuProps.label}
icon={setupSubMenuProps.icon}
to={setupSubMenuProps.to}
params={{ endpointId: environmentId }}
data-cy={setupSubMenuProps.dataCy}
data-cy="portainerSidebar-host"
>
<SidebarItem
label="Details"
isSubMenu
to={setupSubMenuProps.to}
params={{ endpointId: environmentId }}
ignorePaths={[featSubMenuTo, registrySubMenuTo]}
data-cy={setupSubMenuProps.dataCy}
/>
<Authorized
authorizations="PortainerEndpointUpdateSettings"
adminOnlyCE
environmentId={environmentId}
>
<SidebarItem
label="Setup"
isSubMenu
to={featSubMenuTo}
params={{ endpointId: environmentId }}
label="Setup"
/>
</Authorized>
<SidebarItem
label="Registries"
isSubMenu
to={registrySubMenuTo}
params={{ endpointId: environmentId }}
label="Registries"
/>
</SidebarItem>
</SidebarParent>
</>
);
}