From 01aee58c4f0b5b1e940d38a86fc03e84ef673285 Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Mon, 1 Sep 2025 16:34:39 -0400 Subject: [PATCH] Clean up comment editing. --- .../classroom_compliance/entries_table/EntryTableCell.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/apps/classroom_compliance/entries_table/EntryTableCell.vue b/app/src/apps/classroom_compliance/entries_table/EntryTableCell.vue index b333359..02ccc1e 100644 --- a/app/src/apps/classroom_compliance/entries_table/EntryTableCell.vue +++ b/app/src/apps/classroom_compliance/entries_table/EntryTableCell.vue @@ -37,6 +37,7 @@ const entryChanged = computed(() => JSON.stringify(model.value) !== initialEntry const hasComment = computed(() => model.value && (model.value.comment.trim().length > 0 || model.value.checklistItems.length > 0)) const previousCommentValue: Ref = ref('') +const previousCommentChecklistItems: Ref = ref([]) const commentEditorDialog = useTemplateRef('commentEditorDialog') onMounted(() => { @@ -104,12 +105,14 @@ function toggleBehaviorRating() { function showCommentEditor() { if (!model.value) return previousCommentValue.value = model.value?.comment + previousCommentChecklistItems.value = [...model.value?.checklistItems] commentEditorDialog.value?.showModal() } function cancelCommentEdit() { if (model.value) { model.value.comment = previousCommentValue.value + model.value.checklistItems = previousCommentChecklistItems.value } commentEditorDialog.value?.close() } @@ -182,7 +185,7 @@ function addEntry() {