Browse Source

remove passed variable

use property instead
master
sanke 6 years ago
parent
commit
75eb6a610d
  1. 3
      src/controllers/analytic_controller.ts
  2. 5
      src/models/analytic_unit.ts

3
src/controllers/analytic_controller.ts

@ -68,9 +68,10 @@ export class AnalyticController {
}
createNew() {
this._newAnalyticUnit = new AnalyticUnit(undefined, ANALYTIC_UNIT_COLORS[this._currentColorIndex]);
this._newAnalyticUnit = new AnalyticUnit();
this._creatingNewAnalyticType = true;
this._savingNewAnalyticUnit = false;
this._newAnalyticUnit.color = ANALYTIC_UNIT_COLORS[this._currentColorIndex];
this._currentColorIndex++;
this._currentColorIndex %= ANALYTIC_UNIT_COLORS.length;
}

5
src/models/analytic_unit.ts

@ -4,6 +4,7 @@ import { Segment, SegmentId } from './segment';
import { Metric } from './metric';
import _ from 'lodash';
import { ANALYTIC_UNIT_COLORS } from '../colors';
export type AnalyticSegmentPair = { anomalyType: AnalyticUnit, segment: AnalyticSegment };
@ -32,12 +33,12 @@ export class AnalyticUnit {
private _alertEnabled?: boolean;
constructor(private _panelObject?: any, color?: string) {
constructor(private _panelObject?: any) {
if(_panelObject === undefined) {
this._panelObject = {};
}
_.defaults(this._panelObject, {
name: 'AnalyticUnitName', confidence: 0.2, color, type: 'general'
name: 'AnalyticUnitName', confidence: 0.2, color: ANALYTIC_UNIT_COLORS[0], type: 'general'
});
//this._metric = new Metric(_panelObject.metric);

Loading…
Cancel
Save