From aeaaaaf074f64a60e1b7827f6949d0aa78831460 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 17 Jan 2022 00:14:49 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../javascripts/pages/groups/new/index.js | 7 ++- .../new_namespace/new_namespace_page.vue | 18 ++++++- app/helpers/groups_helper.rb | 10 ++++ app/models/group.rb | 4 ++ app/models/group_group_link.rb | 2 +- app/views/groups/new.html.haml | 2 +- ...equire_verification_for_group_creation.yml | 8 +++ doc/administration/audit_event_streaming.md | 2 +- doc/administration/pages/index.md | 2 +- doc/development/code_review.md | 11 ++-- doc/user/application_security/dast/index.md | 28 ++++------ .../reducing_the_repo_size_using_git.md | 3 +- lib/api/entities/group_detail.rb | 2 +- locale/gitlab.pot | 6 +++ spec/models/group_group_link_spec.rb | 26 ---------- spec/models/group_spec.rb | 51 +++++++++++++++++++ spec/requests/api/groups_spec.rb | 48 +++++++++++++++++ 17 files changed, 174 insertions(+), 56 deletions(-) create mode 100644 config/feature_flags/experiment/require_verification_for_group_creation.yml diff --git a/app/assets/javascripts/pages/groups/new/index.js b/app/assets/javascripts/pages/groups/new/index.js index 7b0418e1ad5..702b152d25a 100644 --- a/app/assets/javascripts/pages/groups/new/index.js +++ b/app/assets/javascripts/pages/groups/new/index.js @@ -15,7 +15,7 @@ initFilePickers(); new Group(); // eslint-disable-line no-new function initNewGroupCreation(el) { - const { hasErrors } = el.dataset; + const { hasErrors, verificationRequired, verificationFormUrl, subscriptionsUrl } = el.dataset; const props = { hasErrors: parseBoolean(hasErrors), @@ -23,6 +23,11 @@ function initNewGroupCreation(el) { return new Vue({ el, + provide: { + verificationRequired: parseBoolean(verificationRequired), + verificationFormUrl, + subscriptionsUrl, + }, render(h) { return h(NewGroupCreationApp, { props }); }, diff --git a/app/assets/javascripts/vue_shared/new_namespace/new_namespace_page.vue b/app/assets/javascripts/vue_shared/new_namespace/new_namespace_page.vue index 114f60c96ee..f67e590e2ce 100644 --- a/app/assets/javascripts/vue_shared/new_namespace/new_namespace_page.vue +++ b/app/assets/javascripts/vue_shared/new_namespace/new_namespace_page.vue @@ -10,10 +10,17 @@ export default { GlIcon, WelcomePage, LegacyContainer, + CreditCardVerification: () => + import('ee_component/pages/groups/new/components/credit_card_verification.vue'), }, directives: { SafeHtml, }, + inject: { + verificationRequired: { + default: false, + }, + }, props: { title: { type: String, @@ -41,6 +48,7 @@ export default { data() { return { activePanelName: null, + verificationCompleted: false, }; }, @@ -67,6 +75,10 @@ export default { { text: this.activePanel.title, href: `#${this.activePanel.name}` }, ]; }, + + shouldVerify() { + return this.verificationRequired && !this.verificationCompleted; + }, }, created() { @@ -93,12 +105,16 @@ export default { localStorage.setItem(this.persistenceKey, this.activePanelName); } }, + onVerified() { + this.verificationCompleted = true; + }, }, };