diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:04:13 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:11:58 -0700 |
commit | d8bd57901e33a7057e26e782e295099ffcc0da89 (patch) | |
tree | e12dfc8cad42b1576756d19d7fbfd82646a009bf /webapp/stores/integration_store.jsx | |
parent | 7bc8e9a08dfde56387f946fdf5086252aa4d0491 (diff) | |
download | chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.gz chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.bz2 chat-d8bd57901e33a7057e26e782e295099ffcc0da89.zip |
Removing webapp
Diffstat (limited to 'webapp/stores/integration_store.jsx')
-rw-r--r-- | webapp/stores/integration_store.jsx | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/webapp/stores/integration_store.jsx b/webapp/stores/integration_store.jsx deleted file mode 100644 index f1e86d881..000000000 --- a/webapp/stores/integration_store.jsx +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import EventEmitter from 'events'; - -const CHANGE_EVENT = 'changed'; - -import store from 'stores/redux_store.jsx'; - -class IntegrationStore extends EventEmitter { - constructor() { - super(); - - this.entities = {}; - - store.subscribe(() => { - const newEntities = store.getState().entities.integrations; - if (newEntities !== this.entities) { - this.emitChange(); - } - - this.entities = newEntities; - }); - } - - addChangeListener(callback) { - this.on(CHANGE_EVENT, callback); - } - - removeChangeListener(callback) { - this.removeListener(CHANGE_EVENT, callback); - } - - emitChange() { - this.emit(CHANGE_EVENT); - } - - hasReceivedIncomingWebhooks(teamId) { - const hooks = store.getState().entities.integrations.incomingHooks || {}; - - let hasTeam = false; - Object.values(hooks).forEach((hook) => { - if (hook.team_id === teamId) { - hasTeam = true; - } - }); - - return hasTeam; - } - - getIncomingWebhooks(teamId) { - const hooks = store.getState().entities.integrations.incomingHooks; - - const teamHooks = []; - Object.values(hooks).forEach((hook) => { - if (hook.team_id === teamId) { - teamHooks.push(hook); - } - }); - - return teamHooks; - } - - hasReceivedOutgoingWebhooks(teamId) { - const hooks = store.getState().entities.integrations.outgoingHooks; - - let hasTeam = false; - Object.values(hooks).forEach((hook) => { - if (hook.team_id === teamId) { - hasTeam = true; - } - }); - - return hasTeam; - } - - getOutgoingWebhooks(teamId) { - const hooks = store.getState().entities.integrations.outgoingHooks; - - const teamHooks = []; - Object.values(hooks).forEach((hook) => { - if (hook.team_id === teamId) { - teamHooks.push(hook); - } - }); - - return teamHooks; - } - - getOutgoingWebhook(teamId, id) { - return store.getState().entities.integrations.outgoingHooks[id]; - } - - hasReceivedOAuthApps() { - return Object.keys(store.getState().entities.integrations.oauthApps).length > 0; - } - - getOAuthApps() { - return Object.values(store.getState().entities.integrations.oauthApps); - } -} - -export default new IntegrationStore(); |