Merge pull request #5995 from pinkevmladchy/add-copyDashboardId-button-in-details-panel

[3.4] UI: Add copyDashboardId button in details-panel
This commit is contained in:
Igor Kulikov 2022-06-10 17:48:31 +03:00 committed by GitHub
commit d3b7a334aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 0 deletions

View File

@ -66,6 +66,16 @@
{{'dashboard.delete' | translate }}
</button>
</div>
<div fxLayout="row">
<button mat-raised-button
ngxClipboard
(cbOnSuccess)="onDashboardIdCopied($event)"
[cbContent]="entity?.id?.id"
[fxShow]="!isEdit">
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
<span translate>dashboard.copyId</span>
</button>
</div>
<div class="mat-padding" fxLayout="column">
<mat-form-field class="mat-block"
[fxShow]="!isEdit && assignedCustomersText?.length

View File

@ -119,6 +119,17 @@ export class DashboardFormComponent extends EntityComponent<Dashboard> {
}));
}
onDashboardIdCopied($event) {
this.store.dispatch(new ActionNotificationShow(
{
message: this.translate.instant('dashboard.idCopiedMessage'),
type: 'success',
duration: 750,
verticalPosition: 'bottom',
horizontalPosition: 'right'
}));
}
private updateFields(entity: Dashboard): void {
if (entity && !isEqual(entity, {})) {
this.assignedCustomersText = getDashboardAssignedCustomersText(entity);

View File

@ -937,6 +937,8 @@
"assignedToCustomer": "Assigned to customer",
"assignedToCustomers": "Assigned to customers",
"public": "Public",
"copyId": "Copy dashboard id",
"idCopiedMessage": "Dashboard Id has been copied to clipboard",
"public-link": "Public link",
"copy-public-link": "Copy public link",
"public-link-copied-message": "Dashboard public link has been copied to clipboard",

View File

@ -483,6 +483,8 @@
"add-widget": "Добавить новый виджет",
"title": "Название",
"select-widget-title": "Выберите виджет",
"copyId": "Копировать идентификатор дашборда",
"idCopiedMessage": "Идентификатор дашборда скопирован в буфер обмена",
"select-widget-subtitle": "Список доступных виджетов",
"delete": "Удалить дашборд",
"title-required": "Название обязательно.",

View File

@ -594,6 +594,8 @@
"add-widget": "Додати новий віджет",
"title": "Назва",
"select-widget-title": "Вибрати віджет",
"copyId": "Копіювати ідентифікатор панелі приладів",
"idCopiedMessage": "Ідентифікатор панелі приладів скопійовано в буфер обміну",
"select-widget-subtitle": "Список доступних типів віджетів",
"delete": "Видалити панель приладів",
"title-required": "Необхідно задати назву.",