* Fix OVERLAY_TIME_DELAY in sidebar_header

* Fix webhook channel selection by adding a filter
Этот коммит содержится в:
enahum
2017-01-23 06:11:37 -03:00
коммит произвёл George Goldberg
родитель 784d85f46d
Коммит b064457c74
2 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@@ -31,12 +31,13 @@ export default class ChannelSelect extends React.Component {
super(props);
this.handleChannelChange = this.handleChannelChange.bind(this);
this.filterChannels = this.filterChannels.bind(this);
this.compareByDisplayName = this.compareByDisplayName.bind(this);
AsyncClient.getMoreChannels(true);
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() {
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) {
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 {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';
export default class SidebarHeader extends React.Component {
@@ -78,7 +78,7 @@ export default class SidebarHeader extends React.Component {
teamNameWithToolTip = (
<OverlayTrigger
trigger={['hover', 'focus']}
delayShow={OVERLAY_TIME_DELAY}
delayShow={Constants.OVERLAY_TIME_DELAY}
placement='bottom'
overlay={<Tooltip id='team-name__tooltip'>{this.props.teamDescription}</Tooltip>}
ref='descriptionOverlay'