diff options
6 files changed, 23 insertions, 19 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 4c7f28a20a6..7ae7f7867bb 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 > 0 && (name.length < 2 || name.length > 64)) { + if (name.length > 300) { errors.name = translate('onboarding.create_organization.display_name.error'); } - if (key.length < 2 || key.length > 32 || !/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(key)) { + if (key.length > 300 || !/^[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} {...props} />} + {props => <input autoFocus={true} maxLength={300} {...props} />} </OrganizationDetailsInput> <div className="big-spacer-top"> <ResetButtonLink onClick={this.handleAdditionalClick}> @@ -224,7 +224,7 @@ export default class OrganizationDetailsStep extends React.PureComponent<Props, return organization ? ( <div className="boxed-group-actions display-flex-center"> <AlertSuccessIcon className="spacer-right" /> - <strong>{organization.key}</strong> + <strong className="text-limited">{organization.key}</strong> </div> ) : null; }; 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 056856e7c6d..5eb6b9a65b4 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 @@ -74,7 +74,13 @@ it('should validate', () => { ).resolves.toEqual({}); expect( - instance.handleValidate({ avatar: '', description: '', name: '', key: '', url: '' }) + instance.handleValidate({ + avatar: '', + description: '', + name: '', + key: 'x'.repeat(301), + url: '' + }) ).rejects.toEqual({ key: 'onboarding.create_organization.organization_name.error' }); expect( @@ -82,14 +88,10 @@ it('should validate', () => { ).rejects.toEqual({ avatar: 'onboarding.create_organization.avatar.error' }); expect( - instance.handleValidate({ avatar: '', description: '', name: 'x', key: 'foo', url: '' }) - ).rejects.toEqual({ name: 'onboarding.create_organization.display_name.error' }); - - expect( instance.handleValidate({ avatar: '', description: '', - name: 'x'.repeat(65), + name: 'x'.repeat(301), key: 'foo', url: '' }) diff --git a/server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/OrganizationDetailsStep-test.tsx.snap b/server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/OrganizationDetailsStep-test.tsx.snap index c792c9ff872..14f3109b7eb 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/OrganizationDetailsStep-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/OrganizationDetailsStep-test.tsx.snap @@ -177,7 +177,9 @@ exports[`should render result 1`] = ` <AlertSuccessIcon className="spacer-right" /> - <strong> + <strong + className="text-limited" + > org </strong> </div> 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 fa0bb5ca7f2..28e99ee3a3e 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={64} + maxLength={300} 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 054e0314163..63cf648f317 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={64} + maxLength={300} name="name" onChange={[Function]} required={true} @@ -176,7 +176,7 @@ exports[`smoke test 2`] = ` <input disabled={false} id="organization-name" - maxLength={64} + maxLength={300} name="name" onChange={[Function]} required={true} @@ -327,7 +327,7 @@ exports[`smoke test 3`] = ` <input disabled={true} id="organization-name" - maxLength={64} + maxLength={300} name="name" onChange={[Function]} required={true} diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 88d2afea145..24d6a527259 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2600,9 +2600,9 @@ organization.description=Description organization.description.description=Description of the organization. organization.edit=Edit Organization organization.key=Key -organization.key.description=Key of the organization (2 to 32 characters). All chars must be lower-case letters (a to z), digits or dash (but dash can neither be trailing nor heading). When not specified, the key is computed from the name. +organization.key.description=Key of the organization (up to 300 characters). All chars must be lower-case letters (a to z), digits or dash (but dash can neither be trailing nor heading). When not specified, the key is computed from the name. organization.name=Name -organization.name.description=Name of the organization (2 to 64 characters). +organization.name.description=Name of the organization (up to 300 characters). organization.updated=Organization details have been updated. organization.url=Url organization.url.description=Url of the homepage of the organization. @@ -2699,13 +2699,13 @@ onboarding.create_project.select_repositories=Select repositories onboarding.create_organization.page.header=Create Organization onboarding.create_organization.page.description=An organization is a space where a team or a whole company can collaborate accross many projects.{break}To analyze a private project you must subscribe your organization to a paid plan. From {price} a month. {more} onboarding.create_organization.organization_name=Organization Name -onboarding.create_organization.organization_name.description=2 to 32 characters. All chars must be lower-case letters (a to z), digits or dash (but dash can neither be trailing nor heading). The display name can be specified in the additional info. +onboarding.create_organization.organization_name.description=Up to 300 characters. All chars must be lower-case letters (a to z), digits or dash (but dash can neither be trailing nor heading). The display name can be specified in the additional info. onboarding.create_organization.organization_name.error=The provided value doesn't match the expected format. onboarding.create_organization.organization_name.taken=This name is already taken. onboarding.create_organization.add_additional_info=Add additional info onboarding.create_organization.hide_additional_info=Hide additional info onboarding.create_organization.display_name=Display Name -onboarding.create_organization.display_name.description=2 to 64 characters +onboarding.create_organization.display_name.description=Up to 300 characters onboarding.create_organization.display_name.error=The provided value doesn't match the expected format. onboarding.create_organization.avatar=Avatar onboarding.create_organization.avatar.description=Url of a small image that represents the organization (preferably 30px height). |