From 20e5c258b55b44d33c5b8865fa43eeec19485efd Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Thu, 26 Oct 2023 14:42:29 +0300 Subject: [PATCH] refactor(git): allow empty additional files --- app/react/portainer/gitops/GitForm.tsx | 4 ++-- app/react/portainer/gitops/RefField/RefField.tsx | 2 +- app/react/portainer/gitops/RefField/RefSelector.tsx | 2 +- app/react/portainer/gitops/types.ts | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/react/portainer/gitops/GitForm.tsx b/app/react/portainer/gitops/GitForm.tsx index 19c947206..9b7bc7ada 100644 --- a/app/react/portainer/gitops/GitForm.tsx +++ b/app/react/portainer/gitops/GitForm.tsx @@ -88,7 +88,7 @@ export function GitForm({ {isAdditionalFilesFieldVisible && ( handleChange({ AdditionalFiles: value })} errors={errors.AdditionalFiles} /> @@ -165,5 +165,5 @@ export function buildGitValidationSchema( RepositoryURLValid: boolean().default(false), AutoUpdate: autoUpdateValidation().nullable(), TLSSkipVerify: boolean().default(false), - }).concat(gitAuthValidation(gitCredentials, false)); + }).concat(gitAuthValidation(gitCredentials, false)) as SchemaOf; } diff --git a/app/react/portainer/gitops/RefField/RefField.tsx b/app/react/portainer/gitops/RefField/RefField.tsx index 5e581c26e..b32c6f9b4 100644 --- a/app/react/portainer/gitops/RefField/RefField.tsx +++ b/app/react/portainer/gitops/RefField/RefField.tsx @@ -18,7 +18,7 @@ interface Props { onChange(value: string): void; model: RefFieldModel; error?: string; - isUrlValid: boolean; + isUrlValid?: boolean; stackId?: StackId; } diff --git a/app/react/portainer/gitops/RefField/RefSelector.tsx b/app/react/portainer/gitops/RefField/RefSelector.tsx index 84fed1711..fc07b8223 100644 --- a/app/react/portainer/gitops/RefField/RefSelector.tsx +++ b/app/react/portainer/gitops/RefField/RefSelector.tsx @@ -18,7 +18,7 @@ export function RefSelector({ value: string; stackId?: StackId; onChange: (value: string) => void; - isUrlValid: boolean; + isUrlValid?: boolean; }) { const creds = getAuthentication(model); const payload = { diff --git a/app/react/portainer/gitops/types.ts b/app/react/portainer/gitops/types.ts index 49f75af11..70abb93d9 100644 --- a/app/react/portainer/gitops/types.ts +++ b/app/react/portainer/gitops/types.ts @@ -26,6 +26,7 @@ export interface RepoConfigResponse { ConfigFilePath: string; Authentication?: GitAuthenticationResponse; ConfigHash: string; + TLSSkipVerify: boolean; } export type AutoUpdateModel = { @@ -52,11 +53,11 @@ export type GitAuthModel = GitCredentialsModel & GitNewCredentialModel; export interface GitFormModel extends GitAuthModel { RepositoryURL: string; - RepositoryURLValid: boolean; + RepositoryURLValid?: boolean; ComposeFilePathInRepository: string; RepositoryAuthentication: boolean; RepositoryReferenceName?: string; - AdditionalFiles: string[]; + AdditionalFiles?: string[]; SaveCredential?: boolean; NewCredentialName?: string;