Merge pull request #5051 from rusikv/feature/copy-user-id-button
[3.3.1] UI: add copy user id button in user details
This commit is contained in:
commit
cd4e456b79
@ -53,6 +53,17 @@
|
||||
[fxShow]="!hideDelete() && !isEdit">
|
||||
{{'user.delete' | translate }}
|
||||
</button>
|
||||
<div fxLayout="row" fxLayout.xs="column">
|
||||
<button mat-raised-button
|
||||
ngxClipboard
|
||||
(cbOnSuccess)="onUserIdCopied($event)"
|
||||
[cbContent]="entity?.id?.id"
|
||||
[disabled]="(isLoading$ | async)"
|
||||
[fxShow]="!isEdit">
|
||||
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
|
||||
<span translate>user.copyId</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mat-padding" fxLayout="column">
|
||||
<form [formGroup]="entityForm">
|
||||
|
||||
@ -25,6 +25,8 @@ import { map } from 'rxjs/operators';
|
||||
import { Authority } from '@shared/models/authority.enum';
|
||||
import { isDefinedAndNotNull, isUndefined } from '@core/utils';
|
||||
import { EntityTableConfig } from '@home/models/entity/entities-table-config.models';
|
||||
import { ActionNotificationShow } from '@app/core/notification/notification.actions';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'tb-user',
|
||||
@ -44,7 +46,8 @@ export class UserComponent extends EntityComponent<User> {
|
||||
@Optional() @Inject('entity') protected entityValue: User,
|
||||
@Optional() @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig<User>,
|
||||
public fb: FormBuilder,
|
||||
protected cd: ChangeDetectorRef) {
|
||||
protected cd: ChangeDetectorRef,
|
||||
protected translate: TranslateService) {
|
||||
super(store, fb, entityValue, entitiesTableConfigValue, cd);
|
||||
}
|
||||
|
||||
@ -100,4 +103,16 @@ export class UserComponent extends EntityComponent<User> {
|
||||
isDefinedAndNotNull(entity.additionalInfo.homeDashboardHideToolbar) ? entity.additionalInfo.homeDashboardHideToolbar : true}});
|
||||
}
|
||||
|
||||
onUserIdCopied($event) {
|
||||
this.store.dispatch(new ActionNotificationShow(
|
||||
{
|
||||
message: this.translate.instant('user.idCopiedMessage'),
|
||||
type: 'success',
|
||||
duration: 750,
|
||||
verticalPosition: 'bottom',
|
||||
horizontalPosition: 'right'
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2808,7 +2808,9 @@
|
||||
"disable-account": "Disable User Account",
|
||||
"enable-account": "Enable User Account",
|
||||
"enable-account-message": "User account was successfully enabled!",
|
||||
"disable-account-message": "User account was successfully disabled!"
|
||||
"disable-account-message": "User account was successfully disabled!",
|
||||
"copyId": "Copy user Id",
|
||||
"idCopiedMessage": "User Id has been copied to clipboard"
|
||||
},
|
||||
"value": {
|
||||
"type": "Value type",
|
||||
|
||||
@ -1510,7 +1510,9 @@
|
||||
"disable-account": "Отключить учетную запись пользователя",
|
||||
"enable-account": "Включить учетную запись пользователя",
|
||||
"enable-account-message": "Учетная запись пользователя была успешно включена!",
|
||||
"disable-account-message": "Учетная запись пользователя была успешно отключена!"
|
||||
"disable-account-message": "Учетная запись пользователя была успешно отключена!",
|
||||
"copyId": "Копировать ИД пользователя",
|
||||
"idCopiedMessage": "ИД пользователя скопирован в буфер обмена"
|
||||
},
|
||||
"value": {
|
||||
"type": "Тип значения",
|
||||
|
||||
@ -2078,7 +2078,9 @@
|
||||
"disable-account": "Вимкнути обліковий запис користувача",
|
||||
"enable-account": "Увімкнути обліковий запис користувача",
|
||||
"enable-account-message": "Обліковий запис користувача успішно увімкнено!",
|
||||
"disabled-account-message": "Обліковий запис користувача успішно вимкнено!"
|
||||
"disabled-account-message": "Обліковий запис користувача успішно вимкнено!",
|
||||
"copyId": "Копіювати Id користувача",
|
||||
"idCopiedMessage": "Id користувача було скопійовано в буфер обміну"
|
||||
},
|
||||
"value": {
|
||||
"type": "Тип значення",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user