Skip to content

Commit

Permalink
Revert "Merge pull request #879 from InseeFrLab/fix-title-accordion"
Browse files Browse the repository at this point in the history
This reverts commit 2328bd8, reversing
changes made to d80017e.
  • Loading branch information
garronej committed Nov 26, 2024
1 parent e31b827 commit 88dceb7
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ describe(symToStr({ computeRootForm }), () => {
type: "group",
helmValuesPath: ["services"],
description: undefined,
title: undefined,
nodes: [
{
type: "field",
Expand Down Expand Up @@ -209,7 +208,6 @@ describe(symToStr({ computeRootForm }), () => {
type: "group",
helmValuesPath: ["services"],
description: undefined,
title: undefined,
nodes: [
{
type: "field",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => {
type: "group",
helmValuesPath: [],
description: undefined,
title: undefined,
nodes: [
{
type: "field",
Expand Down Expand Up @@ -88,7 +87,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => {
type: "group",
helmValuesPath: [],
description: undefined,
title: undefined,
nodes: [
{
type: "field",
Expand Down Expand Up @@ -119,7 +117,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => {
properties: {
persistence: {
description: "Configuration for persistence",
title: "Persistence",
type: "object",
properties: {
enabled: {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -196,7 +191,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => {
properties: {
persistence: {
description: "Configuration for persistence",
title: "Persistence",
type: "object",
properties: {
enabled: {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -297,7 +289,6 @@ describe(symToStr({ computeRootFormFieldGroup }), () => {
type: "group",
helmValuesPath: [],
description: undefined,
title: undefined,
nodes: [
{
type: "field",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -389,7 +388,6 @@ function computeRootFormFieldGroup_rec(params: {
type: "group",
helmValuesPath,
description: helmValuesSchema.description,
title: undefined,
nodes: values
.map((...[, index]) =>
computeRootFormFieldGroup_rec({
Expand Down
2 changes: 1 addition & 1 deletion web/src/core/usecases/launcher/decoupledLogic/formTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const rootForm: RootForm = {
type: "group",
helmValuesPath: ["services"],
description: undefined,
title: undefined,
nodes: [
{
type: "field",
Expand All @@ -31,7 +30,6 @@ const rootForm: RootForm = {
type: "group",
helmValuesPath: ["resources"],
description: undefined,
title: undefined,
nodes: [
{
type: "field",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
6 changes: 0 additions & 6 deletions web/src/ui/pages/launcher/RootFormComponent/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type Props = {
className?: string;
helmValuesPath: (string | number)[];
description: string | undefined;
title: string | undefined;
nodes: (FormFieldGroup | FormField)[];
canAdd: boolean;
canRemove: boolean;
Expand All @@ -34,7 +33,6 @@ export function Accordion(props: Props) {
className,
helmValuesPath,
description,
title,
nodes,
canAdd,
canRemove,
Expand Down Expand Up @@ -136,10 +134,6 @@ export function Accordion(props: Props) {
>
<Text typo="label 1" componentProps={{ lang: "und" }}>
{(() => {
if (title !== undefined) {
return title;
}

const lastSegment = helmValuesPath[helmValuesPath.length - 1];

assert(typeof lastSegment === "string");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -62,7 +61,6 @@ export function ConfigurationTopLevelGroup(props: Props) {
{
helmValuesPath: ["Miscellaneous"],
// TODO: i18n
title: undefined,
description: "Top level configuration values",
canAdd: false,
canRemove: false,
Expand All @@ -74,7 +72,6 @@ export function ConfigurationTopLevelGroup(props: Props) {
return {
helmValuesPath: [node.title],
description: node.description,
title: node.title,
canAdd: false,
canRemove: false,
nodes: [
Expand All @@ -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
Expand All @@ -109,12 +105,11 @@ export function ConfigurationTopLevelGroup(props: Props) {
return (
<div className={cx(classes.root, className)}>
{accordionEntries.map(
({ helmValuesPath, description, title, canAdd, canRemove, nodes }) => (
({ helmValuesPath, description, canAdd, canRemove, nodes }) => (
<Accordion
key={JSON.stringify(helmValuesPath)}
helmValuesPath={helmValuesPath}
description={description}
title={title}
canAdd={canAdd}
canRemove={canRemove}
nodes={nodes}
Expand Down

0 comments on commit 88dceb7

Please sign in to comment.