Allow editing cards on filtered views
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -113,9 +113,15 @@ export default {
|
||||
currentBoard: state => state.currentBoard,
|
||||
}),
|
||||
...mapGetters([
|
||||
'canEdit',
|
||||
'isArchived',
|
||||
]),
|
||||
canEdit() {
|
||||
if (this.currentBoard) {
|
||||
return this.$store.getters.canEdit
|
||||
}
|
||||
const board = this.$store.getters.boards.find((item) => item.id === this.card.boardId)
|
||||
return board.permissions.PERMISSION_EDIT
|
||||
},
|
||||
card() {
|
||||
return this.item ? this.item : this.$store.getters.cardById(this.id)
|
||||
},
|
||||
@@ -148,7 +154,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
openCard() {
|
||||
const boardId = this.item ? this.item.boardId : this.$route.params.id
|
||||
const boardId = this.card ? this.card.boardId : this.$route.params.id
|
||||
this.$router.push({ name: 'card', params: { id: boardId, cardId: this.card.id } }).catch(() => {})
|
||||
},
|
||||
startEditing(card) {
|
||||
|
||||
@@ -95,14 +95,19 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'canEdit',
|
||||
'isArchived',
|
||||
]),
|
||||
...mapState({
|
||||
showArchived: state => state.showArchived,
|
||||
currentBoard: state => state.currentBoard,
|
||||
}),
|
||||
|
||||
canEdit() {
|
||||
if (this.currentBoard) {
|
||||
return this.$store.getters.canEdit
|
||||
}
|
||||
const board = this.$store.getters.boards.find((item) => item.id === this.card.boardId)
|
||||
return board.permissions.PERMISSION_EDIT
|
||||
},
|
||||
isBoardAndStackChoosen() {
|
||||
if (this.selectedBoard === '' || this.selectedStack === '') {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user