[MM-59905] Migrate tooltips of 'components/threading/channel_threads/thread_footer/thread_footer.tsx' to WithTooltip (#27802)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5f8f1f8142
Коммит
24ae4a6d9e
@@ -796,8 +796,10 @@ exports[`components/threading/channel_threads/thread_footer should show unread i
|
|||||||
<div
|
<div
|
||||||
className="ThreadFooter"
|
className="ThreadFooter"
|
||||||
>
|
>
|
||||||
<SimpleTooltip
|
<WithTooltip
|
||||||
content={
|
id="threadFooterIndicator"
|
||||||
|
placement="top"
|
||||||
|
title={
|
||||||
<Memo(MemoizedFormattedMessage)
|
<Memo(MemoizedFormattedMessage)
|
||||||
defaultMessage="{newReplies, plural, =0 {no unread messages} =1 {one unread message} other {# unread messages}}"
|
defaultMessage="{newReplies, plural, =0 {no unread messages} =1 {one unread message} other {# unread messages}}"
|
||||||
id="threading.numNewMessages"
|
id="threading.numNewMessages"
|
||||||
@@ -808,28 +810,12 @@ exports[`components/threading/channel_threads/thread_footer should show unread i
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
id="threadFooterIndicator"
|
|
||||||
>
|
>
|
||||||
<OverlayTrigger
|
<OverlayTrigger
|
||||||
defaultOverlayShown={false}
|
defaultOverlayShown={false}
|
||||||
delayShow={100}
|
delay={400}
|
||||||
overlay={
|
disabled={false}
|
||||||
<Tooltip
|
overlay={<Unknown />}
|
||||||
className="hidden-xs"
|
|
||||||
id="threadFooterIndicator"
|
|
||||||
placement="top"
|
|
||||||
>
|
|
||||||
<Memo(MemoizedFormattedMessage)
|
|
||||||
defaultMessage="{newReplies, plural, =0 {no unread messages} =1 {one unread message} other {# unread messages}}"
|
|
||||||
id="threading.numNewMessages"
|
|
||||||
values={
|
|
||||||
Object {
|
|
||||||
"newReplies": 2,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
}
|
|
||||||
placement="top"
|
placement="top"
|
||||||
trigger={
|
trigger={
|
||||||
Array [
|
Array [
|
||||||
@@ -840,11 +826,9 @@ exports[`components/threading/channel_threads/thread_footer should show unread i
|
|||||||
>
|
>
|
||||||
<OverlayTrigger
|
<OverlayTrigger
|
||||||
defaultOverlayShown={false}
|
defaultOverlayShown={false}
|
||||||
delayShow={100}
|
delay={400}
|
||||||
overlay={
|
overlay={
|
||||||
<OverlayWrapper
|
<OverlayWrapper
|
||||||
className="hidden-xs"
|
|
||||||
id="threadFooterIndicator"
|
|
||||||
intl={
|
intl={
|
||||||
Object {
|
Object {
|
||||||
"$t": [Function],
|
"$t": [Function],
|
||||||
@@ -884,18 +868,7 @@ exports[`components/threading/channel_threads/thread_footer should show unread i
|
|||||||
"wrapRichTextChunksInFragment": undefined,
|
"wrapRichTextChunksInFragment": undefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
placement="top"
|
|
||||||
>
|
|
||||||
<Memo(MemoizedFormattedMessage)
|
|
||||||
defaultMessage="{newReplies, plural, =0 {no unread messages} =1 {one unread message} other {# unread messages}}"
|
|
||||||
id="threading.numNewMessages"
|
|
||||||
values={
|
|
||||||
Object {
|
|
||||||
"newReplies": 2,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</OverlayWrapper>
|
|
||||||
}
|
}
|
||||||
placement="top"
|
placement="top"
|
||||||
trigger={
|
trigger={
|
||||||
@@ -920,7 +893,7 @@ exports[`components/threading/channel_threads/thread_footer should show unread i
|
|||||||
</div>
|
</div>
|
||||||
</OverlayTrigger>
|
</OverlayTrigger>
|
||||||
</OverlayTrigger>
|
</OverlayTrigger>
|
||||||
</SimpleTooltip>
|
</WithTooltip>
|
||||||
<Memo(Avatars)
|
<Memo(Avatars)
|
||||||
size="sm"
|
size="sm"
|
||||||
userIds={
|
userIds={
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import type {ComponentProps} from 'react';
|
|||||||
import type {UserThread} from '@mattermost/types/threads';
|
import type {UserThread} from '@mattermost/types/threads';
|
||||||
|
|
||||||
import Timestamp from 'components/timestamp';
|
import Timestamp from 'components/timestamp';
|
||||||
import SimpleTooltip from 'components/widgets/simple_tooltip';
|
|
||||||
import Avatars from 'components/widgets/users/avatars';
|
import Avatars from 'components/widgets/users/avatars';
|
||||||
|
import WithTooltip from 'components/with_tooltip';
|
||||||
|
|
||||||
import {fakeDate} from 'tests/helpers/date';
|
import {fakeDate} from 'tests/helpers/date';
|
||||||
import {mockStore} from 'tests/test_store';
|
import {mockStore} from 'tests/test_store';
|
||||||
@@ -161,7 +161,7 @@ describe('components/threading/channel_threads/thread_footer', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
expect(wrapper.find(SimpleTooltip).find('.dot-unreads').exists()).toBe(true);
|
expect(wrapper.find(WithTooltip).find('.dot-unreads').exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should not show unread indicator if not following', () => {
|
test('should not show unread indicator if not following', () => {
|
||||||
@@ -176,7 +176,7 @@ describe('components/threading/channel_threads/thread_footer', () => {
|
|||||||
mountOptions,
|
mountOptions,
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(wrapper.find(SimpleTooltip).find('.dot-unreads').exists()).toBe(false);
|
expect(wrapper.find(WithTooltip).find('.dot-unreads').exists()).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should have avatars', () => {
|
test('should have avatars', () => {
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import Button from 'components/threading/common/button';
|
|||||||
import FollowButton from 'components/threading/common/follow_button';
|
import FollowButton from 'components/threading/common/follow_button';
|
||||||
import {THREADING_TIME} from 'components/threading/common/options';
|
import {THREADING_TIME} from 'components/threading/common/options';
|
||||||
import Timestamp from 'components/timestamp';
|
import Timestamp from 'components/timestamp';
|
||||||
import SimpleTooltip from 'components/widgets/simple_tooltip';
|
|
||||||
import Avatars from 'components/widgets/users/avatars';
|
import Avatars from 'components/widgets/users/avatars';
|
||||||
|
import WithTooltip from 'components/with_tooltip';
|
||||||
|
|
||||||
import type {GlobalState} from 'types/store';
|
import type {GlobalState} from 'types/store';
|
||||||
|
|
||||||
@@ -84,9 +84,10 @@ function ThreadFooter({
|
|||||||
{!isFollowing || threadIsSynthetic(thread) || !thread.unread_replies ? (
|
{!isFollowing || threadIsSynthetic(thread) || !thread.unread_replies ? (
|
||||||
<div className='indicator'/>
|
<div className='indicator'/>
|
||||||
) : (
|
) : (
|
||||||
<SimpleTooltip
|
<WithTooltip
|
||||||
id='threadFooterIndicator'
|
id='threadFooterIndicator'
|
||||||
content={
|
placement='top'
|
||||||
|
title={
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='threading.numNewMessages'
|
id='threading.numNewMessages'
|
||||||
defaultMessage='{newReplies, plural, =0 {no unread messages} =1 {one unread message} other {# unread messages}}'
|
defaultMessage='{newReplies, plural, =0 {no unread messages} =1 {one unread message} other {# unread messages}}'
|
||||||
@@ -100,7 +101,7 @@ function ThreadFooter({
|
|||||||
>
|
>
|
||||||
<div className='dot-unreads'/>
|
<div className='dot-unreads'/>
|
||||||
</div>
|
</div>
|
||||||
</SimpleTooltip>
|
</WithTooltip>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{participantIds && participantIds.length > 0 ? (
|
{participantIds && participantIds.length > 0 ? (
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user