From 88dceb7571ea0d29e912f6ca2badb0d728806cbc Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Tue, 26 Nov 2024 10:43:24 +0100 Subject: [PATCH] Revert "Merge pull request #879 from InseeFrLab/fix-title-accordion" This reverts commit 2328bd8c62ce61a602da4df7ac80ad16abe94bb3, reversing changes made to d80017e38c19da78e79eaf5d9d4eb93d4d819d44. --- .../computeRootForm/computeRootForm.test.ts | 2 -- .../computeRootForm/computeRootFormFieldGroup.test.ts | 11 ----------- .../computeRootForm/computeRootFormFieldGroup.ts | 2 -- .../usecases/launcher/decoupledLogic/formTypes.ts | 2 +- .../mutateHelmValues_update/findInRootForm.test.ts | 2 -- .../mutateHelmValues_update.test.ts | 1 - .../ui/pages/launcher/RootFormComponent/Accordion.tsx | 6 ------ .../RootFormComponent/ConfigurationTopLevelGroup.tsx | 7 +------ 8 files changed, 2 insertions(+), 31 deletions(-) diff --git a/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootForm.test.ts b/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootForm.test.ts index a2fcef3fb..1427a8659 100644 --- a/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootForm.test.ts +++ b/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootForm.test.ts @@ -67,7 +67,6 @@ describe(symToStr({ computeRootForm }), () => { type: "group", helmValuesPath: ["services"], description: undefined, - title: undefined, nodes: [ { type: "field", @@ -209,7 +208,6 @@ describe(symToStr({ computeRootForm }), () => { type: "group", helmValuesPath: ["services"], description: undefined, - title: undefined, nodes: [ { type: "field", diff --git a/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootFormFieldGroup.test.ts b/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootFormFieldGroup.test.ts index 611cdcbed..3c1409ad3 100644 --- a/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootFormFieldGroup.test.ts +++ b/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootFormFieldGroup.test.ts @@ -35,7 +35,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => { type: "group", helmValuesPath: [], description: undefined, - title: undefined, nodes: [ { type: "field", @@ -88,7 +87,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => { type: "group", helmValuesPath: [], description: undefined, - title: undefined, nodes: [ { type: "field", @@ -119,7 +117,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => { properties: { persistence: { description: "Configuration for persistence", - title: "Persistence", type: "object", properties: { enabled: { @@ -158,13 +155,11 @@ describe(symToStr({ computeRootFormFieldGroup }), () => { type: "group", helmValuesPath: [], description: undefined, - title: undefined, nodes: [ { type: "group", helmValuesPath: ["persistence"], description: "Configuration for persistence", - title: "Persistence", nodes: [ { type: "field", @@ -196,7 +191,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => { properties: { persistence: { description: "Configuration for persistence", - title: "Persistence", type: "object", properties: { enabled: { @@ -234,13 +228,11 @@ describe(symToStr({ computeRootFormFieldGroup }), () => { type: "group", helmValuesPath: [], description: undefined, - title: undefined, nodes: [ { type: "group", helmValuesPath: ["persistence"], description: "Configuration for persistence", - title: "Persistence", nodes: [ { type: "field", @@ -297,7 +289,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => { type: "group", helmValuesPath: [], description: undefined, - title: undefined, nodes: [ { type: "field", @@ -315,13 +306,11 @@ describe(symToStr({ computeRootFormFieldGroup }), () => { type: "group", helmValuesPath: ["b"], description: undefined, - title: undefined, nodes: [ { type: "group", helmValuesPath: ["b", 0], description: undefined, - title: undefined, nodes: [ { type: "field", diff --git a/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootFormFieldGroup.ts b/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootFormFieldGroup.ts index cbc6fae58..6996034b1 100644 --- a/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootFormFieldGroup.ts +++ b/web/src/core/usecases/launcher/decoupledLogic/computeRootForm/computeRootFormFieldGroup.ts @@ -358,7 +358,6 @@ function computeRootFormFieldGroup_rec(params: { type: "group", helmValuesPath, description: helmValuesSchema.description, - title: helmValuesSchema.title ?? undefined, nodes: Object.entries(helmValuesSchema.properties) .map(([segment, helmValuesSchema_child]) => computeRootFormFieldGroup_rec({ @@ -389,7 +388,6 @@ function computeRootFormFieldGroup_rec(params: { type: "group", helmValuesPath, description: helmValuesSchema.description, - title: undefined, nodes: values .map((...[, index]) => computeRootFormFieldGroup_rec({ diff --git a/web/src/core/usecases/launcher/decoupledLogic/formTypes.ts b/web/src/core/usecases/launcher/decoupledLogic/formTypes.ts index 72a7ea8e5..77697cc49 100644 --- a/web/src/core/usecases/launcher/decoupledLogic/formTypes.ts +++ b/web/src/core/usecases/launcher/decoupledLogic/formTypes.ts @@ -18,7 +18,7 @@ export type FormFieldGroup = { type: "group"; helmValuesPath: (string | number)[]; description: string | undefined; - title: string | undefined; + nodes: (FormField | FormFieldGroup)[]; canAdd: boolean; canRemove: boolean; diff --git a/web/src/core/usecases/launcher/decoupledLogic/mutateHelmValues/mutateHelmValues_update/findInRootForm.test.ts b/web/src/core/usecases/launcher/decoupledLogic/mutateHelmValues/mutateHelmValues_update/findInRootForm.test.ts index ecaceae30..dbc384eb0 100644 --- a/web/src/core/usecases/launcher/decoupledLogic/mutateHelmValues/mutateHelmValues_update/findInRootForm.test.ts +++ b/web/src/core/usecases/launcher/decoupledLogic/mutateHelmValues/mutateHelmValues_update/findInRootForm.test.ts @@ -9,7 +9,6 @@ const rootForm: RootForm = { type: "group", helmValuesPath: ["services"], description: undefined, - title: undefined, nodes: [ { type: "field", @@ -31,7 +30,6 @@ const rootForm: RootForm = { type: "group", helmValuesPath: ["resources"], description: undefined, - title: undefined, nodes: [ { type: "field", diff --git a/web/src/core/usecases/launcher/decoupledLogic/mutateHelmValues/mutateHelmValues_update/mutateHelmValues_update.test.ts b/web/src/core/usecases/launcher/decoupledLogic/mutateHelmValues/mutateHelmValues_update/mutateHelmValues_update.test.ts index 9da24b043..4a2bac713 100644 --- a/web/src/core/usecases/launcher/decoupledLogic/mutateHelmValues/mutateHelmValues_update/mutateHelmValues_update.test.ts +++ b/web/src/core/usecases/launcher/decoupledLogic/mutateHelmValues/mutateHelmValues_update/mutateHelmValues_update.test.ts @@ -118,7 +118,6 @@ describe(symToStr({ mutateHelmValues_update }), () => { type: "group", helmValuesPath: ["resources"], description: THROW_IF_ACCESSED, - title: THROW_IF_ACCESSED, canAdd: THROW_IF_ACCESSED, canRemove: THROW_IF_ACCESSED, nodes: [ diff --git a/web/src/ui/pages/launcher/RootFormComponent/Accordion.tsx b/web/src/ui/pages/launcher/RootFormComponent/Accordion.tsx index 9a7c3196d..3497136d5 100644 --- a/web/src/ui/pages/launcher/RootFormComponent/Accordion.tsx +++ b/web/src/ui/pages/launcher/RootFormComponent/Accordion.tsx @@ -22,7 +22,6 @@ type Props = { className?: string; helmValuesPath: (string | number)[]; description: string | undefined; - title: string | undefined; nodes: (FormFieldGroup | FormField)[]; canAdd: boolean; canRemove: boolean; @@ -34,7 +33,6 @@ export function Accordion(props: Props) { className, helmValuesPath, description, - title, nodes, canAdd, canRemove, @@ -136,10 +134,6 @@ export function Accordion(props: Props) { > {(() => { - if (title !== undefined) { - return title; - } - const lastSegment = helmValuesPath[helmValuesPath.length - 1]; assert(typeof lastSegment === "string"); diff --git a/web/src/ui/pages/launcher/RootFormComponent/ConfigurationTopLevelGroup.tsx b/web/src/ui/pages/launcher/RootFormComponent/ConfigurationTopLevelGroup.tsx index ac15332b5..6194e3295 100644 --- a/web/src/ui/pages/launcher/RootFormComponent/ConfigurationTopLevelGroup.tsx +++ b/web/src/ui/pages/launcher/RootFormComponent/ConfigurationTopLevelGroup.tsx @@ -50,7 +50,6 @@ export function ConfigurationTopLevelGroup(props: Props) { { helmValuesPath: ["Global"], description: "configuration that applies to all charts", - title: undefined, canAdd: false, canRemove: false, nodes: global @@ -62,7 +61,6 @@ export function ConfigurationTopLevelGroup(props: Props) { { helmValuesPath: ["Miscellaneous"], // TODO: i18n - title: undefined, description: "Top level configuration values", canAdd: false, canRemove: false, @@ -74,7 +72,6 @@ export function ConfigurationTopLevelGroup(props: Props) { return { helmValuesPath: [node.title], description: node.description, - title: node.title, canAdd: false, canRemove: false, nodes: [ @@ -95,7 +92,6 @@ export function ConfigurationTopLevelGroup(props: Props) { return { helmValuesPath: node.helmValuesPath, description: node.description, - title: node.title, canAdd: node.canAdd, canRemove: node.canRemove, nodes: node.nodes @@ -109,12 +105,11 @@ export function ConfigurationTopLevelGroup(props: Props) { return (
{accordionEntries.map( - ({ helmValuesPath, description, title, canAdd, canRemove, nodes }) => ( + ({ helmValuesPath, description, canAdd, canRemove, nodes }) => (