-
Notifications
You must be signed in to change notification settings - Fork 1
feat(web): EYT-113 Admin-/Mitarbeiter-Shell-Grenze mit serverseitigem Feld-Gate #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
eab296f
refactor(web): EYT-113 Werkbank-Routen in eine Route Group ziehen
BenPerro ed44431
feat(web): EYT-113 serverseitige Sitzungslesung und Start-Shell-Ablei…
BenPerro fb17acf
feat(web): EYT-113 Feld-Shell mit serverseitigem Sitzungs-Gate
BenPerro 04d1ac3
feat(web): EYT-113 Start-Shell-Dispatch auf der Startseite und im Login
BenPerro 58b0859
test(api): EYT-113 Import-Grenze feld-shell-boundary als neunte Regel
BenPerro 42d01ea
test(web): EYT-113 Feld-Reise, Cross-Shell-Negativfall und fail-close…
BenPerro c673f62
style(web): EYT-113 Prettier-Format der Feld-Shell-Suite
BenPerro 2ae3a6e
test(api): EYT-113 Scope-Zusicherung gegen verschluckte Feld-Dateien …
BenPerro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import type { ReactNode } from "react"; | ||
|
|
||
| import { AppShell } from "../../components/app-shell"; | ||
|
|
||
| /** | ||
| * Werkbank-Layout (EYT-113): die bestehende Admin-/Werkbank-Shell gilt nur | ||
| * noch für die Routen dieser Route Group. Die Route Group ändert keine URLs, | ||
| * sie zieht die Shell-Grenze — die Feld-Shell unter `app/feld/` hat ein | ||
| * eigenes Layout und eine eigene Navigation. | ||
| */ | ||
| export default function WerkbankLayout({ children }: { children: ReactNode }) { | ||
| return <AppShell>{children}</AppShell>; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { headers } from "next/headers"; | ||
| import { redirect } from "next/navigation"; | ||
|
|
||
| import { StartInhalt } from "../../components/start-inhalt"; | ||
| import { leseServerSitzung } from "../../lib/feld/sitzung-server"; | ||
| import { startShellFuer } from "../../lib/feld/start-shell"; | ||
|
|
||
| /** | ||
| * Werkbank-Startseite mit Start-Shell-Dispatch (EYT-113): die zulaessige | ||
| * Start-Shell folgt SERVERSEITIG aus der real verifizierten Session. Wer | ||
| * ausschliesslich als member arbeitet, gehoert ins Feld und wird dorthin | ||
| * geleitet — die Route selbst verleiht kein Recht, sie liest nur. | ||
| * | ||
| * Abgemeldete und NICHT PRUEFBARE Sitzungen sehen die Startseite unveraendert: | ||
| * sie ist oeffentlich, und Nichtwissen darf niemanden aussperren oder | ||
| * umleiten (fail-open ist hier richtig, weil kein Inhalt geschuetzt ist — | ||
| * geschuetzte Inhalte pruefen API und RLS). | ||
| */ | ||
| export default async function HomePage() { | ||
| const kopfzeilen = await headers(); | ||
| const sitzung = await leseServerSitzung(kopfzeilen.get("cookie")); | ||
| if (sitzung.zustand === "angemeldet" && startShellFuer(sitzung.session) === "feld") { | ||
| redirect("/feld"); | ||
| } | ||
| return <StartInhalt />; | ||
| } |
6 changes: 3 additions & 3 deletions
6
apps/web/app/planung/page.tsx → apps/web/app/(werkbank)/planung/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import type { Metadata } from "next"; | ||
| import { headers } from "next/headers"; | ||
| import { redirect } from "next/navigation"; | ||
| import type { ReactNode } from "react"; | ||
|
|
||
| import { ErrorState } from "@easytree/ui"; | ||
|
|
||
| import { FeldShell } from "../../components/feld/feld-shell"; | ||
| import { leseServerSitzung } from "../../lib/feld/sitzung-server"; | ||
|
|
||
| export const metadata: Metadata = { title: "Feld — easyTree" }; | ||
|
|
||
| /** | ||
| * Server-Gate der Feld-Shell (EYT-113): die zulaessige Shell folgt aus der | ||
| * REAL VERIFIZIERTEN Session — die API prueft die Cookies, nicht diese | ||
| * Datei, und nicht die Route. `headers()` macht den Teilbaum dynamisch; | ||
| * das Proxyziel wird damit nie zur Bauzeit gelesen (EYT-126). | ||
| * | ||
| * Fail-closed in beide Richtungen: Abgemeldete werden zur Anmeldung | ||
| * geleitet, und NICHTWISSEN (API nicht erreichbar, Antwort unlesbar) ist | ||
| * nicht abgemeldet — es zeigt eine ehrliche Fehlerflaeche statt Shell. | ||
| */ | ||
| export default async function FeldLayout({ children }: { children: ReactNode }) { | ||
| const kopfzeilen = await headers(); | ||
| const sitzung = await leseServerSitzung(kopfzeilen.get("cookie")); | ||
|
|
||
| if (sitzung.zustand === "abgemeldet") { | ||
| redirect("/anmelden"); | ||
| } | ||
|
|
||
| if (sitzung.zustand === "unbekannt") { | ||
| return ( | ||
| <main id="hauptinhalt" tabIndex={-1} className="eyt-app-shell__main feld-gate"> | ||
| <ErrorState | ||
| data-testid="feld-sitzung-unbekannt" | ||
| title="Anmeldung nicht prüfbar" | ||
| description="Die Anmeldung konnte serverseitig nicht geprüft werden. Bitte versuche es später erneut." | ||
| /> | ||
| </main> | ||
| ); | ||
| } | ||
|
|
||
| return <FeldShell>{children}</FeldShell>; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { PageHeader } from "@easytree/ui"; | ||
|
|
||
| import { FeldStart } from "../../components/feld/feld-start"; | ||
|
|
||
| /** | ||
| * Startseite der Feld-App (EYT-113). Muster wie die Werkbank-Seiten: | ||
| * Fragment, KEIN eigenes `<main>` — die Landmark stellt die Feld-Shell. | ||
| */ | ||
| export default function FeldPage() { | ||
| return ( | ||
| <> | ||
| <PageHeader | ||
| title="Feld" | ||
| description="Dein Einstieg für den Einsatz — angemeldet mit deinem easyTree-Konto." | ||
| /> | ||
| <FeldStart /> | ||
| </> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.