Merge pull request #5029 from nextcloud/feature/update-card-create-dialog
This commit is contained in:
@@ -128,6 +128,7 @@ import Description from '../components/card/Description.vue'
|
|||||||
import CardPlusOutline from 'vue-material-design-icons/CardPlusOutline.vue'
|
import CardPlusOutline from 'vue-material-design-icons/CardPlusOutline.vue'
|
||||||
import FormatColumnsIcon from 'vue-material-design-icons/FormatColumns.vue'
|
import FormatColumnsIcon from 'vue-material-design-icons/FormatColumns.vue'
|
||||||
import DeckIcon from '../components/icons/DeckIcon.vue'
|
import DeckIcon from '../components/icons/DeckIcon.vue'
|
||||||
|
import { showError } from '../helpers/errors.js'
|
||||||
|
|
||||||
const cardApi = new CardApi()
|
const cardApi = new CardApi()
|
||||||
const apiClient = new BoardApi()
|
const apiClient = new BoardApi()
|
||||||
@@ -216,7 +217,7 @@ export default {
|
|||||||
fetchBoards() {
|
fetchBoards() {
|
||||||
axios.get(generateUrl('/apps/deck/boards')).then((response) => {
|
axios.get(generateUrl('/apps/deck/boards')).then((response) => {
|
||||||
this.boards = response.data.filter((board) => {
|
this.boards = response.data.filter((board) => {
|
||||||
return board?.permissions?.PERMISSION_EDIT
|
return board?.permissions?.PERMISSION_EDIT && !board?.archived && !board?.deletedAt
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
@@ -239,6 +240,8 @@ export default {
|
|||||||
},
|
},
|
||||||
async createCard() {
|
async createCard() {
|
||||||
this.creating = true
|
this.creating = true
|
||||||
|
|
||||||
|
try {
|
||||||
const response = await cardApi.addCard({
|
const response = await cardApi.addCard({
|
||||||
boardId: this.selectedBoard.id,
|
boardId: this.selectedBoard.id,
|
||||||
stackId: this.selectedStack.id,
|
stackId: this.selectedStack.id,
|
||||||
@@ -246,12 +249,21 @@ export default {
|
|||||||
description: this.card.description,
|
description: this.card.description,
|
||||||
duedate: this.card.duedate,
|
duedate: this.card.duedate,
|
||||||
labels: this.card.labels.map(label => label.id),
|
labels: this.card.labels.map(label => label.id),
|
||||||
users: this.card.assignedUsers.map(user => { return { id: user.uid, type: user.type } }),
|
users: this.card.assignedUsers.map(user => {
|
||||||
|
return {
|
||||||
|
id: user.uid,
|
||||||
|
type: user.type,
|
||||||
|
}
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
this.newCard = response
|
this.newCard = response
|
||||||
this.creating = false
|
this.creating = false
|
||||||
this.created = true
|
this.created = true
|
||||||
this.$emit('submit', window.location.protocol + '//' + window.location.host + generateUrl('/apps/deck') + `/card/${this.newCard.id}`)
|
this.$emit('submit', window.location.protocol + '//' + window.location.host + generateUrl('/apps/deck') + `/card/${this.newCard.id}`)
|
||||||
|
} catch (e) {
|
||||||
|
this.creating = false
|
||||||
|
showError(e)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onSelectLabel(label) {
|
onSelectLabel(label) {
|
||||||
this.card.labels.push(label)
|
this.card.labels.push(label)
|
||||||
|
|||||||
Reference in New Issue
Block a user