Skip to content

Commit c8d489b

Browse files
authored
Merge pull request #5575 from lyttam/BOAC-6697
BOAC-6697: fixes error displaying comments on PAM dashboard
2 parents 67522ed + b0a40a2 commit c8d489b

3 files changed

Lines changed: 8 additions & 25 deletions

File tree

src/components/comment/AdvisingComments.vue

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@
1717
:peer-advising-department-id="comment.peerAdvisingDepartmentId"
1818
/>
1919
</div>
20-
<v-badge
21-
class="advising-comment-new"
22-
:class="{'show': !comment.read}"
23-
color="info"
24-
inline
25-
>
26-
<template #badge>
27-
<span class="font-weight-black text-caption text-uppercase">new</span>
28-
</template>
29-
</v-badge>
3020
</div>
3121
<div
3222
:id="`${idPrefix}-comment-${comment.id}-text`"
@@ -86,6 +76,7 @@
8676
:date="comment.createdAt"
8777
:include-time-of-day="comment.createdAt.length > 10"
8878
class="mb-2"
79+
:class="{'font-weight-bold': !comment.read && comment.createdAt === comment.updatedAt}"
8980
/>
9081
</div>
9182
<div v-if="comment.updatedAt && comment.createdAt !== comment.updatedAt" class="pl-2">
@@ -95,6 +86,7 @@
9586
:date="comment.updatedAt"
9687
:include-time-of-day="comment.updatedAt.length > 10"
9788
class="mb-2"
89+
:class="{'font-weight-bold': !comment.read}"
9890
/>
9991
</div>
10092
</footer>
@@ -268,16 +260,6 @@ const onUpdateComment = (id, body, attachments, deleteAttachmentIds) => {
268260
.academic-timeline-column-date{
269261
margin-right: -24px;
270262
}
271-
.advising-comment-new {
272-
margin-top: 2px;
273-
visibility: hidden;
274-
opacity: 0;
275-
transition: opacity 250ms ease-in, visibility 0ms ease-in 250ms;
276-
}
277-
.advising-comment-new.show {
278-
visibility: visible;
279-
opacity: 1;
280-
}
281263
.advising-comments :deep(ul), .advising-comments :deep(ol) {
282264
padding-left: 25px;
283265
}

src/components/peer/note/PeerAdvisingNotesTable.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
<AdvisingComments
183183
class="pl-5"
184184
:class="{'sr-only': !isExpanded(note)}"
185-
:note="note"
185+
:parent="note"
186186
/>
187187
</div>
188188
</article>
@@ -210,7 +210,7 @@
210210
<script setup lang="ts">
211211
import {DateTime} from 'luxon'
212212
import {computed, ref} from 'vue'
213-
import {get, replace, size, truncate} from 'lodash'
213+
import {each, get, replace, size, truncate} from 'lodash'
214214
import {mdiCloseCircle} from '@mdi/js'
215215
import {useDisplay} from 'vuetify'
216216
import type {Note} from '@/lib/types'
@@ -336,6 +336,7 @@ const toggleShowHide = (note: Note) => {
336336
const index = expandedNoteIds.value.indexOf(note.id)
337337
if (index > -1) {
338338
expandedNoteIds.value.splice(index, 1)
339+
each(note.comments, c => { c.read = true })
339340
putFocusNextTick(`open-peer-advising-${note.id}`, {scroll: false})
340341
} else {
341342
expandedNoteIds.value.push(note.id)

src/components/student/profile/academic-timeline/AcademicTimelineTable.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ const close = message => {
598598
}
599599
if (isExpanded(message)) {
600600
pull(openMessages.value, message.transientId)
601+
if (size(message.comments)) {
602+
each(message.comments, c => { c.read = true })
603+
}
601604
}
602605
if (openMessages.value.length === 0) {
603606
allExpanded.value = false
@@ -686,9 +689,6 @@ const markRead = message => {
686689
markAppointmentRead(message.id)
687690
}
688691
}
689-
if (size(message.comments)) {
690-
each(message.comments, c => { c.read = true })
691-
}
692692
}
693693
694694
const messagesPerType = type => {

0 commit comments

Comments
 (0)