Update text for activated users in team statistics (#25921)
* Update text for activated users in team statistics * Fix lint * Generalize tooltip and make it show according to the designs * Fix lint * Fix test * Generalize even more overlay trigger * Update snapshot * Update link
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7833dd2c1c
Коммит
f8dbb2e168
@@ -565,104 +565,26 @@ exports[`admin_console/team_channel_settings/team/TeamProfile__Cloud should matc
|
||||
<div
|
||||
className="AdminChannelDetails_archiveContainer"
|
||||
>
|
||||
<OverlayTrigger
|
||||
defaultOverlayShown={false}
|
||||
delay={400}
|
||||
disabled={false}
|
||||
overlay={
|
||||
<Tooltip
|
||||
id="sharedTooltip"
|
||||
>
|
||||
<div
|
||||
className="tooltip-title"
|
||||
>
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="Upgrade to Unarchive"
|
||||
id="workspace_limits.teams_limit_reached.upgrade_to_unarchive"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="tooltip-body"
|
||||
>
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="You've reached the team limit for your current plan. Consider upgrading to unarchive this team or archive your other teams"
|
||||
id="workspace_limits.teams_limit_reached.tool_tip"
|
||||
/>
|
||||
</div>
|
||||
</Tooltip>
|
||||
<WithTooltip
|
||||
hint={
|
||||
Object {
|
||||
"defaultMessage": "You've reached the team limit for your current plan. Consider upgrading to unarchive this team or archive your other teams",
|
||||
"id": "workspace_limits.teams_limit_reached.tool_tip",
|
||||
}
|
||||
}
|
||||
id="sharedTooltip"
|
||||
placement="bottom"
|
||||
trigger={
|
||||
Array [
|
||||
"hover",
|
||||
"focus",
|
||||
]
|
||||
title={
|
||||
Object {
|
||||
"defaultMessage": "Upgrade to Unarchive",
|
||||
"id": "workspace_limits.teams_limit_reached.upgrade_to_unarchive",
|
||||
}
|
||||
}
|
||||
>
|
||||
<OverlayTrigger
|
||||
defaultOverlayShown={false}
|
||||
delay={400}
|
||||
overlay={
|
||||
<OverlayWrapper
|
||||
id="sharedTooltip"
|
||||
intl={
|
||||
Object {
|
||||
"$t": [Function],
|
||||
"defaultFormats": Object {},
|
||||
"defaultLocale": "en",
|
||||
"defaultRichTextElements": undefined,
|
||||
"fallbackOnEmptyString": true,
|
||||
"formatDate": [Function],
|
||||
"formatDateTimeRange": [Function],
|
||||
"formatDateToParts": [Function],
|
||||
"formatDisplayName": [Function],
|
||||
"formatList": [Function],
|
||||
"formatListToParts": [Function],
|
||||
"formatMessage": [Function],
|
||||
"formatNumber": [Function],
|
||||
"formatNumberToParts": [Function],
|
||||
"formatPlural": [Function],
|
||||
"formatRelativeTime": [Function],
|
||||
"formatTime": [Function],
|
||||
"formatTimeToParts": [Function],
|
||||
"formats": Object {},
|
||||
"formatters": Object {
|
||||
"getDateTimeFormat": [Function],
|
||||
"getDisplayNames": [Function],
|
||||
"getListFormat": [Function],
|
||||
"getMessageFormat": [Function],
|
||||
"getNumberFormat": [Function],
|
||||
"getPluralRules": [Function],
|
||||
"getRelativeTimeFormat": [Function],
|
||||
},
|
||||
"locale": "en",
|
||||
"messages": Object {},
|
||||
"onError": [Function],
|
||||
"onWarn": [Function],
|
||||
"textComponent": "span",
|
||||
"timeZone": "Etc/UTC",
|
||||
"wrapRichTextChunksInFragment": undefined,
|
||||
}
|
||||
}
|
||||
>
|
||||
<div
|
||||
className="tooltip-title"
|
||||
>
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="Upgrade to Unarchive"
|
||||
id="workspace_limits.teams_limit_reached.upgrade_to_unarchive"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="tooltip-body"
|
||||
>
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="You've reached the team limit for your current plan. Consider upgrading to unarchive this team or archive your other teams"
|
||||
id="workspace_limits.teams_limit_reached.tool_tip"
|
||||
/>
|
||||
</div>
|
||||
</OverlayWrapper>
|
||||
}
|
||||
overlay={<Unknown />}
|
||||
placement="bottom"
|
||||
trigger={
|
||||
Array [
|
||||
@@ -671,40 +593,95 @@ exports[`admin_console/team_channel_settings/team/TeamProfile__Cloud should matc
|
||||
]
|
||||
}
|
||||
>
|
||||
<div
|
||||
className="disabled-overlay-wrapper"
|
||||
onBlur={[Function]}
|
||||
onClick={null}
|
||||
onFocus={[Function]}
|
||||
onMouseOut={[Function]}
|
||||
onMouseOver={[Function]}
|
||||
>
|
||||
<button
|
||||
className="btn btn-danger ArchiveButton ArchiveButton___archived cloud-limits-disabled"
|
||||
disabled={true}
|
||||
onClick={[Function]}
|
||||
style={
|
||||
Object {
|
||||
"pointerEvents": "none",
|
||||
<OverlayTrigger
|
||||
defaultOverlayShown={false}
|
||||
delay={400}
|
||||
overlay={
|
||||
<OverlayWrapper
|
||||
intl={
|
||||
Object {
|
||||
"$t": [Function],
|
||||
"defaultFormats": Object {},
|
||||
"defaultLocale": "en",
|
||||
"defaultRichTextElements": undefined,
|
||||
"fallbackOnEmptyString": true,
|
||||
"formatDate": [Function],
|
||||
"formatDateTimeRange": [Function],
|
||||
"formatDateToParts": [Function],
|
||||
"formatDisplayName": [Function],
|
||||
"formatList": [Function],
|
||||
"formatListToParts": [Function],
|
||||
"formatMessage": [Function],
|
||||
"formatNumber": [Function],
|
||||
"formatNumberToParts": [Function],
|
||||
"formatPlural": [Function],
|
||||
"formatRelativeTime": [Function],
|
||||
"formatTime": [Function],
|
||||
"formatTimeToParts": [Function],
|
||||
"formats": Object {},
|
||||
"formatters": Object {
|
||||
"getDateTimeFormat": [Function],
|
||||
"getDisplayNames": [Function],
|
||||
"getListFormat": [Function],
|
||||
"getMessageFormat": [Function],
|
||||
"getNumberFormat": [Function],
|
||||
"getPluralRules": [Function],
|
||||
"getRelativeTimeFormat": [Function],
|
||||
},
|
||||
"locale": "en",
|
||||
"messages": Object {},
|
||||
"onError": [Function],
|
||||
"onWarn": [Function],
|
||||
"textComponent": "span",
|
||||
"timeZone": "Etc/UTC",
|
||||
"wrapRichTextChunksInFragment": undefined,
|
||||
}
|
||||
}
|
||||
}
|
||||
type="button"
|
||||
>
|
||||
<i
|
||||
className="icon icon-archive-arrow-up-outline"
|
||||
/>
|
||||
<FormattedMessage
|
||||
defaultMessage="Unarchive Team"
|
||||
id="admin.team_settings.team_details.unarchiveTeam"
|
||||
}
|
||||
placement="bottom"
|
||||
trigger={
|
||||
Array [
|
||||
"hover",
|
||||
"focus",
|
||||
]
|
||||
}
|
||||
>
|
||||
<div
|
||||
className="disabled-overlay-wrapper"
|
||||
onBlur={[Function]}
|
||||
onClick={null}
|
||||
onFocus={[Function]}
|
||||
onMouseOut={[Function]}
|
||||
onMouseOver={[Function]}
|
||||
>
|
||||
<button
|
||||
className="btn btn-danger ArchiveButton ArchiveButton___archived cloud-limits-disabled"
|
||||
disabled={true}
|
||||
onClick={[Function]}
|
||||
style={
|
||||
Object {
|
||||
"pointerEvents": "none",
|
||||
}
|
||||
}
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Unarchive Team
|
||||
</span>
|
||||
</FormattedMessage>
|
||||
</button>
|
||||
</div>
|
||||
<i
|
||||
className="icon icon-archive-arrow-up-outline"
|
||||
/>
|
||||
<FormattedMessage
|
||||
defaultMessage="Unarchive Team"
|
||||
id="admin.team_settings.team_details.unarchiveTeam"
|
||||
>
|
||||
<span>
|
||||
Unarchive Team
|
||||
</span>
|
||||
</FormattedMessage>
|
||||
</button>
|
||||
</div>
|
||||
</OverlayTrigger>
|
||||
</OverlayTrigger>
|
||||
</OverlayTrigger>
|
||||
</WithTooltip>
|
||||
<button
|
||||
className="btn btn-secondary upgrade-options-button"
|
||||
onClick={[Function]}
|
||||
|
||||
@@ -16,13 +16,3 @@
|
||||
display: inline-block;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.tooltip-title {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tooltip-body {
|
||||
font-weight: normal;
|
||||
opacity: 56%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -16,11 +16,10 @@ import {openModal} from 'actions/views/modals';
|
||||
import useGetUsage from 'components/common/hooks/useGetUsage';
|
||||
import useGetUsageDeltas from 'components/common/hooks/useGetUsageDeltas';
|
||||
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
|
||||
import OverlayTrigger from 'components/overlay_trigger';
|
||||
import PricingModal from 'components/pricing_modal';
|
||||
import Tooltip from 'components/tooltip';
|
||||
import AdminPanel from 'components/widgets/admin_console/admin_panel';
|
||||
import TeamIcon from 'components/widgets/team_icon/team_icon';
|
||||
import WithTooltip from 'components/with_tooltip';
|
||||
|
||||
import {ModalIdentifiers} from 'utils/constants';
|
||||
import {imageURLForTeam} from 'utils/utils';
|
||||
@@ -66,26 +65,11 @@ export function TeamProfile({team, isArchived, onToggleArchive, isDisabled, save
|
||||
const button = () => {
|
||||
if (restoreDisabled) {
|
||||
return (
|
||||
<OverlayTrigger
|
||||
delay={400}
|
||||
<WithTooltip
|
||||
id='sharedTooltip'
|
||||
title={defineMessage({id: 'workspace_limits.teams_limit_reached.upgrade_to_unarchive', defaultMessage: 'Upgrade to Unarchive'})}
|
||||
hint={defineMessage({id: 'workspace_limits.teams_limit_reached.tool_tip', defaultMessage: 'You\'ve reached the team limit for your current plan. Consider upgrading to unarchive this team or archive your other teams'})}
|
||||
placement='bottom'
|
||||
disabled={!restoreDisabled}
|
||||
overlay={
|
||||
<Tooltip id='sharedTooltip'>
|
||||
<div className={'tooltip-title'}>
|
||||
<FormattedMessage
|
||||
id={'workspace_limits.teams_limit_reached.upgrade_to_unarchive'}
|
||||
defaultMessage={'Upgrade to Unarchive'}
|
||||
/>
|
||||
</div>
|
||||
<div className={'tooltip-body'}>
|
||||
<FormattedMessage
|
||||
id={'workspace_limits.teams_limit_reached.tool_tip'}
|
||||
defaultMessage={'You\'ve reached the team limit for your current plan. Consider upgrading to unarchive this team or archive your other teams'}
|
||||
/>
|
||||
</div>
|
||||
</Tooltip>
|
||||
}
|
||||
>
|
||||
{/* OverlayTrigger doesn't play nicely with `disabled` buttons, because the :hover events don't fire. This is a workaround to ensure the popover appears see: https://github.com/react-bootstrap/react-bootstrap/issues/1588*/}
|
||||
<div
|
||||
@@ -116,8 +100,7 @@ export function TeamProfile({team, isArchived, onToggleArchive, isDisabled, save
|
||||
<FormattedMessage {...archiveBtn}/>
|
||||
</button>
|
||||
</div>
|
||||
</OverlayTrigger>
|
||||
|
||||
</WithTooltip>
|
||||
);
|
||||
}
|
||||
return (
|
||||
|
||||
Ссылка в новой задаче
Block a user