Skip to content

Commit

Permalink
refactor: simplify layout structure by removing conditional checks fo…
Browse files Browse the repository at this point in the history
…r PROCEED_PUBLIC_NEW_LAYOUT
  • Loading branch information
OhKai committed Jan 21, 2025
1 parent 907345b commit 54c535d
Showing 1 changed file with 36 additions and 45 deletions.
81 changes: 36 additions & 45 deletions src/management-system-v2/app/(dashboard)/[environmentId]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,19 @@ const DashboardLayout = async ({
icon: <EditOutlined />,
});

if (env.PROCEED_PUBLIC_NEW_LAYOUT) {
children = [
{
key: 'processes-list',
label: <Link href={spaceURL(activeEnvironment, `/processes`)}>List</Link>,
icon: <CopyOutlined />,
},
...children,
{
key: 'processes-templates',
label: <Link href={spaceURL(activeEnvironment, `/processes`)}>Templates</Link>,
icon: <SnippetsOutlined />,
},
];
}
children = [
{
key: 'processes-list',
label: <Link href={spaceURL(activeEnvironment, `/processes`)}>List</Link>,
icon: <CopyOutlined />,
},
...children,
{
key: 'processes-templates',
label: <Link href={spaceURL(activeEnvironment, `/processes`)}>Templates</Link>,
icon: <SnippetsOutlined />,
},
];

layoutMenuItems.push({
key: 'processes-group',
Expand All @@ -102,35 +100,28 @@ const DashboardLayout = async ({
icon: <LaptopOutlined />,
});

if (env.PROCEED_PUBLIC_NEW_LAYOUT) {
layoutMenuItems = [
{
key: 'tasklist',
label: <Link href={spaceURL(activeEnvironment, `/tasklist`)}>Your Tasks</Link>,
icon: <CheckSquareOutlined />,
},
...layoutMenuItems,
];

children = [
{
key: 'dashboard',
label: <Link href={spaceURL(activeEnvironment, `/executions`)}>Dashboard</Link>,
icon: <BarChartOutlined />,
},
{
key: 'projects',
label: <Link href={spaceURL(activeEnvironment, `/executions`)}>Projects</Link>,
icon: <HistoryOutlined />,
},
...children,
{
key: 'config-server',
label: <Link href={spaceURL(activeEnvironment, `/executions`)}>Config Server</Link>,
icon: <ToolOutlined />,
},
];
}
layoutMenuItems = [
{
key: 'tasklist',
label: <Link href={spaceURL(activeEnvironment, `/tasklist`)}>Your Tasks</Link>,
icon: <CheckSquareOutlined />,
},
...layoutMenuItems,
];

children = [
{
key: 'dashboard',
label: <Link href={spaceURL(activeEnvironment, `/executions`)}>Dashboard</Link>,
icon: <BarChartOutlined />,
},
{
key: 'projects',
label: <Link href={spaceURL(activeEnvironment, `/executions`)}>Projects</Link>,
icon: <HistoryOutlined />,
},
...children,
];

layoutMenuItems.push({
key: 'automations-group',
Expand All @@ -144,7 +135,7 @@ const DashboardLayout = async ({
layoutMenuItems.push({
key: 'machine-config',
label: <Link href={spaceURL(activeEnvironment, `/machine-config`)}>Tech Data Sets</Link>,
icon: <LuTable2 />,
icon: <ToolOutlined />,
});
}

Expand Down

0 comments on commit 54c535d

Please sign in to comment.