diff --git a/app/assets/javascripts/groups/components/transfer_group_form.vue b/app/assets/javascripts/groups/components/transfer_group_form.vue
index 9f968817a3a8edfb2fc0185190741ed26cf8c9b9..f4f92b924c0856e433a6585eedeafbfac3e21cfb 100644
--- a/app/assets/javascripts/groups/components/transfer_group_form.vue
+++ b/app/assets/javascripts/groups/components/transfer_group_form.vue
@@ -6,8 +6,9 @@ import { getGroupTransferLocations } from '~/api/groups_api';
export const i18n = {
confirmationMessage: __(
- 'You are going to transfer %{group_name} to another namespace. Are you ABSOLUTELY sure?',
+ "You are about to transfer %{codeStart}%{groupName}%{codeEnd} to another namespace. This action changes the %{projectLinkStart}project's path%{projectLinkEnd} and can lead to %{documentationLinkStart}data loss%{documentationLinkEnd}.",
),
+ confirmButtonText: __('Transfer group'),
emptyNamespaceTitle: __('No parent group'),
dropdownLabel: s__('GroupSettings|Select parent group'),
};
diff --git a/app/assets/javascripts/groups/init_transfer_group_form.js b/app/assets/javascripts/groups/init_transfer_group_form.js
index 6eab284c066eee1aeea54ab4174ff6e7f4aaf1f2..f64de7d60e4a0b74594405a9bd9d82cc360ffc14 100644
--- a/app/assets/javascripts/groups/init_transfer_group_form.js
+++ b/app/assets/javascripts/groups/init_transfer_group_form.js
@@ -3,6 +3,7 @@ import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { sprintf } from '~/locale';
import { parseBoolean } from '~/lib/utils/common_utils';
+import { helpPagePath } from '~/helpers/help_page_helper';
import TransferGroupForm, { i18n } from './components/transfer_group_form.vue';
export default () => {
@@ -16,7 +17,7 @@ export default () => {
const {
targetFormId = null,
buttonText: confirmButtonText = '',
- groupName = '',
+ warningMessage = '',
groupFullPath,
groupId: resourceId,
isPaidGroup,
@@ -28,7 +29,26 @@ export default () => {
defaultClient: createDefaultClient(),
}),
provide: {
- confirmDangerMessage: sprintf(i18n.confirmationMessage, { group_name: groupName }),
+ confirmDangerMessage: sprintf(
+ i18n.confirmationMessage,
+ {
+ groupName: groupFullPath,
+ codeStart: '',
+ codeEnd: '',
+ projectLinkStart: ``,
+ projectLinkEnd: '',
+ documentationLinkStart: ``,
+ documentationLinkEnd: '',
+ },
+ false,
+ ),
+ htmlConfirmationMessage: true,
+ additionalInformation: warningMessage,
+ confirmButtonText: i18n.confirmButtonText,
resourceId,
},
render(createElement) {
diff --git a/app/assets/javascripts/projects/settings/init_transfer_project_form.js b/app/assets/javascripts/projects/settings/init_transfer_project_form.js
index 7f810e647ae196dfe4ed9c56e9548d6deb21be6a..5d51e72755ffc63bc965cac32d6cd70e04e358d0 100644
--- a/app/assets/javascripts/projects/settings/init_transfer_project_form.js
+++ b/app/assets/javascripts/projects/settings/init_transfer_project_form.js
@@ -18,6 +18,7 @@ export default () => {
buttonText: confirmButtonText = '',
phrase: confirmationPhrase = '',
confirmDangerMessage = '',
+ additionalInformation = '',
} = el.dataset;
return new Vue({
@@ -27,7 +28,9 @@ export default () => {
}),
provide: {
confirmDangerMessage,
+ additionalInformation,
resourceId,
+ htmlConfirmationMessage: true,
},
render(createElement) {
return createElement(TransferProjectForm, {
diff --git a/app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger_modal.vue b/app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger_modal.vue
index 2a72dfc1d4b6e5e81459ff0bd6210d730e4218e1..072205075fb1537e422eb3f5877cfc51387703f1 100644
--- a/app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger_modal.vue
+++ b/app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger_modal.vue
@@ -101,6 +101,9 @@ export default {
equalString(a, b) {
return a.trim().toLowerCase() === b.trim().toLowerCase();
},
+ focusConfirmInput() {
+ this.$refs.confirmInput.$el.focus();
+ },
},
i18n: {
CONFIRM_DANGER_MODAL_BUTTON,
@@ -122,6 +125,7 @@ export default {
size="sm"
@primary="$emit('confirm', $event)"
@change="$emit('change', $event)"
+ @shown="focusConfirmInput()"
>
-
{{ additionalInformation }}
-
+
+ {{ additionalInformation }}
+
+
{{ phrase }}
-
+
', code_end: '', link_to_namespace_change_doc: link_to_namespace_change_doc, link_to_data_loss_doc: link_to_data_loss_doc }
+ end
+
+ def transfer_project_confirm_button
+ _("Transfer project")
end
def remove_fork_project_description_message(project)
diff --git a/app/views/projects/_transfer.html.haml b/app/views/projects/_transfer.html.haml
index d8b1931756e02b7736f87a6c2969ea522b4785a0..05abc89403e704fe07983c1949141a0c2e6667db 100644
--- a/app/views/projects/_transfer.html.haml
+++ b/app/views/projects/_transfer.html.haml
@@ -1,7 +1,7 @@
- return unless can?(current_user, :change_namespace, @project)
- form_id = "transfer-project-form"
- hidden_input_id = "new_namespace_id"
-- initial_data = { button_text: s_('ProjectSettings|Transfer project'), confirm_danger_message: transfer_project_message(@project), phrase: @project.name, target_form_id: form_id, target_hidden_input_id: hidden_input_id, project_id: @project.id }
+- initial_data = { button_text: s_('ProjectSettings|Transfer project'), confirm_danger_message: transfer_project_message(@project), confirm_button_text: transfer_project_confirm_button, phrase: @project.name, target_form_id: form_id, target_hidden_input_id: hidden_input_id, project_id: @project.id }
= render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card', data: { testid: 'transfer-project-content' } }, header_options: { class: 'gl-new-card-header gl-flex-direction-column' }, body_options: { class: 'gl-new-card-body gl-px-5 gl-py-4' }) do |c|
- c.with_header do
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index e849ea945cb9ab8f3d9c52801bb5943f8c174d1a..b3df8da974f7d3270090c69275b4984284a45e55 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -13507,9 +13507,6 @@ msgstr ""
msgid "Confirmation email sent to %{email}"
msgstr ""
-msgid "Confirmation required"
-msgstr ""
-
msgid "Confirmed at:"
msgstr ""
@@ -37822,9 +37819,6 @@ msgstr ""
msgid "Please try and refresh the page. If the problem persists please contact support."
msgstr ""
-msgid "Please type %{phrase_code} to proceed."
-msgstr ""
-
msgid "Please use this form to report to the administrator users who create spam issues, comments or behave inappropriately."
msgstr ""
@@ -52834,6 +52828,9 @@ msgstr ""
msgid "To personalize your GitLab experience, we'd like to know a bit more about you. We won't share this information with anyone."
msgstr ""
+msgid "To proceed with the transfer, type %{phrase_code}:"
+msgstr ""
+
msgid "To protect this issue's confidentiality, %{linkStart}fork this project%{linkEnd} and set the fork's visibility to private."
msgstr ""
@@ -53409,6 +53406,9 @@ msgstr ""
msgid "Transfer"
msgstr ""
+msgid "Transfer group"
+msgstr ""
+
msgid "Transfer group to another parent group."
msgstr ""
@@ -57979,6 +57979,12 @@ msgstr ""
msgid "You are about to remove the group %{group_name}."
msgstr ""
+msgid "You are about to transfer %{codeStart}%{groupName}%{codeEnd} to another namespace. This action changes the %{projectLinkStart}project's path%{projectLinkEnd} and can lead to %{documentationLinkStart}data loss%{documentationLinkEnd}."
+msgstr ""
+
+msgid "You are about to transfer %{code_start}%{project_full_name}%{code_end} to another namespace. This action changes the %{link_to_namespace_change_doc} and can lead to %{link_to_data_loss_doc}."
+msgstr ""
+
msgid "You are already a member of this %{member_source}."
msgstr ""
@@ -58009,12 +58015,6 @@ msgstr ""
msgid "You are going to remove the fork relationship from %{project_full_name}. Are you ABSOLUTELY sure?"
msgstr ""
-msgid "You are going to transfer %{group_name} to another namespace. Are you ABSOLUTELY sure?"
-msgstr ""
-
-msgid "You are going to transfer %{project_full_name} to another namespace. Are you ABSOLUTELY sure?"
-msgstr ""
-
msgid "You are going to turn off the confidentiality. This means %{strongStart}everyone%{strongEnd} will be able to see%{commentText} this %{issuableType}."
msgstr ""
@@ -59795,6 +59795,9 @@ msgstr ""
msgid "data"
msgstr ""
+msgid "data loss"
+msgstr ""
+
msgid "database"
msgstr ""
@@ -60961,6 +60964,9 @@ msgstr ""
msgid "project namespace cannot be the parent of another namespace"
msgstr ""
+msgid "project's path"
+msgstr ""
+
msgid "projects"
msgstr ""
diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb
index a7710ea04ab3b5e177263c0a49b34d89e68ac3f0..fd69ea7a260a93daa782ed15a9becff21219b47d 100644
--- a/spec/features/groups/group_settings_spec.rb
+++ b/spec/features/groups/group_settings_spec.rb
@@ -164,10 +164,10 @@
click_button s_('GroupSettings|Transfer group')
page.within(confirm_modal) do
- expect(page).to have_text "You are going to transfer #{selected_group.name} to another namespace. Are you ABSOLUTELY sure?"
+ expect(page).to have_text "You are about to transfer #{selected_group.full_path} to another namespace. This action changes the project's path and can lead to data loss."
fill_in 'confirm_name_input', with: selected_group.full_path
- click_button 'Confirm'
+ click_button 'Transfer group'
end
within_testid('breadcrumb-links') do
diff --git a/spec/frontend/vue_shared/components/confirm_danger/confirm_danger_modal_spec.js b/spec/frontend/vue_shared/components/confirm_danger/confirm_danger_modal_spec.js
index cc22b1992d7a04227c84affbbd995882fdaaf084..63621b1b1bbea8c23ed7b2e0ec08f6675700baab 100644
--- a/spec/frontend/vue_shared/components/confirm_danger/confirm_danger_modal_spec.js
+++ b/spec/frontend/vue_shared/components/confirm_danger/confirm_danger_modal_spec.js
@@ -1,7 +1,6 @@
import { GlModal, GlSprintf } from '@gitlab/ui';
import { nextTick } from 'vue';
import {
- CONFIRM_DANGER_WARNING,
CONFIRM_DANGER_MODAL_BUTTON,
CONFIRM_DANGER_MODAL_ID,
CONFIRM_DANGER_MODAL_CANCEL,
@@ -21,7 +20,6 @@ describe('Confirm Danger Modal', () => {
const findModal = () => wrapper.findComponent(GlModal);
const findConfirmationPhrase = () => wrapper.findByTestId('confirm-danger-phrase');
const findConfirmationInput = () => wrapper.findByTestId('confirm-danger-field');
- const findDefaultWarning = () => wrapper.findByTestId('confirm-danger-warning');
const findAdditionalMessage = () => wrapper.findByTestId('confirm-danger-message');
const findPrimaryAction = () => findModal().props('actionPrimary');
const findCancelAction = () => findModal().props('actionCancel');
@@ -47,8 +45,8 @@ describe('Confirm Danger Modal', () => {
});
});
- it('renders the default warning message', () => {
- expect(findDefaultWarning().text()).toBe(CONFIRM_DANGER_WARNING);
+ it('renders the correct confirmation phrase', () => {
+ expect(findConfirmationPhrase().text()).toBe(`To proceed with the transfer, type ${phrase}:`);
});
it('renders any additional messages', () => {
@@ -63,10 +61,6 @@ describe('Confirm Danger Modal', () => {
it('renders the cancel button', () => {
expect(findCancelAction().text).toBe(cancelButtonText);
});
-
- it('renders the correct confirmation phrase', () => {
- expect(findConfirmationPhrase().text()).toBe(`Please type ${phrase} to proceed.`);
- });
});
describe('without injected data', () => {