Skip to content

Commit

Permalink
feat: [CDE-255]: Updated validation for private repo (#2557)
Browse files Browse the repository at this point in the history
* feat: [CDE-255]: Updated validation for private repo
  • Loading branch information
deepesh-ui authored and Harness committed Aug 21, 2024
1 parent cccece9 commit fddea63
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,22 @@ export const CDEAnyGitImport = () => {
branch: string
url: string
}
if (response?.is_private) {
if (!response?.branch) {
errorMessage = getString('cde.repository.privateRepoWarning')
setRepoCheckState(RepoCheckStatus.InValid)
setValues((prvValues: any) => {
return {
...prvValues,
code_repo_url: response.url,
branch: undefined,
identifier: undefined,
name: undefined,
code_repo_type: values?.code_repo_type
}
})
setTimeout(() => {
setFieldError('code_repo_url', errorMessage)
}, 500)
} else {
setValues((prvValues: any) => {
return {
Expand Down

0 comments on commit fddea63

Please sign in to comment.