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

fix(edge/templates): fix issues with git templates [EE-6357] (#10679)

This commit is contained in:
Chaim Lev-Ari 2023-12-04 08:46:44 +02:00 committed by GitHub
parent 974378c9b5
commit 2a18c9f215
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 201 additions and 116 deletions

View file

@ -42,7 +42,7 @@ export function InnerForm({ isLoading }: { isLoading: boolean }) {
usePreventExit(
initialValues.FileContent,
values.FileContent,
values.Method === editor.value && !isSubmitting
values.Method === editor.value && !isSubmitting && !isLoading
);
const isGit = values.Method === git.value;
@ -108,16 +108,7 @@ export function InnerForm({ isLoading }: { isLoading: boolean }) {
/>
)}
{isTemplateVariablesEnabled && (
<CustomTemplatesVariablesDefinitionField
value={values.Variables}
onChange={(values) => setFieldValue('Variables', values)}
isVariablesNamesFromParent={values.Method === editor.value}
errors={errors.Variables}
/>
)}
{values.Method === git.value && (
{isGit && (
<GitForm
value={values.Git}
onChange={(newValues) =>
@ -130,6 +121,15 @@ export function InnerForm({ isLoading }: { isLoading: boolean }) {
/>
)}
{isTemplateVariablesEnabled && (
<CustomTemplatesVariablesDefinitionField
value={values.Variables}
onChange={(values) => setFieldValue('Variables', values)}
isVariablesNamesFromParent={values.Method === editor.value}
errors={errors.Variables}
/>
)}
{values.EdgeSettings && (
<EdgeSettingsFieldset
setValues={(edgeSetValues) =>