From 7a808d105e6e2fe2ebfffdac53b8d99441f13d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Wed, 20 Dec 2023 10:02:04 +0100 Subject: [PATCH 1/2] fix tooltip when status text empty --- src/components/LHNOptionsList/OptionRowLHN.js | 2 +- src/pages/home/report/ReportActionItemSingle.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/LHNOptionsList/OptionRowLHN.js b/src/components/LHNOptionsList/OptionRowLHN.js index f0f59130017a..bb5e0958ac15 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.js +++ b/src/components/LHNOptionsList/OptionRowLHN.js @@ -150,7 +150,7 @@ function OptionRowLHN(props) { const statusText = lodashGet(optionItem, 'status.text', ''); const statusClearAfterDate = lodashGet(optionItem, 'status.clearAfter', ''); const formattedDate = DateUtils.getStatusUntilDate(statusClearAfterDate); - const statusContent = formattedDate ? `${statusText} (${formattedDate})` : statusText; + const statusContent = formattedDate ? (statusText ? `${statusText} (${formattedDate})` : `(${formattedDate})`) : statusText; const isStatusVisible = !!emojiCode && ReportUtils.isOneOnOneChat(ReportUtils.getReport(optionItem.reportID)); const isGroupChat = diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 5737d876779f..ed53c9b53323 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -206,7 +206,7 @@ function ReportActionItemSingle(props) { const hasEmojiStatus = !displayAllActors && status && status.emojiCode; const formattedDate = DateUtils.getStatusUntilDate(lodashGet(status, 'clearAfter')); const statusText = lodashGet(status, 'text', ''); - const statusTooltipText = formattedDate ? `${statusText} (${formattedDate})` : statusText; + const statusTooltipText = formattedDate ? (statusText ? `${statusText} (${formattedDate})` : `(${formattedDate})`) : statusText; return ( From 1eeba82ba1ab9e68a26b7982994e1554e0958999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Wed, 20 Dec 2023 15:08:44 +0100 Subject: [PATCH 2/2] fix lint --- src/components/LHNOptionsList/OptionRowLHN.js | 2 +- src/pages/home/report/ReportActionItemSingle.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/LHNOptionsList/OptionRowLHN.js b/src/components/LHNOptionsList/OptionRowLHN.js index bb5e0958ac15..a3f24cd3105a 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.js +++ b/src/components/LHNOptionsList/OptionRowLHN.js @@ -150,7 +150,7 @@ function OptionRowLHN(props) { const statusText = lodashGet(optionItem, 'status.text', ''); const statusClearAfterDate = lodashGet(optionItem, 'status.clearAfter', ''); const formattedDate = DateUtils.getStatusUntilDate(statusClearAfterDate); - const statusContent = formattedDate ? (statusText ? `${statusText} (${formattedDate})` : `(${formattedDate})`) : statusText; + const statusContent = formattedDate ? `${statusText ? `${statusText} ` : ''}(${formattedDate})` : statusText; const isStatusVisible = !!emojiCode && ReportUtils.isOneOnOneChat(ReportUtils.getReport(optionItem.reportID)); const isGroupChat = diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index ed53c9b53323..c47274fa5f94 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -206,7 +206,7 @@ function ReportActionItemSingle(props) { const hasEmojiStatus = !displayAllActors && status && status.emojiCode; const formattedDate = DateUtils.getStatusUntilDate(lodashGet(status, 'clearAfter')); const statusText = lodashGet(status, 'text', ''); - const statusTooltipText = formattedDate ? (statusText ? `${statusText} (${formattedDate})` : `(${formattedDate})`) : statusText; + const statusTooltipText = formattedDate ? `${statusText ? `${statusText} ` : ''}(${formattedDate})` : statusText; return (