diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-15 12:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-15 12:09:03 +0300 |
commit | 73ff43129b98d433923d144fccd2e47c33c3b091 (patch) | |
tree | 8dc7ffe90e38bb0699c3ff48f1d89b1b354e8ef3 /app/assets/javascripts/members | |
parent | 17e561ffb82d134ccdee8dfb505d9cba7c311a4c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/members')
3 files changed, 30 insertions, 4 deletions
diff --git a/app/assets/javascripts/members/components/action_buttons/remove_member_button.vue b/app/assets/javascripts/members/components/action_buttons/remove_member_button.vue index fc5fcdc52c5..a477aedd233 100644 --- a/app/assets/javascripts/members/components/action_buttons/remove_member_button.vue +++ b/app/assets/javascripts/members/components/action_buttons/remove_member_button.vue @@ -42,6 +42,11 @@ export default { required: false, default: false, }, + oncallSchedules: { + type: Object, + required: false, + default: () => {}, + }, }, computed: { ...mapState({ @@ -52,6 +57,9 @@ export default { computedMemberPath() { return this.memberPath.replace(':id', this.memberId); }, + stringifiedSchedules() { + return JSON.stringify(this.oncallSchedules); + }, }, }; </script> @@ -69,6 +77,7 @@ export default { :data-is-access-request="isAccessRequest" :data-is-invite="isInvite" :data-message="message" + :data-oncall-schedules="stringifiedSchedules" data-qa-selector="delete_member_button" /> </template> diff --git a/app/assets/javascripts/members/components/action_buttons/user_action_buttons.vue b/app/assets/javascripts/members/components/action_buttons/user_action_buttons.vue index e723685d88b..1e9f79927ea 100644 --- a/app/assets/javascripts/members/components/action_buttons/user_action_buttons.vue +++ b/app/assets/javascripts/members/components/action_buttons/user_action_buttons.vue @@ -33,7 +33,7 @@ export default { if (user) { return sprintf( - s__('Members|Are you sure you want to remove %{usersName} from "%{source}"'), + s__('Members|Are you sure you want to remove %{usersName} from "%{source}"?'), { usersName: user.name, source: source.fullName, @@ -42,12 +42,16 @@ export default { } return sprintf( - s__('Members|Are you sure you want to remove this orphaned member from "%{source}"'), + s__('Members|Are you sure you want to remove this orphaned member from "%{source}"?'), { source: source.fullName, }, ); }, + oncallScheduleUserData() { + const { user: { name, oncallSchedules: schedules } = {} } = this.member; + return { name, schedules }; + }, }, }; </script> @@ -60,6 +64,7 @@ export default { v-else :member-id="member.id" :member-type="member.type" + :oncall-schedules="oncallScheduleUserData" :message="message" :title="s__('Member|Remove member')" /> diff --git a/app/assets/javascripts/members/components/modals/leave_modal.vue b/app/assets/javascripts/members/components/modals/leave_modal.vue index b4cbef13b75..44178981136 100644 --- a/app/assets/javascripts/members/components/modals/leave_modal.vue +++ b/app/assets/javascripts/members/components/modals/leave_modal.vue @@ -3,6 +3,7 @@ import { GlModal, GlForm, GlSprintf, GlTooltipDirective } from '@gitlab/ui'; import { mapState } from 'vuex'; import csrf from '~/lib/utils/csrf'; import { __, s__, sprintf } from '~/locale'; +import OncallSchedulesList from '~/vue_shared/components/oncall_schedules_list.vue'; import { LEAVE_MODAL_ID } from '../../constants'; export default { @@ -19,7 +20,7 @@ export default { csrf, modalId: LEAVE_MODAL_ID, modalContent: s__('Members|Are you sure you want to leave "%{source}"?'), - components: { GlModal, GlForm, GlSprintf }, + components: { GlModal, GlForm, GlSprintf, OncallSchedulesList }, directives: { GlTooltip: GlTooltipDirective, }, @@ -42,6 +43,12 @@ export default { modalTitle() { return sprintf(s__('Members|Leave "%{source}"'), { source: this.member.source.fullName }); }, + schedules() { + return this.member.user?.oncallSchedules; + }, + isPartOfOnCallSchedules() { + return this.schedules?.length; + }, }, methods: { handlePrimary() { @@ -58,7 +65,6 @@ export default { :title="modalTitle" :action-primary="$options.actionPrimary" :action-cancel="$options.actionCancel" - size="sm" @primary="handlePrimary" > <gl-form ref="form" :action="leavePath" method="post"> @@ -68,6 +74,12 @@ export default { </gl-sprintf> </p> + <oncall-schedules-list + v-if="isPartOfOnCallSchedules" + :schedules="schedules" + :is-current-user="true" + /> + <input type="hidden" name="_method" value="delete" /> <input :value="$options.csrf.token" type="hidden" name="authenticity_token" /> </gl-form> |