Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/notify-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
if: >-
github.event.deployment.environment == 'Production' &&
github.event.deployment_status.state == 'success' &&
github.event.deployment.creator.login == 'vercel[bot]'
github.event.deployment.creator.login == 'vercel[bot]' &&
github.event.deployment_status.environment_url
runs-on: ubuntu-24.04
environment: Production
permissions:
Expand Down
103 changes: 47 additions & 56 deletions .github/workflows/playwright-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,52 @@ on:
workflow_dispatch:

jobs:
logging:
name: Log Deployment Status Event
smoke_test:
name: Playwright tests
if: >-
(github.event_name == 'schedule') ||
(github.event_name == 'workflow_dispatch') ||
(github.event.deployment.environment == 'Production' &&
github.event.deployment_status.state == 'success' &&
github.event.deployment.creator.login == 'vercel[bot]' &&
github.event.deployment_status.environment_url)
runs-on: ubuntu-24.04
environment: Production
permissions:
contents: read
container:
image: mcr.microsoft.com/playwright:v1.58.1-noble
options: --user 1001
defaults:
run:
working-directory: pnpm-monorepo
steps:
- name: Log event payload
run: |
echo "Deployment Status Event Payload:"
echo "${{ toJson(github.event) }}"


# smoke_test:
# name: Playwright tests
# if: >-
# (github.event_name == 'schedule') ||
# (github.event_name == 'workflow_dispatch') ||
# (github.event.deployment.environment == 'Production' &&
# github.event.deployment_status.state == 'success' &&
# github.event.deployment.creator.login == 'vercel[bot]')
# runs-on: ubuntu-24.04
# environment: Production
# permissions:
# contents: read
# container:
# image: mcr.microsoft.com/playwright:v1.58.1-noble
# options: --user 1001
# defaults:
# run:
# working-directory: pnpm-monorepo
# steps:
# - uses: actions/checkout@v6.0.2

# - uses: pnpm/action-setup@v4.2.0
# with:
# version: 10.28.2

# - uses: actions/setup-node@v6.2.0
# with:
# node-version-file: pnpm-monorepo/.nvmrc
# cache: pnpm
# cache-dependency-path: pnpm-monorepo/pnpm-lock.yaml

# - name: Install dependencies
# run: pnpm install --filter @sam-monorepo/playwright

# - name: Run tests
# run: pnpm --filter @sam-monorepo/playwright test
# env:
# BASE_URL: ${{ vars.BASE_URL }}
# PLAYWRIGHT_CUSTOM_HEADER_NAME: ${{ vars.PLAYWRIGHT_CUSTOM_HEADER_NAME }}
# PLAYWRIGHT_CUSTOM_HEADER_VALUE: ${{ secrets.PLAYWRIGHT_CUSTOM_HEADER_VALUE }}

# - name: Upload test report
# uses: actions/upload-artifact@v6.0.0
# if: ${{ !cancelled() }}
# with:
# name: playwright-report
# path: pnpm-monorepo/apps/playwright/playwright-report/
# retention-days: 7
- uses: actions/checkout@v6.0.2

- uses: pnpm/action-setup@v4.2.0
with:
version: 10.28.2

- uses: actions/setup-node@v6.2.0
with:
node-version-file: pnpm-monorepo/.nvmrc
cache: pnpm
cache-dependency-path: pnpm-monorepo/pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --filter @sam-monorepo/playwright

- name: Run tests
run: pnpm --filter @sam-monorepo/playwright test
env:
BASE_URL: ${{ vars.BASE_URL }}
PLAYWRIGHT_CUSTOM_HEADER_NAME: ${{ vars.PLAYWRIGHT_CUSTOM_HEADER_NAME }}
PLAYWRIGHT_CUSTOM_HEADER_VALUE: ${{ secrets.PLAYWRIGHT_CUSTOM_HEADER_VALUE }}

- name: Upload test report
uses: actions/upload-artifact@v6.0.0
if: ${{ !cancelled() }}
with:
name: playwright-report
path: pnpm-monorepo/apps/playwright/playwright-report/
retention-days: 7
3 changes: 3 additions & 0 deletions .github/workflows/terraform-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
push:
branches:
- develop
paths:
- .github/workflows/terraform-validate.yml
- terraform/**

jobs:
validate:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/validate-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
push:
branches:
- develop
paths:
- .github/workflows/validate-app.yml
- app/**

jobs:
lint:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/validate-email-function.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
push:
branches:
- develop
paths:
- .github/workflows/validate-email-function.yml
- bun-packages/packages/email-function/**
- bun-packages/biome.json

jobs:
biome:
Expand Down
10 changes: 4 additions & 6 deletions app/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"dbaeumer",
"deduped",
"deque",
"dicld2d3ciqvi3fs6i5jxw60",
"dragndrop",
"DTEND",
"DTSTAMP",
Expand All @@ -41,6 +42,7 @@
"Membern",
"merriweather",
"Merriweather",
"mwibr68eokqvhw23c3r7msih",
"Notizart",
"novu",
"npcs",
Expand Down Expand Up @@ -80,18 +82,14 @@
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"typescript.preferences.autoImportFileExcludePatterns": [
"auth/*.ts"
], // We only want imports from the `index.ts` files in `auth`
"typescript.preferences.autoImportFileExcludePatterns": ["auth/*.ts"], // We only want imports from the `index.ts` files in `auth`
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
"eslint.useFlatConfig": true,
"i18n-ally.localesPaths": [
"messages"
],
"i18n-ally.localesPaths": ["messages"],
"i18n-ally.keystyle": "nested",
"typescript.experimental.useTsgo": false,
"typescript.native-preview.trace.server": "messages"
Expand Down
8 changes: 8 additions & 0 deletions app/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ const eslintConfig = defineConfig([
message: "Please use @/modules/common/components/tabs instead.",
},
],

"@typescript-eslint/restrict-template-expressions": [
"error",
{
// This needs to be set to true to make use of the `satisfies never` type guard for `switch` statements exhaustive checks.
allowNever: true,
},
],
},
},
]);
Expand Down
2 changes: 2 additions & 0 deletions app/src/app/api/spynet/citizen/[id]/log/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export async function POST(request: Request, props: { params: Params }) {
case "community-moniker":
await authentication.authorizeApi("community-moniker", "create");
break;
default:
throw new Error(`Unknown data.type: ${data satisfies never}`);
}

/**
Expand Down
74 changes: 73 additions & 1 deletion app/src/app/clearance/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AdminEnabler } from "@/modules/auth/components/AdminEnabler";
import { authenticate } from "@/modules/auth/server";
import { requireConfirmedEmailForPage } from "@/modules/auth/utils/emailConfirmation";
import { ClearanceLogout } from "@/modules/iam/components/ClearanceLogout";
import { log } from "@/modules/logging";
import { Footer } from "@/modules/shell/components/Footer";
import { type Metadata } from "next";
Expand Down Expand Up @@ -38,14 +39,85 @@ export default async function Page() {
Anmeldung erfolgreich
</h1>

<div className="flex flex-col gap-2 rounded-primary bg-neutral-800/50 p-8 mx-8">
<div className="flex flex-col gap-2 rounded-primary bg-neutral-800/50 p-4 mx-4">
<p>
Bitte melde dich bei Human Resources oder der Leitung um deinen
Account freischalten zu lassen.
</p>
</div>

<details>
<summary className="mt-4 text-center text-neutral-500 text-xs hover:text-interaction-500 focus-visible:text-interaction-500 active:text-interaction-300 hover:underline focus-visible:underline active:underline cursor-pointer">
Benutzerdetails anzeigen
</summary>

<div className="mt-4 flex flex-col gap-4 items-center px-4">
<section className="flex flex-col gap-2 text-neutral-500 text-xs max-w-full">
<div>
<p className="font-bold mb-1">Discord</p>

<div className="flex gap-1">
<p className="flex-none w-28">ID:</p>
<p
className="flex-1 truncate"
title={authentication.session.discordId}
>
{authentication.session.discordId}
</p>
</div>
</div>

<div>
<p className="font-bold mb-1">Benutzer</p>

<div className="flex gap-1">
<p className="flex-none w-28">User ID:</p>

<p
className="flex-1 truncate"
title={authentication.session.user.id}
>
{authentication.session.user.id}
</p>
</div>

<div className="flex gap-1">
<p className="flex-none w-28">E-Mail-Adresse:</p>
<p
className="flex-1 truncate"
title={authentication.session.user.email || undefined}
>
{authentication.session.user.email}
</p>
</div>
</div>

<div>
<p className="font-bold mb-1">Citizen</p>

{authentication.session.entity ? (
<div className="flex gap-1">
<p className="flex-none w-28">Internal ID:</p>
<p
className="flex-1 truncate"
title={authentication.session.entity.id}
>
{authentication.session.entity.id}
</p>
</div>
) : (
"-"
)}
</div>
</section>

<ClearanceLogout />
</div>
</details>
</main>

<div className="h-[1px] bg-neutral-700 mt-4 w-2" />

<Footer className="mt-4" />

{showAdminEnabler && (
Expand Down
6 changes: 6 additions & 0 deletions app/src/modules/apps/utils/externalApps.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import siloAnfrageScreenshot from "@/assets/silo-anfrage-screenshot.png";
import { AiOutlineForm } from "react-icons/ai";
import { FaShoppingBasket } from "react-icons/fa";
import { FaBarsProgress } from "react-icons/fa6";
import type { ExternalApp } from "./types";

export const externalApps: ExternalApp[] = [
{
id: "cmfavc1fu0000eo9v2ff6bfh2",
name: "SILO-Anfrage",
slug: "silo-request",
icon: <AiOutlineForm />,
imageSrc: siloAnfrageScreenshot,
description:
"Hier kannst du Materialeinträge anmelden, aktuelle Angebote und Preislisten anfordern.",
Expand Down Expand Up @@ -44,6 +48,7 @@ export const externalApps: ExternalApp[] = [
id: "mwibr68eokqvhw23c3r7msih",
name: "Scrapper's Codex",
slug: "scrappers-codex",
icon: <FaShoppingBasket />,
description:
"Verkaufe einfach und schnell deinen Loot gewinnbringend über den Schwarzmarkt der Org",
tags: ["featured", "economics"],
Expand All @@ -65,6 +70,7 @@ export const externalApps: ExternalApp[] = [
id: "dicld2d3ciqvi3fs6i5jxw60",
name: "Projekte",
slug: "projects",
icon: <FaBarsProgress />,
description: "Verfolge den Fortschritt unserer Org-internen Projekte",
tags: ["economics"],
defaultPage: {
Expand Down
2 changes: 2 additions & 0 deletions app/src/modules/apps/utils/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { StaticImageData } from "next/image";
import type { ReactElement } from "react";

export interface BaseApp {
name: string;
Expand Down Expand Up @@ -55,6 +56,7 @@ export interface ExternalApp extends BaseApp {

team: TeamMember[];
iframeSandbox?: string;
icon: ReactElement;
}

export type RedactedApp = Pick<BaseApp, "name" | "tags"> & {
Expand Down
4 changes: 4 additions & 0 deletions app/src/modules/citizen/components/roles/RolesHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export const RolesHistory = async ({ className, entity }: Props) => {
</>
);
break;
default:
throw new Error(
`Unknown change.type: ${change.type satisfies never}`,
);
}

return {
Expand Down
Loading
Loading