diff --git a/ui-ngx/src/app/shared/components/json-form/json-form.component.ts b/ui-ngx/src/app/shared/components/json-form/json-form.component.ts index ca07c1e6eb..31e0f4282f 100644 --- a/ui-ngx/src/app/shared/components/json-form/json-form.component.ts +++ b/ui-ngx/src/app/shared/components/json-form/json-form.component.ts @@ -104,6 +104,7 @@ export class JsonFormComponent implements OnInit, ControlValueAccessor, Validato fullscreenFinishFn: () => void; private propagateChange = null; + private propagateChangePending = false; constructor(public elementRef: ElementRef, private translate: TranslateService, @@ -120,6 +121,12 @@ export class JsonFormComponent implements OnInit, ControlValueAccessor, Validato registerOnChange(fn: any): void { this.propagateChange = fn; + if (this.propagateChangePending) { + this.propagateChangePending = false; + setTimeout(() => { + this.propagateChange(this.data); + }, 0); + } } registerOnTouched(fn: any): void { @@ -154,7 +161,11 @@ export class JsonFormComponent implements OnInit, ControlValueAccessor, Validato updateView() { if (this.data) { this.data.model = this.model; - this.propagateChange(this.data); + if (this.propagateChange) { + this.propagateChange(this.data); + } else { + this.propagateChangePending = true; + } } } diff --git a/ui-ngx/src/app/shared/components/json-form/react/json-form-base-component.tsx b/ui-ngx/src/app/shared/components/json-form/react/json-form-base-component.tsx index b033271d1d..440e71c7a3 100644 --- a/ui-ngx/src/app/shared/components/json-form/react/json-form-base-component.tsx +++ b/ui-ngx/src/app/shared/components/json-form/react/json-form-base-component.tsx @@ -33,9 +33,9 @@ export default ThingsboardBaseComponent => class

} componentDidMount() { - /* if (typeof this.state.value !== 'undefined') { + if (typeof this.state.value !== 'undefined') { this.props.onChange(this.props.form.key, this.state.value); - }*/ + } } onChangeValidate(e, forceUpdate?: boolean) { diff --git a/ui-ngx/src/app/shared/components/json-form/react/json-form-checkbox.tsx b/ui-ngx/src/app/shared/components/json-form/react/json-form-checkbox.tsx index d0fe753e20..88fcc4be54 100644 --- a/ui-ngx/src/app/shared/components/json-form/react/json-form-checkbox.tsx +++ b/ui-ngx/src/app/shared/components/json-form/react/json-form-checkbox.tsx @@ -28,7 +28,7 @@ class ThingsboardCheckbox extends React.Component { this.props.onChangeValidate(e); diff --git a/ui-ngx/src/app/shared/components/json-form/react/json-form.scss b/ui-ngx/src/app/shared/components/json-form/react/json-form.scss index dd46327298..389b447154 100644 --- a/ui-ngx/src/app/shared/components/json-form/react/json-form.scss +++ b/ui-ngx/src/app/shared/components/json-form/react/json-form.scss @@ -134,11 +134,6 @@ $previewSize: 100px !default; display: none; } - span.tb-toggle-icon { - padding-top: 12px; - padding-bottom: 12px; - } - .tb-button-toggle .tb-toggle-icon { display: inline-block; width: 15px; diff --git a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html index 3feae05e5b..1cd5ce43d2 100644 --- a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html +++ b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html @@ -103,7 +103,6 @@ predefinedName="aggregation.group-interval"> -