mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-52529: remove defunct 'all teams' fallback text & tooltip (#23216)
This commit is contained in:
@@ -95,7 +95,6 @@
|
||||
"9M92On": "Select channels",
|
||||
"9Obw6C": "Filter",
|
||||
"9PXW6Q": "Duration / Started on",
|
||||
"9S+ZiL": "No team is selected",
|
||||
"9SIW2x": "Target value for each run",
|
||||
"9TTfXU": "Your System Admin has been notified.",
|
||||
"9X3jwi": "{icon} Cost",
|
||||
@@ -143,7 +142,6 @@
|
||||
"DXACD6": "Publish retrospective report and access the timeline",
|
||||
"DaHpK1": "Search for a channel",
|
||||
"DnBhRg": "Add People",
|
||||
"DoskyC": "All Teams",
|
||||
"DqTQOp": "Once",
|
||||
"DtCplA": "{numParticipants, plural, =1 {<b>#</b> participant} other {<b>#</b> participants}}",
|
||||
"EQpfkS": "Finished",
|
||||
|
||||
@@ -4,11 +4,9 @@ import {getTeam} from 'mattermost-redux/selectors/entities/teams';
|
||||
import {GlobalState} from '@mattermost/types/store';
|
||||
import {useSelector} from 'react-redux';
|
||||
import {Team} from '@mattermost/types/teams';
|
||||
import {OverlayTrigger, Tooltip} from 'react-bootstrap';
|
||||
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';
|
||||
|
||||
@@ -39,30 +37,32 @@ interface SidebarProps {
|
||||
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 team = useSelector(teamNameSelector(props.team_id));
|
||||
const team = useSelector(selectTeam(props.team_id));
|
||||
|
||||
const {formatMessage} = useIntl();
|
||||
const teamName = (
|
||||
<TeamName>
|
||||
{team?.display_name}
|
||||
</TeamName>
|
||||
);
|
||||
|
||||
return (
|
||||
<SidebarComponent>
|
||||
<Header>
|
||||
<OverlayTrigger
|
||||
placement='bottom'
|
||||
delay={OVERLAY_DELAY}
|
||||
shouldUpdatePosition={true}
|
||||
overlay={
|
||||
<Tooltip id='team-name__tooltip'>
|
||||
{team?.description?.length ? team.description : formatMessage({defaultMessage: 'No team is selected'})}
|
||||
</Tooltip>
|
||||
}
|
||||
>
|
||||
<TeamName>
|
||||
{team?.display_name?.length ? team.display_name : formatMessage({defaultMessage: 'All Teams'})}
|
||||
</TeamName>
|
||||
</OverlayTrigger>
|
||||
{team?.description ? (
|
||||
<Tooltip
|
||||
id='team-name__tooltip'
|
||||
content={team?.description}
|
||||
placement='bottom'
|
||||
shouldUpdatePosition={true}
|
||||
>
|
||||
{teamName}
|
||||
</Tooltip>
|
||||
) : (
|
||||
teamName
|
||||
)}
|
||||
{props.headerDropdown}
|
||||
</Header>
|
||||
<Scrollbars
|
||||
|
||||
Reference in New Issue
Block a user