From 3e1f672d071a49148fab2dbf3a25bf8c8562e396 Mon Sep 17 00:00:00 2001
From: Doug Stull <dstull@gitlab.com>
Date: Mon, 14 Feb 2022 21:07:26 +0000
Subject: [PATCH] Remove inviteeType from invite modal triggers

- no longer needed as the option was removed.
---
 .../javascripts/groups/components/invite_members_banner.vue | 1 -
 .../invite_members/components/invite_members_trigger.vue    | 2 +-
 .../pages/projects/learn_gitlab/components/learn_gitlab.vue | 2 +-
 .../learn_gitlab/components/learn_gitlab_section_link.vue   | 6 +-----
 .../groups/components/invite_members_banner_spec.js         | 1 -
 .../invite_members/components/invite_members_modal_spec.js  | 2 +-
 .../components/invite_members_trigger_spec.js               | 1 -
 .../components/learn_gitlab_section_link_spec.js            | 6 +-----
 .../projects/learn_gitlab/components/learn_gitlab_spec.js   | 1 -
 9 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/app/assets/javascripts/groups/components/invite_members_banner.vue b/app/assets/javascripts/groups/components/invite_members_banner.vue
index dfc1549fb4a7..7afea8151979 100644
--- a/app/assets/javascripts/groups/components/invite_members_banner.vue
+++ b/app/assets/javascripts/groups/components/invite_members_banner.vue
@@ -46,7 +46,6 @@ export default {
     },
     openModal() {
       eventHub.$emit('openModal', {
-        inviteeType: 'members',
         source: this.$options.openModalSource,
       });
       this.track(this.$options.buttonClickEvent);
diff --git a/app/assets/javascripts/invite_members/components/invite_members_trigger.vue b/app/assets/javascripts/invite_members/components/invite_members_trigger.vue
index 7dd74f8803a8..79b192e24954 100644
--- a/app/assets/javascripts/invite_members/components/invite_members_trigger.vue
+++ b/app/assets/javascripts/invite_members/components/invite_members_trigger.vue
@@ -71,7 +71,7 @@ export default {
       return this.triggerElement === targetTriggerElement;
     },
     openModal() {
-      eventHub.$emit('openModal', { inviteeType: 'members', source: this.triggerSource });
+      eventHub.$emit('openModal', { source: this.triggerSource });
     },
   },
   TRIGGER_ELEMENT_BUTTON,
diff --git a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab.vue b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab.vue
index d50945e0be2a..adae97c6b6fd 100644
--- a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab.vue
+++ b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab.vue
@@ -72,7 +72,7 @@ export default {
       return value;
     },
     openInviteMembersModal(mode) {
-      eventHub.$emit('openModal', { mode, inviteeType: 'members', source: 'learn-gitlab' });
+      eventHub.$emit('openModal', { mode, source: 'learn-gitlab' });
     },
     handleShowSuccessfulInvitationsAlert() {
       this.showSuccessfulInvitationsAlert = true;
diff --git a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue
index 34a0190a5035..d0ec02bbd0cf 100644
--- a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue
+++ b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue
@@ -37,11 +37,7 @@ export default {
   },
   methods: {
     openModal() {
-      eventHub.$emit('openModal', {
-        inviteeType: 'members',
-        source: 'learn_gitlab',
-        tasksToBeDoneEnabled: true,
-      });
+      eventHub.$emit('openModal', { source: 'learn_gitlab' });
     },
   },
 };
diff --git a/spec/frontend/groups/components/invite_members_banner_spec.js b/spec/frontend/groups/components/invite_members_banner_spec.js
index ef7840182051..1924f400861b 100644
--- a/spec/frontend/groups/components/invite_members_banner_spec.js
+++ b/spec/frontend/groups/components/invite_members_banner_spec.js
@@ -76,7 +76,6 @@ describe('InviteMembersBanner', () => {
 
       it('calls openModal through the eventHub', () => {
         expect(eventHub.$emit).toHaveBeenCalledWith('openModal', {
-          inviteeType: 'members',
           source: 'invite_members_banner',
         });
       });
diff --git a/spec/frontend/invite_members/components/invite_members_modal_spec.js b/spec/frontend/invite_members/components/invite_members_modal_spec.js
index 090efc4d4c35..15a366474e41 100644
--- a/spec/frontend/invite_members/components/invite_members_modal_spec.js
+++ b/spec/frontend/invite_members/components/invite_members_modal_spec.js
@@ -694,7 +694,7 @@ describe('InviteMembersModal', () => {
       });
 
       it('tracks the view for learn_gitlab source', () => {
-        eventHub.$emit('openModal', { inviteeType: 'members', source: LEARN_GITLAB });
+        eventHub.$emit('openModal', { source: LEARN_GITLAB });
 
         expect(ExperimentTracking).toHaveBeenCalledWith(INVITE_MEMBERS_FOR_TASK.name);
         expect(ExperimentTracking.prototype.event).toHaveBeenCalledWith(LEARN_GITLAB);
diff --git a/spec/frontend/invite_members/components/invite_members_trigger_spec.js b/spec/frontend/invite_members/components/invite_members_trigger_spec.js
index 429b6fad24a6..28402c8331cf 100644
--- a/spec/frontend/invite_members/components/invite_members_trigger_spec.js
+++ b/spec/frontend/invite_members/components/invite_members_trigger_spec.js
@@ -71,7 +71,6 @@ describe.each(triggerItems)('with triggerElement as %s', (triggerItem) => {
       findButton().vm.$emit('click');
 
       expect(spy).toHaveBeenCalledWith('openModal', {
-        inviteeType: 'members',
         source: triggerSource,
       });
     });
diff --git a/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_link_spec.js b/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_link_spec.js
index 395e5d87ac1f..3b113f4dcd78 100644
--- a/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_link_spec.js
+++ b/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_link_spec.js
@@ -114,11 +114,7 @@ describe('Learn GitLab Section Link', () => {
     it('calls the eventHub', () => {
       openInviteMembesrModalLink().vm.$emit('click');
 
-      expect(eventHub.$emit).toHaveBeenCalledWith('openModal', {
-        inviteeType: 'members',
-        source: 'learn_gitlab',
-        tasksToBeDoneEnabled: true,
-      });
+      expect(eventHub.$emit).toHaveBeenCalledWith('openModal', { source: 'learn_gitlab' });
     });
 
     it('tracks the click', async () => {
diff --git a/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_spec.js b/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_spec.js
index f6e3a72b5e03..ee682b18af3a 100644
--- a/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_spec.js
+++ b/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_spec.js
@@ -80,7 +80,6 @@ describe('Learn GitLab', () => {
 
       expect(spy).toHaveBeenCalledWith('openModal', {
         mode: 'celebrate',
-        inviteeType: 'members',
         source: 'learn-gitlab',
       });
       expect(cookieSpy).toHaveBeenCalledWith(INVITE_MODAL_OPEN_COOKIE);
-- 
GitLab