From bdfa53fc6b8a3a0d19eb8988f2fc7d25d86c94be Mon Sep 17 00:00:00 2001 From: Oiza Date: Mon, 28 Apr 2025 19:05:50 -0400 Subject: [PATCH 01/13] Add setting for bypassing placeholder email confirmation Adds checkbox and expiry date allowing group owners to skip placeholder user confirmation during reassignment process. Changelog: added EE: true --- app/views/groups/settings/_permissions.html.haml | 1 + .../_placeholder_confirmation_bypass.html.haml | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml diff --git a/app/views/groups/settings/_permissions.html.haml b/app/views/groups/settings/_permissions.html.haml index dfc244825a2137..f3ccb7f28828ad 100644 --- a/app/views/groups/settings/_permissions.html.haml +++ b/app/views/groups/settings/_permissions.html.haml @@ -42,6 +42,7 @@ = render_if_exists 'groups/settings/enforce_ssh_certificates', f: f, group: @group = render 'groups/settings/two_factor_auth', f: f, group: @group = render 'groups/settings/membership', f: f, group: @group + = render_if_exists 'groups/settings/placeholder_confirmation_bypass', f: f, group: @group = render_if_exists 'groups/settings/remove_dormant_members', f: f, group: @group = render_if_exists 'groups/settings/disable_invite_members', f: f, group: @group = render_if_exists 'groups/settings/extensions_marketplace', f: f, group: @group diff --git a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml new file mode 100644 index 00000000000000..5871077040ccc0 --- /dev/null +++ b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml @@ -0,0 +1,12 @@ +- return unless Feature.enabled?(:importer_user_mapping_allow_bypass_of_confirmation, @group) +- return unless @group.licensed_feature_available?(:placeholder_user_confirmation_bypass) + +%h5= s_('UserMapping|Bypass placeholders') +.form-group.gl-mb-3{ role: 'group' } + = f.fields_for :namespace_settings, @group.namespace_settings do |f| + = f.hidden_field :id if @group.namespace_settings.present? + = f.gitlab_ui_checkbox_component :allow_bypass_placeholder_confirmation, + s_('UserMapping|Allow bypassing confirmation emails to users regarding placeholder mapping'), + checkbox_options: { data: { testid: 'allow-bypass-placeholder-confirmation-checkbox' } } + = f.label :allow_bypass_placeholder_confirmation_expires_at, _('Expiration date (optional)'), class: 'label-bold' + = f.gitlab_ui_datepicker :allow_bypass_placeholder_confirmation_expires_at, class: 'gl-datepicker-input form-control gl-form-input', placeholder: 'YYYY-MM-DD', autocomplete: 'off', value: f.object.allow_bypass_placeholder_confirmation_expires_at -- GitLab From f1f0e681bc788f688ee7c5ec1e8df22dbf47d58f Mon Sep 17 00:00:00 2001 From: Oiza Date: Mon, 28 Apr 2025 19:09:00 -0400 Subject: [PATCH 02/13] Translate copy for bypass setting --- locale/gitlab.pot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 76c2424bcaa730..c215167b334abc 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -66758,6 +66758,9 @@ msgstr "" msgid "UserMapping|After you select \"Reassign\", users receive an email to accept the reassignment. Accepted reassignments cannot be undone, so check all data carefully before you continue." msgstr "" +msgid "UserMapping|Allow bypassing confirmation emails to users regarding placeholder mapping" +msgstr "" + msgid "UserMapping|Approve reassignment" msgstr "" @@ -66767,6 +66770,9 @@ msgstr "" msgid "UserMapping|Awaiting reassignment" msgstr "" +msgid "UserMapping|Bypass placeholders" +msgstr "" + msgid "UserMapping|Confirm reassignment" msgstr "" -- GitLab From bb0d82802190780752d5ed658cc58891a0bdbd2f Mon Sep 17 00:00:00 2001 From: Oiza Baiye Date: Tue, 13 May 2025 16:12:31 -0400 Subject: [PATCH 03/13] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Luke Duncalfe --- .../groups/settings/_placeholder_confirmation_bypass.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml index 5871077040ccc0..f8200d185ff29a 100644 --- a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml +++ b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml @@ -6,7 +6,7 @@ = f.fields_for :namespace_settings, @group.namespace_settings do |f| = f.hidden_field :id if @group.namespace_settings.present? = f.gitlab_ui_checkbox_component :allow_bypass_placeholder_confirmation, - s_('UserMapping|Allow bypassing confirmation emails to users regarding placeholder mapping'), + s_('UserMapping|Allow imported contributions to map to enterprise users without user confirmation'), checkbox_options: { data: { testid: 'allow-bypass-placeholder-confirmation-checkbox' } } = f.label :allow_bypass_placeholder_confirmation_expires_at, _('Expiration date (optional)'), class: 'label-bold' = f.gitlab_ui_datepicker :allow_bypass_placeholder_confirmation_expires_at, class: 'gl-datepicker-input form-control gl-form-input', placeholder: 'YYYY-MM-DD', autocomplete: 'off', value: f.object.allow_bypass_placeholder_confirmation_expires_at -- GitLab From 73dd652a7ec4fb220e524ae1881f7f27daf835f8 Mon Sep 17 00:00:00 2001 From: Oiza Baiye Date: Tue, 13 May 2025 16:12:53 -0400 Subject: [PATCH 04/13] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Luke Duncalfe --- .../groups/settings/_placeholder_confirmation_bypass.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml index f8200d185ff29a..fd2f24db8f92e9 100644 --- a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml +++ b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml @@ -1,5 +1,5 @@ - return unless Feature.enabled?(:importer_user_mapping_allow_bypass_of_confirmation, @group) -- return unless @group.licensed_feature_available?(:placeholder_user_confirmation_bypass) +- return unless @group.root? && Gitlab::SaaS.feature_available?(:enterprise_users) %h5= s_('UserMapping|Bypass placeholders') .form-group.gl-mb-3{ role: 'group' } -- GitLab From 45468a6ed1a0a08cac72e499fbfc2bee364cf259 Mon Sep 17 00:00:00 2001 From: Oiza Date: Tue, 13 May 2025 18:58:20 -0400 Subject: [PATCH 05/13] Translate updated copy --- locale/gitlab.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index c215167b334abc..50e26801b87fbb 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -66758,7 +66758,7 @@ msgstr "" msgid "UserMapping|After you select \"Reassign\", users receive an email to accept the reassignment. Accepted reassignments cannot be undone, so check all data carefully before you continue." msgstr "" -msgid "UserMapping|Allow bypassing confirmation emails to users regarding placeholder mapping" +msgid "UserMapping|Allow imported contributions to map to enterprise users without user confirmation" msgstr "" msgid "UserMapping|Approve reassignment" -- GitLab From 991a05d4d9ffed99f2e71ed54c64725d9106fef3 Mon Sep 17 00:00:00 2001 From: Oiza Date: Tue, 20 May 2025 13:29:29 -0400 Subject: [PATCH 06/13] Fix typo for feature check --- .../groups/settings/_placeholder_confirmation_bypass.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml index fd2f24db8f92e9..35367531c29a7c 100644 --- a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml +++ b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml @@ -1,5 +1,5 @@ - return unless Feature.enabled?(:importer_user_mapping_allow_bypass_of_confirmation, @group) -- return unless @group.root? && Gitlab::SaaS.feature_available?(:enterprise_users) +- return unless @group.root? && Gitlab::Saas.feature_available?(:enterprise_users) %h5= s_('UserMapping|Bypass placeholders') .form-group.gl-mb-3{ role: 'group' } -- GitLab From 2df0cf0b47978fa8450d39ca78ab07b7ff032b0c Mon Sep 17 00:00:00 2001 From: Oiza Date: Tue, 20 May 2025 17:47:17 -0400 Subject: [PATCH 07/13] Clarify the purpose of the checkbox and add link --- .../_placeholder_confirmation_bypass.html.haml | 10 +++------- locale/gitlab.pot | 8 ++++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml index 35367531c29a7c..1dfc0306438813 100644 --- a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml +++ b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml @@ -1,12 +1,8 @@ - return unless Feature.enabled?(:importer_user_mapping_allow_bypass_of_confirmation, @group) -- return unless @group.root? && Gitlab::Saas.feature_available?(:enterprise_users) -%h5= s_('UserMapping|Bypass placeholders') +%h5= s_('UserMapping|Placeholder user confirmation') .form-group.gl-mb-3{ role: 'group' } = f.fields_for :namespace_settings, @group.namespace_settings do |f| = f.hidden_field :id if @group.namespace_settings.present? - = f.gitlab_ui_checkbox_component :allow_bypass_placeholder_confirmation, - s_('UserMapping|Allow imported contributions to map to enterprise users without user confirmation'), - checkbox_options: { data: { testid: 'allow-bypass-placeholder-confirmation-checkbox' } } - = f.label :allow_bypass_placeholder_confirmation_expires_at, _('Expiration date (optional)'), class: 'label-bold' - = f.gitlab_ui_datepicker :allow_bypass_placeholder_confirmation_expires_at, class: 'gl-datepicker-input form-control gl-form-input', placeholder: 'YYYY-MM-DD', autocomplete: 'off', value: f.object.allow_bypass_placeholder_confirmation_expires_at + = f.gitlab_ui_checkbox_component :allow_enterprise_bypass_placeholder_confirmation, + "#{s_('UserMapping|Allow imported contributions to map to enterprise users without user confirmation.')} #{link_to _('Learn more'), help_page_path('user/project/import/_index.md', anchor: 'reassign-contributions-and-memberships'), target: '_blank', rel: 'noopener noreferrer'}".html_safe diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 50e26801b87fbb..abbff469a4b5ac 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -66758,7 +66758,7 @@ msgstr "" msgid "UserMapping|After you select \"Reassign\", users receive an email to accept the reassignment. Accepted reassignments cannot be undone, so check all data carefully before you continue." msgstr "" -msgid "UserMapping|Allow imported contributions to map to enterprise users without user confirmation" +msgid "UserMapping|Allow imported contributions to map to enterprise users without user confirmation." msgstr "" msgid "UserMapping|Approve reassignment" @@ -66770,9 +66770,6 @@ msgstr "" msgid "UserMapping|Awaiting reassignment" msgstr "" -msgid "UserMapping|Bypass placeholders" -msgstr "" - msgid "UserMapping|Confirm reassignment" msgstr "" @@ -66869,6 +66866,9 @@ msgstr "" msgid "UserMapping|Placeholder user" msgstr "" +msgid "UserMapping|Placeholder user confirmation" +msgstr "" + msgid "UserMapping|Placeholder user could not be reassigned." msgstr "" -- GitLab From 5ee9a443ab5ac46610d7a81828eb7b3b9e476aed Mon Sep 17 00:00:00 2001 From: Oiza Date: Wed, 28 May 2025 22:56:37 -0400 Subject: [PATCH 08/13] Add expiry date component for bypass --- .../group_settings/components/index.js | 8 +++ .../placeholder_bypass_date_picker.vue | 49 +++++++++++++++++++ .../settings/placeholder_bypass/show/index.js | 3 ++ ..._placeholder_confirmation_bypass.html.haml | 14 +++++- 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 ee/app/assets/javascripts/group_settings/components/index.js create mode 100644 ee/app/assets/javascripts/group_settings/components/placeholder_bypass_date_picker.vue create mode 100644 ee/app/assets/javascripts/pages/groups/settings/placeholder_bypass/show/index.js diff --git a/ee/app/assets/javascripts/group_settings/components/index.js b/ee/app/assets/javascripts/group_settings/components/index.js new file mode 100644 index 00000000000000..a9b81d8f746d04 --- /dev/null +++ b/ee/app/assets/javascripts/group_settings/components/index.js @@ -0,0 +1,8 @@ +import { initSimpleApp } from '~/helpers/init_simple_app_helper'; +import PlaceholderBypassDatePicker from './components/placeholder_bypass_date_picker.vue'; + +export function initPlaceholderBypassDatePicker() { + initSimpleApp('#group-bypass-expiry-datepicker', PlaceholderBypassDatePicker, { + name: 'PlaceholderBypassDatePickerRoot', + }); +} diff --git a/ee/app/assets/javascripts/group_settings/components/placeholder_bypass_date_picker.vue b/ee/app/assets/javascripts/group_settings/components/placeholder_bypass_date_picker.vue new file mode 100644 index 00000000000000..1493422493d488 --- /dev/null +++ b/ee/app/assets/javascripts/group_settings/components/placeholder_bypass_date_picker.vue @@ -0,0 +1,49 @@ + + + diff --git a/ee/app/assets/javascripts/pages/groups/settings/placeholder_bypass/show/index.js b/ee/app/assets/javascripts/pages/groups/settings/placeholder_bypass/show/index.js new file mode 100644 index 00000000000000..9d2c1d3ec62d91 --- /dev/null +++ b/ee/app/assets/javascripts/pages/groups/settings/placeholder_bypass/show/index.js @@ -0,0 +1,3 @@ +import { initPlaceholderBypassDatePicker } from 'ee/group_settings/components/placeholder_bypass_date_picker'; + +initPlaceholderBypassDatePicker(); diff --git a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml index 1dfc0306438813..081ee75e6fdb36 100644 --- a/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml +++ b/ee/app/views/groups/settings/_placeholder_confirmation_bypass.html.haml @@ -1,8 +1,20 @@ - return unless Feature.enabled?(:importer_user_mapping_allow_bypass_of_confirmation, @group) +- return unless @group.root? +- domain_verification_available = true +-# TODO: checkbox disabled when @group.domain_verification_available? is false %h5= s_('UserMapping|Placeholder user confirmation') .form-group.gl-mb-3{ role: 'group' } = f.fields_for :namespace_settings, @group.namespace_settings do |f| = f.hidden_field :id if @group.namespace_settings.present? = f.gitlab_ui_checkbox_component :allow_enterprise_bypass_placeholder_confirmation, - "#{s_('UserMapping|Allow imported contributions to map to enterprise users without user confirmation.')} #{link_to _('Learn more'), help_page_path('user/project/import/_index.md', anchor: 'reassign-contributions-and-memberships'), target: '_blank', rel: 'noopener noreferrer'}".html_safe + "#{s_('UserMapping|Allow imported contributions to map to enterprise users without user confirmation.')} #{link_to _('Learn more'), help_page_path('user/project/import/_index.md', anchor: 'reassign-contributions-and-memberships'), target: '_blank', rel: 'noopener noreferrer'}".html_safe, + checkbox_options: { disabled: !domain_verification_available } + #group-bypass-expiry-datepicker.gl-mt-3{ + data: { + view_model: { + current_expiry_date: '', + min_date: 1.day.from_now.iso8601 + }.to_json + } + } -- GitLab From dd8f575a54b6dfbc20f5f41e8f97921599719559 Mon Sep 17 00:00:00 2001 From: Oiza Date: Wed, 28 May 2025 23:13:08 -0400 Subject: [PATCH 09/13] Translate text, fix lint errors --- .../group_settings/components/index.js | 2 +- .../placeholder_bypass_date_picker.vue | 21 +++++++++---------- .../settings/placeholder_bypass/show/index.js | 2 +- locale/gitlab.pot | 3 +++ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ee/app/assets/javascripts/group_settings/components/index.js b/ee/app/assets/javascripts/group_settings/components/index.js index a9b81d8f746d04..b7cd42e0ee0128 100644 --- a/ee/app/assets/javascripts/group_settings/components/index.js +++ b/ee/app/assets/javascripts/group_settings/components/index.js @@ -1,5 +1,5 @@ import { initSimpleApp } from '~/helpers/init_simple_app_helper'; -import PlaceholderBypassDatePicker from './components/placeholder_bypass_date_picker.vue'; +import PlaceholderBypassDatePicker from './placeholder_bypass_date_picker.vue'; export function initPlaceholderBypassDatePicker() { initSimpleApp('#group-bypass-expiry-datepicker', PlaceholderBypassDatePicker, { diff --git a/ee/app/assets/javascripts/group_settings/components/placeholder_bypass_date_picker.vue b/ee/app/assets/javascripts/group_settings/components/placeholder_bypass_date_picker.vue index 1493422493d488..64d8bcda363944 100644 --- a/ee/app/assets/javascripts/group_settings/components/placeholder_bypass_date_picker.vue +++ b/ee/app/assets/javascripts/group_settings/components/placeholder_bypass_date_picker.vue @@ -1,6 +1,5 @@