diff options
author | Corey Hulen <corey@hulen.com> | 2016-03-17 13:16:10 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-03-17 13:16:10 -0700 |
commit | 53d7718e57d4225eb5c020324d32cbe5b5eca7ad (patch) | |
tree | 9e549812c250513d56dd631c65c49402ea549ff7 /webapp/stores/admin_store.jsx | |
parent | 8d571ee498c97128bd797f8ac1cb4c3c995fb875 (diff) | |
parent | 2e5cc29738340c7330d1b2606ceba40865872e4c (diff) | |
download | chat-53d7718e57d4225eb5c020324d32cbe5b5eca7ad.tar.gz chat-53d7718e57d4225eb5c020324d32cbe5b5eca7ad.tar.bz2 chat-53d7718e57d4225eb5c020324d32cbe5b5eca7ad.zip |
Merge pull request #2442 from mattermost/PLT-2115
PLT-2115 adding compliance feature
Diffstat (limited to 'webapp/stores/admin_store.jsx')
-rw-r--r-- | webapp/stores/admin_store.jsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/webapp/stores/admin_store.jsx b/webapp/stores/admin_store.jsx index 0a4c8c442..0f19dd484 100644 --- a/webapp/stores/admin_store.jsx +++ b/webapp/stores/admin_store.jsx @@ -13,6 +13,7 @@ const LOG_CHANGE_EVENT = 'log_change'; const SERVER_AUDIT_CHANGE_EVENT = 'server_audit_change'; const CONFIG_CHANGE_EVENT = 'config_change'; const ALL_TEAMS_EVENT = 'all_team_change'; +const SERVER_COMPLIANCE_REPORT_CHANGE_EVENT = 'server_compliance_reports_change'; class AdminStoreClass extends EventEmitter { constructor() { @@ -22,6 +23,7 @@ class AdminStoreClass extends EventEmitter { this.audits = null; this.config = null; this.teams = null; + this.complianceReports = null; this.emitLogChange = this.emitLogChange.bind(this); this.addLogChangeListener = this.addLogChangeListener.bind(this); @@ -31,6 +33,10 @@ class AdminStoreClass extends EventEmitter { this.addAuditChangeListener = this.addAuditChangeListener.bind(this); this.removeAuditChangeListener = this.removeAuditChangeListener.bind(this); + this.emitComplianceReportsChange = this.emitComplianceReportsChange.bind(this); + this.addComplianceReportsChangeListener = this.addComplianceReportsChangeListener.bind(this); + this.removeComplianceReportsChangeListener = this.removeComplianceReportsChangeListener.bind(this); + this.emitConfigChange = this.emitConfigChange.bind(this); this.addConfigChangeListener = this.addConfigChangeListener.bind(this); this.removeConfigChangeListener = this.removeConfigChangeListener.bind(this); @@ -64,6 +70,18 @@ class AdminStoreClass extends EventEmitter { this.removeListener(SERVER_AUDIT_CHANGE_EVENT, callback); } + emitComplianceReportsChange() { + this.emit(SERVER_COMPLIANCE_REPORT_CHANGE_EVENT); + } + + addComplianceReportsChangeListener(callback) { + this.on(SERVER_COMPLIANCE_REPORT_CHANGE_EVENT, callback); + } + + removeComplianceReportsChangeListener(callback) { + this.removeListener(SERVER_COMPLIANCE_REPORT_CHANGE_EVENT, callback); + } + emitConfigChange() { this.emit(CONFIG_CHANGE_EVENT); } @@ -104,6 +122,14 @@ class AdminStoreClass extends EventEmitter { this.audits = audits; } + getComplianceReports() { + return this.complianceReports; + } + + saveComplianceReports(complianceReports) { + this.complianceReports = complianceReports; + } + getConfig() { return this.config; } @@ -147,6 +173,10 @@ AdminStoreClass.dispatchToken = AppDispatcher.register((payload) => { AdminStore.saveAudits(action.audits); AdminStore.emitAuditChange(); break; + case ActionTypes.RECEIVED_SERVER_COMPLIANCE_REPORTS: + AdminStore.saveComplianceReports(action.complianceReports); + AdminStore.emitComplianceReportsChange(); + break; case ActionTypes.RECEIVED_CONFIG: AdminStore.saveConfig(action.config); AdminStore.emitConfigChange(); |