refactor(git): allow empty additional files

feat/EE-5573/related-changes
Chaim Lev-Ari 2023-10-26 14:42:29 +03:00
parent 6674df6dc9
commit 20e5c258b5
4 changed files with 7 additions and 6 deletions

View File

@ -88,7 +88,7 @@ export function GitForm({
{isAdditionalFilesFieldVisible && ( {isAdditionalFilesFieldVisible && (
<AdditionalFileField <AdditionalFileField
value={value.AdditionalFiles} value={value.AdditionalFiles || []}
onChange={(value) => handleChange({ AdditionalFiles: value })} onChange={(value) => handleChange({ AdditionalFiles: value })}
errors={errors.AdditionalFiles} errors={errors.AdditionalFiles}
/> />
@ -165,5 +165,5 @@ export function buildGitValidationSchema(
RepositoryURLValid: boolean().default(false), RepositoryURLValid: boolean().default(false),
AutoUpdate: autoUpdateValidation().nullable(), AutoUpdate: autoUpdateValidation().nullable(),
TLSSkipVerify: boolean().default(false), TLSSkipVerify: boolean().default(false),
}).concat(gitAuthValidation(gitCredentials, false)); }).concat(gitAuthValidation(gitCredentials, false)) as SchemaOf<GitFormModel>;
} }

View File

@ -18,7 +18,7 @@ interface Props {
onChange(value: string): void; onChange(value: string): void;
model: RefFieldModel; model: RefFieldModel;
error?: string; error?: string;
isUrlValid: boolean; isUrlValid?: boolean;
stackId?: StackId; stackId?: StackId;
} }

View File

@ -18,7 +18,7 @@ export function RefSelector({
value: string; value: string;
stackId?: StackId; stackId?: StackId;
onChange: (value: string) => void; onChange: (value: string) => void;
isUrlValid: boolean; isUrlValid?: boolean;
}) { }) {
const creds = getAuthentication(model); const creds = getAuthentication(model);
const payload = { const payload = {

View File

@ -26,6 +26,7 @@ export interface RepoConfigResponse {
ConfigFilePath: string; ConfigFilePath: string;
Authentication?: GitAuthenticationResponse; Authentication?: GitAuthenticationResponse;
ConfigHash: string; ConfigHash: string;
TLSSkipVerify: boolean;
} }
export type AutoUpdateModel = { export type AutoUpdateModel = {
@ -52,11 +53,11 @@ export type GitAuthModel = GitCredentialsModel & GitNewCredentialModel;
export interface GitFormModel extends GitAuthModel { export interface GitFormModel extends GitAuthModel {
RepositoryURL: string; RepositoryURL: string;
RepositoryURLValid: boolean; RepositoryURLValid?: boolean;
ComposeFilePathInRepository: string; ComposeFilePathInRepository: string;
RepositoryAuthentication: boolean; RepositoryAuthentication: boolean;
RepositoryReferenceName?: string; RepositoryReferenceName?: string;
AdditionalFiles: string[]; AdditionalFiles?: string[];
SaveCredential?: boolean; SaveCredential?: boolean;
NewCredentialName?: string; NewCredentialName?: string;