diff --git a/app/src/common/utils/validation/commonValidators.js b/app/src/common/utils/validation/commonValidators.js index 5007f30609..0dfd5af2bf 100644 --- a/app/src/common/utils/validation/commonValidators.js +++ b/app/src/common/utils/validation/commonValidators.js @@ -36,7 +36,8 @@ export const descriptionEntity = bindMessageToValidator( 'descriptionEntityHint', ); -export const btsUrl = bindMessageToValidator(validate.url, 'btsUrlHint'); +export const btsJiraUrl = bindMessageToValidator(validate.jiraUrl, 'btsUrlHint'); +export const btsRallyUrl = bindMessageToValidator(validate.rallyUrl, 'btsUrlHint'); export const btsIntegrationName = bindMessageToValidator( validate.btsIntegrationName, 'btsIntegrationNameHint', diff --git a/app/src/common/utils/validation/validate.js b/app/src/common/utils/validation/validate.js index 0fd5d4ea90..767f04c6a3 100644 --- a/app/src/common/utils/validation/validate.js +++ b/app/src/common/utils/validation/validate.js @@ -29,6 +29,14 @@ import { export const required = isNotEmpty; export const isNotEmptyArray = composeValidators([isNotEmpty, minLength(1)]); export const url = composeValidators([isNotEmpty, regex(/^(ftp|http|https):\/\/[^ "]+$/)]); +export const jiraUrl = composeValidators([ + isNotEmpty, + regex(/https:\/\/[^?]*.atlassian.(net|com)\/.*/), +]); +export const rallyUrl = composeValidators([ + isNotEmpty, + regex(/^(https:\/\/rally1.rallydev.com\/).*/), +]); export const email = composeValidators([regex(/^[a-z0-9.+_-]+@[a-z0-9_.-]+?\.[a-z0-9]{2,}$/i)]); export const requiredEmail = composeValidators([isNotEmpty, email]); export const login = composeValidators([isNotEmpty, regex(/^[0-9a-zA-Z-_.]{1,128}$/)]); diff --git a/app/src/components/integrations/integrationProviders/jiraIntegration/jiraConnectionFormFields/jiraConnectionFormFields.jsx b/app/src/components/integrations/integrationProviders/jiraIntegration/jiraConnectionFormFields/jiraConnectionFormFields.jsx index aeea89b533..51cc35695f 100644 --- a/app/src/components/integrations/integrationProviders/jiraIntegration/jiraConnectionFormFields/jiraConnectionFormFields.jsx +++ b/app/src/components/integrations/integrationProviders/jiraIntegration/jiraConnectionFormFields/jiraConnectionFormFields.jsx @@ -90,7 +90,7 @@ export class JiraConnectionFormFields extends Component {