Feature/extract historical market data editor to reusable component (#4080)
* Extract historical market data editor to reusable component * Update changelogpull/4091/head^2
parent
c85a1be3cf
commit
11d5f36c31
@ -1,15 +0,0 @@
|
|||||||
import { GfLineChartComponent } from '@ghostfolio/ui/line-chart';
|
|
||||||
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
|
||||||
|
|
||||||
import { AdminMarketDataDetailComponent } from './admin-market-data-detail.component';
|
|
||||||
import { GfMarketDataDetailDialogModule } from './market-data-detail-dialog/market-data-detail-dialog.module';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
declarations: [AdminMarketDataDetailComponent],
|
|
||||||
exports: [AdminMarketDataDetailComponent],
|
|
||||||
imports: [CommonModule, GfLineChartComponent, GfMarketDataDetailDialogModule],
|
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
||||||
})
|
|
||||||
export class GfAdminMarketDataDetailModule {}
|
|
@ -1,26 +0,0 @@
|
|||||||
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 { MatDatepickerModule } from '@angular/material/datepicker';
|
|
||||||
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],
|
|
||||||
imports: [
|
|
||||||
CommonModule,
|
|
||||||
FormsModule,
|
|
||||||
MatButtonModule,
|
|
||||||
MatDatepickerModule,
|
|
||||||
MatDialogModule,
|
|
||||||
MatFormFieldModule,
|
|
||||||
MatInputModule,
|
|
||||||
ReactiveFormsModule
|
|
||||||
],
|
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
||||||
})
|
|
||||||
export class GfMarketDataDetailDialogModule {}
|
|
@ -1,34 +1,58 @@
|
|||||||
import { AdminService } from '@ghostfolio/client/services/admin.service';
|
import { AdminService } from '@ghostfolio/client/services/admin.service';
|
||||||
|
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
import {
|
import {
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
Component,
|
Component,
|
||||||
|
CUSTOM_ELEMENTS_SCHEMA,
|
||||||
Inject,
|
Inject,
|
||||||
OnDestroy
|
OnDestroy
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
|
import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||||
|
import {
|
||||||
|
MAT_DIALOG_DATA,
|
||||||
|
MatDialogModule,
|
||||||
|
MatDialogRef
|
||||||
|
} from '@angular/material/dialog';
|
||||||
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||||
|
import { MatInputModule } from '@angular/material/input';
|
||||||
import { Subject, takeUntil } from 'rxjs';
|
import { Subject, takeUntil } from 'rxjs';
|
||||||
|
|
||||||
import { MarketDataDetailDialogParams } from './interfaces/interfaces';
|
import { HistoricalMarketDataEditorDialogParams } from './interfaces/interfaces';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
host: { class: 'h-100' },
|
|
||||||
selector: 'gf-market-data-detail-dialog',
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
styleUrls: ['./market-data-detail-dialog.scss'],
|
host: { class: 'h-100' },
|
||||||
templateUrl: 'market-data-detail-dialog.html'
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
MatButtonModule,
|
||||||
|
MatDatepickerModule,
|
||||||
|
MatDialogModule,
|
||||||
|
MatFormFieldModule,
|
||||||
|
MatInputModule,
|
||||||
|
ReactiveFormsModule
|
||||||
|
],
|
||||||
|
selector: 'gf-historical-market-data-editor-dialog',
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
standalone: true,
|
||||||
|
styleUrls: ['./historical-market-data-editor-dialog.scss'],
|
||||||
|
templateUrl: 'historical-market-data-editor-dialog.html'
|
||||||
})
|
})
|
||||||
export class MarketDataDetailDialog implements OnDestroy {
|
export class GfHistoricalMarketDataEditorDialogComponent implements OnDestroy {
|
||||||
private unsubscribeSubject = new Subject<void>();
|
private unsubscribeSubject = new Subject<void>();
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
private adminService: AdminService,
|
private adminService: AdminService,
|
||||||
private changeDetectorRef: ChangeDetectorRef,
|
private changeDetectorRef: ChangeDetectorRef,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: MarketDataDetailDialogParams,
|
@Inject(MAT_DIALOG_DATA)
|
||||||
|
public data: HistoricalMarketDataEditorDialogParams,
|
||||||
private dateAdapter: DateAdapter<any>,
|
private dateAdapter: DateAdapter<any>,
|
||||||
public dialogRef: MatDialogRef<MarketDataDetailDialog>,
|
public dialogRef: MatDialogRef<GfHistoricalMarketDataEditorDialogComponent>,
|
||||||
@Inject(MAT_DATE_LOCALE) private locale: string
|
@Inject(MAT_DATE_LOCALE) private locale: string
|
||||||
) {}
|
) {}
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
export * from './historical-market-data-editor.component';
|
Loading…
Reference in new issue