feat: [CDE-205]: revert the changes in pr for ticket CDE-205 (#2334)

* feat: [CDE-205]: revert the changes in pr for ticket CDE-205
This commit is contained in:
Shashwat Sachan 2024-07-31 12:41:28 +00:00 committed by Harness
parent 6232a8f5b8
commit 910c4819c7
3 changed files with 7 additions and 10 deletions

View File

@ -18,7 +18,7 @@ import css from './GitnessRepoImportForm.module.scss'
const RepositoryText = ({ repoList, value }: { repoList: TypesRepository[] | null; value?: string }) => {
const { getString } = useStrings()
const repoMetadata = repoList?.find(repo => repo.path === value)
const repoMetadata = repoList?.find(repo => repo.git_url === value)
const repoName = repoMetadata?.path
return (
@ -114,7 +114,7 @@ export const GitnessRepoImportForm = () => {
const formik = useFormikContext<any>()
const { values } = formik
const repoMetadata = repoListOptions.find(repo => repo.path === values.code_repo_url)
const repoMetadata = repoListOptions.find(repo => repo.git_url === values.code_repo_url)
if (repoRef !== repoMetadata?.path) {
setReporef(repoMetadata?.path as string)
}
@ -157,7 +157,7 @@ export const GitnessRepoImportForm = () => {
<Text>{repo.path}</Text>
</Layout.Horizontal>
}
active={repo.path === values.code_repo_url}
active={repo.git_url === values.code_repo_url}
onClick={() => {
const repoParams = repo?.path?.split('/') || []
formik.setValues((prvValues: any) => {
@ -166,11 +166,10 @@ export const GitnessRepoImportForm = () => {
code_repo_url: repo.git_url,
branch: repo.default_branch,
identifier: repoParams?.[repoParams.length - 1],
name: repo.path,
code_repo_type: 'gitness'
name: repo.path
}
})
formik.setFieldValue('code_repo_url', repo.path)
formik.setFieldValue('code_repo_url', repo.git_url)
}}
/>
))

View File

@ -56,8 +56,7 @@ export const ThirdPartyRepoImportForm = () => {
code_repo_url: response.url,
branch: response.branch,
identifier: getRepoIdFromURL(response.url),
name: getRepoNameFromURL(response.url),
code_repo_type: 'unknown'
name: getRepoNameFromURL(response.url)
}
})
setRepoCheckState(RepoCheckStatus.Valid)

View File

@ -22,7 +22,7 @@ export type EnumFileDiffStatus = string
export type EnumGitspaceAccessType = 'jwt_token' | 'user_credentials' | 'ssh_key'
export type EnumGitspaceCodeRepoType = 'github' | 'gitlab' | 'harness_code' | 'bitbucket' | 'unknown' | 'gitness'
export type EnumGitspaceCodeRepoType = 'github' | 'gitlab' | 'harness_code' | 'bitbucket' | 'unknown'
export type EnumGitspaceEntityType = 'gitspace_config' | 'gitspace_instance'
@ -319,7 +319,6 @@ export interface OpenapiCreateConnectorRequest {
export interface OpenapiCreateGitspaceRequest {
branch?: string
code_repo_url?: string
code_repo_type?: EnumGitspaceCodeRepoType
devcontainer_path?: string | null
ide?: EnumIDEType
identifier?: string