From 3a66986785754b4bb70cadc06c20cfaaa5a75ffe Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Thu, 9 May 2024 15:52:17 +0530 Subject: [PATCH] [WEB-1256] fix: accept image as a valid comment (#4409) * fix: accept image as a valid comment * fix: update space app helper function --- space/helpers/string.helper.ts | 2 +- web/helpers/string.helper.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/space/helpers/string.helper.ts b/space/helpers/string.helper.ts index b44974d250..525a9fc99d 100644 --- a/space/helpers/string.helper.ts +++ b/space/helpers/string.helper.ts @@ -52,7 +52,7 @@ export const checkEmailValidity = (email: string): boolean => { export const isEmptyHtmlString = (htmlString: string) => { // Remove HTML tags using regex - const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: [] }); + const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: ["img"] }); // Trim the string and check if it's empty return cleanText.trim() === ""; }; diff --git a/web/helpers/string.helper.ts b/web/helpers/string.helper.ts index 558c888834..51feb46561 100644 --- a/web/helpers/string.helper.ts +++ b/web/helpers/string.helper.ts @@ -174,10 +174,10 @@ export const getFetchKeysForIssueMutation = (options: { const ganttFetchKey = cycleId ? { ganttFetchKey: CYCLE_ISSUES_WITH_PARAMS(cycleId.toString(), ganttParams) } : moduleId - ? { ganttFetchKey: MODULE_ISSUES_WITH_PARAMS(moduleId.toString(), ganttParams) } - : viewId - ? { ganttFetchKey: VIEW_ISSUES(viewId.toString(), viewGanttParams) } - : { ganttFetchKey: PROJECT_ISSUES_LIST_WITH_PARAMS(projectId?.toString() ?? "", ganttParams) }; + ? { ganttFetchKey: MODULE_ISSUES_WITH_PARAMS(moduleId.toString(), ganttParams) } + : viewId + ? { ganttFetchKey: VIEW_ISSUES(viewId.toString(), viewGanttParams) } + : { ganttFetchKey: PROJECT_ISSUES_LIST_WITH_PARAMS(projectId?.toString() ?? "", ganttParams) }; return { ...ganttFetchKey, @@ -230,7 +230,7 @@ export const checkEmailValidity = (email: string): boolean => { export const isEmptyHtmlString = (htmlString: string) => { // Remove HTML tags using regex - const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: [] }); + const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: ["img"] }); // Trim the string and check if it's empty return cleanText.trim() === ""; };