Skip to content

Commit

Permalink
refactor: shuffle files
Browse files Browse the repository at this point in the history
  • Loading branch information
simonknittel committed Jan 5, 2025
1 parent 5584d08 commit 3aec97e
Show file tree
Hide file tree
Showing 149 changed files with 250 additions and 262 deletions.
2 changes: 1 addition & 1 deletion app/src/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { authOptions } from "@/auth/server";
import NextAuth from "next-auth";
import { authOptions } from "../../../../server/auth";

const handler = NextAuth(authOptions);

Expand Down
4 changes: 2 additions & 2 deletions app/src/app/app/documents/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { authenticatePage } from "@/auth/server";
import { Hero } from "@/common/components/Hero";
import allianceManifest from "@/documents/assets/alliance_manifest.png";
import introductionCompendium from "@/documents/assets/introduction_compendium.png";
import { type Metadata } from "next";
import Image from "next/image";
import Link from "next/link";
import { redirect } from "next/navigation";
import allianceManifest from "./_assets/alliance_manifest.png";
import introductionCompendium from "./_assets/introduction_compendium.png";

export const metadata: Metadata = {
title: "Dokumente | S.A.M. - Sinister Incorporated",
Expand Down
6 changes: 3 additions & 3 deletions app/src/app/app/fleet/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { authenticatePage } from "@/auth/server";
import { Hero } from "@/common/components/Hero";
import { SkeletonTile } from "@/common/components/SkeletonTile";
import {
searchParamsNextjsToURLSearchParams,
type NextjsSearchParams,
} from "@/common/utils/searchParamsNextjsToURLSearchParams";
import { MyFleetTile } from "@/fleet/components/MyFleetTile";
import { OrgFleetTile } from "@/fleet/components/OrgFleetTile";
import { TileSkeleton } from "@/fleet/components/TileSkeleton";
import { type Metadata } from "next";
import { Suspense } from "react";

Expand Down Expand Up @@ -34,7 +34,7 @@ export default async function Page({ searchParams }: Props) {

<div className="flex flex-col-reverse xl:flex-row gap-8 items-start mt-8">
{showOrgFleetTile && (
<Suspense fallback={<TileSkeleton className="w-full 2xl:flex-1" />}>
<Suspense fallback={<SkeletonTile className="w-full 2xl:flex-1" />}>
<OrgFleetTile
urlSearchParams={urlSearchParams}
className="w-full 2xl:flex-1"
Expand All @@ -44,7 +44,7 @@ export default async function Page({ searchParams }: Props) {

{showMyFleetTile && (
<Suspense
fallback={<TileSkeleton className="w-full 2xl:w-[480px]" />}
fallback={<SkeletonTile className="w-full 2xl:w-[480px]" />}
>
<MyFleetTile className="w-full 2xl:w-[480px]" />
</Suspense>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ImageUpload } from "@/common/components/ImageUpload";
import { SkeletonTile } from "@/common/components/SkeletonTile";
import { EditableManufacturerName } from "@/fleet/components/EditableManufacturerName";
import { SeriesTile } from "@/fleet/components/SeriesTile";
import { TileSkeleton } from "@/fleet/components/TileSkeleton";
import { getManufacturerById } from "@/fleet/utils/getManufacturerById";
import { log } from "@/logging";
import clsx from "clsx";
Expand Down Expand Up @@ -83,7 +83,7 @@ export default async function Page(props: Props) {
</div>
</section>

<Suspense fallback={<TileSkeleton className="w-full flex-1" />}>
<Suspense fallback={<SkeletonTile className="w-full flex-1" />}>
<SeriesTile
manufacturerId={manufacturer.id}
className="w-full flex-1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SkeletonTile } from "@/common/components/SkeletonTile";
import { EditableSeriesName } from "@/fleet/components/EditableSeriesName";
import { TileSkeleton } from "@/fleet/components/TileSkeleton";
import { VariantsTile } from "@/fleet/components/VariantsTile";
import { dedupedGetSeriesAndManufacturerById } from "@/fleet/utils/getSeriesAndManufacturer";
import { log } from "@/logging";
Expand Down Expand Up @@ -70,7 +70,7 @@ export default async function Page(props: Props) {
</dl>
</section>

<Suspense fallback={<TileSkeleton className="w-full flex-1" />}>
<Suspense fallback={<SkeletonTile className="w-full flex-1" />}>
<VariantsTile
manufacturerId={manufacturer.id}
seriesId={series.id}
Expand Down
4 changes: 2 additions & 2 deletions app/src/app/app/fleet/settings/manufacturer/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { authenticatePage } from "@/auth/server";
import { SkeletonTile } from "@/common/components/SkeletonTile";
import { CreateManufacturereButton } from "@/fleet/components/CreateManufacturerButton";
import { ManufacturersTile } from "@/fleet/components/ManufacturersTile";
import { TileSkeleton } from "@/fleet/components/TileSkeleton";
import { type Metadata } from "next";
import { Suspense } from "react";

Expand All @@ -24,7 +24,7 @@ export default async function Page() {
<CreateManufacturereButton />
</div>

<Suspense fallback={<TileSkeleton />}>
<Suspense fallback={<SkeletonTile />}>
<ManufacturersTile />
</Suspense>
</main>
Expand Down
8 changes: 4 additions & 4 deletions app/src/app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AdminEnabler } from "@/auth/components/AdminEnabler";
import { SessionProviderContainer } from "@/auth/components/SessionProviderContainer";
import { authenticatePage } from "@/auth/server";
import { AdminEnabler } from "@/common/components/AdminEnabler";
import ImpersonationBannerContainer from "@/common/components/ImpersonationBannerContainer";
import QueryClientProviderContainer from "@/common/components/QueryClientProviderContainer";
import SessionProviderContainer from "@/common/components/SessionProviderContainer";
import { DesktopSidebarContainer } from "@/common/components/Sidebar/DesktopSidebarContainer";
import { MobileActionBarContainer } from "@/common/components/Sidebar/MobileActionBarContainer";
import { TRPCReactProvider } from "@/trpc/react";
Expand All @@ -17,7 +17,7 @@ export default async function AppLayout({ children }: Readonly<Props>) {
const authentication = await authenticatePage();

return (
(<SessionProviderContainer session={authentication.session}>
<SessionProviderContainer session={authentication.session}>
<QueryClientProviderContainer>
<TRPCReactProvider>
<div className="min-h-dvh bg-sinister-radial-gradient">
Expand All @@ -38,6 +38,6 @@ export default async function AppLayout({ children }: Readonly<Props>) {
)}
</TRPCReactProvider>
</QueryClientProviderContainer>
</SessionProviderContainer>)
</SessionProviderContainer>
);
}
60 changes: 8 additions & 52 deletions app/src/app/app/operations/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,63 +1,19 @@
import { authenticatePage } from "@/auth/server";
import Avatar from "@/common/components/Avatar";
import { dedupedGetUnleashFlag } from "@/common/utils/getUnleashFlag";
import { prisma } from "@/db";
import { log } from "@/logging";
import ConfirmParticipation from "@/operations/components/ConfirmParticipation";
import CreateUnit from "@/operations/components/CreateUnit";
import DeleteOperation from "@/operations/components/DeleteOperation";
import EditOperation from "@/operations/components/EditOperation";
import JoinOperation from "@/operations/components/JoinOperation";
import RemoveParticipation from "@/operations/components/RemoveParticipation";
import SquadronTile from "@/operations/components/SquadronTile";
import { getOperation } from "@/operations/queries";
import { type Metadata } from "next";
import Link from "next/link";
import { notFound } from "next/navigation";
import { cache } from "react";
import { serializeError } from "serialize-error";
import ConfirmParticipation from "./_components/ConfirmParticipation";
import CreateUnit from "./_components/CreateUnit";
import DeleteOperation from "./_components/DeleteOperation";
import EditOperation from "./_components/EditOperation";
import JoinOperation from "./_components/JoinOperation";
import RemoveParticipation from "./_components/RemoveParticipation";
import SquadronTile from "./_components/SquadronTile";

const getOperation = cache(async (id: string) => {
return prisma.operation.findUnique({
where: {
id,
},
include: {
members: {
include: {
user: true,
},
},
units: {
include: {
members: {
include: {
user: true,
ship: {
include: {
variant: true,
},
},
},
},
childUnits: {
include: {
members: {
include: {
user: true,
ship: {
include: {
variant: true,
},
},
},
},
},
},
},
},
},
});
});

type Params = Promise<{
id: string;
Expand Down
4 changes: 2 additions & 2 deletions app/src/app/app/operations/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { authenticatePage } from "@/auth/server";
import Note from "@/common/components/Note";
import { dedupedGetUnleashFlag } from "@/common/utils/getUnleashFlag";
import { prisma } from "@/db";
import { CreateOperation } from "@/operations/components/CreateOperation";
import OperationTile from "@/operations/components/OperationTile";
import { type Metadata } from "next";
import { notFound } from "next/navigation";
import CreateOperation from "./_components/CreateOperation";
import OperationTile from "./_components/OperationTile";

export const metadata: Metadata = {
title: "Operationen | S.A.M. - Sinister Incorporated",
Expand Down
10 changes: 5 additions & 5 deletions app/src/app/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { authenticatePage } from "@/auth/server";
import { ProfileTile } from "@/citizen/components/ProfileTile";
import { Hero } from "@/common/components/Hero";
import { SpynetSearchTile } from "@/common/components/SpynetSearchTile/SpynetSearchTile";
import { UwuHero } from "@/common/components/UwuHero";
import { dedupedGetUnleashFlag } from "@/common/utils/getUnleashFlag";
import {
searchParamsNextjsToURLSearchParams,
type NextjsSearchParams,
} from "@/common/utils/searchParamsNextjsToURLSearchParams";
import { QuotesTile } from "@/dashboard/components/QuotesTile";
import { TileSkeleton } from "@/dashboard/components/TileSkeleton";
import { CalendarTile } from "@/discord/components/CalendarTile";
import { SpynetSearchTile } from "@/spynet/components/SpynetSearchTile/SpynetSearchTile";
import { type Metadata } from "next";
import { Suspense } from "react";
import { CalendarTile } from "./_components/CalendarTile";
import { ProfileTile } from "./_components/ProfileTile";
import { QuotesTile } from "./_components/QuotesTile";
import { TileSkeleton } from "./_components/TileSkeleton";

export const metadata: Metadata = {
title: "Dashboard | S.A.M. - Sinister Incorporated",
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app/roles/_components/tabs/CitizenTab.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import TabPanel from "@/common/components/tabs/TabPanel";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import { type ClassificationLevel, type NoteType } from "@prisma/client";
import { usePermissionsContext } from "../PermissionsContext";
import { CitizenIdSection } from "./components/CitizenIdSection";
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app/roles/_components/tabs/DocumentsTab.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import Note from "@/common/components/Note";
import TabPanel from "@/common/components/tabs/TabPanel";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import { usePermissionsContext } from "../PermissionsContext";

export const DocumentsTab = () => {
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app/roles/_components/tabs/EventsTab.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import TabPanel from "@/common/components/tabs/TabPanel";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import { usePermissionsContext } from "../PermissionsContext";

type Props = Readonly<{
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app/roles/_components/tabs/FleetTab.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import TabPanel from "@/common/components/tabs/TabPanel";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import { usePermissionsContext } from "../PermissionsContext";

const FleetTab = () => {
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app/roles/_components/tabs/OtherTab.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import TabPanel from "@/common/components/tabs/TabPanel";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import { type Role } from "@prisma/client";
import { usePermissionsContext } from "../PermissionsContext";
import { CareerSection } from "./components/CareerSection";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Button from "@/common/components/Button";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import * as Tooltip from "@radix-ui/react-tooltip";
import clsx from "clsx";
import { FaInfoCircle } from "react-icons/fa";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import clsx from "clsx";
import { usePermissionsContext } from "../../PermissionsContext";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import clsx from "clsx";
import { usePermissionsContext } from "../../PermissionsContext";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import clsx from "clsx";
import { usePermissionsContext } from "../../PermissionsContext";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import clsx from "clsx";
import { usePermissionsContext } from "../../PermissionsContext";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import clsx from "clsx";
import { usePermissionsContext } from "../../PermissionsContext";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import clsx from "clsx";
import { usePermissionsContext } from "../../PermissionsContext";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Button from "@/common/components/Button";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import { type ClassificationLevel, type NoteType } from "@prisma/client";
import clsx from "clsx";
import { useState } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Button from "@/common/components/Button";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import * as Tooltip from "@radix-ui/react-tooltip";
import clsx from "clsx";
import { FaInfoCircle } from "react-icons/fa";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import clsx from "clsx";
import { usePermissionsContext } from "../../PermissionsContext";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Button from "@/common/components/Button";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import * as Tooltip from "@radix-ui/react-tooltip";
import clsx from "clsx";
import { FaInfoCircle } from "react-icons/fa";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import clsx from "clsx";
import { usePermissionsContext } from "../../PermissionsContext";

Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app/spynet/activity/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { authenticatePage } from "@/auth/server";
import { SkeletonTile } from "@/common/components/SkeletonTile";
import { ActivityTile } from "@/spynet/components/ActivityTile/ActivityTile";
import { type Metadata } from "next";
import Link from "next/link";
import { Suspense } from "react";
import { ActivityTile } from "../_components/ActivityTile/ActivityTile";

export const metadata: Metadata = {
title: "Aktivität - Spynet | S.A.M. - Sinister Incorporated",
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app/spynet/citizen/_components/Filters.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { requireAuthentication } from "@/auth/server";
import getVisibleRoles from "@/common/utils/getVisibleRoles";
import { Filter } from "../../_components/Filter";
import { Filter } from "@/spynet/components/Filter";
import RoleFilter from "./RoleFilter";
import { UnknownsFilter } from "./UnknownsFilter";

Expand Down
4 changes: 2 additions & 2 deletions app/src/app/app/spynet/citizen/_components/RoleFilter.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use client";

import Button from "@/common/components/Button";
import YesNoCheckbox from "@/common/components/YesNoCheckbox";
import YesNoCheckbox from "@/common/components/form/YesNoCheckbox";
import { env } from "@/env";
import { useFilter } from "@/spynet/components/Filter";
import { type Role } from "@prisma/client";
import Image from "next/image";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { useForm, type SubmitHandler } from "react-hook-form";
import { FaSave } from "react-icons/fa";
import { useFilter } from "../../_components/Filter";

interface FormValues {
values: string[];
Expand Down
Loading

0 comments on commit 3aec97e

Please sign in to comment.