From da937b0598ce3f4b4eead05c62f1f688de463c2d Mon Sep 17 00:00:00 2001 From: Harshil Sharma <18575143+harshilsharma63@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:44:11 +0530 Subject: [PATCH] Scheudled post show more (#29226) * Added show more to long draft adn scheduled post * Added show more to long draft adn scheduled post * Fixed layout * Updated snapshots --- .../__snapshots__/panel_body.test.tsx.snap | 998 ++++++++++-------- .../drafts/panel/panel_body.test.tsx | 6 + .../components/drafts/panel/panel_body.tsx | 67 +- 3 files changed, 600 insertions(+), 471 deletions(-) diff --git a/webapp/channels/src/components/drafts/panel/__snapshots__/panel_body.test.tsx.snap b/webapp/channels/src/components/drafts/panel/__snapshots__/panel_body.test.tsx.snap index 4158c8a1ee..026c6d632e 100644 --- a/webapp/channels/src/components/drafts/panel/__snapshots__/panel_body.test.tsx.snap +++ b/webapp/channels/src/components/drafts/panel/__snapshots__/panel_body.test.tsx.snap @@ -117,80 +117,109 @@ exports[`components/drafts/panel/panel_body should have called handleFormattedTe
-
-
- - display_name - -
-
- - -

- message -

-
-
-
-
+
+
+ + display_name + +
+
+ + +

+ message +

+
+
+
+
+
+ + + + @@ -314,80 +343,109 @@ exports[`components/drafts/panel/panel_body should match snapshot 1`] = `
-
-
- - display_name - -
-
- - -

- message -

-
-
-
-
+
+
+ + display_name + +
+
+ + +

+ message +

+
+
+
+
+
+ + + + @@ -517,142 +575,171 @@ exports[`components/drafts/panel/panel_body should match snapshot for priority 1
-
-
- - display_name - - -
- - - + display_name + + -
- - - - - - - - Important - - -
-
-
-
+ + +
+ + + + + + + + Important + + +
+
+
+ +
+
+
+
+
+ + +

+ message +

+
+
+
+
- - - -
- - -

- message -

-
-
-
- + + + + @@ -782,213 +869,242 @@ exports[`components/drafts/panel/panel_body should match snapshot for requested_
-
-
- - display_name - - -
-
- + display_name + + - } - placement="top" - trigger={ + +
+ +
+ + } + placement="top" + trigger={ + Array [ + "hover", + "focus", + ] + } + > + + } + placement="top" + trigger={ + Array [ + "hover", + "focus", + ] + } + > + + + + + + + + + + + Request acknowledgement + + +
+
+
+
+
+
+
+ + - - } - placement="top" - trigger={ - Array [ - "hover", - "focus", - ] - } +

- - - - - - - - - - - Request acknowledgement - - + message +

+
+
-
+
- - -
-
- - -

- message -

-
-
-
-
+ + + + diff --git a/webapp/channels/src/components/drafts/panel/panel_body.test.tsx b/webapp/channels/src/components/drafts/panel/panel_body.test.tsx index 210398f9ea..61a9aa9fcf 100644 --- a/webapp/channels/src/components/drafts/panel/panel_body.test.tsx +++ b/webapp/channels/src/components/drafts/panel/panel_body.test.tsx @@ -70,6 +70,12 @@ describe('components/drafts/panel/panel_body', () => { }, }, }, + views: { + rhs: { + isSidebarExpanded: false, + isSidebarOpen: false, + }, + }, }; it('should match snapshot', () => { diff --git a/webapp/channels/src/components/drafts/panel/panel_body.tsx b/webapp/channels/src/components/drafts/panel/panel_body.tsx index d2330f20bc..331cb426ea 100644 --- a/webapp/channels/src/components/drafts/panel/panel_body.tsx +++ b/webapp/channels/src/components/drafts/panel/panel_body.tsx @@ -12,6 +12,7 @@ import {getCurrentRelativeTeamUrl} from 'mattermost-redux/selectors/entities/tea import PriorityLabels from 'components/advanced_text_editor/priority_labels'; import FilePreview from 'components/file_preview'; import Markdown from 'components/markdown'; +import ShowMore from 'components/post_view/show_more'; import ProfilePicture from 'components/profile_picture'; import {imageURLForUser, handleFormattedTextClick} from 'utils/utils'; @@ -66,37 +67,43 @@ function PanelBody({ src={imageURLForUser(userId)} /> -
-
-
- {displayName} - {priority && ( - - )} +
+ +
+
+
+ {displayName} + {priority && ( + + )} +
+
+ +
+
-
- -
- {(fileInfos.length > 0 || uploadsInProgress?.length > 0) && ( - - )} -
+ + {(fileInfos.length > 0 || uploadsInProgress?.length > 0) && ( + + )}
);