fix(ui): fix alert change value
This commit is contained in:
parent
30efc6cfe5
commit
bf4689e171
2 changed files with 5 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||
import { Input } from 'UI';
|
||||
import Select from 'Shared/Select';
|
||||
import { alertConditions as conditions } from 'App/constants';
|
||||
import Alert from 'Types/alert'
|
||||
|
||||
const thresholdOptions = [
|
||||
{ label: '15 minutes', value: 15 },
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ export default class AlertsStore {
|
|||
this.page = 1;
|
||||
}
|
||||
|
||||
// TODO: remove it
|
||||
updateKey(key: string, value: any) {
|
||||
// @ts-ignore
|
||||
this[key] = value
|
||||
}
|
||||
|
||||
|
|
@ -77,10 +79,10 @@ export default class AlertsStore {
|
|||
|
||||
edit = (diff: Partial<Alert>) => {
|
||||
const key = Object.keys(diff)[0]
|
||||
const oldInst = this.instance
|
||||
const oldInst = { ...this.instance }
|
||||
// @ts-ignore
|
||||
oldInst[key] = diff[key]
|
||||
|
||||
this.instance = oldInst
|
||||
this.instance = new Alert(oldInst, !!oldInst.alertId)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue