diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-02 00:13:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-02 00:13:00 +0000 |
commit | ed1fc17f2c218d8d216b834fc4b38b4510675f0a (patch) | |
tree | 968e928b1a7eee09205c07e3539294a0ebf042de | |
parent | 30dcba871f8cecf0bd672b7f3d20bb797c558822 (diff) | |
download | gitlab-ce-ed1fc17f2c218d8d216b834fc4b38b4510675f0a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | .gitlab/ci/docs.gitlab-ci.yml | 4 | ||||
-rw-r--r-- | app/assets/javascripts/projects/components/shared/delete_button.vue | 11 | ||||
-rw-r--r-- | app/finders/members_finder.rb | 15 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 10 | ||||
-rw-r--r-- | app/views/projects/_remove.html.haml | 2 | ||||
-rw-r--r-- | config/feature_flags/development/linear_members_finder_ancestor_scopes.yml | 8 | ||||
-rw-r--r-- | doc/api/graphql/reference/index.md | 2 | ||||
-rw-r--r-- | doc/development/i18n/translation.md | 14 | ||||
-rw-r--r-- | doc/user/permissions.md | 11 | ||||
-rw-r--r-- | locale/gitlab.pot | 3 | ||||
-rw-r--r-- | spec/features/projects_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/members_finder_spec.rb | 8 | ||||
-rw-r--r-- | spec/frontend/projects/components/__snapshots__/project_delete_button_spec.js.snap | 4 | ||||
-rw-r--r-- | spec/frontend/projects/components/shared/__snapshots__/delete_button_spec.js.snap | 4 | ||||
-rw-r--r-- | spec/helpers/projects_helper_spec.rb | 8 |
15 files changed, 54 insertions, 52 deletions
diff --git a/.gitlab/ci/docs.gitlab-ci.yml b/.gitlab/ci/docs.gitlab-ci.yml index 43a2cd6dbcb..559d0749c96 100644 --- a/.gitlab/ci/docs.gitlab-ci.yml +++ b/.gitlab/ci/docs.gitlab-ci.yml @@ -44,7 +44,7 @@ docs-lint markdown: - .default-retry - .docs:rules:docs-lint # When updating the image version here, update it in /scripts/lint-doc.sh too. - image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-markdown:alpine-3.14-vale-2.10.4-markdownlint-0.28.1 + image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-markdown:alpine-3.14-vale-2.12.0-markdownlint-0.29.0 stage: lint needs: [] script: @@ -53,7 +53,7 @@ docs-lint markdown: docs-lint links: extends: - .docs:rules:docs-lint - image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-html:alpine-3.14-ruby-2.7.4-db71f027 + image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-html:alpine-3.14-ruby-2.7.4-0fae0f62 stage: lint needs: [] script: diff --git a/app/assets/javascripts/projects/components/shared/delete_button.vue b/app/assets/javascripts/projects/components/shared/delete_button.vue index 2e46f437ace..525ea462847 100644 --- a/app/assets/javascripts/projects/components/shared/delete_button.vue +++ b/app/assets/javascripts/projects/components/shared/delete_button.vue @@ -1,5 +1,5 @@ <script> -import { GlModal, GlModalDirective, GlFormInput, GlButton } from '@gitlab/ui'; +import { GlModal, GlModalDirective, GlFormTextarea, GlButton } from '@gitlab/ui'; import { uniqueId } from 'lodash'; import csrf from '~/lib/utils/csrf'; import { __ } from '~/locale'; @@ -7,7 +7,7 @@ import { __ } from '~/locale'; export default { components: { GlModal, - GlFormInput, + GlFormTextarea, GlButton, }, directives: { @@ -88,12 +88,7 @@ export default { <p> <code class="gl-white-space-pre-wrap">{{ confirmPhrase }}</code> </p> - <gl-form-input - id="confirm_name_input" - v-model="userInput" - name="confirm_name_input" - type="text" - /> + <gl-form-textarea id="confirm_name_input" v-model="userInput" name="confirm_name_input" /> <slot name="modal-footer"></slot> </div> </gl-modal> diff --git a/app/finders/members_finder.rb b/app/finders/members_finder.rb index 0faafa6df9c..e68a0c8fca9 100644 --- a/app/finders/members_finder.rb +++ b/app/finders/members_finder.rb @@ -70,16 +70,11 @@ class MembersFinder end def project_invited_groups - invited_groups_and_ancestors = if ::Feature.enabled?(:linear_members_finder_ancestor_scopes, current_user, default_enabled: :yaml) - project.invited_groups - .self_and_ancestors - else - Gitlab::ObjectHierarchy - .new(project.invited_groups) - .base_and_ancestors - end - - invited_groups_ids_including_ancestors = invited_groups_and_ancestors.public_or_visible_to_user(current_user).select(:id) + invited_groups_ids_including_ancestors = project + .invited_groups + .self_and_ancestors + .public_or_visible_to_user(current_user) + .select(:id) GroupMember.with_source_id(invited_groups_ids_including_ancestors).non_minimal_access end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index ef4bdfb46cf..bee25e2a569 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -382,6 +382,16 @@ module ProjectsHelper "" end + # Returns the confirm phrase the user needs to type in order to delete the project + # + # Occasionally a user will delete one project, believing it is a different (similar) one. + # Specifically, a user might delete an original project, believing it is a fork. + # Thus the phrase should be the project full name to include the namespace. + # Relevant issue: https://gitlab.com/gitlab-org/gitlab/-/issues/343591 + def delete_confirm_phrase(project) + s_('DeleteProject|Delete %{name}') % { name: project.full_name } + end + private def tab_ability_map diff --git a/app/views/projects/_remove.html.haml b/app/views/projects/_remove.html.haml index cb0ec9f19c8..ef4a90a5c08 100644 --- a/app/views/projects/_remove.html.haml +++ b/app/views/projects/_remove.html.haml @@ -7,4 +7,4 @@ = link_to _('Learn more.'), help_page_path('user/project/settings/index', anchor: 'removing-a-fork-relationship'), target: '_blank', rel: 'noopener noreferrer' %p %strong= _('Deleted projects cannot be restored!') - #js-project-delete-button{ data: { form_path: project_path(project), confirm_phrase: project.path } } + #js-project-delete-button{ data: { form_path: project_path(project), confirm_phrase: delete_confirm_phrase(project) } } diff --git a/config/feature_flags/development/linear_members_finder_ancestor_scopes.yml b/config/feature_flags/development/linear_members_finder_ancestor_scopes.yml deleted file mode 100644 index 6bd5e164324..00000000000 --- a/config/feature_flags/development/linear_members_finder_ancestor_scopes.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: linear_members_finder_ancestor_scopes -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70583 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/341347 -milestone: '14.4' -type: development -group: group::access -default_enabled: false diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 5bf7e4c4349..b62d46b4a03 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -8933,6 +8933,7 @@ Represents the current license. | <a id="currentlicensebillableuserscount"></a>`billableUsersCount` | [`Int`](#int) | Number of billable users on the system. | | <a id="currentlicenseblockchangesat"></a>`blockChangesAt` | [`Date`](#date) | Date, including grace period, when licensed features will be blocked. | | <a id="currentlicensecompany"></a>`company` | [`String`](#string) | Company of the licensee. | +| <a id="currentlicensecreatedat"></a>`createdAt` | [`Date`](#date) | Date when the license was added. | | <a id="currentlicenseemail"></a>`email` | [`String`](#string) | Email of the licensee. | | <a id="currentlicenseexpiresat"></a>`expiresAt` | [`Date`](#date) | Date when the license expires. | | <a id="currentlicenseid"></a>`id` | [`ID!`](#id) | ID of the license. | @@ -11306,6 +11307,7 @@ Represents an entry from the Cloud License history. | <a id="licensehistoryentryactivatedat"></a>`activatedAt` | [`Date`](#date) | Date when the license was activated. | | <a id="licensehistoryentryblockchangesat"></a>`blockChangesAt` | [`Date`](#date) | Date, including grace period, when licensed features will be blocked. | | <a id="licensehistoryentrycompany"></a>`company` | [`String`](#string) | Company of the licensee. | +| <a id="licensehistoryentrycreatedat"></a>`createdAt` | [`Date`](#date) | Date when the license was added. | | <a id="licensehistoryentryemail"></a>`email` | [`String`](#string) | Email of the licensee. | | <a id="licensehistoryentryexpiresat"></a>`expiresAt` | [`Date`](#date) | Date when the license expires. | | <a id="licensehistoryentryid"></a>`id` | [`ID!`](#id) | ID of the license. | diff --git a/doc/development/i18n/translation.md b/doc/development/i18n/translation.md index 34b7f5e8763..04a9f68abec 100644 --- a/doc/development/i18n/translation.md +++ b/doc/development/i18n/translation.md @@ -48,10 +48,10 @@ Be sure to check the following guidelines before you translate any strings. ### Namespaced strings -When an externalized string is prepended with a namespace (for example, -`s_('OpenedNDaysAgo|Opened')`), the namespace should be removed from the final translation. For -example, in French, `OpenedNDaysAgo|Opened` is translated to `Ouvert•e`, not -`OpenedNDaysAgo|Ouvert•e`. +A namespace precedes the string and is separated from it by a `|` (`namespace|string`). When you see +a namespace before an externalized string, you should remove the namespace from the final +translation. For example, in `OpenedNDaysAgo|Opened`, remove `OpenedNDaysAgo|`. If translating to +French, translate `OpenedNDaysAgo|Opened` to `Ouvert•e`, not `OpenedNDaysAgo|Ouvert•e`. ### Technical terms @@ -61,6 +61,12 @@ should always be in English are noted in the glossary when using This helps maintain a logical connection and consistency between tools (for example, a Git client) and GitLab. +To find the list of technical terms: + +1. Go to [`translate.gitlab.com`](https://translate.gitlab.com). +1. Select the language to translate. +1. Select **Glossary**. + ### Formality The level of formality used in software varies by language: diff --git a/doc/user/permissions.md b/doc/user/permissions.md index a7142d6df47..60333d1ab6a 100644 --- a/doc/user/permissions.md +++ b/doc/user/permissions.md @@ -477,15 +477,14 @@ subscriptions. Project features like wiki and issues can be hidden from users depending on which visibility level you select on project settings. -- Disabled: disabled for everyone -- Only team members: only team members will see even if your project is public or internal -- Everyone with access: everyone can see depending on your project visibility level -- Everyone: enabled for everyone (only available for GitLab Pages) +- Disabled: disabled for everyone. +- Only team members: only team members can see, even if your project is public or internal. +- Everyone with access: everyone can see depending on your project visibility level. +- Everyone: enabled for everyone (only available for GitLab Pages). ## GitLab CI/CD permissions -GitLab CI/CD permissions rely on the role the user has in GitLab. There are four -roles: +GitLab CI/CD permissions rely on the role the user has in GitLab: - Administrator - Maintainer diff --git a/locale/gitlab.pot b/locale/gitlab.pot index fa08a12bd41..e445b38eb6f 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -11101,6 +11101,9 @@ msgstr "" msgid "Delete variable" msgstr "" +msgid "DeleteProject|Delete %{name}" +msgstr "" + msgid "DeleteProject|Failed to remove project repository. Please try again or contact administrator." msgstr "" diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb index 149e8db7178..707769d9f25 100644 --- a/spec/features/projects_spec.rb +++ b/spec/features/projects_spec.rb @@ -257,7 +257,7 @@ RSpec.describe 'Project' do end it 'deletes a project', :sidekiq_inline do - expect { remove_with_confirm('Delete project', project.path, 'Yes, delete project') }.to change { Project.count }.by(-1) + expect { remove_with_confirm('Delete project', "Delete #{project.full_name}", 'Yes, delete project') }.to change { Project.count }.by(-1) expect(page).to have_content "Project '#{project.full_name}' is in the process of being deleted." expect(Project.all.count).to be_zero expect(project.issues).to be_empty diff --git a/spec/finders/members_finder_spec.rb b/spec/finders/members_finder_spec.rb index 749e319f9c7..aa7d32e51ac 100644 --- a/spec/finders/members_finder_spec.rb +++ b/spec/finders/members_finder_spec.rb @@ -202,13 +202,5 @@ RSpec.describe MembersFinder, '#execute' do end it_behaves_like 'with invited_groups param' - - context 'when feature flag :linear_members_finder_ancestor_scopes is disabled' do - before do - stub_feature_flags(linear_members_finder_ancestor_scopes: false) - end - - it_behaves_like 'with invited_groups param' - end end end diff --git a/spec/frontend/projects/components/__snapshots__/project_delete_button_spec.js.snap b/spec/frontend/projects/components/__snapshots__/project_delete_button_spec.js.snap index c255fcce321..492a40458e2 100644 --- a/spec/frontend/projects/components/__snapshots__/project_delete_button_spec.js.snap +++ b/spec/frontend/projects/components/__snapshots__/project_delete_button_spec.js.snap @@ -71,10 +71,10 @@ exports[`Project remove modal initialized matches the snapshot 1`] = ` </code> </p> - <gl-form-input-stub + <gl-form-textarea-stub id="confirm_name_input" name="confirm_name_input" - type="text" + noresize="true" /> </div> diff --git a/spec/frontend/projects/components/shared/__snapshots__/delete_button_spec.js.snap b/spec/frontend/projects/components/shared/__snapshots__/delete_button_spec.js.snap index dd54db7dc0a..a34507e9199 100644 --- a/spec/frontend/projects/components/shared/__snapshots__/delete_button_spec.js.snap +++ b/spec/frontend/projects/components/shared/__snapshots__/delete_button_spec.js.snap @@ -51,10 +51,10 @@ exports[`Project remove modal intialized matches the snapshot 1`] = ` </code> </p> - <gl-form-input-stub + <gl-form-textarea-stub id="confirm_name_input" name="confirm_name_input" - type="text" + noresize="true" /> </div> diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index 5d52c9178cb..661d9ac2821 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -983,4 +983,12 @@ RSpec.describe ProjectsHelper do it { is_expected.not_to include('project-highlight-puc') } end end + + describe "#delete_confirm_phrase" do + subject { helper.delete_confirm_phrase(project) } + + it 'includes the project full name' do + expect(subject).to eq("Delete #{project.full_name}") + end + end end |