From 58180272ecae793c58e010958aeb3fd5b02a4f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 11 Nov 2023 19:45:22 +0100 Subject: [PATCH 01/11] fix: Expose card actions in the card menu (fix #3180) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/cards/CardMenu.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/cards/CardMenu.vue b/src/components/cards/CardMenu.vue index c1d355095..6cbb52977 100644 --- a/src/components/cards/CardMenu.vue +++ b/src/components/cards/CardMenu.vue @@ -42,6 +42,13 @@ {{ t('deck', 'Move card') }} + + {{ action.label }} + {{ t('deck', 'Card details') }} @@ -122,6 +129,7 @@ export default { ...mapGetters([ 'isArchived', 'boards', + 'cardActions', ]), ...mapState({ showArchived: state => state.showArchived, From 265c4c40394807686e07ecf10e20ce70be9f25ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 11 Nov 2023 20:02:24 +0100 Subject: [PATCH 02/11] fix: Use full card menu everywhere (fix #3993) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/card/CardSidebar.vue | 10 +- src/components/cards/CardMenu.vue | 204 +------------------- src/components/cards/CardMenuEntries.vue | 234 +++++++++++++++++++++++ 3 files changed, 244 insertions(+), 204 deletions(-) create mode 100644 src/components/cards/CardMenuEntries.vue diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue index 6692e3de8..9f94c018f 100644 --- a/src/components/card/CardSidebar.vue +++ b/src/components/card/CardSidebar.vue @@ -39,13 +39,7 @@ {{ t('deck', 'Open in bigger view') }} - - {{ action.label }} - + - - diff --git a/src/components/cards/CardMenuEntries.vue b/src/components/cards/CardMenuEntries.vue new file mode 100644 index 000000000..8237db616 --- /dev/null +++ b/src/components/cards/CardMenuEntries.vue @@ -0,0 +1,234 @@ + + + + + + From ee1a3e0515a8bae666411507da075efb72375bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 11 Nov 2023 20:26:14 +0100 Subject: [PATCH 03/11] fix: Detect end of the activity responses (fix #3395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/ActivityList.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/ActivityList.vue b/src/components/ActivityList.vue index fa1eb7df2..e16519fe1 100644 --- a/src/components/ActivityList.vue +++ b/src/components/ActivityList.vue @@ -84,7 +84,20 @@ export default { params.append('object_id', '' + this.objectId) params.append('limit', ACTIVITY_FETCH_LIMIT) - const response = await axios.get(generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params) + const response = await axios.get( + generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params, + { + validateStatus: (status) => { + return (status >= 200 && status < 300) || status === 304 + }, + }, + ) + + if (response.status === 304) { + this.endReached = true + return [] + } + let activities = response.data.ocs.data if (this.filter === 'deck') { // We need to manually filter activities here, since currently we use two different types and there is no way @@ -95,7 +108,7 @@ export default { }) } this.activities.push(...activities) - if (response.data.ocs.meta.statuscode === 304 || activities.length === 0) { + if (activities.length === 0) { this.endReached = true return [] } From 342d9beaf6b6531432cc2319669d0d815f93bc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 11 Nov 2023 22:30:47 +0100 Subject: [PATCH 04/11] fix: Add title with absolute date time to activity (fix #4508, fix #2122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/ActivityEntry.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ActivityEntry.vue b/src/components/ActivityEntry.vue index 211ffb208..3c6ee6902 100644 --- a/src/components/ActivityEntry.vue +++ b/src/components/ActivityEntry.vue @@ -25,7 +25,7 @@
-
+
{{ relativeDate(activity.datetime) }}
@@ -39,6 +39,7 @@ import { NcRichText, NcUserBubble } from '@nextcloud/vue' import moment from '@nextcloud/moment' import DOMPurify from 'dompurify' import relativeDate from '../mixins/relativeDate.js' +import formatReadableDate from '../mixins/readableDate.js' const InternalLink = { name: 'InternalLink', @@ -62,7 +63,7 @@ export default { components: { NcRichText, }, - mixins: [relativeDate], + mixins: [relativeDate, formatReadableDate], props: { activity: { type: Object, From c876e879906fb4cd1ab04cfe29b336e732b92b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sun, 12 Nov 2023 00:24:58 +0100 Subject: [PATCH 05/11] fix: Disable dragging archived cards (fix #3271) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/board/Stack.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/board/Stack.vue b/src/components/board/Stack.vue index 6fc557774..9f01c6a46 100644 --- a/src/components/board/Stack.vue +++ b/src/components/board/Stack.vue @@ -217,7 +217,7 @@ export default { }) }, dragHandleSelector() { - return this.canEdit ? null : '.no-drag' + return this.canEdit && !this.showArchived ? null : '.no-drag' }, cardDetailsInModal: { get() { From 6f6d6282bc3edb87673f78c4604d3f139c68bbad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sun, 12 Nov 2023 00:29:51 +0100 Subject: [PATCH 06/11] fix: Hide unavailable card menu entries for archived card view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/cards/CardMenuEntries.vue | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/cards/CardMenuEntries.vue b/src/components/cards/CardMenuEntries.vue index 8237db616..687dd8e99 100644 --- a/src/components/cards/CardMenuEntries.vue +++ b/src/components/cards/CardMenuEntries.vue @@ -26,22 +26,28 @@ {{ t('deck', 'Card details') }} - {{ t('deck', 'Assign to me') }} - {{ t('deck', 'Unassign myself') }} - + {{ card.done ? t('deck', 'Mark as not done') : t('deck', 'Mark as done') }} - + {{ t('deck', 'Move card') }} {{ action.label }} - + {{ card.archived ? t('deck', 'Unarchive card') : t('deck', 'Archive card') }} - @@ -136,6 +142,9 @@ export default { currentBoard: state => state.currentBoard, }), canEdit() { + return !this.card.archived + }, + canEditBoard() { if (this.currentBoard) { return this.$store.getters.canEdit } From f24123c686518570228b2a86646ac5a2fe8f4ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sun, 12 Nov 2023 00:38:14 +0100 Subject: [PATCH 07/11] fix: Use localCompare to sort labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/board/TagsTabSidebar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/board/TagsTabSidebar.vue b/src/components/board/TagsTabSidebar.vue index 22b3348cc..5bf81071b 100644 --- a/src/components/board/TagsTabSidebar.vue +++ b/src/components/board/TagsTabSidebar.vue @@ -130,7 +130,7 @@ export default { return true }, labelsSorted() { - return [...this.labels].sort((a, b) => (a.title < b.title) ? -1 : 1) + return [...this.labels].sort((a, b) => a.title.localeCompare(b.title)) }, }, From bd122b0d74b7908deb2390201c00aa1aa358055b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sun, 12 Nov 2023 01:09:44 +0100 Subject: [PATCH 08/11] fix: More fitting click target for title editing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/cards/CardItem.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/cards/CardItem.vue b/src/components/cards/CardItem.vue index 3b9e588af..44e604b32 100644 --- a/src/components/cards/CardItem.vue +++ b/src/components/cards/CardItem.vue @@ -44,9 +44,8 @@ tabindex="0" class="editable" :aria-label="t('deck', 'Edit card title')" - @click.stop="startEditing(card)" @keydown.enter.stop.prevent="startEditing(card)"> - {{ card.title }} + {{ card.title }}
Date: Sun, 12 Nov 2023 11:03:43 +0100 Subject: [PATCH 09/11] fix: Always load proper dashboard js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Dashboard/DeckWidgetToday.php | 2 +- lib/Dashboard/DeckWidgetTomorrow.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Dashboard/DeckWidgetToday.php b/lib/Dashboard/DeckWidgetToday.php index 2006fec40..38a21ed11 100644 --- a/lib/Dashboard/DeckWidgetToday.php +++ b/lib/Dashboard/DeckWidgetToday.php @@ -80,6 +80,6 @@ public function getUrl(): ?string { * @inheritDoc */ public function load(): void { - \OCP\Util::addScript('deck', 'dashboard'); + \OCP\Util::addScript('deck', 'deck-dashboard'); } } diff --git a/lib/Dashboard/DeckWidgetTomorrow.php b/lib/Dashboard/DeckWidgetTomorrow.php index 946a62802..6c9b09da1 100644 --- a/lib/Dashboard/DeckWidgetTomorrow.php +++ b/lib/Dashboard/DeckWidgetTomorrow.php @@ -80,6 +80,6 @@ public function getUrl(): ?string { * @inheritDoc */ public function load(): void { - \OCP\Util::addScript('deck', 'dashboard'); + \OCP\Util::addScript('deck', 'deck-dashboard'); } } From 587b44f7b9d53d98f88b3297ca41d08d4dde0c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sun, 12 Nov 2023 12:20:21 +0100 Subject: [PATCH 10/11] fix: Set fixed height for card modal (fix #4296) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/App.vue | 6 ++++++ src/components/card/CardSidebar.vue | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index cfeb3309e..920bf4a3f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -194,4 +194,10 @@ export default { width: 100%; } + .modal__card { + height: 100vh; + max-height: calc(100vh - 120px); + overflow: auto; + } + diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue index 9f94c018f..6b4988cca 100644 --- a/src/components/card/CardSidebar.vue +++ b/src/components/card/CardSidebar.vue @@ -235,7 +235,7 @@ section.app-sidebar__tab--active { right: 0; max-width: calc(100% - #{$modal-padding * 2}); padding: 0 14px; - max-height: 100%; + height: auto; overflow: initial; user-select: text; -webkit-user-select: text; From 29d5913e8bd673fc9c61bfa141a5952a12348e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sun, 12 Nov 2023 12:22:42 +0100 Subject: [PATCH 11/11] fix: Make sure to always update card description when navigating awayfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #5254 fix #2705 Signed-off-by: Julius Härtl --- src/components/card/CardSidebarTabDetails.vue | 6 ++++-- src/components/card/Description.vue | 20 ++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/card/CardSidebarTabDetails.vue b/src/components/card/CardSidebarTabDetails.vue index c34eab09d..387298cfa 100644 --- a/src/components/card/CardSidebarTabDetails.vue +++ b/src/components/card/CardSidebarTabDetails.vue @@ -119,8 +119,10 @@ export default { this.initialize() }, methods: { - descriptionChanged(newDesc) { - this.$store.dispatch('updateCardDesc', { ...this.card, description: newDesc }) + async descriptionChanged(newDesc) { + if (newDesc === this.copiedCard.description) { + return + } this.copiedCard.description = newDesc }, async initialize() { diff --git a/src/components/card/Description.vue b/src/components/card/Description.vue index 42a76c095..76c5fbdfe 100644 --- a/src/components/card/Description.vue +++ b/src/components/card/Description.vue @@ -187,17 +187,26 @@ export default { mounted() { this.setupEditor() }, - beforeDestroy() { - this?.editor?.destroy() + async beforeDestroy() { + await this.destroyEditor() }, methods: { async setupEditor() { - this?.editor?.destroy() + await this.destroyEditor() + this.descriptionLastEdit = 0 + this.description = this.card.description this.editor = await window.OCA.Text.createEditor({ el: this.$refs.editor, content: this.card.description, readOnly: !this.canEdit, + onLoaded: () => { + this.descriptionLastEdit = 0 + }, onUpdate: ({ markdown }) => { + if (this.description === markdown) { + this.descriptionLastEdit = 0 + return + } this.description = markdown this.updateDescription() }, @@ -207,6 +216,10 @@ export default { }) }, + async destroyEditor() { + await this.saveDescription() + this?.editor?.destroy() + }, addKeyListeners() { this.$refs.markdownEditor.easymde.codemirror.on('keydown', (a, b) => { if (this.keyExitState === 0 && (b.key === 'Meta' || b.key === 'Alt')) { @@ -287,6 +300,7 @@ export default { return } this.descriptionSaving = true + await this.$store.dispatch('updateCardDesc', { ...this.card, description: this.description }) this.$emit('change', this.description) this.descriptionLastEdit = 0 this.descriptionSaving = false