PLT-4815 Refactor 'More Channels' modal into the new modal pattern (#4742)
* Refactor 'More Channels' modal into the new modal pattern * Fix unit test * Readded CSS changes
Этот коммит содержится в:
коммит произвёл
enahum
родитель
c35b95709e
Коммит
7f48a7fc9d
@@ -4,6 +4,8 @@
|
||||
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
|
||||
import EventEmitter from 'events';
|
||||
|
||||
import TeamStore from 'stores/team_store.jsx';
|
||||
|
||||
var Utils;
|
||||
import {ActionTypes, Constants} from 'utils/constants.jsx';
|
||||
const NotificationPrefs = Constants.NotificationPrefs;
|
||||
@@ -233,24 +235,25 @@ class ChannelStoreClass extends EventEmitter {
|
||||
return this.myChannelMembers;
|
||||
}
|
||||
|
||||
storeMoreChannels(channels) {
|
||||
storeMoreChannels(channels, teamId = TeamStore.getCurrentId()) {
|
||||
const newChannels = {};
|
||||
for (let i = 0; i < channels.length; i++) {
|
||||
newChannels[channels[i].id] = channels[i];
|
||||
}
|
||||
this.moreChannels = Object.assign({}, this.moreChannels, newChannels);
|
||||
this.moreChannels[teamId] = Object.assign({}, this.moreChannels[teamId], newChannels);
|
||||
}
|
||||
|
||||
removeMoreChannel(channelId) {
|
||||
Reflect.deleteProperty(this.moreChannels, channelId);
|
||||
removeMoreChannel(channelId, teamId = TeamStore.getCurrentId()) {
|
||||
Reflect.deleteProperty(this.moreChannels[teamId], channelId);
|
||||
}
|
||||
|
||||
getMoreChannels() {
|
||||
return Object.assign({}, this.moreChannels);
|
||||
getMoreChannels(teamId = TeamStore.getCurrentId()) {
|
||||
return Object.assign({}, this.moreChannels[teamId]);
|
||||
}
|
||||
|
||||
getMoreChannelsList() {
|
||||
return Object.keys(this.moreChannels).map((cid) => this.moreChannels[cid]);
|
||||
getMoreChannelsList(teamId = TeamStore.getCurrentId()) {
|
||||
const teamChannels = this.moreChannels[teamId] || {};
|
||||
return Object.keys(teamChannels).map((cid) => teamChannels[cid]);
|
||||
}
|
||||
|
||||
storeStats(stats) {
|
||||
|
||||
Ссылка в новой задаче
Block a user