From 80c89ca38864efaaed986cbb3061b9e7e642c0d9 Mon Sep 17 00:00:00 2001 From: Nicolas Pennec Date: Fri, 22 Sep 2023 09:58:14 +0200 Subject: [PATCH 1/7] [ui] fix text wrap if small panel --- src/components/widgets/Comment.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/widgets/Comment.vue b/src/components/widgets/Comment.vue index dd506d2fc9..ce53c14644 100644 --- a/src/components/widgets/Comment.vue +++ b/src/components/widgets/Comment.vue @@ -982,6 +982,7 @@ article.comment { .date { font-size: 0.8em; margin-right: 0.5em; + white-space: nowrap; } .preview-info { From aa70fdd57a16cc35a619e3b0992f4de5ca3b5000 Mon Sep 17 00:00:00 2001 From: Nicolas Pennec Date: Fri, 22 Sep 2023 18:28:37 +0200 Subject: [PATCH 2/7] [ui] improve scroll --- src/components/sides/TaskInfo.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/sides/TaskInfo.vue b/src/components/sides/TaskInfo.vue index 701a13c374..19822d298e 100644 --- a/src/components/sides/TaskInfo.vue +++ b/src/components/sides/TaskInfo.vue @@ -1568,7 +1568,7 @@ export default { .side { flex: 1; - overflow: scroll; + overflow: auto; } .extend-bar { From 6db7ca7cd93963e970c76550a9cd8dc661c8b6eb Mon Sep 17 00:00:00 2001 From: Nicolas Pennec Date: Fri, 22 Sep 2023 18:58:36 +0200 Subject: [PATCH 3/7] [ui] toggle active buttons in players --- src/components/pages/Edit.vue | 1 + src/components/pages/playlists/PlaylistPlayer.vue | 2 ++ src/components/previews/PreviewPlayer.vue | 1 + 3 files changed, 4 insertions(+) diff --git a/src/components/pages/Edit.vue b/src/components/pages/Edit.vue index 0545223117..159ba33813 100644 --- a/src/components/pages/Edit.vue +++ b/src/components/pages/Edit.vue @@ -421,6 +421,7 @@
diff --git a/src/components/previews/PreviewPlayer.vue b/src/components/previews/PreviewPlayer.vue index bca98e07d2..ec4c3d0970 100644 --- a/src/components/previews/PreviewPlayer.vue +++ b/src/components/previews/PreviewPlayer.vue @@ -348,6 +348,7 @@ Date: Fri, 22 Sep 2023 19:15:39 +0200 Subject: [PATCH 4/7] [qa] refactor code --- src/components/cells/MetadataHeader.vue | 2 +- src/components/pages/Edit.vue | 7 ++----- src/components/pages/playlists/PlaylistPlayer.vue | 8 ++------ src/components/previews/PreviewPlayer.vue | 10 ++-------- src/components/sides/TaskInfo.vue | 6 +----- 5 files changed, 8 insertions(+), 25 deletions(-) diff --git a/src/components/cells/MetadataHeader.vue b/src/components/cells/MetadataHeader.vue index 1bcde6a8c6..b70bb52d81 100644 --- a/src/components/cells/MetadataHeader.vue +++ b/src/components/cells/MetadataHeader.vue @@ -22,7 +22,7 @@ @click="$emit('show-metadata-header-menu', $event)" v-if="!noMenu" > - + diff --git a/src/components/pages/Edit.vue b/src/components/pages/Edit.vue index 159ba33813..5633e8fbbe 100644 --- a/src/components/pages/Edit.vue +++ b/src/components/pages/Edit.vue @@ -157,17 +157,14 @@ diff --git a/src/components/pages/playlists/PlaylistPlayer.vue b/src/components/pages/playlists/PlaylistPlayer.vue index b348479778..6ef38e2048 100644 --- a/src/components/pages/playlists/PlaylistPlayer.vue +++ b/src/components/pages/playlists/PlaylistPlayer.vue @@ -265,18 +265,14 @@ diff --git a/src/components/previews/PreviewPlayer.vue b/src/components/previews/PreviewPlayer.vue index ec4c3d0970..a7c0fcdd8f 100644 --- a/src/components/previews/PreviewPlayer.vue +++ b/src/components/previews/PreviewPlayer.vue @@ -89,19 +89,15 @@ @@ -1591,8 +1587,6 @@ export default { this.$nextTick(() => { if (!this.isCommentsHidden) { this.$refs['task-info-player'].$el.style.height = `${height}px` - } - if (this.$refs['task-info-player']) { this.$refs['task-info-player'].focusCommentTextarea() } this.previewViewer.resetVideo() diff --git a/src/components/sides/TaskInfo.vue b/src/components/sides/TaskInfo.vue index 19822d298e..159c772764 100644 --- a/src/components/sides/TaskInfo.vue +++ b/src/components/sides/TaskInfo.vue @@ -339,10 +339,6 @@ export default { type: Boolean, default: false }, - panelName: { - type: String, - default: 'todefine' - }, withActions: { type: Boolean, default: false @@ -804,7 +800,7 @@ export default { }, focusCommentTextarea() { - if (this.$refs['add-comment']) this.$refs['add-comment'].focus() + this.$refs['add-comment']?.focus() }, getOriginalPath() { From 50d78bfedecc4f484a17e665df26c7215f4417e1 Mon Sep 17 00:00:00 2001 From: Nicolas Pennec Date: Fri, 22 Sep 2023 20:11:22 +0200 Subject: [PATCH 5/7] [comments] fix the comment data being loaded twice Data fetch runs twice due to nested task-info components --- src/components/mixins/player.js | 1 - src/components/pages/playlists/PlaylistPlayer.vue | 2 +- src/components/previews/PreviewPlayer.vue | 1 + src/components/sides/TaskInfo.vue | 9 ++++++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/mixins/player.js b/src/components/mixins/player.js index 74f3958455..6c103d783f 100644 --- a/src/components/mixins/player.js +++ b/src/components/mixins/player.js @@ -1268,7 +1268,6 @@ export const playerMixin = { watch: { isCommentsHidden() { - if (!this.isCommentsHidden) this.$refs['task-info'].loadTaskData() if (this.isCurrentPreviewSound) { this.soundPlayer.redraw() } diff --git a/src/components/pages/playlists/PlaylistPlayer.vue b/src/components/pages/playlists/PlaylistPlayer.vue index 6ef38e2048..259e045088 100644 --- a/src/components/pages/playlists/PlaylistPlayer.vue +++ b/src/components/pages/playlists/PlaylistPlayer.vue @@ -1423,7 +1423,7 @@ export default { if (this.$refs['video-container']) { this.$refs['video-container'].style.height = `${height}px` } - if (!this.isCommentsHidden) { + if (this.$refs['task-info'] && !this.isCommentsHidden) { this.$refs['task-info'].$el.style.height = `${height}px` } if (this.$refs['picture-preview-wrapper']) { diff --git a/src/components/previews/PreviewPlayer.vue b/src/components/previews/PreviewPlayer.vue index a7c0fcdd8f..c555105cc4 100644 --- a/src/components/previews/PreviewPlayer.vue +++ b/src/components/previews/PreviewPlayer.vue @@ -93,6 +93,7 @@ class="flexrow-item task-info-column" :task="task" :is-preview="false" + :silent="isCommentsHidden" :current-time-raw="currentTimeRaw" :current-parent-preview="currentPreview" @comment-added="$emit('comment-added')" diff --git a/src/components/sides/TaskInfo.vue b/src/components/sides/TaskInfo.vue index 159c772764..ebd2deb47d 100644 --- a/src/components/sides/TaskInfo.vue +++ b/src/components/sides/TaskInfo.vue @@ -404,7 +404,6 @@ export default { }, mounted() { - this.loadTaskData() if (this.$refs['add-comment']) { const draft = drafts.getTaskDraft(this.task.id) if (draft) { @@ -1274,6 +1273,14 @@ export default { if (!this.silent) { this.loadTaskData() } + }, + silent: { + immediate: true, + handler() { + if (!this.silent) { + this.loadTaskData() + } + } } }, From f6f991f0b9813ff95911ffee890605de2cbd8266 Mon Sep 17 00:00:00 2001 From: Nicolas Pennec Date: Mon, 25 Sep 2023 12:14:08 +0200 Subject: [PATCH 6/7] [qa] refactor code --- src/store/api/tasks.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/store/api/tasks.js b/src/store/api/tasks.js index ba258d65bc..53c1d2654c 100644 --- a/src/store/api/tasks.js +++ b/src/store/api/tasks.js @@ -39,12 +39,10 @@ export default { comment: data.comment, checklist: data.checklist || [] } - if (data.attachment && data.attachment.length > 0) { + if (data.attachment?.length) { commentData = new FormData() - let i = 0 - data.attachment.forEach(attachment => { - commentData.append('file-' + i, attachment.get('file')) - i++ + data.attachment.forEach((attachment, index) => { + commentData.append(`file-${index}`, attachment.get('file')) }) commentData.set('task_status_id', data.taskStatusId) commentData.set('comment', data.comment) From 62310ea81273ace79e8bd707230a7cff6aedd5e2 Mon Sep 17 00:00:00 2001 From: Nicolas Pennec Date: Mon, 25 Sep 2023 12:16:27 +0200 Subject: [PATCH 7/7] [qa] remove unused code Duplicate method in taskStatusApi --- src/store/api/tasks.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/store/api/tasks.js b/src/store/api/tasks.js index 53c1d2654c..1485f5683d 100644 --- a/src/store/api/tasks.js +++ b/src/store/api/tasks.js @@ -9,10 +9,6 @@ export default { return client.pput(`/api/data/tasks/${taskId}`, data, callback) }, - getTaskStatuses(callback) { - client.get('/api/data/task-status', callback) - }, - getTaskSubscribed(taskId, callback) { return client.pget(`/api/data/user/tasks/${taskId}/subscribed`) },