diff --git a/ui-ngx/src/app/core/api/entity-data-subscription.ts b/ui-ngx/src/app/core/api/entity-data-subscription.ts index 25cb47ca0a..1e0f31c4d0 100644 --- a/ui-ngx/src/app/core/api/entity-data-subscription.ts +++ b/ui-ngx/src/app/core/api/entity-data-subscription.ts @@ -42,6 +42,7 @@ import { EntityCountCmd, EntityDataCmd, IndexedSubscriptionData, + NOT_SUPPORTED, SubscriptionData, TelemetrySubscriber } from '@shared/models/telemetry/telemetry.models'; @@ -786,7 +787,7 @@ export class EntityDataSubscription { private reportNotSupported(keys: AggKey[], isUpdate: boolean) { const indexedData: IndexedSubscriptionData = []; for (const key of keys) { - indexedData[key.id] = [[0, 'Not supported!']]; + indexedData[key.id] = [[0, NOT_SUPPORTED]]; } for (let dataIndex = 0; dataIndex < this.pageData.data.length; dataIndex++) { this.onIndexedData(indexedData, dataIndex, true, diff --git a/ui-ngx/src/app/core/api/widget-subscription.ts b/ui-ngx/src/app/core/api/widget-subscription.ts index f9a79d8f76..374775bdd0 100644 --- a/ui-ngx/src/app/core/api/widget-subscription.ts +++ b/ui-ngx/src/app/core/api/widget-subscription.ts @@ -81,6 +81,7 @@ import { distinct, filter, map, switchMap, takeUntil } from 'rxjs/operators'; import { AlarmDataListener } from '@core/api/alarm-data.service'; import { RpcStatus } from '@shared/models/rpc.models'; import { EventEmitter } from '@angular/core'; +import { NOT_SUPPORTED } from '@shared/models/telemetry/telemetry.models'; const moment = moment_; @@ -1541,7 +1542,7 @@ export class WidgetSubscription implements IWidgetSubscription { } else if (prevData && prevData[0] && prevData[0].length > 1 && data.data.length > 0) { const prevTs = prevData[0][0]; const prevValue = prevData[0][1]; - if (prevTs === data.data[0][0] && prevValue === data.data[0][1]) { + if (prevTs === data.data[0][0] && prevValue === data.data[0][1] && data.data[0][1] !== NOT_SUPPORTED) { update = false; } } diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts index 868b1544c3..e24f1cad07 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts @@ -161,12 +161,14 @@ import { HasDirtyFlag } from '@core/guards/confirm-on-exit.guard'; }) export class DashboardPageComponent extends PageComponent implements IDashboardController, HasDirtyFlag, OnInit, AfterViewInit, OnDestroy { + private forcePristine = false; + get isDirty(): boolean { - return this.isEdit; + return this.isEdit && !this.forcePristine; } set isDirty(value: boolean) { - + this.forcePristine = !value; } authState: AuthState = getCurrentAuthState(this.store); diff --git a/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html b/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html index 5244cf9101..89e1e1ddc4 100644 --- a/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html @@ -43,6 +43,11 @@ (click)="editAssetProfile($event)"> edit + - + @@ -122,7 +122,7 @@ maxWidth: (alarmsDatasource.countCellButtonAction * 48) + 'px', width: (alarmsDatasource.countCellButtonAction * 48) + 'px' }"> -
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html index d8039efe17..c18a6bab14 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html @@ -52,7 +52,7 @@ maxWidth: (entityDatasource.countCellButtonAction * 48) + 'px', width: (entityDatasource.countCellButtonAction * 48) + 'px' }"> -
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts index be447d1dde..5110b6121d 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts @@ -452,7 +452,7 @@ export function constructTableCssString(widgetConfig: WidgetConfig): string { '.mat-mdc-table .mat-mdc-row .mat-mdc-cell.mat-mdc-table-sticky, .mat-mdc-table .mat-mdc-header-cell.mat-mdc-table-sticky {\n' + 'background-color: ' + origBackgroundColor + ';\n' + '}\n' + - '.mat-mdc-table .mat-mdc-cell {\n' + + '.mat-mdc-table .mat-mdc-row {\n' + 'color: ' + mdDark + ';\n' + 'background-color: rgba(0, 0, 0, 0);\n' + '}\n' + diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html index 87283ec8ca..b07f490dcc 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html @@ -64,7 +64,7 @@ maxWidth: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px', width: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px' }"> -
@@ -74,22 +74,22 @@ mat-icon-button [disabled]="isLoading$ | async" matTooltip="{{ actionDescriptor.displayName }}" matTooltipPosition="above" - (click)="onActionButtonClick($event, row, actionDescriptor)"> + (click)="onActionButtonClick($event, entity, actionDescriptor)"> {{actionDescriptor.icon}}
-
+
- + diff --git a/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts b/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts index 8210f9a533..215c77a1bd 100644 --- a/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts @@ -146,11 +146,8 @@ export class DeviceWizardDialogComponent extends DialogComponent 0) { return this.deviceService.saveDeviceWithCredentials(deepTrim(device), deepTrim(this.credentialsFormGroup.value.credential)).pipe( catchError((e: HttpErrorResponse) => { diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset.component.html b/ui-ngx/src/app/modules/home/pages/asset/asset.component.html index 16229a7af6..b2c4b5a10a 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset.component.html +++ b/ui-ngx/src/app/modules/home/pages/asset/asset.component.html @@ -86,13 +86,6 @@ {{ 'asset.name-max-length' | translate }} - - asset.label @@ -100,6 +93,20 @@ {{ 'asset.label-max-length' | translate }} + + + +
asset.description diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts b/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts index 8c53cbba38..a96b65e249 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts @@ -69,6 +69,7 @@ export class AssetComponent extends EntityComponent { name: [entity ? entity.name : '', [Validators.required, Validators.maxLength(255)]], assetProfileId: [entity ? entity.assetProfileId : null, [Validators.required]], label: [entity ? entity.label : '', Validators.maxLength(255)], + customerId: [entity ? entity.customerId : ''], additionalInfo: this.fb.group( { description: [entity && entity.additionalInfo ? entity.additionalInfo.description : ''], @@ -82,6 +83,7 @@ export class AssetComponent extends EntityComponent { this.entityForm.patchValue({name: entity.name}); this.entityForm.patchValue({assetProfileId: entity.assetProfileId}); this.entityForm.patchValue({label: entity.label}); + this.entityForm.patchValue({customerId: entity.customerId}); this.entityForm.patchValue({additionalInfo: {description: entity.additionalInfo ? entity.additionalInfo.description : ''}}); } diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/add-rule-node-dialog.component.html b/ui-ngx/src/app/modules/home/pages/rulechain/add-rule-node-dialog.component.html index bc72cd90c0..0da62e48bc 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/add-rule-node-dialog.component.html +++ b/ui-ngx/src/app/modules/home/pages/rulechain/add-rule-node-dialog.component.html @@ -29,16 +29,12 @@
-
- - -
+ +
-
-
-
- - rulenode.name - - + + rulenode.name + + - {{ 'rulenode.name-required' | translate }} - - - {{ 'rulenode.name-max-length' | translate }} - - -
- - {{ 'rulenode.debug-mode' | translate }} - - - {{ 'rulenode.singleton-mode' | translate }} - -
-
- - -
- - rulenode.rule-node-description - - -
+ {{ 'rulenode.name-required' | translate }} + + + {{ 'rulenode.name-max-length' | translate }} + + +
+ + {{ 'rulenode.debug-mode' | translate }} + + + {{ 'rulenode.singleton-mode' | translate }} +
-
+ + + +
+ + rulenode.rule-node-description + + +
diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.ts b/ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.ts index f1d6001c88..5fce7f8e0b 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.ts +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.ts @@ -22,11 +22,11 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms import { FcRuleNode, RuleNodeType } from '@shared/models/rule-node.models'; import { EntityType } from '@shared/models/entity-type.models'; import { Subscription } from 'rxjs'; -import { RuleChainService } from '@core/http/rule-chain.service'; import { RuleNodeConfigComponent } from './rule-node-config.component'; import { Router } from '@angular/router'; import { RuleChainType } from '@app/shared/models/rule-chain.models'; import { ComponentClusteringMode } from '@shared/models/component-descriptor.models'; +import { coerceBoolean } from '@shared/decorators/coercion'; @Component({ selector: 'tb-rule-node', @@ -47,12 +47,11 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O ruleChainType: RuleChainType; @Input() - isEdit: boolean; - - @Input() - isReadOnly: boolean; + @coerceBoolean() + disabled = false; @Input() + @coerceBoolean() isAdd = false; @Output() @@ -70,7 +69,6 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O constructor(protected store: Store, private fb: UntypedFormBuilder, - private ruleChainService: RuleChainService, private router: Router) { super(store); this.ruleNodeFormGroup = this.fb.group({}); @@ -99,6 +97,9 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O } else { this.ruleNodeFormGroup = this.fb.group({}); } + if (this.disabled) { + this.ruleNodeFormGroup.disable({emitEvent: false}); + } } private updateRuleNode() { @@ -108,6 +109,9 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O } ngOnInit(): void { + if (this.disabled) { + this.ruleNodeFormGroup.disable({emitEvent: false}); + } } ngOnChanges(changes: SimpleChanges): void { diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html index c37db14a18..6911558ad4 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html @@ -110,8 +110,6 @@ [ruleNode]="editingRuleNode" [ruleChainId]="ruleChain.id?.id" [ruleChainType]="ruleChainType" - [isEdit]="true" - [isReadOnly]="false" (initRuleNode)="onRuleNodeInit()" (changeScript)="switchToFirstTab()"> diff --git a/ui-ngx/src/app/shared/models/rule-node.models.ts b/ui-ngx/src/app/shared/models/rule-node.models.ts index 2a7dedabec..d38d027607 100644 --- a/ui-ngx/src/app/shared/models/rule-node.models.ts +++ b/ui-ngx/src/app/shared/models/rule-node.models.ts @@ -74,6 +74,7 @@ export interface IRuleNodeConfigurationComponent { ruleNodeId: string; ruleChainId: string; hasScript: boolean; + disabled: boolean; testScriptLabel?: string; changeScript?: EventEmitter; ruleChainType: RuleChainType; @@ -101,6 +102,14 @@ export abstract class RuleNodeConfigurationComponent extends PageComponent imple private configurationSet = false; + set disabled(value: boolean) { + if (value) { + this.configForm().disable({emitEvent: false}); + } else { + this.configForm().enable({emitEvent: false}); + } + }; + set configuration(value: RuleNodeConfiguration) { this.configurationValue = value; if (!this.configurationSet) { diff --git a/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts b/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts index d93dde4530..66f39d080a 100644 --- a/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts +++ b/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts @@ -37,6 +37,8 @@ import { isUndefined } from '@core/utils'; import { CmdWrapper, WsSubscriber } from '@shared/models/websocket/websocket.models'; import { TelemetryWebsocketService } from '@core/ws/telemetry-websocket.service'; +export const NOT_SUPPORTED = 'Not supported!'; + export enum DataKeyType { timeseries = 'timeseries', attribute = 'attribute', diff --git a/ui-ngx/src/styles.scss b/ui-ngx/src/styles.scss index 8e6a9dde75..a2810d925e 100644 --- a/ui-ngx/src/styles.scss +++ b/ui-ngx/src/styles.scss @@ -692,6 +692,21 @@ mat-label { margin: 0; } + .tb-table-widget { + .mat-mdc-table { + .mat-mdc-cell { + background: inherit; + color: inherit; + font-size: inherit; + font-family: inherit; + font-weight: inherit; + line-height: inherit; + letter-spacing: inherit; + text-transform: inherit; + } + } + } + .mat-mdc-footer-row::after, .mat-mdc-header-row::after, .mat-mdc-row::after { content: none; }