diff --git a/ui-ngx/src/app/modules/home/components/vc/complex-version-create.component.ts b/ui-ngx/src/app/modules/home/components/vc/complex-version-create.component.ts index 50edca8ce7..6aab7d147a 100644 --- a/ui-ngx/src/app/modules/home/components/vc/complex-version-create.component.ts +++ b/ui-ngx/src/app/modules/home/components/vc/complex-version-create.component.ts @@ -120,32 +120,34 @@ export class ComplexVersionCreateComponent extends PageComponent implements OnIn this.popoverComponent.updatePosition(); } - this.versionCreateResultSubscription = this.versionCreateResult$.subscribe((result) => { - let message: string; - if (!result.error) { - if (result.done && !result.added && !result.modified && !result.removed) { - message = this.translate.instant('version-control.nothing-to-commit'); + this.versionCreateResultSubscription = this.versionCreateResult$.subscribe({ + next: (result) => { + let message: string; + if (!result.error) { + if (result.done && !result.added && !result.modified && !result.removed) { + message = this.translate.instant('version-control.nothing-to-commit'); + } else { + message = this.translate.instant('version-control.version-create-result', + {added: result.added, modified: result.modified, removed: result.removed}); + } } else { - message = this.translate.instant('version-control.version-create-result', - {added: result.added, modified: result.modified, removed: result.removed}); - } - } else { message = result.error; - } - this.resultMessage = this.sanitizer.bypassSecurityTrustHtml(message); - this.versionCreateResult = result; - this.versionCreateBranch = request.branch; - this.cd.detectChanges(); - if (this.popoverComponent) { - this.popoverComponent.updatePosition(); - } - }, - (error) => { - this.hasError = true; - this.resultMessage = this.sanitizer.bypassSecurityTrustHtml(parseHttpErrorMessage(error, this.translate).message); - this.cd.detectChanges(); - if (this.popoverComponent) { - this.popoverComponent.updatePosition(); + } + this.resultMessage = this.sanitizer.bypassSecurityTrustHtml(message); + this.versionCreateResult = result; + this.versionCreateBranch = request.branch; + this.cd.detectChanges(); + if (this.popoverComponent) { + this.popoverComponent.updatePosition(); + } + }, + error: (error) => { + this.hasError = true; + this.resultMessage = this.sanitizer.bypassSecurityTrustHtml(parseHttpErrorMessage(error, this.translate).message); + this.cd.detectChanges(); + if (this.popoverComponent) { + this.popoverComponent.updatePosition(); + } } }); } diff --git a/ui-ngx/src/app/modules/home/components/vc/entity-types-version-create.component.ts b/ui-ngx/src/app/modules/home/components/vc/entity-types-version-create.component.ts index e87d712534..b41e51c5c2 100644 --- a/ui-ngx/src/app/modules/home/components/vc/entity-types-version-create.component.ts +++ b/ui-ngx/src/app/modules/home/components/vc/entity-types-version-create.component.ts @@ -18,12 +18,12 @@ import { Component, forwardRef, Input, OnInit } from '@angular/core'; import { AbstractControl, ControlValueAccessor, + NG_VALIDATORS, + NG_VALUE_ACCESSOR, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, - NG_VALIDATORS, - NG_VALUE_ACCESSOR, Validator, Validators } from '@angular/forms'; @@ -104,6 +104,9 @@ export class EntityTypesVersionCreateComponent extends PageComponent implements this.entityTypesVersionCreateFormGroup.disable({emitEvent: false}); } else { this.entityTypesVersionCreateFormGroup.enable({emitEvent: false}); + (this.entityTypesVersionCreateFormGroup.get('entityTypes') as UntypedFormArray).controls.forEach( + control => this.updateEntityTypeValidators(control) + ); } } @@ -147,7 +150,7 @@ export class EntityTypesVersionCreateComponent extends PageComponent implements } ); this.updateEntityTypeValidators(entityTypeControl); - entityTypeControl.get('config').get('allEntities').valueChanges.subscribe(() => { + entityTypeControl.get('config.allEntities').valueChanges.subscribe(() => { this.updateEntityTypeValidators(entityTypeControl); }); return entityTypeControl; @@ -229,7 +232,7 @@ export class EntityTypesVersionCreateComponent extends PageComponent implements allowedEntityTypes(entityTypeControl?: AbstractControl): Array { let res = [...exportableEntityTypes]; const currentEntityType: EntityType = entityTypeControl?.get('entityType')?.value; - const value: [{entityType: string, config: EntityTypeVersionCreateConfig}] = + const value: [{entityType: string; config: EntityTypeVersionCreateConfig}] = this.entityTypesVersionCreateFormGroup.get('entityTypes').value || []; const usedEntityTypes = value.map(val => val.entityType).filter(val => val); res = res.filter(entityType => !usedEntityTypes.includes(entityType) || entityType === currentEntityType); @@ -237,7 +240,7 @@ export class EntityTypesVersionCreateComponent extends PageComponent implements } private updateModel() { - const value: [{entityType: string, config: EntityTypeVersionCreateConfig}] = + const value: [{entityType: string; config: EntityTypeVersionCreateConfig}] = this.entityTypesVersionCreateFormGroup.get('entityTypes').value || []; let modelValue: {[entityType: string]: EntityTypeVersionCreateConfig} = null; if (value && value.length) { 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 a4e34029f5..b16322bea5 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 @@ -271,7 +271,7 @@ {{ 'widget-config.alarm-source' | translate }} -
+
diff --git a/ui-ngx/src/app/modules/home/pages/edge/edge.component.html b/ui-ngx/src/app/modules/home/pages/edge/edge.component.html index 15759508c2..ef0c452a7b 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edge.component.html +++ b/ui-ngx/src/app/modules/home/pages/edge/edge.component.html @@ -40,49 +40,48 @@ [fxShow]="!isEdit && (edgeScope === 'customer' || edgeScope === 'tenant') && isAssignedToCustomer(entity)"> {{ (entity?.customerIsPublic ? 'edge.make-private' : 'edge.unassign-from-customer') | translate }} + + + + + -
- - - - - -
-
+