Random fixes (#5145)
* Fix OVERLAY_TIME_DELAY in sidebar_header * Fix webhook channel selection by adding a filter
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
784d85f46d
Коммит
b064457c74
@@ -31,12 +31,13 @@ export default class ChannelSelect extends React.Component {
|
|||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.handleChannelChange = this.handleChannelChange.bind(this);
|
this.handleChannelChange = this.handleChannelChange.bind(this);
|
||||||
|
this.filterChannels = this.filterChannels.bind(this);
|
||||||
this.compareByDisplayName = this.compareByDisplayName.bind(this);
|
this.compareByDisplayName = this.compareByDisplayName.bind(this);
|
||||||
|
|
||||||
AsyncClient.getMoreChannels(true);
|
AsyncClient.getMoreChannels(true);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
channels: ChannelStore.getAll().sort(this.compareByDisplayName)
|
channels: ChannelStore.getAll().filter(this.filterChannels).sort(this.compareByDisplayName)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,10 +51,19 @@ export default class ChannelSelect extends React.Component {
|
|||||||
|
|
||||||
handleChannelChange() {
|
handleChannelChange() {
|
||||||
this.setState({
|
this.setState({
|
||||||
channels: ChannelStore.getAll().concat(ChannelStore.getMoreAll()).sort(this.compareByDisplayName)
|
channels: ChannelStore.getAll().concat(ChannelStore.getMoreAll()).
|
||||||
|
filter(this.filterChannels).sort(this.compareByDisplayName)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filterChannels(channel) {
|
||||||
|
if (channel.display_name) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
compareByDisplayName(channelA, channelB) {
|
compareByDisplayName(channelA, channelB) {
|
||||||
return channelA.display_name.localeCompare(channelB.display_name);
|
return channelA.display_name.localeCompare(channelB.display_name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import * as Utils from 'utils/utils.jsx';
|
|||||||
import SidebarHeaderDropdown from './sidebar_header_dropdown.jsx';
|
import SidebarHeaderDropdown from './sidebar_header_dropdown.jsx';
|
||||||
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
import {Tooltip, OverlayTrigger} from 'react-bootstrap';
|
||||||
|
|
||||||
import {Preferences, TutorialSteps, OVERLAY_TIME_DELAY} from 'utils/constants.jsx';
|
import {Preferences, TutorialSteps, Constants} from 'utils/constants.jsx';
|
||||||
import {createMenuTip} from 'components/tutorial/tutorial_tip.jsx';
|
import {createMenuTip} from 'components/tutorial/tutorial_tip.jsx';
|
||||||
|
|
||||||
export default class SidebarHeader extends React.Component {
|
export default class SidebarHeader extends React.Component {
|
||||||
@@ -78,7 +78,7 @@ export default class SidebarHeader extends React.Component {
|
|||||||
teamNameWithToolTip = (
|
teamNameWithToolTip = (
|
||||||
<OverlayTrigger
|
<OverlayTrigger
|
||||||
trigger={['hover', 'focus']}
|
trigger={['hover', 'focus']}
|
||||||
delayShow={OVERLAY_TIME_DELAY}
|
delayShow={Constants.OVERLAY_TIME_DELAY}
|
||||||
placement='bottom'
|
placement='bottom'
|
||||||
overlay={<Tooltip id='team-name__tooltip'>{this.props.teamDescription}</Tooltip>}
|
overlay={<Tooltip id='team-name__tooltip'>{this.props.teamDescription}</Tooltip>}
|
||||||
ref='descriptionOverlay'
|
ref='descriptionOverlay'
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user