From 6ea07ba2ee58c23fb56a7e8a069791fc061fc08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Weberru=C3=9F?= Date: Tue, 27 Oct 2026 09:33:36 +0000 Subject: [PATCH 1/2] fix(configurator): keep a single template drafts editor --- .../apps/web/src/components/Applications.tsx | 5 +- .../apps/web/src/components/CommonEditor.tsx | 89 +++++-------- .../app/apps/web/src/locales/en.ts | 3 + .../app/apps/web/src/main.tsx | 86 ++++++++++-- .../app/apps/web/src/navigation.ts | 68 +++++----- .../e2e/application-access-transition.spec.ts | 24 ++-- .../app/e2e/cloud-catalogues.spec.ts | 33 ++--- .../app/e2e/common-editor.spec.ts | 124 +++++++++++------- .../app/e2e/configurator.spec.ts | 34 ++--- .../app/e2e/editor-navigation.ts | 40 ++++++ .../app/e2e/federation.spec.ts | 14 +- .../app/e2e/organisation.spec.ts | 22 ++-- .../app/e2e/template-parameters.spec.ts | 66 +++------- .../docs/common-editor.de.md | 6 +- .../docs/common-editor.md | 7 +- .../docs/development.de.md | 2 + landing-zone-configurator/docs/development.md | 7 +- .../docs/project-template-drafts.de.md | 4 +- .../docs/project-template-drafts.md | 4 +- 19 files changed, 375 insertions(+), 263 deletions(-) create mode 100644 landing-zone-configurator/app/e2e/editor-navigation.ts diff --git a/landing-zone-configurator/app/apps/web/src/components/Applications.tsx b/landing-zone-configurator/app/apps/web/src/components/Applications.tsx index f39a76ce..6ecb8e05 100644 --- a/landing-zone-configurator/app/apps/web/src/components/Applications.tsx +++ b/landing-zone-configurator/app/apps/web/src/components/Applications.tsx @@ -2397,8 +2397,11 @@ export function Applications({ if (!session) return (
-

{t("Anmeldung erforderlich")}

+

+ {t(templateEditor ? "Template-Entwürfe" : "Anmeldung erforderlich")} +

{t("Bitte melde dich für Application Landing Zones an.")}

+ {templateEditor}
); diff --git a/landing-zone-configurator/app/apps/web/src/components/CommonEditor.tsx b/landing-zone-configurator/app/apps/web/src/components/CommonEditor.tsx index 33463bbe..dab47356 100644 --- a/landing-zone-configurator/app/apps/web/src/components/CommonEditor.tsx +++ b/landing-zone-configurator/app/apps/web/src/components/CommonEditor.tsx @@ -22,13 +22,11 @@ import { import { useState } from "react"; import { t } from "../i18n"; import type { EditorStep } from "../navigation"; -import type { Session } from "./Account"; import { useObservabilityCatalogue } from "./CloudCatalogues"; import { ComponentPicker } from "./ComponentPicker"; import { FederatedIdentityEditor } from "./FederatedIdentityEditor"; import { labelFor } from "./feature-labels"; import { NetworkEditor } from "./NetworkEditor"; -import { ProjectTemplates } from "./ProjectTemplates"; import { projectTemplateSummary } from "./project-template-summary"; import { StructuredField } from "./StructuredField"; import { Topology } from "./Topology"; @@ -87,22 +85,20 @@ const steps: { id: EditorStep; title: string; inputs: string[] }[] = [ export function CommonEditor({ draft, - session = null, - savedConfigurationId = null, onChange, step, onStepChange, onOpenStorage, onCreatePlatformCopy, + onOpenTemplates, }: { draft: CommonConfiguration; - session?: Session | null; - savedConfigurationId?: string | null; onChange: (draft: CommonConfiguration) => void; step: EditorStep; onStepChange: (step: EditorStep) => void; onOpenStorage: () => void; onCreatePlatformCopy?: () => void; + onOpenTemplates: () => void; }) { const [error, setError] = useState(""); const [notice, setNotice] = useState(""); @@ -110,24 +106,12 @@ export function CommonEditor({ "public", ); const [newKey, setNewKey] = useState(""); - const [selectedTemplateId, setSelectedTemplateId] = useState( - null, - ); const platformDraft = draft.projectTemplates !== undefined; - const selectedTemplate = - draft.projectTemplates?.find( - (template) => template.id === selectedTemplateId, - ) ?? draft.projectTemplates?.[0]; - const selectTemplate = (id: string) => { - setSelectedTemplateId(id); - onStepChange("projects"); - }; + const visibleSteps = steps.filter( + (item) => !platformDraft || item.id !== "projects", + ); const stepTitle = (id: EditorStep, title: string) => - id === "projects" - ? platformDraft - ? "Template-Entwürfe" - : "Projekte (Bestand)" - : title; + id === "projects" ? "Projekte (Bestand)" : title; const values = compileCommonConfiguration(draft); const projects = commonProjects(draft); const areas = commonNetworkAreas(draft); @@ -158,7 +142,8 @@ export function CommonEditor({ ) .map((finding) => ({ field: finding.path, message: finding.message })), ]; - const active = steps.find((item) => item.id === step) ?? steps[0]; + const active = + visibleSteps.find((item) => item.id === step) ?? visibleSteps[0]; const perform = (action: () => CommonConfiguration) => { try { onChange(action()); @@ -257,11 +242,25 @@ export function CommonEditor({ {t("Konfigurationen →")} + {platformDraft && ( +

+ {t( + "Template-Entwürfe bearbeitest du unter Application Landing Zones. Sie werden weiterhin mit dieser Konfiguration gespeichert.", + )}{" "} + +

+ )}