Skip to content

Commit

Permalink
Merge pull request #2817 from nextcloud/backport/2812/stable1.3
Browse files Browse the repository at this point in the history
[stable1.3] Fix issues when creating a card from a talk message
  • Loading branch information
juliusknorr authored Feb 20, 2021
2 parents 0c7da56 + 1279e75 commit f75de55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/Controller/CardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public function rename($cardId, $title) {
* @param int $order
* @return \OCP\AppFramework\Db\Entity
*/
public function create($title, $stackId, $type = 'plain', $order = 999) {
return $this->cardService->create($title, $stackId, $type, $order, $this->userId);
public function create($title, $stackId, $type = 'plain', $order = 999, string $description = '') {
return $this->cardService->create($title, $stackId, $type, $order, $this->userId, $description);
}

/**
Expand Down
11 changes: 8 additions & 3 deletions src/CardCreateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
type="text"
:placeholder="t('deck', 'Card title')"
:disabled="loading || !selectedStack">
<textarea v-model="description" :disabled="loading || !selectedStack" />
<textarea v-model="pendingDescription" :disabled="loading || !selectedStack" />
<div class="modal-buttons">
<button @click="close">
{{ t('deck', 'Cancel') }}
Expand All @@ -77,7 +77,7 @@
<EmptyContent v-else-if="created" icon="icon-checkmark">
{{ t('deck', '"{card}" was added to "{board}"', { card: pendingTitle, board: selectedBoard.title }) }}
<template #desc>
<button class="primary">
<button class="primary" @click="openNewCard">
{{ t('deck', 'Open card') }}
</button>
<button @click="close">
Expand Down Expand Up @@ -132,6 +132,7 @@ export default {
selectedBoard: '',
creating: false,
created: false,
newCard: null,
}
},
computed: {
Expand Down Expand Up @@ -171,17 +172,21 @@ export default {
},
async select() {
this.creating = true
await cardApi.addCard({
const response = await cardApi.addCard({
boardId: this.selectedBoard.id,
stackId: this.selectedStack.id,
title: this.pendingTitle,
description: this.pendingDescription,
})
this.newCard = response
this.creating = false
this.created = true
// We do not emit here since we want to give feedback to the user that the card was created
// this.$root.$emit('select', createdCard)
},
openNewCard() {
window.location = generateUrl('/apps/deck') + `#/board/${this.selectedBoard.id}/card/${this.newCard.id}`
},
},

}
Expand Down

0 comments on commit f75de55

Please sign in to comment.