Feature/extend asset profile details dialog by currency and symbol (#1565)
* Extend asset profile details dialog * Update changelog
This commit is contained in:
parent
eb4d088a80
commit
07dd22f7fe
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Optimized the page titles in the header for mobile
|
- Optimized the page titles in the header for mobile
|
||||||
|
- Extended the asset profile details dialog in the admin control panel
|
||||||
|
|
||||||
## 1.222.0 - 2022-12-29
|
## 1.222.0 - 2022-12-29
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ import {
|
|||||||
addDays,
|
addDays,
|
||||||
format,
|
format,
|
||||||
isBefore,
|
isBefore,
|
||||||
isDate,
|
|
||||||
isSameDay,
|
isSameDay,
|
||||||
isToday,
|
isToday,
|
||||||
isValid,
|
isValid,
|
||||||
@ -31,6 +30,7 @@ import { last } from 'lodash';
|
|||||||
import { DeviceDetectorService } from 'ngx-device-detector';
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
||||||
import { Subject, takeUntil } from 'rxjs';
|
import { Subject, takeUntil } from 'rxjs';
|
||||||
|
|
||||||
|
import { MarketDataDetailDialogParams } from './market-data-detail-dialog/interfaces/interfaces';
|
||||||
import { MarketDataDetailDialog } from './market-data-detail-dialog/market-data-detail-dialog.component';
|
import { MarketDataDetailDialog } from './market-data-detail-dialog/market-data-detail-dialog.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -40,6 +40,7 @@ import { MarketDataDetailDialog } from './market-data-detail-dialog/market-data-
|
|||||||
templateUrl: './admin-market-data-detail.component.html'
|
templateUrl: './admin-market-data-detail.component.html'
|
||||||
})
|
})
|
||||||
export class AdminMarketDataDetailComponent implements OnChanges, OnInit {
|
export class AdminMarketDataDetailComponent implements OnChanges, OnInit {
|
||||||
|
@Input() currency: string;
|
||||||
@Input() dataSource: DataSource;
|
@Input() dataSource: DataSource;
|
||||||
@Input() dateOfFirstActivity: string;
|
@Input() dateOfFirstActivity: string;
|
||||||
@Input() locale = getLocale();
|
@Input() locale = getLocale();
|
||||||
@ -161,9 +162,10 @@ export class AdminMarketDataDetailComponent implements OnChanges, OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const dialogRef = this.dialog.open(MarketDataDetailDialog, {
|
const dialogRef = this.dialog.open(MarketDataDetailDialog, {
|
||||||
data: {
|
data: <MarketDataDetailDialogParams>{
|
||||||
date,
|
date,
|
||||||
marketPrice,
|
marketPrice,
|
||||||
|
currency: this.currency,
|
||||||
dataSource: this.dataSource,
|
dataSource: this.dataSource,
|
||||||
symbol: this.symbol,
|
symbol: this.symbol,
|
||||||
user: this.user
|
user: this.user
|
||||||
|
@ -2,6 +2,7 @@ import { User } from '@ghostfolio/common/interfaces';
|
|||||||
import { DataSource } from '@prisma/client';
|
import { DataSource } from '@prisma/client';
|
||||||
|
|
||||||
export interface MarketDataDetailDialogParams {
|
export interface MarketDataDetailDialogParams {
|
||||||
|
currency: string;
|
||||||
dataSource: DataSource;
|
dataSource: DataSource;
|
||||||
date: Date;
|
date: Date;
|
||||||
marketPrice: number;
|
marketPrice: number;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<form class="d-flex flex-column h-100">
|
<form class="d-flex flex-column h-100">
|
||||||
<h1 mat-dialog-title i18n>Details for {{ data.symbol }}</h1>
|
<h1 i18n mat-dialog-title>Details for {{ data.symbol }}</h1>
|
||||||
<div class="flex-grow-1" mat-dialog-content>
|
<div class="flex-grow-1" mat-dialog-content>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<mat-form-field appearance="outline" class="w-100">
|
<mat-form-field appearance="outline" class="w-100">
|
||||||
@ -30,6 +30,7 @@
|
|||||||
type="number"
|
type="number"
|
||||||
[(ngModel)]="data.marketPrice"
|
[(ngModel)]="data.marketPrice"
|
||||||
/>
|
/>
|
||||||
|
<span class="ml-2" matSuffix>{{ data.currency }}</span>
|
||||||
<button
|
<button
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
matSuffix
|
matSuffix
|
||||||
|
@ -14,6 +14,7 @@ import {
|
|||||||
EnhancedSymbolProfile,
|
EnhancedSymbolProfile,
|
||||||
UniqueAsset
|
UniqueAsset
|
||||||
} from '@ghostfolio/common/interfaces';
|
} from '@ghostfolio/common/interfaces';
|
||||||
|
import { translate } from '@ghostfolio/ui/i18n';
|
||||||
import { MarketData } from '@prisma/client';
|
import { MarketData } from '@prisma/client';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
@ -28,11 +29,13 @@ import { AssetProfileDialogParams } from './interfaces/interfaces';
|
|||||||
styleUrls: ['./asset-profile-dialog.component.scss']
|
styleUrls: ['./asset-profile-dialog.component.scss']
|
||||||
})
|
})
|
||||||
export class AssetProfileDialog implements OnDestroy, OnInit {
|
export class AssetProfileDialog implements OnDestroy, OnInit {
|
||||||
|
public assetClass: string;
|
||||||
public assetProfile: EnhancedSymbolProfile;
|
public assetProfile: EnhancedSymbolProfile;
|
||||||
public assetProfileForm = this.formBuilder.group({
|
public assetProfileForm = this.formBuilder.group({
|
||||||
comment: '',
|
comment: '',
|
||||||
symbolMapping: ''
|
symbolMapping: ''
|
||||||
});
|
});
|
||||||
|
public assetSubClass: string;
|
||||||
public countries: {
|
public countries: {
|
||||||
[code: string]: { name: string; value: number };
|
[code: string]: { name: string; value: number };
|
||||||
};
|
};
|
||||||
@ -64,6 +67,9 @@ export class AssetProfileDialog implements OnDestroy, OnInit {
|
|||||||
.pipe(takeUntil(this.unsubscribeSubject))
|
.pipe(takeUntil(this.unsubscribeSubject))
|
||||||
.subscribe(({ assetProfile, marketData }) => {
|
.subscribe(({ assetProfile, marketData }) => {
|
||||||
this.assetProfile = assetProfile;
|
this.assetProfile = assetProfile;
|
||||||
|
|
||||||
|
this.assetClass = translate(this.assetProfile?.assetClass);
|
||||||
|
this.assetSubClass = translate(this.assetProfile?.assetSubClass);
|
||||||
this.countries = {};
|
this.countries = {};
|
||||||
this.marketDataDetails = marketData;
|
this.marketDataDetails = marketData;
|
||||||
this.sectors = {};
|
this.sectors = {};
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
<div class="flex-grow-1" mat-dialog-content>
|
<div class="flex-grow-1" mat-dialog-content>
|
||||||
<gf-admin-market-data-detail
|
<gf-admin-market-data-detail
|
||||||
class="mb-3"
|
class="mb-3"
|
||||||
|
[currency]="assetProfile?.currency"
|
||||||
[dataSource]="data.dataSource"
|
[dataSource]="data.dataSource"
|
||||||
[dateOfFirstActivity]="assetProfile?.dateOfFirstActivity"
|
[dateOfFirstActivity]="assetProfile?.dateOfFirstActivity"
|
||||||
[locale]="data.locale"
|
[locale]="data.locale"
|
||||||
@ -51,6 +52,16 @@
|
|||||||
(marketDataChanged)="onMarketDataChanged($event)"
|
(marketDataChanged)="onMarketDataChanged($event)"
|
||||||
></gf-admin-market-data-detail>
|
></gf-admin-market-data-detail>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-6 mb-3">
|
||||||
|
<gf-value i18n size="medium" [value]="assetProfile?.symbol"
|
||||||
|
>Symbol</gf-value
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 mb-3">
|
||||||
|
<gf-value i18n size="medium" [value]="assetProfile?.currency"
|
||||||
|
>Currency</gf-value
|
||||||
|
>
|
||||||
|
</div>
|
||||||
<div class="col-6 mb-3">
|
<div class="col-6 mb-3">
|
||||||
<gf-value
|
<gf-value
|
||||||
i18n
|
i18n
|
||||||
@ -71,11 +82,7 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 mb-3">
|
<div class="col-6 mb-3">
|
||||||
<gf-value
|
<gf-value i18n size="medium" [hidden]="!assetClass" [value]="assetClass"
|
||||||
i18n
|
|
||||||
size="medium"
|
|
||||||
[hidden]="!assetProfile?.assetClass"
|
|
||||||
[value]="assetProfile?.assetClass"
|
|
||||||
>Asset Class</gf-value
|
>Asset Class</gf-value
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@ -83,8 +90,8 @@
|
|||||||
<gf-value
|
<gf-value
|
||||||
i18n
|
i18n
|
||||||
size="medium"
|
size="medium"
|
||||||
[hidden]="!assetProfile?.assetSubClass"
|
[hidden]="!assetSubClass"
|
||||||
[value]="assetProfile?.assetSubClass"
|
[value]="assetSubClass"
|
||||||
>Asset Sub Class</gf-value
|
>Asset Sub Class</gf-value
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user