MM-52529: remove defunct 'all teams' fallback text & tooltip (#23216)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f77501ec10
Коммит
f9f4553dae
@@ -95,7 +95,6 @@
|
|||||||
"9M92On": "Select channels",
|
"9M92On": "Select channels",
|
||||||
"9Obw6C": "Filter",
|
"9Obw6C": "Filter",
|
||||||
"9PXW6Q": "Duration / Started on",
|
"9PXW6Q": "Duration / Started on",
|
||||||
"9S+ZiL": "No team is selected",
|
|
||||||
"9SIW2x": "Target value for each run",
|
"9SIW2x": "Target value for each run",
|
||||||
"9TTfXU": "Your System Admin has been notified.",
|
"9TTfXU": "Your System Admin has been notified.",
|
||||||
"9X3jwi": "{icon} Cost",
|
"9X3jwi": "{icon} Cost",
|
||||||
@@ -143,7 +142,6 @@
|
|||||||
"DXACD6": "Publish retrospective report and access the timeline",
|
"DXACD6": "Publish retrospective report and access the timeline",
|
||||||
"DaHpK1": "Search for a channel",
|
"DaHpK1": "Search for a channel",
|
||||||
"DnBhRg": "Add People",
|
"DnBhRg": "Add People",
|
||||||
"DoskyC": "All Teams",
|
|
||||||
"DqTQOp": "Once",
|
"DqTQOp": "Once",
|
||||||
"DtCplA": "{numParticipants, plural, =1 {<b>#</b> participant} other {<b>#</b> participants}}",
|
"DtCplA": "{numParticipants, plural, =1 {<b>#</b> participant} other {<b>#</b> participants}}",
|
||||||
"EQpfkS": "Finished",
|
"EQpfkS": "Finished",
|
||||||
|
|||||||
@@ -4,11 +4,9 @@ import {getTeam} from 'mattermost-redux/selectors/entities/teams';
|
|||||||
import {GlobalState} from '@mattermost/types/store';
|
import {GlobalState} from '@mattermost/types/store';
|
||||||
import {useSelector} from 'react-redux';
|
import {useSelector} from 'react-redux';
|
||||||
import {Team} from '@mattermost/types/teams';
|
import {Team} from '@mattermost/types/teams';
|
||||||
import {OverlayTrigger, Tooltip} from 'react-bootstrap';
|
|
||||||
import Scrollbars from 'react-custom-scrollbars';
|
import Scrollbars from 'react-custom-scrollbars';
|
||||||
import {useIntl} from 'react-intl';
|
|
||||||
|
|
||||||
import {OVERLAY_DELAY} from 'src/constants';
|
import Tooltip from 'src/components/widgets/tooltip';
|
||||||
|
|
||||||
import {renderThumbVertical, renderTrackHorizontal, renderView} from 'src/components/rhs/rhs_shared';
|
import {renderThumbVertical, renderTrackHorizontal, renderView} from 'src/components/rhs/rhs_shared';
|
||||||
|
|
||||||
@@ -39,30 +37,32 @@ interface SidebarProps {
|
|||||||
headerDropdown: React.ReactNode;
|
headerDropdown: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const teamNameSelector = (teamId: string) => (state: GlobalState): Team => getTeam(state, teamId);
|
const selectTeam = (teamId: string) => (state: GlobalState): Team => getTeam(state, teamId);
|
||||||
|
|
||||||
const Sidebar = (props: SidebarProps) => {
|
const Sidebar = (props: SidebarProps) => {
|
||||||
const team = useSelector(teamNameSelector(props.team_id));
|
const team = useSelector(selectTeam(props.team_id));
|
||||||
|
|
||||||
const {formatMessage} = useIntl();
|
const teamName = (
|
||||||
|
<TeamName>
|
||||||
|
{team?.display_name}
|
||||||
|
</TeamName>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidebarComponent>
|
<SidebarComponent>
|
||||||
<Header>
|
<Header>
|
||||||
<OverlayTrigger
|
{team?.description ? (
|
||||||
placement='bottom'
|
<Tooltip
|
||||||
delay={OVERLAY_DELAY}
|
id='team-name__tooltip'
|
||||||
shouldUpdatePosition={true}
|
content={team?.description}
|
||||||
overlay={
|
placement='bottom'
|
||||||
<Tooltip id='team-name__tooltip'>
|
shouldUpdatePosition={true}
|
||||||
{team?.description?.length ? team.description : formatMessage({defaultMessage: 'No team is selected'})}
|
>
|
||||||
</Tooltip>
|
{teamName}
|
||||||
}
|
</Tooltip>
|
||||||
>
|
) : (
|
||||||
<TeamName>
|
teamName
|
||||||
{team?.display_name?.length ? team.display_name : formatMessage({defaultMessage: 'All Teams'})}
|
)}
|
||||||
</TeamName>
|
|
||||||
</OverlayTrigger>
|
|
||||||
{props.headerDropdown}
|
{props.headerDropdown}
|
||||||
</Header>
|
</Header>
|
||||||
<Scrollbars
|
<Scrollbars
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user