diff --git a/ui-ngx/src/app/modules/home/components/widget/data-keys.component.models.ts b/ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.models.ts
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/data-keys.component.models.ts
rename to ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.models.ts
diff --git a/ui-ngx/src/app/modules/home/components/widget/data-keys.component.scss b/ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.scss
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/data-keys.component.scss
rename to ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.scss
diff --git a/ui-ngx/src/app/modules/home/components/widget/data-keys.component.ts b/ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.ts
similarity index 96%
rename from ui-ngx/src/app/modules/home/components/widget/data-keys.component.ts
rename to ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.ts
index 5e4dafe6cf..a4d11dc1de 100644
--- a/ui-ngx/src/app/modules/home/components/widget/data-keys.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.ts
@@ -68,6 +68,7 @@ import { AggregationType } from '@shared/models/time/time.models';
import { DndDropEvent } from 'ngx-drag-drop/lib/dnd-dropzone.directive';
import { moveItemInArray } from '@angular/cdk/drag-drop';
import { coerceBoolean } from '@shared/decorators/coercion';
+import { DatasourceComponent } from '@home/components/widget/datasource.component';
@Component({
selector: 'tb-data-keys',
@@ -88,6 +89,22 @@ import { coerceBoolean } from '@shared/decorators/coercion';
})
export class DataKeysComponent implements ControlValueAccessor, OnInit, OnChanges, ErrorStateMatcher {
+ public get hideDataKeyLabel(): boolean {
+ return this.datasourceComponent.hideDataKeyLabel;
+ }
+
+ public get hideDataKeyColor(): boolean {
+ return this.datasourceComponent.hideDataKeyColor;
+ }
+
+ public get hideDataKeyUnits(): boolean {
+ return this.datasourceComponent.hideDataKeyUnits;
+ }
+
+ public get hideDataKeyDecimals(): boolean {
+ return this.datasourceComponent.hideDataKeyDecimals;
+ }
+
datasourceTypes = DatasourceType;
widgetTypes = widgetType;
dataKeyTypes = DataKeyType;
@@ -188,6 +205,7 @@ export class DataKeysComponent implements ControlValueAccessor, OnInit, OnChange
constructor(private store: Store
,
@SkipSelf() private errorStateMatcher: ErrorStateMatcher,
+ private datasourceComponent: DatasourceComponent,
public translate: TranslateService,
private utils: UtilsService,
private dialogs: DialogService,
@@ -480,7 +498,11 @@ export class DataKeysComponent implements ControlValueAccessor, OnInit, OnChange
deviceId: this.deviceId,
entityAliasId: this.entityAliasId,
showPostProcessing: this.widgetType !== widgetType.alarm,
- callbacks: this.callbacks
+ callbacks: this.callbacks,
+ hideDataKeyLabel: this.hideDataKeyLabel,
+ hideDataKeyColor: this.hideDataKeyColor,
+ hideDataKeyUnits: this.hideDataKeyUnits,
+ hideDataKeyDecimals: this.hideDataKeyDecimals
}
}).afterClosed().subscribe((updatedDataKey) => {
if (updatedDataKey) {
diff --git a/ui-ngx/src/app/modules/home/components/widget/datasource.component.html b/ui-ngx/src/app/modules/home/components/widget/config/datasource.component.html
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/datasource.component.html
rename to ui-ngx/src/app/modules/home/components/widget/config/datasource.component.html
diff --git a/ui-ngx/src/app/modules/home/components/widget/datasource.component.models.ts b/ui-ngx/src/app/modules/home/components/widget/config/datasource.component.models.ts
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/datasource.component.models.ts
rename to ui-ngx/src/app/modules/home/components/widget/config/datasource.component.models.ts
diff --git a/ui-ngx/src/app/modules/home/components/widget/datasource.component.scss b/ui-ngx/src/app/modules/home/components/widget/config/datasource.component.scss
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/datasource.component.scss
rename to ui-ngx/src/app/modules/home/components/widget/config/datasource.component.scss
diff --git a/ui-ngx/src/app/modules/home/components/widget/datasource.component.ts b/ui-ngx/src/app/modules/home/components/widget/config/datasource.component.ts
similarity index 92%
rename from ui-ngx/src/app/modules/home/components/widget/datasource.component.ts
rename to ui-ngx/src/app/modules/home/components/widget/config/datasource.component.ts
index 79adc363a6..a3e3fc7c26 100644
--- a/ui-ngx/src/app/modules/home/components/widget/datasource.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/config/datasource.component.ts
@@ -14,7 +14,7 @@
/// limitations under the License.
///
-import { Component, forwardRef, Input, OnInit } from '@angular/core';
+import { Component, forwardRef, Input, OnInit, Optional } from '@angular/core';
import {
ControlValueAccessor,
NG_VALIDATORS,
@@ -41,6 +41,7 @@ import { EntityAliasSelectCallbacks } from '@home/components/alias/entity-alias-
import { FilterSelectCallbacks } from '@home/components/filter/filter-select.component.models';
import { DataKeysCallbacks } from '@home/components/widget/data-keys.component.models';
import { EntityType } from '@shared/models/entity-type.models';
+import { DatasourcesComponent } from '@home/components/widget/datasources.component';
@Component({
selector: 'tb-datasource',
@@ -122,6 +123,22 @@ export class DatasourceComponent implements ControlValueAccessor, OnInit, Valida
return this.widgetConfigComponent.widget;
}
+ public get hideDataKeyLabel(): boolean {
+ return this.datasourcesComponent?.hideDataKeyLabel;
+ }
+
+ public get hideDataKeyColor(): boolean {
+ return this.datasourcesComponent?.hideDataKeyColor;
+ }
+
+ public get hideDataKeyUnits(): boolean {
+ return this.datasourcesComponent?.hideDataKeyUnits;
+ }
+
+ public get hideDataKeyDecimals(): boolean {
+ return this.datasourcesComponent?.hideDataKeyDecimals;
+ }
+
@Input()
disabled: boolean;
@@ -138,6 +155,8 @@ export class DatasourceComponent implements ControlValueAccessor, OnInit, Valida
private propagateChange = (_val: any) => {};
constructor(private fb: UntypedFormBuilder,
+ @Optional()
+ private datasourcesComponent: DatasourcesComponent,
private widgetConfigComponent: WidgetConfigComponent) {
}
diff --git a/ui-ngx/src/app/modules/home/components/widget/datasources.component.html b/ui-ngx/src/app/modules/home/components/widget/config/datasources.component.html
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/datasources.component.html
rename to ui-ngx/src/app/modules/home/components/widget/config/datasources.component.html
diff --git a/ui-ngx/src/app/modules/home/components/widget/datasources.component.scss b/ui-ngx/src/app/modules/home/components/widget/config/datasources.component.scss
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/datasources.component.scss
rename to ui-ngx/src/app/modules/home/components/widget/config/datasources.component.scss
diff --git a/ui-ngx/src/app/modules/home/components/widget/datasources.component.ts b/ui-ngx/src/app/modules/home/components/widget/config/datasources.component.ts
similarity index 97%
rename from ui-ngx/src/app/modules/home/components/widget/datasources.component.ts
rename to ui-ngx/src/app/modules/home/components/widget/config/datasources.component.ts
index f47adfb2a9..dc62b0e25e 100644
--- a/ui-ngx/src/app/modules/home/components/widget/datasources.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/config/datasources.component.ts
@@ -41,6 +41,7 @@ import { DataKeyType } from '@shared/models/telemetry/telemetry.models';
import { UtilsService } from '@core/services/utils.service';
import { DataKeysCallbacks } from '@home/components/widget/data-keys.component.models';
import { TranslateService } from '@ngx-translate/core';
+import { coerceBoolean } from '@shared/decorators/coercion';
@Component({
selector: 'tb-datasources',
@@ -87,6 +88,22 @@ export class DatasourcesComponent implements ControlValueAccessor, OnInit, Valid
@Input()
disabled: boolean;
+ @Input()
+ @coerceBoolean()
+ hideDataKeyLabel = false;
+
+ @Input()
+ @coerceBoolean()
+ hideDataKeyColor = false;
+
+ @Input()
+ @coerceBoolean()
+ hideDataKeyUnits = false;
+
+ @Input()
+ @coerceBoolean()
+ hideDataKeyDecimals = false;
+
@Input()
configMode: WidgetConfigMode;
diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config-components.module.ts b/ui-ngx/src/app/modules/home/components/widget/config/widget-config-components.module.ts
similarity index 87%
rename from ui-ngx/src/app/modules/home/components/widget/widget-config-components.module.ts
rename to ui-ngx/src/app/modules/home/components/widget/config/widget-config-components.module.ts
index 56302e212d..c5a114d763 100644
--- a/ui-ngx/src/app/modules/home/components/widget/widget-config-components.module.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/config/widget-config-components.module.ts
@@ -18,6 +18,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedModule } from '@app/shared/shared.module';
import { AlarmFilterConfigComponent } from '@home/components/alarm/alarm-filter-config.component';
+import { AlarmAssigneeSelectComponent } from '@home/components/alarm/alarm-assignee-select.component';
import { DataKeysComponent } from '@home/components/widget/data-keys.component';
import { DataKeyConfigDialogComponent } from '@home/components/widget/data-key-config-dialog.component';
import { DataKeyConfigComponent } from '@home/components/widget/data-key-config.component';
@@ -27,10 +28,12 @@ import { EntityAliasSelectComponent } from '@home/components/alias/entity-alias-
import { FilterSelectComponent } from '@home/components/filter/filter-select.component';
import { WidgetSettingsModule } from '@home/components/widget/lib/settings/widget-settings.module';
import { WidgetSettingsComponent } from '@home/components/widget/widget-settings.component';
+import { TimewindowConfigPanelComponent } from '@home/components/widget/timewindow-config-panel.component';
@NgModule({
declarations:
[
+ AlarmAssigneeSelectComponent,
AlarmFilterConfigComponent,
DataKeysComponent,
DataKeyConfigDialogComponent,
@@ -39,6 +42,7 @@ import { WidgetSettingsComponent } from '@home/components/widget/widget-settings
DatasourcesComponent,
EntityAliasSelectComponent,
FilterSelectComponent,
+ TimewindowConfigPanelComponent,
WidgetSettingsComponent
],
imports: [
@@ -47,6 +51,7 @@ import { WidgetSettingsComponent } from '@home/components/widget/widget-settings
WidgetSettingsModule
],
exports: [
+ AlarmAssigneeSelectComponent,
AlarmFilterConfigComponent,
DataKeysComponent,
DataKeyConfigDialogComponent,
@@ -55,6 +60,7 @@ import { WidgetSettingsComponent } from '@home/components/widget/widget-settings
DatasourcesComponent,
EntityAliasSelectComponent,
FilterSelectComponent,
+ TimewindowConfigPanelComponent,
WidgetSettingsComponent
]
})
diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.models.ts b/ui-ngx/src/app/modules/home/components/widget/config/widget-config.component.models.ts
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/widget-config.component.models.ts
rename to ui-ngx/src/app/modules/home/components/widget/config/widget-config.component.models.ts
diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config.scss b/ui-ngx/src/app/modules/home/components/widget/config/widget-config.scss
similarity index 85%
rename from ui-ngx/src/app/modules/home/components/widget/widget-config.scss
rename to ui-ngx/src/app/modules/home/components/widget/config/widget-config.scss
index bc269e5a67..15e14e211e 100644
--- a/ui-ngx/src/app/modules/home/components/widget/widget-config.scss
+++ b/ui-ngx/src/app/modules/home/components/widget/config/widget-config.scss
@@ -80,6 +80,30 @@
}
}
+ .mat-mdc-form-field {
+ &.center {
+ .mat-mdc-text-field-wrapper.mdc-text-field--outlined {
+ .mat-mdc-form-field-infix {
+ .mdc-text-field__input {
+ text-align: center;
+ }
+ }
+ }
+ }
+ &.number {
+ .mat-mdc-text-field-wrapper.mdc-text-field--outlined {
+ padding-right: 4px;
+ .mat-mdc-form-field-infix {
+ width: 80px;
+ input.mdc-text-field__input[type=number]::-webkit-inner-spin-button,
+ input.mdc-text-field__input[type=number]::-webkit-outer-spin-button {
+ opacity: 1;
+ }
+ }
+ }
+ }
+ }
+
.tb-widget-config-row {
.mat-mdc-form-field {
.mat-mdc-text-field-wrapper.mdc-text-field--outlined {
@@ -97,27 +121,6 @@
width: 72px;
}
}
- &.center {
- .mat-mdc-text-field-wrapper.mdc-text-field--outlined {
- .mat-mdc-form-field-infix {
- .mdc-text-field__input {
- text-align: center;
- }
- }
- }
- }
- &.number {
- .mat-mdc-text-field-wrapper.mdc-text-field--outlined {
- padding-right: 4px;
- .mat-mdc-form-field-infix {
- width: 80px;
- input.mdc-text-field__input[type=number]::-webkit-inner-spin-button,
- input.mdc-text-field__input[type=number]::-webkit-outer-spin-button {
- opacity: 1;
- }
- }
- }
- }
}
}
diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/config/widget-settings.component.html
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/widget-settings.component.html
rename to ui-ngx/src/app/modules/home/components/widget/config/widget-settings.component.html
diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-settings.component.scss b/ui-ngx/src/app/modules/home/components/widget/config/widget-settings.component.scss
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/widget-settings.component.scss
rename to ui-ngx/src/app/modules/home/components/widget/config/widget-settings.component.scss
diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/config/widget-settings.component.ts
similarity index 91%
rename from ui-ngx/src/app/modules/home/components/widget/widget-settings.component.ts
rename to ui-ngx/src/app/modules/home/components/widget/config/widget-settings.component.ts
index 7bfb66fd61..cc482bfd4e 100644
--- a/ui-ngx/src/app/modules/home/components/widget/widget-settings.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/config/widget-settings.component.ts
@@ -16,28 +16,27 @@
import {
AfterViewInit,
- Component, ComponentFactoryResolver,
+ Component,
+ ComponentFactoryResolver,
ComponentRef,
forwardRef,
- Input, OnChanges,
+ Input,
+ OnChanges,
OnDestroy,
- OnInit, SimpleChanges,
+ OnInit,
+ SimpleChanges,
ViewChild,
ViewContainerRef
} from '@angular/core';
-import { ControlValueAccessor, UntypedFormBuilder, UntypedFormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
import {
- IRuleNodeConfigurationComponent,
- RuleNodeConfiguration,
- RuleNodeDefinition
-} from '@shared/models/rule-node.models';
+ ControlValueAccessor,
+ NG_VALUE_ACCESSOR,
+ UntypedFormBuilder,
+ UntypedFormGroup,
+ Validators
+} from '@angular/forms';
import { Subscription } from 'rxjs';
-import { RuleChainService } from '@core/http/rule-chain.service';
-import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { TranslateService } from '@ngx-translate/core';
-import { JsonObjectEditComponent } from '@shared/components/json-object-edit.component';
-import { deepClone } from '@core/utils';
-import { RuleChainType } from '@shared/models/rule-chain.models';
import { JsonFormComponent } from '@shared/components/json-form/json-form.component';
import { JsonFormComponentData } from '@shared/components/json-form/json-form-component.models';
import { IWidgetSettingsComponent, Widget, WidgetSettings } from '@shared/models/widget.models';
diff --git a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/trip-animation/trip-animation.component.html
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.html
rename to ui-ngx/src/app/modules/home/components/widget/lib/trip-animation/trip-animation.component.html
diff --git a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/trip-animation/trip-animation.component.scss
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.scss
rename to ui-ngx/src/app/modules/home/components/widget/lib/trip-animation/trip-animation.component.scss
diff --git a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/trip-animation/trip-animation.component.ts
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts
rename to ui-ngx/src/app/modules/home/components/widget/lib/trip-animation/trip-animation.component.ts
diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html
index cde8205f62..86f2cba04e 100644
--- a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html
@@ -199,31 +199,12 @@