summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/admin/users/components/actions/shared/shared_delete_action.vue
blob: c9f29b55dbfd5987b8a6c93c242ebf4c577ad750 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<script>
import { GlDropdownItem } from '@gitlab/ui';

export default {
  components: {
    GlDropdownItem,
  },
  props: {
    username: {
      type: String,
      required: true,
    },
    paths: {
      type: Object,
      required: true,
    },
    deletePath: {
      type: String,
      required: true,
    },
    modalType: {
      type: String,
      required: true,
    },
    userDeletionObstacles: {
      type: Array,
      required: true,
    },
  },
  computed: {
    modalAttributes() {
      return {
        'data-block-user-url': this.paths.block,
        'data-delete-user-url': this.deletePath,
        'data-gl-modal-action': this.modalType,
        'data-username': this.username,
        'data-user-deletion-obstacles': JSON.stringify(this.userDeletionObstacles),
      };
    },
  },
};
</script>

<template>
  <div class="js-delete-user-modal-button" v-bind="{ ...modalAttributes }">
    <gl-dropdown-item>
      <span class="gl-text-red-500">
        <slot></slot>
      </span>
    </gl-dropdown-item>
  </div>
</template>