UI: Add copy button for attribute table cell

This commit is contained in:
Artem Dzhereleiko 2023-04-28 14:42:08 +03:00
parent f5c9854aad
commit def7b203ef
2 changed files with 27 additions and 3 deletions

View File

@ -161,7 +161,18 @@
<ng-container matColumnDef="key">
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 40%"> {{ 'attribute.key' | translate }} </mat-header-cell>
<mat-cell *matCellDef="let attribute">
{{ attribute.key }}
<div fxLayout="row" style="align-items: center">
<span>{{ attribute.key }}</span>
<tb-copy-button
[disabled]="isLoading$ | async"
[copyText]="attribute.key"
tooltipText="{{ 'attribute.copy-key' | translate }}"
tooltipPosition="above"
icon="content_copy"
[style]="{padding: '4px', 'font-size': '16px', color: 'rgba(0,0,0,.87)'}"
>
</tb-copy-button>
</div>
</mat-cell>
</ng-container>
<ng-container matColumnDef="value">
@ -170,7 +181,18 @@
class="tb-value-cell"
(click)="editAttribute($event, attribute)">
<div fxLayout="row" style="align-items: center">
<span style="overflow: hidden;text-overflow: ellipsis;" fxFlex>{{attribute.value | tbJson}}</span>
<div fxFlex>
<span style="overflow: hidden;text-overflow: ellipsis;">{{attribute.value | tbJson}}</span>
<tb-copy-button
[disabled]="isLoading$ | async"
[copyText]="attribute.value | tbJson"
tooltipText="{{ 'attribute.copy-value' | translate }}"
tooltipPosition="above"
icon="content_copy"
[style]="{padding: '4px', 'font-size': '16px', color: 'rgba(0,0,0,.87)'}"
>
</tb-copy-button>
</div>
<span [fxShow]="!isClientSideTelemetryTypeMap.get(attributeScope)">
<mat-icon>edit</mat-icon>
</span>

View File

@ -691,7 +691,9 @@
"selected-attributes": "{ count, plural, =1 {1 attribute} other {# attributes} } selected",
"selected-telemetry": "{ count, plural, =1 {1 telemetry unit} other {# telemetry units} } selected",
"no-attributes-text": "No attributes found",
"no-telemetry-text": "No telemetry found"
"no-telemetry-text": "No telemetry found",
"copy-key": "Copy key",
"copy-value": "Copy value"
},
"api-usage": {
"api-features": "API features",