diff --git a/webapp/channels/src/components/add_groups_to_channel_modal/__snapshots__/add_groups_to_channel_modal.test.tsx.snap b/webapp/channels/src/components/add_groups_to_channel_modal/__snapshots__/add_groups_to_channel_modal.test.tsx.snap index 6db1132c5ea3..340ba8e7e1e3 100644 --- a/webapp/channels/src/components/add_groups_to_channel_modal/__snapshots__/add_groups_to_channel_modal.test.tsx.snap +++ b/webapp/channels/src/components/add_groups_to_channel_modal/__snapshots__/add_groups_to_channel_modal.test.tsx.snap @@ -157,13 +157,14 @@ exports[`components/AddGroupsToChannelModal should match when renderOption is ca
-
-
+
`; @@ -206,13 +207,14 @@ exports[`components/AddGroupsToChannelModal should match when renderOption is ca
-
-
+
`; @@ -255,13 +257,14 @@ exports[`components/AddGroupsToChannelModal should match when renderOption is ca
-
-
+
`; diff --git a/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx b/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx index 8383269c5a19..0d57931f46cb 100644 --- a/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx +++ b/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx @@ -216,9 +216,12 @@ export class AddGroupsToChannelModal extends React.PureComponent {
-
+
+
); diff --git a/webapp/channels/src/components/add_groups_to_team_modal/__snapshots__/add_groups_to_team_modal.test.tsx.snap b/webapp/channels/src/components/add_groups_to_team_modal/__snapshots__/add_groups_to_team_modal.test.tsx.snap index 239866a98869..4cc13d2c4318 100644 --- a/webapp/channels/src/components/add_groups_to_team_modal/__snapshots__/add_groups_to_team_modal.test.tsx.snap +++ b/webapp/channels/src/components/add_groups_to_team_modal/__snapshots__/add_groups_to_team_modal.test.tsx.snap @@ -196,13 +196,14 @@ exports[`components/AddGroupsToTeamModal should match when renderOption is calle
-
-
+
`; @@ -247,13 +248,14 @@ exports[`components/AddGroupsToTeamModal should match when renderOption is calle
-
-
+
`; diff --git a/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx b/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx index 82de21a55692..7e0f8de90473 100644 --- a/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx +++ b/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx @@ -223,9 +223,12 @@ export class AddGroupsToTeamModal extends React.PureComponent {
-
+
+
); diff --git a/webapp/channels/src/components/add_user_to_group_multiselect/multiselect_option/multiselect_option.tsx b/webapp/channels/src/components/add_user_to_group_multiselect/multiselect_option/multiselect_option.tsx index ceb6c98bc101..2e5e909ed1b0 100644 --- a/webapp/channels/src/components/add_user_to_group_multiselect/multiselect_option/multiselect_option.tsx +++ b/webapp/channels/src/components/add_user_to_group_multiselect/multiselect_option/multiselect_option.tsx @@ -56,11 +56,14 @@ const MultiSelectOption = React.forwardRef(({
-
+
+
); diff --git a/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx b/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx index cef90a33679b..52395437422e 100644 --- a/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx +++ b/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx @@ -135,11 +135,14 @@ export class AddUsersToTeamModal extends React.PureComponent {
-
+
+
); diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx index 8e3fbb6d1308..c8d47a6aa27c 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx @@ -137,11 +137,14 @@ export class AddUsersToRoleModal extends React.PureComponent {
-
+
+
); diff --git a/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.test.tsx b/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.test.tsx index b1bd8c064ccb..9868cecf5bbd 100644 --- a/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.test.tsx +++ b/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.test.tsx @@ -410,6 +410,6 @@ describe('components/avanced_text_editor/advanced_text_editor', () => { }), ); - expect(screen.getByTestId('editPostAtMentionWarning')).toBeVisible(); + expect(screen.getByText('Editing this message with an \'@mention\' will not notify the recipient.')).toBeVisible(); }); }); diff --git a/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx b/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx index 3d572815adfb..9701b8d9de56 100644 --- a/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx +++ b/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx @@ -6,7 +6,6 @@ import React, {lazy, useCallback, useEffect, useMemo, useRef, useState} from 're import {FormattedMessage, useIntl} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; -import {InformationOutlineIcon} from '@mattermost/compass-icons/components'; import type {ServerError} from '@mattermost/types/errors'; import type {SchedulingInfo} from '@mattermost/types/schedule_post'; @@ -66,6 +65,7 @@ import EditPostFooter from './edit_post_footer'; import Footer from './footer'; import FormattingBar from './formatting_bar'; import {FormattingBarSpacer, Separator} from './formatting_bar/formatting_bar'; +import MessageWithMentionsFooter from './message_with_mentions_footer'; import SendButton from './send_button'; import ShowFormat from './show_formatting'; import TexteditorActions from './texteditor_actions'; @@ -200,7 +200,6 @@ const AdvancedTextEditor = ({ const [isMessageLong, setIsMessageLong] = useState(false); const [renderScrollbar, setRenderScrollbar] = useState(false); const [keepEditorInFocus, setKeepEditorInFocus] = useState(false); - const [showMentionHelper, setShowMentionHelper] = useState(false); const readOnlyChannel = !canPost; const hasDraftMessage = Boolean(draft.message); @@ -217,15 +216,6 @@ const AdvancedTextEditor = ({ GlobalActions.emitLocalUserTypingEvent(channelId, postId); }, [channelId, postId]); - const handleShowMentionHelper = useCallback((message: string) => { - if (!isInEditMode) { - return; - } - - const isMentions = allAtMentions(message).length > 0; - setShowMentionHelper(isMentions); - }, [isInEditMode]); - const handleDraftChange = useCallback((draftToChange: PostDraft, options: {instant?: boolean; show?: boolean} = {instant: false, show: false}) => { if (saveDraftFrame.current) { clearTimeout(saveDraftFrame.current); @@ -564,11 +554,6 @@ const AdvancedTextEditor = ({ }; }, [channelId, postId]); - useEffect(() => { - // this checks for the mention helper for initial load of component. - handleShowMentionHelper(draft.message); - }, [draft.message, handleShowMentionHelper]); - const disableSendButton = Boolean(isDisabled || (!draft.message.trim().length && !draft.fileInfos.length)) || !isValidPersistentNotifications; const sendButton = readOnlyChannel || isInEditMode ? null : ( 0; + return (
- { showMentionHelper ? ( -
- - - - { - formatMessage({ - id: 'edit_post.no_notification_trigger_on_mention', - defaultMessage: "Editing this message with an '@mention' will not notify the recipient.", - }) - } -
) : null - } - {isInEditMode && ( - + {isInEditMode && containsAtMentionsInMessage && ( + )}