feat(ws): Notebooks 2.0 // Frontend // Rename settings to debug (#184)

Signed-off-by: paulovmr <832830+paulovmr@users.noreply.github.com>
This commit is contained in:
Paulo Rego 2025-01-17 17:20:20 -03:00 committed by GitHub
parent d84621aac1
commit 9a91f66972
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import * as React from 'react';
import { Route, Routes } from 'react-router-dom';
import { NotFound } from './pages/notFound/NotFound';
import { Settings } from './pages/Settings/Settings';
import { Debug } from './pages/Debug/Debug';
import { Workspaces } from './pages/Workspaces/Workspaces';
export const isNavDataGroup = (navItem: NavDataItem): navItem is NavDataGroup =>
@ -21,7 +21,7 @@ export type NavDataGroup = NavDataCommon & {
type NavDataItem = NavDataHref | NavDataGroup;
export const useAdminSettings = (): NavDataItem[] => {
export const useAdminDebugSettings = (): NavDataItem[] => {
// get auth access for example set admin as true
const isAdmin = true; //this should be a call to getting auth / role access
@ -33,8 +33,8 @@ export const useAdminSettings = (): NavDataItem[] => {
return [
{
label: 'Settings',
children: [{ label: 'Notebooks', path: '/notebookSettings' }],
label: 'Debug',
children: [{ label: 'Notebooks', path: '/notebookDebugSettings' }],
},
];
};
@ -44,7 +44,7 @@ export const useNavData = (): NavDataItem[] => [
label: 'Notebooks',
path: '/',
},
...useAdminSettings(),
...useAdminDebugSettings(),
];
const AppRoutes: React.FC = () => {
@ -57,7 +57,7 @@ const AppRoutes: React.FC = () => {
{
// TODO: Remove the linter skip when we implement authentication
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
isAdmin && <Route path="/notebookSettings/*" element={<Settings />} />
isAdmin && <Route path="/notebookDebugSettings/*" element={<Debug />} />
}
</Routes>
);

View File

@ -9,11 +9,11 @@ import {
PageSection,
} from '@patternfly/react-core';
const Settings: React.FunctionComponent = () => (
const Debug: React.FunctionComponent = () => (
<PageSection>
<EmptyState
variant={EmptyStateVariant.full}
titleText="Empty State (Stub Settings Module)"
titleText="Debug page (for development only)"
icon={CubesIcon}
>
<EmptyStateBody>
@ -27,4 +27,4 @@ const Settings: React.FunctionComponent = () => (
</PageSection>
);
export { Settings };
export { Debug };