From 04698226716bdfaf59831367f04b254d042045f3 Mon Sep 17 00:00:00 2001 From: Simon Van Accoleyen Date: Tue, 14 Feb 2023 20:21:42 +0100 Subject: [PATCH] fix: render markdown in notes on the dashboard --- .../js/components/dashboard/DashboardLog.vue | 64 ++++++++++--------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/resources/js/components/dashboard/DashboardLog.vue b/resources/js/components/dashboard/DashboardLog.vue index b11df919525..b870d1ceca1 100644 --- a/resources/js/components/dashboard/DashboardLog.vue +++ b/resources/js/components/dashboard/DashboardLog.vue @@ -99,9 +99,7 @@ {{ note.name }} -

- {{ note.body }} -

+

@@ -334,33 +332,33 @@ export default { this.saveTab(view); switch (view) { - case 'calls': - if (! this.callsAlreadyLoaded) { - this.getCalls(); - this.callsAlreadyLoaded = true; - } - break; - - case 'notes': - if (! this.notesAlreadyLoaded) { - this.getNotes(); - this.notesAlreadyLoaded = true; - } - break; - - case 'debts': - if (! this.debtsAlreadyLoaded) { - this.getDebts(); - this.debtsAlreadyLoaded = true; - } - break; - - case 'tasks': - if (! this.tasksAlreadyLoaded) { - this.getTasks(); - this.tasksAlreadyLoaded = true; - } - break; + case 'calls': + if (! this.callsAlreadyLoaded) { + this.getCalls(); + this.callsAlreadyLoaded = true; + } + break; + + case 'notes': + if (! this.notesAlreadyLoaded) { + this.getNotes(); + this.notesAlreadyLoaded = true; + } + break; + + case 'debts': + if (! this.debtsAlreadyLoaded) { + this.getDebts(); + this.debtsAlreadyLoaded = true; + } + break; + + case 'tasks': + if (! this.tasksAlreadyLoaded) { + this.getTasks(); + this.tasksAlreadyLoaded = true; + } + break; } }, @@ -449,7 +447,11 @@ export default { .then(response => { this.tasks.splice(this.tasks.indexOf(task), 1); }); - } + }, + + compiledMarkdown (text) { + return text !== undefined && text !== null ? marked(text, { sanitize: true }) : ''; + }, } };