mirror of https://github.com/ghostfolio/ghostfolio
committed by
GitHub
7 changed files with 176 additions and 5 deletions
@ -0,0 +1,7 @@ |
|||||
|
import { AdminUsers } from '@ghostfolio/common/interfaces'; |
||||
|
|
||||
|
export interface UserDetailDialogParams { |
||||
|
deviceType: string; |
||||
|
locale: string; |
||||
|
userData: AdminUsers['users'][0]; |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
:host { |
||||
|
display: block; |
||||
|
|
||||
|
.mat-mdc-dialog-content { |
||||
|
max-height: unset; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,52 @@ |
|||||
|
import { GfDialogFooterComponent } from '@ghostfolio/client/components/dialog-footer/dialog-footer.component'; |
||||
|
import { GfDialogHeaderComponent } from '@ghostfolio/client/components/dialog-header/dialog-header.component'; |
||||
|
import { GfValueComponent } from '@ghostfolio/ui/value'; |
||||
|
|
||||
|
import { CommonModule } from '@angular/common'; |
||||
|
import { |
||||
|
ChangeDetectionStrategy, |
||||
|
Component, |
||||
|
CUSTOM_ELEMENTS_SCHEMA, |
||||
|
Inject, |
||||
|
OnDestroy |
||||
|
} from '@angular/core'; |
||||
|
import { MatButtonModule } from '@angular/material/button'; |
||||
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; |
||||
|
import { MatDialogModule } from '@angular/material/dialog'; |
||||
|
import { Subject } from 'rxjs'; |
||||
|
|
||||
|
import { UserDetailDialogParams } from './interfaces/interfaces'; |
||||
|
|
||||
|
@Component({ |
||||
|
changeDetection: ChangeDetectionStrategy.OnPush, |
||||
|
host: { class: 'd-flex flex-column h-100' }, |
||||
|
imports: [ |
||||
|
CommonModule, |
||||
|
GfDialogFooterComponent, |
||||
|
GfDialogHeaderComponent, |
||||
|
GfValueComponent, |
||||
|
MatButtonModule, |
||||
|
MatDialogModule |
||||
|
], |
||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA], |
||||
|
selector: 'gf-user-detail-dialog', |
||||
|
styleUrls: ['./user-detail-dialog.component.scss'], |
||||
|
templateUrl: './user-detail-dialog.html' |
||||
|
}) |
||||
|
export class GfUserDetailDialogComponent implements OnDestroy { |
||||
|
private unsubscribeSubject = new Subject<void>(); |
||||
|
|
||||
|
public constructor( |
||||
|
@Inject(MAT_DIALOG_DATA) public data: UserDetailDialogParams, |
||||
|
public dialogRef: MatDialogRef<GfUserDetailDialogComponent> |
||||
|
) {} |
||||
|
|
||||
|
public onClose() { |
||||
|
this.dialogRef.close(); |
||||
|
} |
||||
|
|
||||
|
public ngOnDestroy() { |
||||
|
this.unsubscribeSubject.next(); |
||||
|
this.unsubscribeSubject.complete(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
<gf-dialog-header |
||||
|
position="center" |
||||
|
[deviceType]="data.deviceType" |
||||
|
(closeButtonClicked)="onClose()" |
||||
|
/> |
||||
|
|
||||
|
<div class="flex-grow-1" mat-dialog-content> |
||||
|
<div class="container p-0"> |
||||
|
<div class="mb-3 row"> |
||||
|
<div class="col-6 mb-3"> |
||||
|
<gf-value i18n size="medium" [value]="data.userData.id" |
||||
|
>User ID</gf-value |
||||
|
> |
||||
|
</div> |
||||
|
<div class="col-6 mb-3"> |
||||
|
<gf-value |
||||
|
i18n |
||||
|
size="medium" |
||||
|
[isDate]="true" |
||||
|
[locale]="data.locale" |
||||
|
[value]="data.userData.createdAt" |
||||
|
>Registration Date</gf-value |
||||
|
> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<gf-dialog-footer |
||||
|
[deviceType]="data.deviceType" |
||||
|
(closeButtonClicked)="onClose()" |
||||
|
/> |
||||
Loading…
Reference in new issue