Browse Source
Merge pull request #5995 from pinkevmladchy/add-copyDashboardId-button-in-details-panel
[3.4] UI: Add copyDashboardId button in details-panel
pull/6698/head
Igor Kulikov
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
27 additions and
0 deletions
-
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.html
-
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts
-
ui-ngx/src/assets/locale/locale.constant-en_US.json
-
ui-ngx/src/assets/locale/locale.constant-ru_RU.json
-
ui-ngx/src/assets/locale/locale.constant-uk_UA.json
|
|
|
@ -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 |
|
|
|
|
|
|
|
@ -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); |
|
|
|
|
|
|
|
@ -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", |
|
|
|
|
|
|
|
@ -483,6 +483,8 @@ |
|
|
|
"add-widget": "Добавить новый виджет", |
|
|
|
"title": "Название", |
|
|
|
"select-widget-title": "Выберите виджет", |
|
|
|
"copyId": "Копировать идентификатор дашборда", |
|
|
|
"idCopiedMessage": "Идентификатор дашборда скопирован в буфер обмена", |
|
|
|
"select-widget-subtitle": "Список доступных виджетов", |
|
|
|
"delete": "Удалить дашборд", |
|
|
|
"title-required": "Название обязательно.", |
|
|
|
|
|
|
|
@ -594,6 +594,8 @@ |
|
|
|
"add-widget": "Додати новий віджет", |
|
|
|
"title": "Назва", |
|
|
|
"select-widget-title": "Вибрати віджет", |
|
|
|
"copyId": "Копіювати ідентифікатор панелі приладів", |
|
|
|
"idCopiedMessage": "Ідентифікатор панелі приладів скопійовано в буфер обміну", |
|
|
|
"select-widget-subtitle": "Список доступних типів віджетів", |
|
|
|
"delete": "Видалити панель приладів", |
|
|
|
"title-required": "Необхідно задати назву.", |
|
|
|
|