diff --git a/app/config-types.ts b/app/config-types.ts index 553df0107..99c54a66d 100644 --- a/app/config-types.ts +++ b/app/config-types.ts @@ -1103,11 +1103,18 @@ const DataSource = t.type({ }); export type DataSource = t.TypeOf; +const Layout = t.type({ + type: t.literal("tab"), +}); +export type Layout = t.TypeOf; +export type LayoutType = Layout["type"]; + const Config = t.type( { version: t.string, dataSource: DataSource, meta: Meta, + layout: Layout, chartConfigs: t.array(ChartConfig), activeChartKey: t.string, }, diff --git a/app/configurator/components/configurator.tsx b/app/configurator/components/configurator.tsx index 83b83b26b..b4bad7aed 100644 --- a/app/configurator/components/configurator.tsx +++ b/app/configurator/components/configurator.tsx @@ -224,7 +224,17 @@ const LayoutingStep = () => { mx: "auto", }} > - {}} /> + { + if (state.layout.type === "tab") { + return; + } + + dispatch({ type: "LAYOUT_CHANGED", value: { type: "tab" } }); + }} + /> = ( return draft; + case "LAYOUT_CHANGED": + if (draft.state === "LAYOUTING") { + draft.layout = action.value; + } + + return draft; + default: throw unreachableError(action); } diff --git a/app/utils/chart-config/versioning.ts b/app/utils/chart-config/versioning.ts index cdae06fd0..34ec43771 100644 --- a/app/utils/chart-config/versioning.ts +++ b/app/utils/chart-config/versioning.ts @@ -812,7 +812,7 @@ export const migrateChartConfig = makeMigrate(chartConfigMigrations, { defaultToVersion: CHART_CONFIG_VERSION, }); -export const CONFIGURATOR_STATE_VERSION = "3.0.1"; +export const CONFIGURATOR_STATE_VERSION = "3.1.0"; const configuratorStateMigrations: Migration[] = [ { @@ -940,6 +940,25 @@ const configuratorStateMigrations: Migration[] = [ }); }, }, + { + description: "ALL + layout", + from: "3.0.1", + to: "3.1.0", + up: (config) => { + const newConfig = { ...config, version: "3.1.0" }; + + return produce(newConfig, (draft: any) => { + draft.layout = { type: "tab" }; + }); + }, + down: (config) => { + const newConfig = { ...config, version: "3.0.1" }; + + return produce(newConfig, (draft: any) => { + delete draft.layout; + }); + }, + }, ]; export const migrateConfiguratorState = makeMigrate(