From 14d4f47619be9377fa95319d40d7a14aa214aa50 Mon Sep 17 00:00:00 2001 From: Anant Bhasin Date: Sat, 20 Feb 2021 03:02:59 +0530 Subject: [PATCH 1/2] [FIX] Render markdown in Fields content --- app/containers/message/Reply.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/containers/message/Reply.js b/app/containers/message/Reply.js index 2502cb42c7..c8443d183e 100644 --- a/app/containers/message/Reply.js +++ b/app/containers/message/Reply.js @@ -111,16 +111,24 @@ const Description = React.memo(({ return true; }); -const Fields = React.memo(({ attachment, theme }) => { +const Fields = React.memo(({ attachment, theme, getCustomEmoji }) => { if (!attachment.fields) { return null; } + + const { baseUrl, user } = useContext(MessageContext); return ( {attachment.fields.map(field => ( {field.title} - {field.value} + ))} @@ -175,7 +183,11 @@ const Reply = React.memo(({ getCustomEmoji={getCustomEmoji} theme={theme} /> - + Date: Wed, 10 Mar 2021 20:18:11 +0530 Subject: [PATCH 2/2] Added stories --- .../__snapshots__/Storyshots.test.js.snap | 306 ++++++++++++++++-- storybook/stories/Message.js | 6 +- 2 files changed, 290 insertions(+), 22 deletions(-) diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 0eb72257c2..d8bff99e2b 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -39301,17 +39301,44 @@ exports[`Storyshots Message list message 1`] = ` Object { "backgroundColor": "transparent", "fontFamily": "System", - "fontSize": 14, + "fontSize": 16, "fontWeight": "400", "textAlign": "left", }, + undefined, Object { "color": "#2f343d", }, ] } > - Value 1 + + Value 1 + - Value 2 + + Value 2 + - Value 3 + + Value 3 + - Value 4 + + Value 4 + - Value 5 + + Value 5 + @@ -39541,7 +39676,7 @@ exports[`Storyshots Message list message 1`] = ` ] } > - Two short custom fields + Two short custom fields with markdown - Value 1 + + Value 1 + - Value 2 + + + Value 2 + + @@ -40191,17 +40402,44 @@ exports[`Storyshots Message list message 1`] = ` Object { "backgroundColor": "transparent", "fontFamily": "System", - "fontSize": 14, + "fontSize": 16, "fontWeight": "400", "textAlign": "left", }, + undefined, Object { "color": "#2f343d", }, ] } > - Value 1 + + Value 1 + - Value 2 + + Value 2 + diff --git a/storybook/stories/Message.js b/storybook/stories/Message.js index 7e8e06646b..36ed6b3fc5 100644 --- a/storybook/stories/Message.js +++ b/storybook/stories/Message.js @@ -706,7 +706,7 @@ export default ({ theme }) => { }]} /> - + { short: true }, { title: 'Field 2', - value: 'Value 2', + value: '[Value 2](https://google.com/)', short: true }] }, { @@ -734,7 +734,7 @@ export default ({ theme }) => { short: true }, { title: 'Field 2', - value: 'Value 2', + value: '**Value 2**', short: true }] }]}