Feature/set up rule settings dialog (#3771)
parent
3de192c65e
commit
fbf377f67f
@ -0,0 +1,5 @@
|
||||
import { PortfolioReportRule } from '@ghostfolio/common/interfaces';
|
||||
|
||||
export interface IRuleSettingsDialogParams {
|
||||
rule: PortfolioReportRule;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
import { PortfolioReportRule } from '@ghostfolio/common/interfaces';
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import {
|
||||
MAT_DIALOG_DATA,
|
||||
MatDialogModule,
|
||||
MatDialogRef
|
||||
} from '@angular/material/dialog';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
|
||||
import { IRuleSettingsDialogParams } from './interfaces/interfaces';
|
||||
|
||||
@Component({
|
||||
imports: [
|
||||
CommonModule,
|
||||
MatButtonModule,
|
||||
MatDialogModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule
|
||||
],
|
||||
selector: 'gf-rule-settings-dialog',
|
||||
standalone: true,
|
||||
styleUrls: ['./rule-settings-dialog.scss'],
|
||||
templateUrl: './rule-settings-dialog.html'
|
||||
})
|
||||
export class GfRuleSettingsDialogComponent {
|
||||
public settings: PortfolioReportRule['settings'];
|
||||
|
||||
public constructor(
|
||||
@Inject(MAT_DIALOG_DATA) public data: IRuleSettingsDialogParams,
|
||||
public dialogRef: MatDialogRef<GfRuleSettingsDialogComponent>
|
||||
) {
|
||||
console.log(this.data.rule);
|
||||
|
||||
this.settings = this.data.rule.settings;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<div mat-dialog-title>{{ data.rule.name }}</div>
|
||||
|
||||
<div class="py-3" mat-dialog-content>
|
||||
<mat-form-field appearance="outline" class="w-100">
|
||||
<mat-label i18n>Threshold Min</mat-label>
|
||||
<input matInput name="thresholdMin" type="number" />
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline" class="w-100">
|
||||
<mat-label i18n>Threshold Max</mat-label>
|
||||
<input matInput name="thresholdMax" type="number" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div align="end" mat-dialog-actions>
|
||||
<button i18n mat-button (click)="dialogRef.close()">Close</button>
|
||||
<button
|
||||
color="primary"
|
||||
mat-flat-button
|
||||
(click)="dialogRef.close({ settings })"
|
||||
>
|
||||
<ng-container i18n>Save</ng-container>
|
||||
</button>
|
||||
</div>
|
@ -0,0 +1,2 @@
|
||||
:host {
|
||||
}
|
Loading…
Reference in new issue