mirror of
https://github.com/harness/drone.git
synced 2025-05-11 22:50:11 +08:00
fix: [CDE-468]: Added a check to differentiate between CDE Gitspace and Gitness (#2955)
* Re-trigger Build * Bug Fix
This commit is contained in:
parent
2f54f4003a
commit
e3f56f5a3d
@ -151,7 +151,7 @@ export const CDECreateGitspace = () => {
|
||||
...includeQueryParams,
|
||||
metadata: { infraProvider: 'HARNESS_GCP' }
|
||||
}}
|
||||
validationSchema={validateGitnessForm(getString)}
|
||||
validationSchema={validateGitnessForm(getString, true)}
|
||||
formName="importRepoForm"
|
||||
enableReinitialize>
|
||||
{formik => {
|
||||
|
@ -18,7 +18,7 @@ import * as yup from 'yup'
|
||||
import type { UseStringsReturn } from 'framework/strings'
|
||||
import { IDEType } from 'cde-gitness/constants'
|
||||
|
||||
export const validateGitnessForm = (getString: UseStringsReturn['getString']) =>
|
||||
export const validateGitnessForm = (getString: UseStringsReturn['getString'], isCDE = false) =>
|
||||
yup.object().shape({
|
||||
branch: yup.string().trim().required(getString('cde.branchValidationMessage')),
|
||||
code_repo_url: yup.string().trim().required(getString('cde.repoValidationMessage')),
|
||||
@ -27,7 +27,7 @@ export const validateGitnessForm = (getString: UseStringsReturn['getString']) =>
|
||||
resource_identifier: yup.string().trim().required(getString('cde.machineValidationMessage')),
|
||||
name: yup.string().trim().required(),
|
||||
ssh_token_identifier: yup.string().when('ide', {
|
||||
is: IDEType.VSCODE,
|
||||
is: ide => ide === IDEType.VSCODE && isCDE,
|
||||
then: yup.string().required(getString('cde.sshValidationMessage'))
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user