diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2018-10-09 15:43:17 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-10-10 13:10:51 +0200 |
commit | 1c042dd1f4d5efecdf509e412af10d07453a4329 (patch) | |
tree | dcc3cacef4ffb8792bafaeb599b5294f3a76ac0e /server/sonar-web/src/main | |
parent | e6bb0c9a13e5c477c5402ca476d1a8b8eb159cf3 (diff) | |
download | sonarqube-1c042dd1f4d5efecdf509e412af10d07453a4329.tar.gz sonarqube-1c042dd1f4d5efecdf509e412af10d07453a4329.zip |
SONAR-11302 Decrease ORGANIZATIONS#KEE from 300 to 255
As personal organizations are created from login, it was decided to increase the org key size to a round number (300) higher than the login size (255).
Unfortunately, MySQL doesn't support to use more than 255 characters in a unique index.
Diffstat (limited to 'server/sonar-web/src/main')
4 files changed, 9 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/apps/create/organization/OrganizationDetailsStep.tsx b/server/sonar-web/src/main/js/apps/create/organization/OrganizationDetailsStep.tsx index 7ae7f7867bb..e2b81934afc 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/OrganizationDetailsStep.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/OrganizationDetailsStep.tsx @@ -84,11 +84,11 @@ export default class OrganizationDetailsStep extends React.PureComponent<Props, errors.avatar = translate('onboarding.create_organization.avatar.error'); } - if (name.length > 300) { + if (name.length > 255) { errors.name = translate('onboarding.create_organization.display_name.error'); } - if (key.length > 300 || !/^[a-z0-9][a-z0-9-]*[a-z0-9]?$/.test(key)) { + if (key.length > 255 || !/^[a-z0-9][a-z0-9-]*[a-z0-9]?$/.test(key)) { errors.key = translate('onboarding.create_organization.organization_name.error'); } @@ -134,7 +134,7 @@ export default class OrganizationDetailsStep extends React.PureComponent<Props, required={true} touched={touched.key} value={values.key}> - {props => <input autoFocus={true} maxLength={300} {...props} />} + {props => <input autoFocus={true} maxLength={255} {...props} />} </OrganizationDetailsInput> <div className="big-spacer-top"> <ResetButtonLink onClick={this.handleAdditionalClick}> diff --git a/server/sonar-web/src/main/js/apps/create/organization/__tests__/OrganizationDetailsStep-test.tsx b/server/sonar-web/src/main/js/apps/create/organization/__tests__/OrganizationDetailsStep-test.tsx index 5eb6b9a65b4..aad43c0a619 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/__tests__/OrganizationDetailsStep-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/__tests__/OrganizationDetailsStep-test.tsx @@ -78,7 +78,7 @@ it('should validate', () => { avatar: '', description: '', name: '', - key: 'x'.repeat(301), + key: 'x'.repeat(256), url: '' }) ).rejects.toEqual({ key: 'onboarding.create_organization.organization_name.error' }); @@ -91,7 +91,7 @@ it('should validate', () => { instance.handleValidate({ avatar: '', description: '', - name: 'x'.repeat(301), + name: 'x'.repeat(256), key: 'foo', url: '' }) diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx index 28e99ee3a3e..03a0be23ef9 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx +++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx @@ -119,7 +119,7 @@ export class OrganizationEdit extends React.PureComponent<Props, State> { <input disabled={this.state.loading} id="organization-name" - maxLength={300} + maxLength={255} name="name" onChange={e => this.setState({ name: e.target.value })} required={true} diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.tsx.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.tsx.snap index 63cf648f317..71bc33ee084 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.tsx.snap @@ -40,7 +40,7 @@ exports[`smoke test 1`] = ` <input disabled={false} id="organization-name" - maxLength={300} + maxLength={255} name="name" onChange={[Function]} required={true} @@ -176,7 +176,7 @@ exports[`smoke test 2`] = ` <input disabled={false} id="organization-name" - maxLength={300} + maxLength={255} name="name" onChange={[Function]} required={true} @@ -327,7 +327,7 @@ exports[`smoke test 3`] = ` <input disabled={true} id="organization-name" - maxLength={300} + maxLength={255} name="name" onChange={[Function]} required={true} |