fix(edgestack): broken parallel setting in create view [EE-7245] (#11945)
parent
e3364457c4
commit
6486a5d971
|
@ -124,7 +124,15 @@ export function InnerForm({
|
|||
<StaggerFieldset
|
||||
isEdit={false}
|
||||
values={values.staggerConfig}
|
||||
onChange={(value) => setFieldValue('staggerConfig', value)}
|
||||
onChange={(newStaggerValues) =>
|
||||
setValues((values) => ({
|
||||
...values,
|
||||
staggerConfig: {
|
||||
...values.staggerConfig,
|
||||
...newStaggerValues,
|
||||
},
|
||||
}))
|
||||
}
|
||||
/>
|
||||
|
||||
<FormActions
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import { useMutation } from '@tanstack/react-query';
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
import axios, { parseAxiosError } from '@/portainer/services/axios';
|
||||
import { mutationOptions, withError } from '@/react-tools/react-query';
|
||||
import {
|
||||
mutationOptions,
|
||||
withError,
|
||||
withInvalidate,
|
||||
} from '@/react-tools/react-query';
|
||||
import {
|
||||
AutoUpdateResponse,
|
||||
GitAuthenticationResponse,
|
||||
|
@ -11,6 +15,8 @@ import { DeploymentType, EdgeStack } from '@/react/edge/edge-stacks/types';
|
|||
import { EdgeGroup } from '@/react/edge/edge-groups/types';
|
||||
import { Registry } from '@/react/portainer/registries/types/registry';
|
||||
|
||||
import { queryKeys } from '../../../queries/query-keys';
|
||||
|
||||
export interface UpdateEdgeStackGitPayload {
|
||||
id: EdgeStack['Id'];
|
||||
autoUpdate: AutoUpdateResponse | null;
|
||||
|
@ -23,9 +29,14 @@ export interface UpdateEdgeStackGitPayload {
|
|||
}
|
||||
|
||||
export function useUpdateEdgeStackGitMutation() {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation(
|
||||
updateEdgeStackGit,
|
||||
mutationOptions(withError('Failed updating stack'))
|
||||
mutationOptions(
|
||||
withError('Failed updating stack'),
|
||||
withInvalidate(queryClient, [queryKeys.base()])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -186,6 +186,7 @@ function InnerForm({
|
|||
setFieldValue,
|
||||
isValid,
|
||||
errors,
|
||||
setValues,
|
||||
setFieldError,
|
||||
initialValues,
|
||||
} = useFormikContext<FormValues>();
|
||||
|
@ -327,10 +328,14 @@ function InnerForm({
|
|||
|
||||
<StaggerFieldset
|
||||
values={values.staggerConfig}
|
||||
onChange={(value) =>
|
||||
Object.entries(value).forEach(([key, value]) =>
|
||||
setFieldValue(`staggerConfig.${key}`, value)
|
||||
)
|
||||
onChange={(newStaggerValues) =>
|
||||
setValues((values) => ({
|
||||
...values,
|
||||
staggerConfig: {
|
||||
...values.staggerConfig,
|
||||
...newStaggerValues,
|
||||
},
|
||||
}))
|
||||
}
|
||||
errors={errors.staggerConfig}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue