From fac1e990f6bcb1b27e731ec22b623bc61adfa0a4 Mon Sep 17 00:00:00 2001 From: Mateusz Baginski Date: Sun, 29 Dec 2024 11:53:19 +0100 Subject: [PATCH] feat(chat): init management route --- apps/chat/src/i18n/packs/i18n-lang-en.ts | 10 +++++++++- apps/chat/src/i18n/packs/i18n-lang-pl.ts | 12 ++++++++++-- .../navigation/links/navigation-links.tsx | 13 +++++++++++-- .../navigation/navigation-right-toolbar.tsx | 17 ++--------------- apps/chat/src/modules/management/.gitkeep | 0 apps/chat/src/router.tsx | 2 ++ apps/chat/src/routes/index.ts | 1 + apps/chat/src/routes/management/index.ts | 1 + .../src/routes/management/management.route.tsx | 16 ++++++++++++++++ apps/chat/src/routes/use-sitemap.tsx | 3 +++ 10 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 apps/chat/src/modules/management/.gitkeep create mode 100644 apps/chat/src/routes/management/index.ts create mode 100644 apps/chat/src/routes/management/management.route.tsx diff --git a/apps/chat/src/i18n/packs/i18n-lang-en.ts b/apps/chat/src/i18n/packs/i18n-lang-en.ts index 07ed8821..3d446641 100644 --- a/apps/chat/src/i18n/packs/i18n-lang-en.ts +++ b/apps/chat/src/i18n/packs/i18n-lang-en.ts @@ -5,10 +5,11 @@ import { I18N_FORWARDED_EN_PACK } from '@llm/ui'; export const I18N_PACK_EN = deepmerge(I18N_FORWARDED_EN_PACK, { navigation: { links: { - home: 'Home', + home: 'Chats', projects: 'Projects', apps: 'Apps', experts: 'Experts', + management: 'Management', }, loggedIn: { logout: 'Logout', @@ -178,6 +179,13 @@ export const I18N_PACK_EN = deepmerge(I18N_FORWARDED_EN_PACK, { rootOnly: 'This step is only required for root users - regular users are automatically assigned to their organization', }, }, + management: { + meta: { + title: 'Management', + description: 'Management', + }, + title: 'Management', + }, }, workspace: { selectOrganization: 'Select organization', diff --git a/apps/chat/src/i18n/packs/i18n-lang-pl.ts b/apps/chat/src/i18n/packs/i18n-lang-pl.ts index f72fd25d..dedd478b 100644 --- a/apps/chat/src/i18n/packs/i18n-lang-pl.ts +++ b/apps/chat/src/i18n/packs/i18n-lang-pl.ts @@ -7,10 +7,11 @@ import type { I18nLangPack } from './i18n-packs'; export const I18N_PACK_PL: I18nLangPack = deepmerge(I18N_FORWARDED_PL_PACK, { navigation: { links: { - home: 'Strona główna', + home: 'Czaty', projects: 'Projekty', - apps: 'Aplikacje', + apps: 'Appki', experts: 'Eksperci', + management: 'Administracja', }, loggedIn: { logout: 'Wyloguj się', @@ -180,6 +181,13 @@ export const I18N_PACK_PL: I18nLangPack = deepmerge(I18N_FORWARDED_PL_PACK, { rootOnly: 'Ten krok jest wymagany tylko dla użytkowników root - zwykli użytkownicy są automatycznie przypisani do swojej organizacji', }, }, + management: { + meta: { + title: 'Administracja', + description: 'Zarządzaj ustawieniami organizacji', + }, + title: 'Administracja', + }, }, workspace: { selectOrganization: 'Wybierz organizację', diff --git a/apps/chat/src/layouts/navigation/links/navigation-links.tsx b/apps/chat/src/layouts/navigation/links/navigation-links.tsx index 2c18fc7e..0024a8a9 100644 --- a/apps/chat/src/layouts/navigation/links/navigation-links.tsx +++ b/apps/chat/src/layouts/navigation/links/navigation-links.tsx @@ -1,7 +1,8 @@ import { FolderKanbanIcon, GraduationCapIcon, - HomeIcon, + MessageSquareTextIcon, + SettingsIcon, WandSparklesIcon, } from 'lucide-react'; @@ -21,7 +22,7 @@ export function NavigationLinks() { ); } diff --git a/apps/chat/src/layouts/navigation/navigation-right-toolbar.tsx b/apps/chat/src/layouts/navigation/navigation-right-toolbar.tsx index 5f5c402e..c1e1a307 100644 --- a/apps/chat/src/layouts/navigation/navigation-right-toolbar.tsx +++ b/apps/chat/src/layouts/navigation/navigation-right-toolbar.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import { BellIcon, SearchIcon } from 'lucide-react'; +import { SearchIcon } from 'lucide-react'; import { useI18n } from '~/i18n'; import { useHasWorkspaceOrganization } from '~/modules'; @@ -22,7 +22,7 @@ export function NavigationRightToolbar() { - - diff --git a/apps/chat/src/modules/management/.gitkeep b/apps/chat/src/modules/management/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/apps/chat/src/router.tsx b/apps/chat/src/router.tsx index 932c0aee..18b60da3 100644 --- a/apps/chat/src/router.tsx +++ b/apps/chat/src/router.tsx @@ -10,6 +10,7 @@ import { ForceRedirectRoute, HomeRoute, LoginRoute, + ManagementRoute, ProjectRoute, ProjectsRoute, SettingsRoute, @@ -64,6 +65,7 @@ function LoggedInRouter() { + path={sitemap.chat.raw}> diff --git a/apps/chat/src/routes/index.ts b/apps/chat/src/routes/index.ts index cda4a698..63279385 100644 --- a/apps/chat/src/routes/index.ts +++ b/apps/chat/src/routes/index.ts @@ -6,6 +6,7 @@ export * from './experts'; export * from './force-redirect-route'; export * from './home'; export * from './login'; +export * from './management'; export * from './project'; export * from './projects'; export * from './settings'; diff --git a/apps/chat/src/routes/management/index.ts b/apps/chat/src/routes/management/index.ts new file mode 100644 index 00000000..7f763d09 --- /dev/null +++ b/apps/chat/src/routes/management/index.ts @@ -0,0 +1 @@ +export * from './management.route'; diff --git a/apps/chat/src/routes/management/management.route.tsx b/apps/chat/src/routes/management/management.route.tsx new file mode 100644 index 00000000..c696b9f7 --- /dev/null +++ b/apps/chat/src/routes/management/management.route.tsx @@ -0,0 +1,16 @@ +import { useI18n } from '~/i18n'; +import { LayoutHeader, PageWithNavigationLayout } from '~/layouts'; +import { RouteMetaTags } from '~/routes'; + +export function ManagementRoute() { + const t = useI18n().pack.routes.management; + return ( + + + + + {t.title} + + + ); +} diff --git a/apps/chat/src/routes/use-sitemap.tsx b/apps/chat/src/routes/use-sitemap.tsx index 357af112..50c54f07 100644 --- a/apps/chat/src/routes/use-sitemap.tsx +++ b/apps/chat/src/routes/use-sitemap.tsx @@ -18,6 +18,9 @@ export function useSitemap() { login: prefixWithBaseRoute('/login'), settings: prefixWithBaseRoute('/settings'), chat: defineSitemapRouteGenerator(prefixWithBaseRoute)('/chat/:id'), + management: { + index: prefixWithBaseRoute('/management/groups'), + }, forceRedirect: { raw: prefixWithBaseRoute('/force-redirect'), generate: (targetUrl: string) => pipe(