Browse Source

Merge pull request #15362 from mtsymbarov-del/fix/disable-add-telemetry-for-entity-views

Hidden "Add Telemetry" button for Entity view
pull/15384/head
Vladyslav Prykhodko 6 months ago
committed by GitHub
parent
commit
e4e3df7ae9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  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
  3. 1
      ui-ngx/src/app/modules/home/pages/entity-view/entity-view-tabs.component.html

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

@ -90,6 +90,7 @@ import { Filters } from '@shared/models/query/query.models';
import { hidePageSizePixelValue } from '@shared/models/constants'; import { hidePageSizePixelValue } from '@shared/models/constants';
import { DeleteTimeseriesPanelComponent } from '@home/components/attribute/delete-timeseries-panel.component'; import { DeleteTimeseriesPanelComponent } from '@home/components/attribute/delete-timeseries-panel.component';
import { FormBuilder } from '@angular/forms'; import { FormBuilder } from '@angular/forms';
import { coerceBoolean } from '@shared/decorators/coercion';
@Component({ @Component({
selector: 'tb-attribute-table', selector: 'tb-attribute-table',
@ -143,6 +144,10 @@ export class AttributeTableComponent extends PageComponent implements AfterViewI
return this.disableAttributeScopeSelectionValue; return this.disableAttributeScopeSelectionValue;
} }
@Input()
@coerceBoolean()
disableAddTelemetry: boolean;
@Input() @Input()
set disableAttributeScopeSelection(value: boolean) { set disableAttributeScopeSelection(value: boolean) {
this.disableAttributeScopeSelectionValue = coerceBooleanProperty(value); this.disableAttributeScopeSelectionValue = coerceBooleanProperty(value);

1
ui-ngx/src/app/modules/home/pages/entity-view/entity-view-tabs.component.html

@ -27,6 +27,7 @@
label="{{ 'attribute.latest-telemetry' | translate }}" #telemetryTab="matTab"> label="{{ 'attribute.latest-telemetry' | translate }}" #telemetryTab="matTab">
<tb-attribute-table [defaultAttributeScope]="latestTelemetryTypes.LATEST_TELEMETRY" <tb-attribute-table [defaultAttributeScope]="latestTelemetryTypes.LATEST_TELEMETRY"
disableAttributeScopeSelection disableAttributeScopeSelection
disableAddTelemetry
[active]="telemetryTab.isActive" [active]="telemetryTab.isActive"
[entityId]="entity.id" [entityId]="entity.id"
[entityName]="entity.name"> [entityName]="entity.name">

Loading…
Cancel
Save