Commit ed615bb9 authored by peterhegman's avatar peterhegman

Update revoke invite modal title and remove unneeded checkbox

Change title to "Revoke invite" and remove "issuables checkbox"
parent 0425ff3d
...@@ -42,6 +42,7 @@ export default { ...@@ -42,6 +42,7 @@ export default {
:member-id="member.id" :member-id="member.id"
:message="message" :message="message"
:title="s__('Member|Revoke invite')" :title="s__('Member|Revoke invite')"
is-invite
/> />
</div> </div>
</action-button-group> </action-button-group>
......
...@@ -36,6 +36,11 @@ export default { ...@@ -36,6 +36,11 @@ export default {
required: false, required: false,
default: false, default: false,
}, },
isInvite: {
type: Boolean,
required: false,
default: false,
},
}, },
computed: { computed: {
...mapState(['memberPath']), ...mapState(['memberPath']),
...@@ -57,6 +62,7 @@ export default { ...@@ -57,6 +62,7 @@ export default {
:data-member-path="computedMemberPath" :data-member-path="computedMemberPath"
:data-member-type="memberType" :data-member-type="memberType"
:data-is-access-request="isAccessRequest" :data-is-access-request="isAccessRequest"
:data-is-invite="isInvite"
:data-message="message" :data-message="message"
data-qa-selector="delete_member_button" data-qa-selector="delete_member_button"
/> />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { GlFormCheckbox, GlModal } from '@gitlab/ui'; import { GlFormCheckbox, GlModal } from '@gitlab/ui';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import csrf from '~/lib/utils/csrf'; import csrf from '~/lib/utils/csrf';
import { __ } from '~/locale'; import { s__, __ } from '~/locale';
export default { export default {
actionCancel: { actionCancel: {
...@@ -22,11 +22,20 @@ export default { ...@@ -22,11 +22,20 @@ export default {
isAccessRequest() { isAccessRequest() {
return parseBoolean(this.modalData.isAccessRequest); return parseBoolean(this.modalData.isAccessRequest);
}, },
isInvite() {
return parseBoolean(this.modalData.isInvite);
},
isGroupMember() { isGroupMember() {
return this.modalData.memberType === 'GroupMember'; return this.modalData.memberType === 'GroupMember';
}, },
actionText() { actionText() {
return this.isAccessRequest ? __('Deny access request') : __('Remove member'); if (this.isAccessRequest) {
return __('Deny access request');
} else if (this.isInvite) {
return s__('Member|Revoke invite');
}
return __('Remove member');
}, },
actionPrimary() { actionPrimary() {
return { return {
...@@ -36,6 +45,9 @@ export default { ...@@ -36,6 +45,9 @@ export default {
}, },
}; };
}, },
showUnassignIssuablesCheckbox() {
return !this.isAccessRequest && !this.isInvite;
},
}, },
mounted() { mounted() {
document.addEventListener('click', this.handleClick); document.addEventListener('click', this.handleClick);
...@@ -76,7 +88,7 @@ export default { ...@@ -76,7 +88,7 @@ export default {
<gl-form-checkbox v-if="isGroupMember" name="remove_sub_memberships"> <gl-form-checkbox v-if="isGroupMember" name="remove_sub_memberships">
{{ __('Also remove direct user membership from subgroups and projects') }} {{ __('Also remove direct user membership from subgroups and projects') }}
</gl-form-checkbox> </gl-form-checkbox>
<gl-form-checkbox v-if="!isAccessRequest" name="unassign_issuables"> <gl-form-checkbox v-if="showUnassignIssuablesCheckbox" name="unassign_issuables">
{{ __('Also unassign this user from related issues and merge requests') }} {{ __('Also unassign this user from related issues and merge requests') }}
</gl-form-checkbox> </gl-form-checkbox>
</form> </form>
......
---
title: Update title on revoke member invite modal and hide unneeded related issues and merge requests checkbox
merge_request: 57755
author:
type: changed
...@@ -42,6 +42,7 @@ describe('AccessRequestActionButtons', () => { ...@@ -42,6 +42,7 @@ describe('AccessRequestActionButtons', () => {
memberId: member.id, memberId: member.id,
title: 'Deny access', title: 'Deny access',
isAccessRequest: true, isAccessRequest: true,
isInvite: false,
icon: 'close', icon: 'close',
}); });
}); });
......
...@@ -43,6 +43,7 @@ describe('InviteActionButtons', () => { ...@@ -43,6 +43,7 @@ describe('InviteActionButtons', () => {
message: `Are you sure you want to revoke the invitation for ${member.invite.email} to join "${member.source.fullName}"`, message: `Are you sure you want to revoke the invitation for ${member.invite.email} to join "${member.source.fullName}"`,
title: 'Revoke invite', title: 'Revoke invite',
isAccessRequest: false, isAccessRequest: false,
isInvite: true,
icon: 'remove', icon: 'remove',
}); });
}); });
......
...@@ -28,6 +28,7 @@ describe('RemoveMemberButton', () => { ...@@ -28,6 +28,7 @@ describe('RemoveMemberButton', () => {
message: 'Are you sure you want to remove John Smith?', message: 'Are you sure you want to remove John Smith?',
title: 'Remove member', title: 'Remove member',
isAccessRequest: true, isAccessRequest: true,
isInvite: true,
...propsData, ...propsData,
}, },
directives: { directives: {
...@@ -48,6 +49,7 @@ describe('RemoveMemberButton', () => { ...@@ -48,6 +49,7 @@ describe('RemoveMemberButton', () => {
'data-member-type': 'GroupMember', 'data-member-type': 'GroupMember',
'data-message': 'Are you sure you want to remove John Smith?', 'data-message': 'Are you sure you want to remove John Smith?',
'data-is-access-request': 'true', 'data-is-access-request': 'true',
'data-is-invite': 'true',
'aria-label': 'Remove member', 'aria-label': 'Remove member',
title: 'Remove member', title: 'Remove member',
icon: 'remove', icon: 'remove',
......
...@@ -43,6 +43,7 @@ describe('UserActionButtons', () => { ...@@ -43,6 +43,7 @@ describe('UserActionButtons', () => {
message: `Are you sure you want to remove ${member.user.name} from "${member.source.fullName}"`, message: `Are you sure you want to remove ${member.user.name} from "${member.source.fullName}"`,
title: 'Remove member', title: 'Remove member',
isAccessRequest: false, isAccessRequest: false,
isInvite: false,
icon: 'remove', icon: 'remove',
}); });
}); });
......
...@@ -15,16 +15,18 @@ describe('RemoveMemberModal', () => { ...@@ -15,16 +15,18 @@ describe('RemoveMemberModal', () => {
}); });
describe.each` describe.each`
state | memberType | isAccessRequest | actionText | removeSubMembershipsCheckboxExpected | unassignIssuablesCheckboxExpected | message state | memberType | isAccessRequest | isInvite | actionText | removeSubMembershipsCheckboxExpected | unassignIssuablesCheckboxExpected | message
${'removing a group member'} | ${'GroupMember'} | ${'false'} | ${'Remove member'} | ${true} | ${true} | ${'Are you sure you want to remove Jane Doe from the Gitlab Org / Gitlab Test project?'} ${'removing a group member'} | ${'GroupMember'} | ${'false'} | ${'false'} | ${'Remove member'} | ${true} | ${true} | ${'Are you sure you want to remove Jane Doe from the Gitlab Org / Gitlab Test project?'}
${'removing a project member'} | ${'ProjectMember'} | ${'false'} | ${'Remove member'} | ${false} | ${true} | ${'Are you sure you want to remove Jane Doe from the Gitlab Org / Gitlab Test project?'} ${'removing a project member'} | ${'ProjectMember'} | ${'false'} | ${'false'} | ${'Remove member'} | ${false} | ${true} | ${'Are you sure you want to remove Jane Doe from the Gitlab Org / Gitlab Test project?'}
${'denying an access request'} | ${'ProjectMember'} | ${'true'} | ${'Deny access request'} | ${false} | ${false} | ${"Are you sure you want to deny Jane Doe's request to join the Gitlab Org / Gitlab Test project?"} ${'denying an access request'} | ${'ProjectMember'} | ${'true'} | ${'false'} | ${'Deny access request'} | ${false} | ${false} | ${"Are you sure you want to deny Jane Doe's request to join the Gitlab Org / Gitlab Test project?"}
${'revoking invite'} | ${'ProjectMember'} | ${'false'} | ${'true'} | ${'Revoke invite'} | ${false} | ${false} | ${'Are you sure you want to revoke the invitation for foo@bar.com to join the Gitlab Org / Gitlab Test project?'}
`( `(
'when $state', 'when $state',
({ ({
actionText, actionText,
memberType, memberType,
isAccessRequest, isAccessRequest,
isInvite,
message, message,
removeSubMembershipsCheckboxExpected, removeSubMembershipsCheckboxExpected,
unassignIssuablesCheckboxExpected, unassignIssuablesCheckboxExpected,
...@@ -35,6 +37,7 @@ describe('RemoveMemberModal', () => { ...@@ -35,6 +37,7 @@ describe('RemoveMemberModal', () => {
return { return {
modalData: { modalData: {
isAccessRequest, isAccessRequest,
isInvite,
message, message,
memberPath, memberPath,
memberType, memberType,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment