@ -1,6 +1,6 @@
<template>
<confirm-dialog
:disabled="!isProjectSelected"
:disabled="!isDeletable"
:items="selected"
title="Delete Project"
message="Are you sure you want to delete these projects?"
@ -20,7 +20,7 @@ export default {
computed: {
...mapState('projects', ['selected']),
...mapGetters('projects', ['isProjectSelected'])
...mapGetters('projects', ['isDeletable'])
},
methods: {
@ -8,8 +8,9 @@ export const state = () => ({
})
export const getters = {
isProjectSelected(state) {
return state.selected.length > 0
isDeletable(state) {
const isProjectAdministrator = project => project.current_users_role.is_project_admin
return state.selected.length > 0 && state.selected.every(isProjectAdministrator)
currentProject(state) {
return state.current