diff --git a/ui-ngx/src/app/shared/components/json-content.component.scss b/ui-ngx/src/app/shared/components/json-content.component.scss
index fd2afd9e72..124092718a 100644
--- a/ui-ngx/src/app/shared/components/json-content.component.scss
+++ b/ui-ngx/src/app/shared/components/json-content.component.scss
@@ -13,44 +13,47 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-:host {
+.tb-json-content {
position: relative;
.fill-height {
height: 100%;
}
-}
-.tb-json-content-toolbar {
- button.mat-button, button.mat-icon-button, button.mat-icon-button.tb-mat-32 {
- align-items: center;
- vertical-align: middle;
- min-width: 32px;
- min-height: 15px;
- padding: 4px;
- margin: 0;
- font-size: .8rem;
- line-height: 15px;
- color: #7b7b7b;
- background: rgba(220, 220, 220, .35);
- &:not(:last-child) {
- margin-right: 4px;
- }
+ &:not(.tb-fullscreen) {
+ padding-bottom: 15px;
}
-}
-.tb-json-content-panel {
- height: 100%;
- margin-left: 15px;
- border: 1px solid #c0c0c0;
+ .tb-json-content-toolbar {
+ button.mat-button, button.mat-icon-button, button.mat-icon-button.tb-mat-32 {
+ align-items: center;
+ vertical-align: middle;
+ min-width: 32px;
+ min-height: 15px;
+ padding: 4px;
+ margin: 0;
+ font-size: .8rem;
+ line-height: 15px;
+ color: #7b7b7b;
+ background: rgba(220, 220, 220, .35);
+ &:not(:last-child) {
+ margin-right: 4px;
+ }
+ }
+ }
- #tb-json-input {
- width: 100%;
- min-width: 200px;
+ .tb-json-content-panel {
height: 100%;
+ border: 1px solid #c0c0c0;
+
+ #tb-json-input {
+ width: 100%;
+ min-width: 200px;
+ height: 100%;
- &:not(.fill-height) {
- min-height: 200px;
+ &:not(.fill-height) {
+ min-height: 200px;
+ }
}
}
}
diff --git a/ui-ngx/src/app/shared/components/json-content.component.ts b/ui-ngx/src/app/shared/components/json-content.component.ts
index 89d1a85c25..edf6e51ac8 100644
--- a/ui-ngx/src/app/shared/components/json-content.component.ts
+++ b/ui-ngx/src/app/shared/components/json-content.component.ts
@@ -15,6 +15,7 @@
///
import {
+ ChangeDetectorRef,
Component,
ElementRef,
forwardRef,
@@ -23,7 +24,7 @@ import {
OnDestroy,
OnInit,
SimpleChanges,
- ViewChild
+ ViewChild, ViewEncapsulation
} from '@angular/core';
import { ControlValueAccessor, FormControl, NG_VALIDATORS, NG_VALUE_ACCESSOR, Validator } from '@angular/forms';
import { Ace } from 'ace-builds';
@@ -53,7 +54,8 @@ import { beautifyJs } from '@shared/models/beautify.models';
useExisting: forwardRef(() => JsonContentComponent),
multi: true,
}
- ]
+ ],
+ encapsulation: ViewEncapsulation.None
})
export class JsonContentComponent implements OnInit, ControlValueAccessor, Validator, OnChanges, OnDestroy {
@@ -116,7 +118,8 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
constructor(public elementRef: ElementRef,
protected store: Store
,
- private raf: RafService) {
+ private raf: RafService,
+ private cd: ChangeDetectorRef) {
}
ngOnInit(): void {
@@ -151,9 +154,12 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
this.updateView();
}
});
- this.jsonEditor.on('blur', () => {
- this.contentValid = !this.validateContent || this.doValidate(true);
- });
+ if (this.validateContent) {
+ this.jsonEditor.on('blur', () => {
+ this.contentValid = this.doValidate(true);
+ this.cd.markForCheck();
+ });
+ }
this.editorResize$ = new ResizeObserver(() => {
this.onAceEditorResize();
});
@@ -225,12 +231,13 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
this.propagateChange(this.contentBody);
this.contentValid = this.doValidate(true);
this.propagateChange(this.contentBody);
+ this.cd.markForCheck();
}
}
private doValidate(showErrorToast = false): boolean {
try {
- if (this.validateContent && this.contentType === ContentType.JSON) {
+ if (this.contentType === ContentType.JSON) {
JSON.parse(this.contentBody);
}
return true;
@@ -283,6 +290,7 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
this.contentBody = editorValue;
this.contentValid = !this.validateOnChange || this.doValidate();
this.propagateChange(this.contentBody);
+ this.cd.markForCheck();
}
}
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json
index 6f8117c77d..38b693b4a8 100644
--- a/ui-ngx/src/assets/locale/locale.constant-en_US.json
+++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json
@@ -3628,7 +3628,7 @@
"set-value-method": "RPC set value method",
"convert-value-function": "Convert value function",
"rpc-settings": "RPC settings",
- "request-timeout": "RPC request timeout",
+ "request-timeout": "RPC request timeout (ms)",
"persistent-rpc-settings": "Persistent RPC settings",
"request-persistent": "RPC request persistent",
"persistent-polling-interval": "Polling interval (ms) to get persistent RPC command response",
@@ -3642,7 +3642,34 @@
"slider-color": "Slider color",
"slider-color-primary": "Primary",
"slider-color-accent": "Accent",
- "slider-color-warn": "Warn"
+ "slider-color-warn": "Warn",
+ "button-style": "Button style",
+ "button-raised": "Raised button",
+ "button-primary": "Primary color",
+ "button-background-color": "Button background color",
+ "button-text-color": "Button text color",
+ "widget-title": "Widget title",
+ "button-label": "Button label",
+ "device-attribute-scope": "Device attribute scope",
+ "server-attribute": "Server attribute",
+ "shared-attribute": "Shared attribute",
+ "device-attribute-parameters": "Device attribute parameters",
+ "is-one-way-command": "Is one way command",
+ "rpc-method": "RPC method",
+ "rpc-method-params": "RPC method params",
+ "show-rpc-error": "Show RPC command execution error",
+ "led-title": "LED title",
+ "led-color": "LED color",
+ "check-status-settings": "Check status settings",
+ "perform-rpc-status-check": "Perform RPC device status check",
+ "retrieve-led-status-value-method": "Retrieve led status value using method",
+ "led-status-value-attribute": "Device attribute containing led status value",
+ "led-status-value-timeseries": "Device timeseries containing led status value",
+ "check-status-method": "RPC check device status method",
+ "parse-led-status-value-function": "Parse led status value function",
+ "knob-title": "Knob title",
+ "min-value": "Minimum value",
+ "max-value": "Maximum value"
},
"maps": {
"select-entity": "Select entity",