summaryrefslogtreecommitdiffstats
path: root/webapp/stores
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/stores')
-rw-r--r--webapp/stores/admin_store.jsx30
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();