1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

fix(edge groups): make large edge groups editable [BE-11720] (#558)

This commit is contained in:
Viktor Pettersson 2025-03-28 15:16:05 +01:00 committed by GitHub
parent 7c01f84a5c
commit 1d12011eb5
14 changed files with 373 additions and 46 deletions

View file

@ -35,6 +35,7 @@ export function EdgeGroupForm({
name: group.Name,
partialMatch: group.PartialMatch,
tagIds: group.TagIds,
edgeGroupId: group.Id,
}
: {
name: '',
@ -42,6 +43,7 @@ export function EdgeGroupForm({
environmentIds: [],
partialMatch: false,
tagIds: [],
edgeGroupId: 0,
}
}
onSubmit={onSubmit}

View file

@ -1,6 +1,6 @@
import { useFormikContext } from 'formik';
import { AssociatedEdgeEnvironmentsSelector } from '@/react/edge/components/AssociatedEdgeEnvironmentsSelector';
import { AssociatedEdgeGroupEnvironmentsSelector } from '@/react/edge/components/AssociatedEdgeGroupEnvironmentsSelector';
import { FormSection } from '@@/form-components/FormSection';
import { confirmDestructive } from '@@/modals/confirm';
@ -14,7 +14,7 @@ export function StaticGroupFieldset({ isEdit }: { isEdit?: boolean }) {
return (
<FormSection title="Associated environments">
<div className="form-group">
<AssociatedEdgeEnvironmentsSelector
<AssociatedEdgeGroupEnvironmentsSelector
value={values.environmentIds}
error={errors.environmentIds}
onChange={async (environmentIds, meta) => {
@ -33,6 +33,7 @@ export function StaticGroupFieldset({ isEdit }: { isEdit?: boolean }) {
setFieldValue('environmentIds', environmentIds);
}}
edgeGroupId={values.edgeGroupId}
/>
</div>
</FormSection>

View file

@ -1,7 +1,11 @@
import { EnvironmentId } from '@/react/portainer/environments/types';
import {
EdgeGroupId,
EnvironmentId,
} from '@/react/portainer/environments/types';
import { TagId } from '@/portainer/tags/types';
export interface FormValues {
edgeGroupId: EdgeGroupId;
name: string;
dynamic: boolean;
environmentIds: EnvironmentId[];

View file

@ -21,6 +21,7 @@ export function useValidation({
is: true,
then: (schema) => schema.min(1, 'Tags are required'),
}),
edgeGroupId: number().default(0).notRequired(),
}),
[nameValidation]
);