diff --git a/platform/publicreport/log.go b/platform/publicreport/log.go index d9e6d0b7..73b5d501 100644 --- a/platform/publicreport/log.go +++ b/platform/publicreport/log.go @@ -8,6 +8,7 @@ import ( "github.com/Gleipnir-Technology/bob/dialect/psql" "github.com/Gleipnir-Technology/bob/dialect/psql/sm" "github.com/Gleipnir-Technology/nidus-sync/db" + "github.com/Gleipnir-Technology/nidus-sync/db/enums" "github.com/Gleipnir-Technology/nidus-sync/db/models" "github.com/Gleipnir-Technology/nidus-sync/platform/types" "github.com/rs/zerolog/log" @@ -157,12 +158,16 @@ func logEntriesFromTexts(ctx context.Context, report_ids []int32) (map[int32][]* } else { user_id_ptr = &user_id } + type_ := "message-text-outgoing" + if row.Origin == enums.CommsTextoriginCustomer { + type_ = "message-text-incoming" + } logs = append(logs, &types.LogEntry{ Created: row.Created, ID: row.ID, Message: row.Content, ReportID: report_id, - Type: "text-message", + Type: type_, UserID: user_id_ptr, }) results[report_id] = logs diff --git a/ts/components/CommunicationColumnAction.vue b/ts/components/CommunicationColumnAction.vue index aa42017a..5dd3f789 100644 --- a/ts/components/CommunicationColumnAction.vue +++ b/ts/components/CommunicationColumnAction.vue @@ -112,20 +112,7 @@ :key="index" class="border-start border-2 ps-2 mb-2" > -
-
Initial Report
- {{ - formatDate(entry.created) - }} -
-
-
Text Message
-
{{ entry.message }}
- {{ - formatDate(entry.created) - }} -
-
{{ entry.type }}
+
import { ref } from "vue"; import { Communication, User } from "@/type/api"; +import ListCardActivityLog from "@/components/ListCardActivityLog.vue"; interface Emits { (e: "markSignal"): void; (e: "markInvalid"): void; @@ -173,9 +161,6 @@ function applyMessageTemplate(template: string) { messageText.value = templates[template as keyof typeof templates]; } } -function formatDate(date: Date) { - return date.toLocaleString(); -} function handleTemplateChange(event: Event) { const target = event.target as HTMLSelectElement; applyMessageTemplate(target.value); diff --git a/ts/components/ListCardActivityLog.vue b/ts/components/ListCardActivityLog.vue new file mode 100644 index 00000000..cfcf7d5e --- /dev/null +++ b/ts/components/ListCardActivityLog.vue @@ -0,0 +1,43 @@ + + +