Browse Source

Add condition to not display "Add Telemetry" button for Entity view type

pull/15362/head
Maksym Tsymbarov 6 months ago
parent
commit
77e3b5cd8d
  1. 2
      ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.html
  2. 5
      ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts

2
ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.html

@ -34,7 +34,7 @@
</div>
<span class="flex-1"></span>
<button mat-icon-button
*ngIf="attributeScope !== attributeScopeTypes.CLIENT_SCOPE"
*ngIf="attributeScope !== attributeScopeTypes.CLIENT_SCOPE && !disableAddTelemetry"
[disabled]="isLoading$ | async"
(click)="addAttribute($event)"
matTooltip="{{ 'action.add' | translate }}"

5
ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts

@ -121,6 +121,7 @@ export class AttributeTableComponent extends PageComponent implements AfterViewI
activeValue = false;
dirtyValue = false;
entityIdValue: EntityId;
entityType = EntityType;
attributeScopeSelectionReadonly = false;
@ -143,6 +144,10 @@ export class AttributeTableComponent extends PageComponent implements AfterViewI
return this.disableAttributeScopeSelectionValue;
}
get disableAddTelemetry(): boolean {
return this.defaultAttributeScope === this.latestTelemetryTypes.LATEST_TELEMETRY && this.entityType.ENTITY_VIEW === this.entityIdValue.entityType;
}
@Input()
set disableAttributeScopeSelection(value: boolean) {
this.disableAttributeScopeSelectionValue = coerceBooleanProperty(value);

Loading…
Cancel
Save