Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
clone(feedback) {
let cloned = [];
for (var i = 0; i < feedback.length; i++) {
let fb = new Model.OnmsSituationFeedback();
fb.situationKey = feedback[i].situationKey;
fb.situationFingerprint = feedback[i].situationFingerprint;
fb.alarmKey = feedback[i].alarmKey;
fb.feedbackType = feedback[i].feedbackType;
fb.reason = feedback[i].reason;
fb.rootCause = feedback[i].rootCause;
fb.tags = feedback[i].tags;
fb.user = feedback[i].user;
cloned.push(fb);
}
return cloned;
}
initalizeFeeback() {
this.$scope.feedbackCorrectCount = 0;
this.$scope.feedbackIncorrectCount = 0;
let feedback = [];
for (let alarm of this.$scope.alarm.relatedAlarms) {
let alarmFeedback = new Model.OnmsSituationFeedback();
alarmFeedback.situationKey = this.$scope.alarm.reductionKey;
alarmFeedback.situationFingerprint = this.fingerPrint(this.$scope.alarm);
alarmFeedback.alarmKey = alarm.reductionKey;
alarmFeedback.feedbackType = Model.FeedbackTypes.CORRECT;
alarmFeedback.reason = "ALL_CORRECT";
alarmFeedback.rootCause = false;
alarmFeedback.tags = [];
alarmFeedback.timestamp = 0;
alarmFeedback.user = this.contextSrv.user.login;
feedback.push(alarmFeedback);
this.$scope.feedbackCorrectCount++;
}
return feedback;
}