From 79e72ff3bc00c89cb5b5fa20262765d657243d94 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Fri, 9 Feb 2024 12:27:08 +1100 Subject: [PATCH] Fix UI config mutation not working (#4533) --- ui/v2.5/graphql/client-schema.graphql | 2 +- ui/v2.5/graphql/mutations/config.graphql | 2 +- ui/v2.5/src/components/Settings/context.tsx | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/v2.5/graphql/client-schema.graphql b/ui/v2.5/graphql/client-schema.graphql index 094ee3368f9..e16590172a0 100644 --- a/ui/v2.5/graphql/client-schema.graphql +++ b/ui/v2.5/graphql/client-schema.graphql @@ -22,5 +22,5 @@ extend input SetDefaultFilterInput { } extend type Mutation { - configureUI(input: UIConfig!): UIConfig! + configureUI(input: Map!): UIConfig! } diff --git a/ui/v2.5/graphql/mutations/config.graphql b/ui/v2.5/graphql/mutations/config.graphql index 1228bcd94ee..dfd53ed757b 100644 --- a/ui/v2.5/graphql/mutations/config.graphql +++ b/ui/v2.5/graphql/mutations/config.graphql @@ -36,7 +36,7 @@ mutation ConfigureDefaults($input: ConfigDefaultSettingsInput!) { } } -mutation ConfigureUI($input: UIConfig!) { +mutation ConfigureUI($input: Map!) { configureUI(input: $input) } diff --git a/ui/v2.5/src/components/Settings/context.tsx b/ui/v2.5/src/components/Settings/context.tsx index 8b82c820bc1..bb7db4c35b0 100644 --- a/ui/v2.5/src/components/Settings/context.tsx +++ b/ui/v2.5/src/components/Settings/context.tsx @@ -423,13 +423,15 @@ export const SettingsContext: React.FC = ({ children }) => { }); } + type UIConfigInput = GQL.Scalars["Map"]["input"]; + // saves the configuration if no further changes are made after a half second const saveUIConfig = useDebounce(async (input: IUIConfig) => { try { setUpdateSuccess(undefined); await updateUIConfig({ variables: { - input, + input: input as UIConfigInput, }, });