diff options
Diffstat (limited to 'app/assets/javascripts/design_management/components/design_overlay.vue')
-rw-r--r-- | app/assets/javascripts/design_management/components/design_overlay.vue | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/app/assets/javascripts/design_management/components/design_overlay.vue b/app/assets/javascripts/design_management/components/design_overlay.vue index beb51647821..926e7c74802 100644 --- a/app/assets/javascripts/design_management/components/design_overlay.vue +++ b/app/assets/javascripts/design_management/components/design_overlay.vue @@ -33,6 +33,10 @@ export default { required: false, default: false, }, + resolvedDiscussionsExpanded: { + type: Boolean, + required: true, + }, }, apollo: { activeDiscussion: { @@ -140,7 +144,7 @@ export default { }, onExistingNoteMove(e) { const note = this.notes.find(({ id }) => id === this.movingNoteStartPosition.noteId); - if (!note) return; + if (!note || !this.canMoveNote(note)) return; const { position } = note; const { width, height } = position; @@ -186,8 +190,6 @@ export default { }); }, onNoteMousedown({ clientX, clientY }, note) { - if (note && !this.canMoveNote(note)) return; - this.movingNoteStartPosition = { noteId: note?.id, discussionId: note?.discussion.id, @@ -236,6 +238,9 @@ export default { isNoteInactive(note) { return this.activeDiscussion.id && this.activeDiscussion.id !== note.id; }, + designPinClass(note) { + return { inactive: this.isNoteInactive(note), resolved: note.resolved }; + }, }, }; </script> @@ -254,20 +259,23 @@ export default { data-qa-selector="design_image_button" @mouseup="onAddCommentMouseup" ></button> - <design-note-pin - v-for="(note, index) in notes" - :key="note.id" - :label="`${index + 1}`" - :repositioning="isMovingNote(note.id)" - :position=" - isMovingNote(note.id) && movingNoteNewPosition - ? getNotePositionStyle(movingNoteNewPosition) - : getNotePositionStyle(note.position) - " - :class="{ inactive: isNoteInactive(note) }" - @mousedown.stop="onNoteMousedown($event, note)" - @mouseup.stop="onNoteMouseup(note)" - /> + <template v-for="note in notes"> + <design-note-pin + v-if="resolvedDiscussionsExpanded || !note.resolved" + :key="note.id" + :label="note.index" + :repositioning="isMovingNote(note.id)" + :position=" + isMovingNote(note.id) && movingNoteNewPosition + ? getNotePositionStyle(movingNoteNewPosition) + : getNotePositionStyle(note.position) + " + :class="designPinClass(note)" + @mousedown.stop="onNoteMousedown($event, note)" + @mouseup.stop="onNoteMouseup(note)" + /> + </template> + <design-note-pin v-if="currentCommentForm" :position="currentCommentPositionStyle" |