diff --git a/app/models/project.rb b/app/models/project.rb index bc6d2600d832e5c559628e7b5d886e5eee3db1ae..9fb7745d432f280006c31156465c2eff5801a269 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1530,9 +1530,9 @@ def check_personal_projects_limit limit = creator.projects_limit error = if limit == 0 - _('Personal project creation is not allowed. Please contact your administrator with questions') + _('You cannot create projects in your personal namespace. Contact your GitLab administrator.') else - _('Your project limit is %{limit} projects! Please contact your administrator to increase it') + _("You've reached your limit of %{limit} projects created. Contact your GitLab administrator.") end self.errors.add(:limit_reached, error % { limit: limit }) diff --git a/app/views/dashboard/_projects_head.html.haml b/app/views/dashboard/_projects_head.html.haml index 74dc2277f5424cf2113d431f355f743c6a3f0d2c..7527f32274a78471f26114bb7296b25e25fd673d 100644 --- a/app/views/dashboard/_projects_head.html.haml +++ b/app/views/dashboard/_projects_head.html.haml @@ -1,5 +1,6 @@ -= content_for :flash_message do - = render 'shared/project_limit' +- if params[:personal] + = content_for :flash_message do + = render 'shared/project_limit' .page-title-holder.gl-display-flex.gl-align-items-center %h1.page-title.gl-font-size-h-display= _('Projects') diff --git a/app/views/projects/_errors.html.haml b/app/views/projects/_errors.html.haml index 2dba22d3be665f0b975f054135b3417aca300ede..9c478f245dc1ebbc83e7a021e0012cc4fe6b0c77 100644 --- a/app/views/projects/_errors.html.haml +++ b/app/views/projects/_errors.html.haml @@ -1 +1 @@ -= form_errors(@project) += form_errors(@project, custom_message: [:limit_reached]) diff --git a/app/views/shared/_project_limit.html.haml b/app/views/shared/_project_limit.html.haml index a99db32c40eb0c59bddc3216170a4173d9fc5fe6..914c20fb7b06c1b65ebf403985fc1065011d7897 100644 --- a/app/views/shared/_project_limit.html.haml +++ b/app/views/shared/_project_limit.html.haml @@ -3,7 +3,7 @@ dismissible: false, alert_options: { class: 'project-limit-message' }) do |c| - c.with_body do - = _("You won't be able to create new projects because you have reached your project limit.") + = _("You cannot create new projects in your personal namespace because you have reached your personal project limit.") - c.with_actions do = link_button_to _('Remind later'), '#', class: 'alert-link hide-project-limit-message', variant: :confirm = link_button_to _("Don't show again"), profile_path(user: {hide_project_limit: true}), method: :put, class: 'alert-link gl-ml-3' diff --git a/locale/gitlab.pot b/locale/gitlab.pot index a0100bad0d996d5db890ba1a006e090fccc77a21..0c1706fdf73bd1430517bedc134789a58b9a74cd 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -34605,9 +34605,6 @@ msgstr "" msgid "Personal access token" msgstr "" -msgid "Personal project creation is not allowed. Please contact your administrator with questions" -msgstr "" - msgid "Personal projects" msgstr "" @@ -55083,6 +55080,12 @@ msgstr "" msgid "You cannot combine replace_ids with add_ids or remove_ids" msgstr "" +msgid "You cannot create new projects in your personal namespace because you have reached your personal project limit." +msgstr "" + +msgid "You cannot create projects in your personal namespace. Contact your GitLab administrator." +msgstr "" + msgid "You cannot impersonate a blocked user" msgstr "" @@ -55433,9 +55436,6 @@ msgstr "" msgid "You will receive notifications only for comments in which you were @mentioned" msgstr "" -msgid "You won't be able to create new projects because you have reached your project limit." -msgstr "" - msgid "You'll be charged for %{true_up_start}users over license%{true_up_end} on a quarterly or annual basis, depending on the terms of your agreement." msgstr "" @@ -55505,6 +55505,9 @@ msgstr "" msgid "You've already enabled two-factor authentication using one time password authenticators. In order to register a different device, you must first disable two-factor authentication." msgstr "" +msgid "You've reached your limit of %{limit} projects created. Contact your GitLab administrator." +msgstr "" + msgid "You've rejected %{user}" msgstr "" @@ -55800,9 +55803,6 @@ msgstr "" msgid "Your profile" msgstr "" -msgid "Your project limit is %{limit} projects! Please contact your administrator to increase it" -msgstr "" - msgid "Your projects" msgstr "" diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 5f1054a35bbae8bb325526af6be447706413ea63..55ec199e0c9c545dc4934709da7084a4de589621 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -7120,7 +7120,7 @@ def has_external_wiki project.check_personal_projects_limit expect(project.errors[:limit_reached].first) - .to match(/Personal project creation is not allowed/) + .to eq('You cannot create projects in your personal namespace. Contact your GitLab administrator.') end end @@ -7133,7 +7133,7 @@ def has_external_wiki project.check_personal_projects_limit expect(project.errors[:limit_reached].first) - .to match(/Your project limit is 5 projects/) + .to eq("You've reached your limit of 5 projects created. Contact your GitLab administrator.") end end end diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index ce7e5188c7bde89c6335f9c8bf777d66ebad9a95..899ed4771803b2e824858373138f79c566bc326f 100644 --- a/spec/services/projects/create_service_spec.rb +++ b/spec/services/projects/create_service_spec.rb @@ -320,7 +320,7 @@ it 'cannot create a project' do expect(project.errors.errors.length).to eq 1 - expect(project.errors.messages[:limit_reached].first).to eq(_('Personal project creation is not allowed. Please contact your administrator with questions')) + expect(project.errors.messages[:limit_reached].first).to eq(_('You cannot create projects in your personal namespace. Contact your GitLab administrator.')) end end