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> </div>
<span class="flex-1"></span> <span class="flex-1"></span>
<button mat-icon-button <button mat-icon-button
*ngIf="attributeScope !== attributeScopeTypes.CLIENT_SCOPE" *ngIf="attributeScope !== attributeScopeTypes.CLIENT_SCOPE && !disableAddTelemetry"
[disabled]="isLoading$ | async" [disabled]="isLoading$ | async"
(click)="addAttribute($event)" (click)="addAttribute($event)"
matTooltip="{{ 'action.add' | translate }}" 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; activeValue = false;
dirtyValue = false; dirtyValue = false;
entityIdValue: EntityId; entityIdValue: EntityId;
entityType = EntityType;
attributeScopeSelectionReadonly = false; attributeScopeSelectionReadonly = false;
@ -143,6 +144,10 @@ export class AttributeTableComponent extends PageComponent implements AfterViewI
return this.disableAttributeScopeSelectionValue; return this.disableAttributeScopeSelectionValue;
} }
get disableAddTelemetry(): boolean {
return this.defaultAttributeScope === this.latestTelemetryTypes.LATEST_TELEMETRY && this.entityType.ENTITY_VIEW === this.entityIdValue.entityType;
}
@Input() @Input()
set disableAttributeScopeSelection(value: boolean) { set disableAttributeScopeSelection(value: boolean) {
this.disableAttributeScopeSelectionValue = coerceBooleanProperty(value); this.disableAttributeScopeSelectionValue = coerceBooleanProperty(value);

Loading…
Cancel
Save