mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
refactor(sidebar): migrate sidebar to react [EE-2907] (#6725)
* refactor(sidebar): migrate sidebar to react [EE-2907] fixes [EE-2907] feat(sidebar): show label for help fix(sidebar): apply changes from ddExtension fix(sidebar): resolve conflicts style(ts): add explanation for ddExtension fix(sidebar): use enum for status refactor(sidebar): rename to EdgeComputeSidebar refactor(sidebar): removed the need of `ident` prop style(sidebar): add ref for mobile breakpoint refactor(app): document testing props refactor(sidebar): use single sidebar item refactor(sidebar): use section for nav refactor(sidebar): rename sidebarlink to link refactor(sidebar): memoize menu paths fix(kubectl-shell): infinite loop on hooks dependencies refactor(sidebar): use authorized element feat(k8s/shell): track open shell refactor(k8s/shell): remove memoization refactor(settings): move settings queries to queries fix(sidebar): close sidebar on mobile refactor(settings): use mutation helpers refactor(sidebar): remove memo refactor(sidebar): rename sidebar item for storybook refactor(sidebar): move to react gprefactor(sidebar): remove dependence on EndProvider feat(environments): rename settings type feat(kube): move kubeconfig button fix(sidebar): open submenus fix(sidebar): open on expand fix(sibebar): show kube shell correctly * fix(sidebar): import from react component * chore(tests): fix missing prop
This commit is contained in:
parent
f78a6568a6
commit
84611a90a1
118 changed files with 2284 additions and 1648 deletions
93
app/react/sidebar/SettingsSidebar.tsx
Normal file
93
app/react/sidebar/SettingsSidebar.tsx
Normal file
|
@ -0,0 +1,93 @@
|
|||
import { usePublicSettings } from '@/portainer/settings/queries';
|
||||
|
||||
import { SidebarItem } from './SidebarItem';
|
||||
import { SidebarSection } from './SidebarSection';
|
||||
|
||||
interface Props {
|
||||
isAdmin: boolean;
|
||||
}
|
||||
|
||||
export function SettingsSidebar({ isAdmin }: Props) {
|
||||
const teamSyncQuery = usePublicSettings<boolean>(
|
||||
(settings) => settings.TeamSync
|
||||
);
|
||||
|
||||
const showUsersSection =
|
||||
!window.ddExtension && (isAdmin || teamSyncQuery.data);
|
||||
|
||||
return (
|
||||
<SidebarSection title="Settings">
|
||||
{showUsersSection && (
|
||||
<SidebarItem
|
||||
to="portainer.users"
|
||||
label="Users"
|
||||
iconClass="fa-users fa-fw"
|
||||
>
|
||||
<SidebarItem to="portainer.teams" label="Teams" />
|
||||
|
||||
{isAdmin && <SidebarItem to="portainer.roles" label="Roles" />}
|
||||
</SidebarItem>
|
||||
)}
|
||||
{isAdmin && (
|
||||
<>
|
||||
<SidebarItem
|
||||
label="Environments"
|
||||
to="portainer.endpoints"
|
||||
iconClass="fa-plug fa-fw"
|
||||
openOnPaths={['portainer.wizard.endpoints']}
|
||||
>
|
||||
<SidebarItem to="portainer.groups" label="Groups" />
|
||||
<SidebarItem to="portainer.tags" label="Tags" />
|
||||
</SidebarItem>
|
||||
|
||||
<SidebarItem
|
||||
label="Registries"
|
||||
to="portainer.registries"
|
||||
iconClass="fa-database fa-fw"
|
||||
/>
|
||||
|
||||
<SidebarItem
|
||||
label="Authentication logs"
|
||||
to="portainer.authLogs"
|
||||
iconClass="fa-history fa-fw"
|
||||
>
|
||||
<SidebarItem to="portainer.activityLogs" label="Activity Logs" />
|
||||
</SidebarItem>
|
||||
|
||||
<SidebarItem
|
||||
to="portainer.settings"
|
||||
label="Settings"
|
||||
iconClass="fa-cogs fa-fw"
|
||||
>
|
||||
{!window.ddExtension && (
|
||||
<SidebarItem
|
||||
to="portainer.settings.authentication"
|
||||
label="Authentication"
|
||||
/>
|
||||
)}
|
||||
<SidebarItem to="portainer.settings.cloud" label="Cloud" />
|
||||
|
||||
<SidebarItem
|
||||
to="portainer.settings.edgeCompute"
|
||||
label="Edge Compute"
|
||||
/>
|
||||
|
||||
<SidebarItem.Wrapper label="Help / About">
|
||||
<a
|
||||
href={
|
||||
process.env.PORTAINER_EDITION === 'CE'
|
||||
? 'https://www.portainer.io/community_help'
|
||||
: 'https://documentation.portainer.io/r/business-support'
|
||||
}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Help / About
|
||||
</a>
|
||||
</SidebarItem.Wrapper>
|
||||
</SidebarItem>
|
||||
</>
|
||||
)}
|
||||
</SidebarSection>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue