From 65b173094f01f75f7e2d4c74c22694ef12f9a848 Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Wed, 18 Mar 2026 13:49:28 +0100 Subject: [PATCH] Refactor task description handling in `SelfServeTaskList.vue`: - Add `hasTaskDescription` utility to validate and handle task descriptions more robustly. - Update template to conditionally render task descriptions using the new utility. --- .../displays/selfServe/SelfServeTaskList.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/displays/selfServe/SelfServeTaskList.vue b/src/components/displays/selfServe/SelfServeTaskList.vue index 4d60b483..b658fb8b 100644 --- a/src/components/displays/selfServe/SelfServeTaskList.vue +++ b/src/components/displays/selfServe/SelfServeTaskList.vue @@ -19,6 +19,16 @@ const isImageAttachment = (attachment: any) => ( && !!attachment.content?.other && attachment.content.other.match(/\.(jpg|jpeg|png|gif|webp|svg)$/i) ); + +const hasTaskDescription = (task: any) => { + const description = task?.description; + if (typeof description !== "string") { + return !!description; + } + + const trimmedDescription = description.trim(); + return trimmedDescription.length > 0 && trimmedDescription !== "-"; +};