From 09024592ba0e3e293d6aa9c7885bed6f48e1e49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ertu=C4=9Frulcan=20Bakas?= Date: Mon, 16 Dec 2024 12:02:15 +0300 Subject: [PATCH] refactor: collect app files/folders to (main) --- .../[lang]/{ => (main)}/(core)/home/page.tsx | 0 .../src/app/[lang]/(main)/(core)/layout.tsx | 56 +++++++++++++++++++ .../management/[domain]/[data]/page.tsx | 0 .../[domain]/[data]/table-actions/claims.tsx | 0 .../[data]/table-actions/permissions.tsx | 0 .../[data]/table-actions/sessions.tsx | 0 .../[domain]/organization/action.ts | 0 .../management/[domain]/organization/form.tsx | 0 .../management/[domain]/organization/page.tsx | 0 .../{ => (main)}/(core)/management/data.tsx | 0 .../[group]/_components/description.tsx | 0 .../tenant/[group]/_components/utils.ts | 0 .../(core)/settings/tenant/[group]/group.tsx | 0 .../tenant/[group]/mock-settings-response.ts | 0 .../(core)/settings/tenant/[group]/page.tsx | 0 .../(core)/settings/tenant/page.tsx | 0 .../web/src/app/[lang]/{ => (main)}/error.tsx | 0 .../app/[lang]/{(core) => (main)}/layout.tsx | 0 .../src/app/[lang]/{ => (main)}/not-found.tsx | 0 .../[lang]/{ => (main)}/unauthorized/page.tsx | 0 20 files changed, 56 insertions(+) rename apps/web/src/app/[lang]/{ => (main)}/(core)/home/page.tsx (100%) create mode 100644 apps/web/src/app/[lang]/(main)/(core)/layout.tsx rename apps/web/src/app/[lang]/{ => (main)}/(core)/management/[domain]/[data]/page.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/management/[domain]/[data]/table-actions/claims.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/management/[domain]/[data]/table-actions/permissions.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/management/[domain]/[data]/table-actions/sessions.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/management/[domain]/organization/action.ts (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/management/[domain]/organization/form.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/management/[domain]/organization/page.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/management/data.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/settings/tenant/[group]/_components/description.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/settings/tenant/[group]/_components/utils.ts (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/settings/tenant/[group]/group.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/settings/tenant/[group]/mock-settings-response.ts (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/settings/tenant/[group]/page.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/(core)/settings/tenant/page.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/error.tsx (100%) rename apps/web/src/app/[lang]/{(core) => (main)}/layout.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/not-found.tsx (100%) rename apps/web/src/app/[lang]/{ => (main)}/unauthorized/page.tsx (100%) diff --git a/apps/web/src/app/[lang]/(core)/home/page.tsx b/apps/web/src/app/[lang]/(main)/(core)/home/page.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/home/page.tsx rename to apps/web/src/app/[lang]/(main)/(core)/home/page.tsx diff --git a/apps/web/src/app/[lang]/(main)/(core)/layout.tsx b/apps/web/src/app/[lang]/(main)/(core)/layout.tsx new file mode 100644 index 000000000..2512e2872 --- /dev/null +++ b/apps/web/src/app/[lang]/(main)/(core)/layout.tsx @@ -0,0 +1,56 @@ +"use server"; +import MainAdminLayout from "@repo/ui/theme/main-admin-layout"; +import { LogOut } from "lucide-react"; +import { auth } from "auth"; +import { signOutServer } from "auth-action"; +import unirefund from "public/unirefund.png"; +import { getResourceData } from "src/language-data/core/AbpUiNavigation"; +import { getBaseLink } from "src/utils"; +import { getNavbarFromDB } from "../../../../utils/navbar/navbar-data"; +import { getProfileMenuFromDB } from "../../../../utils/navbar/navbar-profile-data"; + +interface LayoutProps { + params: { lang: string }; + children: JSX.Element; +} +const appName = process.env.APPLICATION_NAME || "UNIREFUND"; +export default async function Layout({ children, params }: LayoutProps) { + const { lang } = params; + const { languageData } = await getResourceData(lang); + const session = await auth(); + const baseURL = getBaseLink("/", true, lang); + const navbarFromDB = await getNavbarFromDB(lang, languageData, session); + const profileMenuProps = getProfileMenuFromDB(languageData); + profileMenuProps.info.name = + session?.user?.name ?? profileMenuProps.info.name; + profileMenuProps.info.email = + session?.user?.email ?? profileMenuProps.info.email; + profileMenuProps.info.image = + "https://flowbite.com/docs/images/people/profile-picture-5.jpg"; + + profileMenuProps.menu.secondary = [ + { + href: undefined, + onClick: signOutServer, + name: languageData.LogOut, + icon: , + }, + ]; + const logo = appName === "UNIREFUND" ? unirefund : undefined; + return ( +
+ +
+ {children} +
+
+ ); +} diff --git a/apps/web/src/app/[lang]/(core)/management/[domain]/[data]/page.tsx b/apps/web/src/app/[lang]/(main)/(core)/management/[domain]/[data]/page.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/management/[domain]/[data]/page.tsx rename to apps/web/src/app/[lang]/(main)/(core)/management/[domain]/[data]/page.tsx diff --git a/apps/web/src/app/[lang]/(core)/management/[domain]/[data]/table-actions/claims.tsx b/apps/web/src/app/[lang]/(main)/(core)/management/[domain]/[data]/table-actions/claims.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/management/[domain]/[data]/table-actions/claims.tsx rename to apps/web/src/app/[lang]/(main)/(core)/management/[domain]/[data]/table-actions/claims.tsx diff --git a/apps/web/src/app/[lang]/(core)/management/[domain]/[data]/table-actions/permissions.tsx b/apps/web/src/app/[lang]/(main)/(core)/management/[domain]/[data]/table-actions/permissions.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/management/[domain]/[data]/table-actions/permissions.tsx rename to apps/web/src/app/[lang]/(main)/(core)/management/[domain]/[data]/table-actions/permissions.tsx diff --git a/apps/web/src/app/[lang]/(core)/management/[domain]/[data]/table-actions/sessions.tsx b/apps/web/src/app/[lang]/(main)/(core)/management/[domain]/[data]/table-actions/sessions.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/management/[domain]/[data]/table-actions/sessions.tsx rename to apps/web/src/app/[lang]/(main)/(core)/management/[domain]/[data]/table-actions/sessions.tsx diff --git a/apps/web/src/app/[lang]/(core)/management/[domain]/organization/action.ts b/apps/web/src/app/[lang]/(main)/(core)/management/[domain]/organization/action.ts similarity index 100% rename from apps/web/src/app/[lang]/(core)/management/[domain]/organization/action.ts rename to apps/web/src/app/[lang]/(main)/(core)/management/[domain]/organization/action.ts diff --git a/apps/web/src/app/[lang]/(core)/management/[domain]/organization/form.tsx b/apps/web/src/app/[lang]/(main)/(core)/management/[domain]/organization/form.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/management/[domain]/organization/form.tsx rename to apps/web/src/app/[lang]/(main)/(core)/management/[domain]/organization/form.tsx diff --git a/apps/web/src/app/[lang]/(core)/management/[domain]/organization/page.tsx b/apps/web/src/app/[lang]/(main)/(core)/management/[domain]/organization/page.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/management/[domain]/organization/page.tsx rename to apps/web/src/app/[lang]/(main)/(core)/management/[domain]/organization/page.tsx diff --git a/apps/web/src/app/[lang]/(core)/management/data.tsx b/apps/web/src/app/[lang]/(main)/(core)/management/data.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/management/data.tsx rename to apps/web/src/app/[lang]/(main)/(core)/management/data.tsx diff --git a/apps/web/src/app/[lang]/(core)/settings/tenant/[group]/_components/description.tsx b/apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/_components/description.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/settings/tenant/[group]/_components/description.tsx rename to apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/_components/description.tsx diff --git a/apps/web/src/app/[lang]/(core)/settings/tenant/[group]/_components/utils.ts b/apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/_components/utils.ts similarity index 100% rename from apps/web/src/app/[lang]/(core)/settings/tenant/[group]/_components/utils.ts rename to apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/_components/utils.ts diff --git a/apps/web/src/app/[lang]/(core)/settings/tenant/[group]/group.tsx b/apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/group.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/settings/tenant/[group]/group.tsx rename to apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/group.tsx diff --git a/apps/web/src/app/[lang]/(core)/settings/tenant/[group]/mock-settings-response.ts b/apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/mock-settings-response.ts similarity index 100% rename from apps/web/src/app/[lang]/(core)/settings/tenant/[group]/mock-settings-response.ts rename to apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/mock-settings-response.ts diff --git a/apps/web/src/app/[lang]/(core)/settings/tenant/[group]/page.tsx b/apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/page.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/settings/tenant/[group]/page.tsx rename to apps/web/src/app/[lang]/(main)/(core)/settings/tenant/[group]/page.tsx diff --git a/apps/web/src/app/[lang]/(core)/settings/tenant/page.tsx b/apps/web/src/app/[lang]/(main)/(core)/settings/tenant/page.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/settings/tenant/page.tsx rename to apps/web/src/app/[lang]/(main)/(core)/settings/tenant/page.tsx diff --git a/apps/web/src/app/[lang]/error.tsx b/apps/web/src/app/[lang]/(main)/error.tsx similarity index 100% rename from apps/web/src/app/[lang]/error.tsx rename to apps/web/src/app/[lang]/(main)/error.tsx diff --git a/apps/web/src/app/[lang]/(core)/layout.tsx b/apps/web/src/app/[lang]/(main)/layout.tsx similarity index 100% rename from apps/web/src/app/[lang]/(core)/layout.tsx rename to apps/web/src/app/[lang]/(main)/layout.tsx diff --git a/apps/web/src/app/[lang]/not-found.tsx b/apps/web/src/app/[lang]/(main)/not-found.tsx similarity index 100% rename from apps/web/src/app/[lang]/not-found.tsx rename to apps/web/src/app/[lang]/(main)/not-found.tsx diff --git a/apps/web/src/app/[lang]/unauthorized/page.tsx b/apps/web/src/app/[lang]/(main)/unauthorized/page.tsx similarity index 100% rename from apps/web/src/app/[lang]/unauthorized/page.tsx rename to apps/web/src/app/[lang]/(main)/unauthorized/page.tsx