You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.1 KiB

4 years ago
4 years ago
  1. <template>
  2. <div>
  3. <v-btn
  4. :disabled="!isLabelSelected"
  5. class="text-capitalize"
  6. outlined
  7. @click="dialog=true"
  8. >
  9. Delete
  10. </v-btn>
  11. <v-dialog
  12. v-model="dialog"
  13. width="800"
  14. >
  15. <confirm-form
  16. :items="selected"
  17. title="Delete Label"
  18. message="Are you sure you want to delete these labels from this project?"
  19. item-key="text"
  20. @ok="deleteLabel($route.params.id);dialog=false"
  21. @cancel="dialog=false"
  22. />
  23. </v-dialog>
  24. </div>
  25. </template>
  26. <script>
  27. import { mapState, mapGetters, mapActions } from 'vuex'
  28. import ConfirmForm from '@/components/organisms/utils/ConfirmForm'
  29. export default {
  30. components: {
  31. ConfirmForm
  32. },
  33. data() {
  34. return {
  35. dialog: false
  36. }
  37. },
  38. computed: {
  39. ...mapState('labels', ['selected']),
  40. ...mapGetters('labels', ['isLabelSelected'])
  41. },
  42. methods: {
  43. ...mapActions('labels', ['deleteLabel']),
  44. handleDeleteLabel() {
  45. const projectId = this.$route.params.id
  46. this.deleteLabel(projectId)
  47. }
  48. }
  49. }
  50. </script>