From a66d94553980d0137daccb70714533d7b3b15b66 Mon Sep 17 00:00:00 2001 From: Anant Bhasin Date: Fri, 19 Feb 2021 19:30:14 +0530 Subject: [PATCH 1/3] Remove time if no message_link --- app/containers/message/Reply.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/containers/message/Reply.js b/app/containers/message/Reply.js index 2502cb42c7..fd040397cf 100644 --- a/app/containers/message/Reply.js +++ b/app/containers/message/Reply.js @@ -72,7 +72,7 @@ const Title = React.memo(({ attachment, timeFormat, theme }) => { if (!attachment.author_name) { return null; } - const time = attachment.ts ? moment(attachment.ts).format(timeFormat) : null; + const time = attachment.message_link && attachment.ts ? moment(attachment.ts).format(timeFormat) : null; return ( {attachment.author_name ? {attachment.author_name} : null} From da3b63722e1bc215450fb58358b66811f381e261 Mon Sep 17 00:00:00 2001 From: Anant Bhasin Date: Wed, 24 Feb 2021 03:17:32 +0530 Subject: [PATCH 2/3] Fix message stories for replies --- storybook/stories/Message.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/storybook/stories/Message.js b/storybook/stories/Message.js index e2f67a469a..40d33403ed 100644 --- a/storybook/stories/Message.js +++ b/storybook/stories/Message.js @@ -426,7 +426,8 @@ export default ({ theme }) => { author_name: 'I\'m a very long long title and I\'ll break', ts: date, timeFormat: 'LT', - text: 'How are you?' + text: 'How are you?', + message_link: 'http:///example.com' }]} /> { author_name: 'rocket.cat', ts: date, timeFormat: 'LT', - text: 'How are you? :nyan_rocket:' + text: 'How are you? :nyan_rocket:', + message_link: 'http:///example.com' }]} /> @@ -714,6 +716,7 @@ export default ({ theme }) => { ts: date, timeFormat: 'LT', text: 'Custom fields', + message_link: 'http:///example.com', fields: [{ title: 'Field 1', value: 'Value 1', @@ -728,6 +731,7 @@ export default ({ theme }) => { ts: date, timeFormat: 'LT', text: 'Custom fields 2', + message_link: 'http:///example.com', fields: [{ title: 'Field 1', value: 'Value 1', @@ -774,6 +778,7 @@ export default ({ theme }) => { author_name: 'rocket.cat', ts: date, timeFormat: 'LT', + message_link: 'http:///example.com', text: 'First message' }]} /> From 5e25a24113642e2d34ae71ee688d4b89e0179b67 Mon Sep 17 00:00:00 2001 From: Anant Bhasin Date: Wed, 24 Feb 2021 17:52:13 +0530 Subject: [PATCH 3/3] Final stories fix --- storybook/stories/Message.js | 1 + 1 file changed, 1 insertion(+) diff --git a/storybook/stories/Message.js b/storybook/stories/Message.js index 40d33403ed..5877274e5b 100644 --- a/storybook/stories/Message.js +++ b/storybook/stories/Message.js @@ -689,6 +689,7 @@ export default ({ theme }) => { ts: date, timeFormat: 'LT', text: 'Custom fields', + message_link: 'http:///example.com', fields: [{ title: 'Field 1', value: 'Value 1'