From 8a779b3e5f1e936520b1643e76a4e3372d61a38d Mon Sep 17 00:00:00 2001
From: Matthew Birtch
Date: Mon, 18 Mar 2024 17:12:48 -0400
Subject: [PATCH] fixes from code review
---
.../keyboard_shortcuts_1_spec.js | 4 +-
.../ctrl_cmd_k_open_dm_with_mouse_spec.js | 4 +-
.../channels/messaging/group_message_spec.js | 4 +-
.../send_message_via_profile_popover_spec.js | 6 +-
.../multi_team_and_dm/gm_add_user_spec.js | 2 +-
.../add_members_button.tsx | 9 +--
.../channel_intro_message.test.tsx | 3 +-
.../channel_intro_message.tsx | 76 +++++++++----------
webapp/channels/src/i18n/en.json | 9 +--
9 files changed, 52 insertions(+), 65 deletions(-)
diff --git a/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/keyboard_shortcuts_1_spec.js b/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/keyboard_shortcuts_1_spec.js
index 61fb30d804..5b15720402 100644
--- a/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/keyboard_shortcuts_1_spec.js
+++ b/e2e-tests/cypress/tests/integration/channels/keyboard_shortcuts/keyboard_shortcuts_1_spec.js
@@ -59,13 +59,13 @@ describe('Keyboard Shortcuts', () => {
});
// # Verify that we are in the test channel
- cy.get('#channelIntro').contains('.channel-intro__title', `Beginning of ${testChannel.display_name}`).should('be.visible');
+ cy.get('#channelIntro').contains('.channel-intro__title', `${testChannel.display_name}`).should('be.visible');
// # Verify that the right channel is displayed in LHS
cy.uiGetLhsSection('CHANNELS').findByText(testChannel.display_name).should('be.visible');
// # Verify that the current user(sysadmin) created the channel
- cy.get('#channelIntro').contains('.channel-intro__content', `This is the start of the ${testChannel.display_name} channel, created by sysadmin`).should('be.visible');
+ cy.get('#channelIntro').contains('.channel-intro__created', `Public channel created by sysadmin`).should('be.visible');
});
});
diff --git a/e2e-tests/cypress/tests/integration/channels/messaging/ctrl_cmd_k_open_dm_with_mouse_spec.js b/e2e-tests/cypress/tests/integration/channels/messaging/ctrl_cmd_k_open_dm_with_mouse_spec.js
index 3a81ae9e84..e5aeeba87d 100644
--- a/e2e-tests/cypress/tests/integration/channels/messaging/ctrl_cmd_k_open_dm_with_mouse_spec.js
+++ b/e2e-tests/cypress/tests/integration/channels/messaging/ctrl_cmd_k_open_dm_with_mouse_spec.js
@@ -51,10 +51,10 @@ describe('Messaging', () => {
// # Verify that we are in a DM channel
cy.get('#channelIntro').should('be.visible').within(() => {
- cy.get('.channel-intro-profile').
+ cy.get('.channel-intro__title').
should('be.visible').
and('have.text', secondUser.username);
- cy.get('.channel-intro-text').
+ cy.get('.channel-intro__text').
should('be.visible').
and('contain', `This is the start of your direct message history with ${secondUser.username}.`).
and('contain', 'Direct messages and files shared here are not shown to people outside this area.');
diff --git a/e2e-tests/cypress/tests/integration/channels/messaging/group_message_spec.js b/e2e-tests/cypress/tests/integration/channels/messaging/group_message_spec.js
index 721bc985e4..d4d2f194a8 100644
--- a/e2e-tests/cypress/tests/integration/channels/messaging/group_message_spec.js
+++ b/e2e-tests/cypress/tests/integration/channels/messaging/group_message_spec.js
@@ -137,8 +137,8 @@ describe('Group Message', () => {
});
// * Assert that intro message includes the right copy
- const expectedChannelInfo = `This is the start of your group message history with ${sortedParticipants[0].username}, ${sortedParticipants[1].username}.Messages and files shared here are not shown to people outside this area.`;
- cy.get('#channelIntro p.channel-intro-text').first().should('contain', expectedChannelInfo);
+ const expectedChannelInfo = `This is the start of your group message history with these teammates.`;
+ cy.get('#channelIntro p.channel-intro__text').first().should('contain', expectedChannelInfo);
cy.get('#channelIntro .profile-icon').should('have.length', '2');
cy.location().then((loc) => {
diff --git a/e2e-tests/cypress/tests/integration/channels/messaging/send_message_via_profile_popover_spec.js b/e2e-tests/cypress/tests/integration/channels/messaging/send_message_via_profile_popover_spec.js
index b561cc107c..4c28b8e1e8 100644
--- a/e2e-tests/cypress/tests/integration/channels/messaging/send_message_via_profile_popover_spec.js
+++ b/e2e-tests/cypress/tests/integration/channels/messaging/send_message_via_profile_popover_spec.js
@@ -95,12 +95,12 @@ function verifyDMChannelViaSendMessage(postId, team, channel, profileSelector, u
// * Verify that it redirects into the DM channel and matches channel intro
cy.get('#channelIntro').should('be.visible').within(() => {
cy.url().should('include', `/${team.name}/messages/@${user.username}`);
- cy.get('.channel-intro-profile').
+ cy.get('.channel-intro__title').
should('be.visible').
and('have.text', user.username);
- cy.get('.channel-intro-text').
+ cy.get('.channel-intro__text').
should('be.visible').
and('contain', `This is the start of your direct message history with ${user.username}.`).
- and('contain', 'Direct messages and files shared here are not shown to people outside this area.');
+ and('contain', 'Messages and files shared here are not shown to anyone else.');
});
}
diff --git a/e2e-tests/cypress/tests/integration/channels/multi_team_and_dm/gm_add_user_spec.js b/e2e-tests/cypress/tests/integration/channels/multi_team_and_dm/gm_add_user_spec.js
index 5e92e3fe16..8cded03fa1 100644
--- a/e2e-tests/cypress/tests/integration/channels/multi_team_and_dm/gm_add_user_spec.js
+++ b/e2e-tests/cypress/tests/integration/channels/multi_team_and_dm/gm_add_user_spec.js
@@ -136,7 +136,7 @@ describe('Multi-user group messages', () => {
// * Original messages does not exist
cy.contains('.post-message__text', 'historical').should('not.exist');
- cy.contains('p.channel-intro-text span', 'This is the start of your group message history with');
+ cy.contains('p.channel-intro__text', 'This is the start of your group message history with');
// * New user is added to the GM
cy.get('.member-rhs__trigger').click();
diff --git a/webapp/channels/src/components/post_view/channel_intro_message/add_members_button.tsx b/webapp/channels/src/components/post_view/channel_intro_message/add_members_button.tsx
index a1e57ff2a5..bcd4e15583 100644
--- a/webapp/channels/src/components/post_view/channel_intro_message/add_members_button.tsx
+++ b/webapp/channels/src/components/post_view/channel_intro_message/add_members_button.tsx
@@ -118,17 +118,12 @@ const MoreThanMaxFreeUsers = ({channel, pluginButtons}: {channel: Channel; plugi
className='icon-account-plus-outline'
title={formatMessage({id: 'generic_icons.add', defaultMessage: 'Add Icon'})}
/>
- {isPrivate && channel.group_constrained &&
+ {channel.group_constrained &&
}
- {isPrivate && !channel.group_constrained &&
- }
- {!isPrivate &&
+ {!channel.group_constrained &&
{
expect(beginningHeading).toBeInTheDocument();
expect(beginningHeading).toHaveClass('channel-intro__title');
- expect(screen.getByText(`This is the start of the test channel channel, created by ${baseProps.creatorName} on October 17, 2017.`));
- expect(screen.getByText('Any member can join and read this channel.')).toBeInTheDocument();
+ expect(screen.getByText('This is the start of test channel. Any team member can join and read this channel.')).toBeInTheDocument();
});
});
diff --git a/webapp/channels/src/components/post_view/channel_intro_message/channel_intro_message.tsx b/webapp/channels/src/components/post_view/channel_intro_message/channel_intro_message.tsx
index cb9352777b..387a1a03f3 100644
--- a/webapp/channels/src/components/post_view/channel_intro_message/channel_intro_message.tsx
+++ b/webapp/channels/src/components/post_view/channel_intro_message/channel_intro_message.tsx
@@ -201,13 +201,13 @@ function createGMIntroMessage(
{channel.display_name}
-
+
{getGMIntroMessageSpecificPart(currentUserProfile, channelMembership)}
-
+
{actionButtons}
);
@@ -218,12 +218,12 @@ function createGMIntroMessage(
id={channelIntroId}
className={'channel-intro ' + centeredIntro}
>
-
+
);
}
@@ -278,7 +278,7 @@ function createDMIntroMessage(
disablePopover={false}
/>
-
+
{actionButtons}
);
@@ -297,12 +297,12 @@ function createDMIntroMessage(
id={channelIntroId}
className={'channel-intro ' + centeredIntro}
>
-
+
);
}
@@ -371,7 +371,7 @@ function createOffTopicIntroMessage(
{channel.display_name}
-
+
{actionButtons}
);
@@ -488,7 +488,7 @@ function createDefaultIntroMessage(
{channel.display_name}
-
+
{actionButtons}
);
@@ -538,14 +538,20 @@ function createStandardIntroMessage(
memberMessage = (
);
} else {
memberMessage = (
);
}
@@ -565,7 +571,7 @@ function createStandardIntroMessage(
createMessage = (
);
@@ -573,7 +579,7 @@ function createStandardIntroMessage(
createMessage = (
);
@@ -583,7 +589,7 @@ function createStandardIntroMessage(
-
-
- );
- } else if (channel.type === Constants.OPEN_CHANNEL) {
- purposeMessage = (
-
-
-
- );
- }
+ purposeMessage = (
+
+
+
+ );
}
const isPrivate = channel.type === Constants.PRIVATE_CHANNEL;
@@ -689,10 +683,10 @@ function createStandardIntroMessage(
{isPrivate ? : }
{createMessage}
-
+
{memberMessage}
{purposeMessage}
-
+
{actionButtons}
);
diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json
index 77c82e7319..674abc0456 100644
--- a/webapp/channels/src/i18n/en.json
+++ b/webapp/channels/src/i18n/en.json
@@ -3968,7 +3968,7 @@
"interactive_dialog.submit": "Submit",
"interactive_dialog.submitting": "Submitting...",
"intro_messages.addGroupsToTeam": "Add other groups to this team",
- "intro_messages.anyMember": " Any member can join and read this channel.",
+ "intro_messages.anyMember": "This is the start of {display_name}. Any team member can join and read this channel.",
"intro_messages.creator": "Public channel created by {creator} on {date}.",
"intro_messages.creatorPrivate": "Private channel created by {creator} on {date}.",
"intro_messages.default": "Welcome to {display_name}. Post messages here that you want everyone to see. Everyone automatically becomes a member of this channel when they join the team.",
@@ -3982,13 +3982,12 @@
"intro_messages.inviteMembersToChannel.button": "Add people",
"intro_messages.inviteOthers": "Invite others to this team",
"intro_messages.inviteOthersToWorkspace.button": "Invite others to the workspace",
- "intro_messages.noCreator": "This is the start of the {name} channel, created on {date}.",
- "intro_messages.noCreatorPrivate": "This is the start of the {name} private channel, created on {date}.",
+ "intro_messages.noCreator": "Public channel created on {date}.",
+ "intro_messages.noCreatorPrivate": "Private channel created on {date}.",
"intro_messages.notificationPreferences": "Notifications",
"intro_messages.offTopic": "This is the start of {display_name}, a channel for non-work-related conversations.",
- "intro_messages.onlyInvited": " Only invited members can see this private channel.",
+ "intro_messages.onlyInvited": "This is the start of {display_name}. Only invited members can see this private channel.",
"intro_messages.purpose": " This channel's purpose is: {purpose}",
- "intro_messages.purposePrivate": " This private channel's purpose is: {purpose}",
"intro_messages.readonly.default": "Welcome to {display_name}. Messages can only be posted by admins. Everyone automatically becomes a permanent member of this channel when they join the team.",
"intro_messages.setHeader": "Set header",
"intro_messages.teammate": "This is the start of your direct message history with this teammate. Messages and files shared here are not shown to anyone else.",