diff --git a/app/assets/javascripts/projects/new_v2/components/shared_project_creation_fields.vue b/app/assets/javascripts/projects/new_v2/components/shared_project_creation_fields.vue index 83a216c12c2b225e10c43d7c5e29b9862ebcfcbc..24f29009d93c992a7a49483d8822d8ae7a8e2afa 100644 --- a/app/assets/javascripts/projects/new_v2/components/shared_project_creation_fields.vue +++ b/app/assets/javascripts/projects/new_v2/components/shared_project_creation_fields.vue @@ -112,7 +112,6 @@ export default { name: visibilityLevelString, disabled: disableMessage !== '', disabledMessage: disableMessage, - id: 1, }; }, updateProjectNameValidationStatus(status) { @@ -254,9 +253,8 @@ export default { name, disabled, disabledMessage, - id, } in visibilityLevels" - :id="id" + :id="name" :key="value" :value="value" :description="description" diff --git a/app/assets/javascripts/visibility_level/constants.js b/app/assets/javascripts/visibility_level/constants.js index d0b2f874790e90145a647fb062352e4a775b955b..8b326f8f5485b5fbdb2203a7a0f4022ddc2a8848 100644 --- a/app/assets/javascripts/visibility_level/constants.js +++ b/app/assets/javascripts/visibility_level/constants.js @@ -59,13 +59,13 @@ export const ORGANIZATION_VISIBILITY_TYPE = { export const PROJECT_VISIBILITY_LEVEL_DESCRIPTIONS = { [VISIBILITY_LEVEL_PUBLIC_STRING]: s__( - 'VisibilityLevel|Project access must be granted explicitly to each user. If this project is part of a group, access is granted to members of the group.', + 'VisibilityLevel|The project can be accessed without any authentication.', ), [VISIBILITY_LEVEL_INTERNAL_STRING]: s__( 'VisibilityLevel|The project can be accessed by any logged in user except external users.', ), [VISIBILITY_LEVEL_PRIVATE_STRING]: s__( - 'VisibilityLevel|The project can be accessed without any authentication.', + 'VisibilityLevel|Project access must be granted explicitly to each user. If this project is part of a group, access is granted to members of the group.', ), }; diff --git a/spec/frontend/projects/new_v2/components/shared_project_creation_fields_spec.js b/spec/frontend/projects/new_v2/components/shared_project_creation_fields_spec.js index 2b21c058030cc291e6c74b76562653e01f4327c5..7e7ff7360a9d539625859ffeef2a330f9a3871dc 100644 --- a/spec/frontend/projects/new_v2/components/shared_project_creation_fields_spec.js +++ b/spec/frontend/projects/new_v2/components/shared_project_creation_fields_spec.js @@ -157,8 +157,17 @@ describe('Project creation form fields component', () => { await nextTick(); expect(findPrivateVisibilityLevelOption().props('disabled')).toBe(false); + expect(findPrivateVisibilityLevelOption().props('description')).toBe( + 'Project access must be granted explicitly to each user. If this project is part of a group, access is granted to members of the group.', + ); expect(findInternalVisibilityLevelOption().props('disabled')).toBe(false); + expect(findInternalVisibilityLevelOption().props('description')).toBe( + 'The project can be accessed by any logged in user except external users.', + ); expect(findPublicVisibilityLevelOption().props('disabled')).toBe(false); + expect(findPublicVisibilityLevelOption().props('description')).toBe( + 'The project can be accessed without any authentication.', + ); }); it('renders internal visibility level as disabled when it was rescticted by admin', async () => { @@ -192,10 +201,10 @@ describe('Project creation form fields component', () => { it('renders internal visibility level as default when admin set it up', () => { createComponent({ - provide: { defaultProjectVisibility: 10 }, + provide: { defaultProjectVisibility: '10' }, }); - expect(findVisibilitySelector().props('checked')).toBe(10); + expect(findVisibilitySelector().props('checked')).toBe('10'); }); }); });