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/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/Edit.vue b/src/components/pages/Edit.vue index 0545223117..5633e8fbbe 100644 --- a/src/components/pages/Edit.vue +++ b/src/components/pages/Edit.vue @@ -157,17 +157,14 @@ @@ -421,6 +418,7 @@
@@ -670,6 +666,7 @@
@@ -1425,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 bca98e07d2..c555105cc4 100644 --- a/src/components/previews/PreviewPlayer.vue +++ b/src/components/previews/PreviewPlayer.vue @@ -89,19 +89,16 @@ @@ -348,6 +345,7 @@ { 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 701a13c374..ebd2deb47d 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 @@ -408,7 +404,6 @@ export default { }, mounted() { - this.loadTaskData() if (this.$refs['add-comment']) { const draft = drafts.getTaskDraft(this.task.id) if (draft) { @@ -804,7 +799,7 @@ export default { }, focusCommentTextarea() { - if (this.$refs['add-comment']) this.$refs['add-comment'].focus() + this.$refs['add-comment']?.focus() }, getOriginalPath() { @@ -1278,6 +1273,14 @@ export default { if (!this.silent) { this.loadTaskData() } + }, + silent: { + immediate: true, + handler() { + if (!this.silent) { + this.loadTaskData() + } + } } }, @@ -1568,7 +1571,7 @@ export default { .side { flex: 1; - overflow: scroll; + overflow: auto; } .extend-bar { 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 { diff --git a/src/store/api/tasks.js b/src/store/api/tasks.js index ba258d65bc..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`) }, @@ -39,12 +35,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)