mirror of https://github.com/ghostfolio/ghostfolio
Thomas Kaul
3 years ago
committed by
GitHub
16 changed files with 299 additions and 9 deletions
@ -0,0 +1,5 @@ |
|||
export interface MarketDataDetailDialogParams { |
|||
date: string; |
|||
marketPrice: number; |
|||
symbol: string; |
|||
} |
@ -0,0 +1,37 @@ |
|||
import { |
|||
ChangeDetectionStrategy, |
|||
Component, |
|||
Inject, |
|||
OnDestroy |
|||
} from '@angular/core'; |
|||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; |
|||
import { Subject } from 'rxjs'; |
|||
|
|||
import { MarketDataDetailDialogParams } from './interfaces/interfaces'; |
|||
|
|||
@Component({ |
|||
host: { class: 'h-100' }, |
|||
selector: 'gf-market-data-detail-dialog', |
|||
changeDetection: ChangeDetectionStrategy.OnPush, |
|||
styleUrls: ['./market-data-detail-dialog.scss'], |
|||
templateUrl: 'market-data-detail-dialog.html' |
|||
}) |
|||
export class MarketDataDetailDialog implements OnDestroy { |
|||
private unsubscribeSubject = new Subject<void>(); |
|||
|
|||
public constructor( |
|||
public dialogRef: MatDialogRef<MarketDataDetailDialog>, |
|||
@Inject(MAT_DIALOG_DATA) public data: MarketDataDetailDialogParams |
|||
) {} |
|||
|
|||
public ngOnInit() {} |
|||
|
|||
public onCancel(): void { |
|||
this.dialogRef.close(); |
|||
} |
|||
|
|||
public ngOnDestroy() { |
|||
this.unsubscribeSubject.next(); |
|||
this.unsubscribeSubject.complete(); |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
<form class="d-flex flex-column h-100"> |
|||
<h1 mat-dialog-title i18n>Details for {{ data.symbol }}</h1> |
|||
<div class="flex-grow-1" mat-dialog-content> |
|||
<div> |
|||
<mat-form-field appearance="outline" class="w-100"> |
|||
<mat-label i18n>Date</mat-label> |
|||
<input matInput name="date" readonly [(ngModel)]="data.date" /> |
|||
</mat-form-field> |
|||
</div> |
|||
<div> |
|||
<mat-form-field appearance="outline" class="w-100"> |
|||
<mat-label i18n>MarketPrice</mat-label> |
|||
<input |
|||
matInput |
|||
name="marketPrice" |
|||
readonly |
|||
[(ngModel)]="data.marketPrice" |
|||
/> |
|||
</mat-form-field> |
|||
</div> |
|||
</div> |
|||
<div class="justify-content-end" mat-dialog-actions> |
|||
<button i18n mat-button (click)="onCancel()">Cancel</button> |
|||
</div> |
|||
</form> |
@ -0,0 +1,26 @@ |
|||
import { CommonModule } from '@angular/common'; |
|||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; |
|||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
|||
import { MatButtonModule } from '@angular/material/button'; |
|||
import { MatDialogModule } from '@angular/material/dialog'; |
|||
import { MatFormFieldModule } from '@angular/material/form-field'; |
|||
import { MatInputModule } from '@angular/material/input'; |
|||
|
|||
import { MarketDataDetailDialog } from './market-data-detail-dialog.component'; |
|||
|
|||
@NgModule({ |
|||
declarations: [MarketDataDetailDialog], |
|||
exports: [], |
|||
imports: [ |
|||
CommonModule, |
|||
FormsModule, |
|||
MatButtonModule, |
|||
MatDialogModule, |
|||
MatFormFieldModule, |
|||
MatInputModule, |
|||
ReactiveFormsModule |
|||
], |
|||
providers: [], |
|||
schemas: [CUSTOM_ELEMENTS_SCHEMA] |
|||
}) |
|||
export class GfMarketDataDetailDialogModule {} |
@ -0,0 +1,7 @@ |
|||
:host { |
|||
display: block; |
|||
|
|||
.mat-dialog-content { |
|||
max-height: unset; |
|||
} |
|||
} |
@ -1,12 +1,19 @@ |
|||
import { CommonModule } from '@angular/common'; |
|||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; |
|||
import { MatButtonModule } from '@angular/material/button'; |
|||
import { MatMenuModule } from '@angular/material/menu'; |
|||
import { GfAdminMarketDataDetailModule } from '@ghostfolio/client/components/admin-market-data-detail/admin-market-data-detail.module'; |
|||
|
|||
import { AdminMarketDataComponent } from './admin-market-data.component'; |
|||
|
|||
@NgModule({ |
|||
declarations: [AdminMarketDataComponent], |
|||
imports: [CommonModule, GfAdminMarketDataDetailModule], |
|||
imports: [ |
|||
CommonModule, |
|||
GfAdminMarketDataDetailModule, |
|||
MatButtonModule, |
|||
MatMenuModule |
|||
], |
|||
schemas: [CUSTOM_ELEMENTS_SCHEMA] |
|||
}) |
|||
export class GfAdminMarketDataModule {} |
|||
|
Loading…
Reference in new issue