mirror of https://github.com/ghostfolio/ghostfolio
committed by
GitHub
14 changed files with 689 additions and 177 deletions
@ -0,0 +1,9 @@ |
|||||
|
import { IsObject, IsOptional } from 'class-validator'; |
||||
|
|
||||
|
export class UpdateAssetProfileDto { |
||||
|
@IsObject() |
||||
|
@IsOptional() |
||||
|
symbolMapping?: { |
||||
|
[dataProvider: string]: string; |
||||
|
}; |
||||
|
} |
@ -1,112 +1,164 @@ |
|||||
<gf-dialog-header |
<form |
||||
mat-dialog-title |
class="d-flex flex-column h-100" |
||||
position="center" |
[formGroup]="assetProfileForm" |
||||
[deviceType]="data.deviceType" |
(keyup.enter)="assetProfileForm.valid && onSubmit()" |
||||
[title]="assetProfile?.name ?? data.symbol" |
(ngSubmit)="onSubmit()" |
||||
(closeButtonClicked)="onClose()" |
> |
||||
></gf-dialog-header> |
<div class="d-flex mb-3"> |
||||
|
<h1 class="flex-grow-1 m-0" mat-dialog-title> |
||||
<div class="flex-grow-1" mat-dialog-content> |
{{ assetProfile?.name ?? data.symbol }} |
||||
<gf-admin-market-data-detail |
</h1> |
||||
class="mb-3" |
<button |
||||
[dataSource]="data.dataSource" |
class="mx-1 no-min-width px-2" |
||||
[dateOfFirstActivity]="data.dateOfFirstActivity" |
mat-button |
||||
[locale]="data.locale" |
type="button" |
||||
[marketData]="marketDataDetails" |
[matMenuTriggerFor]="assetProfileActionsMenu" |
||||
[symbol]="data.symbol" |
(click)="$event.stopPropagation()" |
||||
(marketDataChanged)="onMarketDataChanged($event)" |
> |
||||
></gf-admin-market-data-detail> |
<ion-icon name="ellipsis-vertical"></ion-icon> |
||||
<div class="row"> |
</button> |
||||
<div class="col-6 mb-3"> |
<mat-menu #assetProfileActionsMenu="matMenu" xPosition="before"> |
||||
<gf-value |
<button mat-menu-item type="button" (click)="initialize()"> |
||||
i18n |
<ng-container i18n>Refresh</ng-container> |
||||
size="medium" |
</button> |
||||
[isDate]="data.dateOfFirstActivity ? true : false" |
<button |
||||
[locale]="data.locale" |
mat-menu-item |
||||
[value]="data.dateOfFirstActivity ?? '-'" |
type="button" |
||||
>First Buy Date</gf-value |
[disabled]="assetProfileForm.dirty" |
||||
> |
(click)="onGatherSymbol({dataSource: data.dataSource, symbol: data.symbol})" |
||||
</div> |
|
||||
<div class="col-6 mb-3"> |
|
||||
<gf-value |
|
||||
i18n |
|
||||
size="medium" |
|
||||
[locale]="data.locale" |
|
||||
[value]="assetProfile?.activitiesCount ?? 0" |
|
||||
>Transactions</gf-value |
|
||||
> |
|
||||
</div> |
|
||||
<div class="col-6 mb-3"> |
|
||||
<gf-value |
|
||||
i18n |
|
||||
size="medium" |
|
||||
[hidden]="!assetProfile?.assetClass" |
|
||||
[value]="assetProfile?.assetClass" |
|
||||
>Asset Class</gf-value |
|
||||
> |
> |
||||
</div> |
<ng-container i18n>Gather Data</ng-container> |
||||
<div class="col-6 mb-3"> |
</button> |
||||
<gf-value |
<button |
||||
i18n |
mat-menu-item |
||||
size="medium" |
type="button" |
||||
[hidden]="!assetProfile?.assetSubClass" |
[disabled]="assetProfileForm.dirty" |
||||
[value]="assetProfile?.assetSubClass" |
(click)="onGatherProfileDataBySymbol({dataSource: data.dataSource, symbol: data.symbol})" |
||||
>Asset Sub Class</gf-value |
|
||||
> |
> |
||||
</div> |
<ng-container i18n>Gather Profile Data</ng-container> |
||||
<ng-container |
</button> |
||||
*ngIf="assetProfile?.countries?.length > 0 || assetProfile?.sectors?.length > 0" |
</mat-menu> |
||||
> |
</div> |
||||
|
|
||||
|
<div class="flex-grow-1" mat-dialog-content> |
||||
|
<gf-admin-market-data-detail |
||||
|
class="mb-3" |
||||
|
[dataSource]="data.dataSource" |
||||
|
[dateOfFirstActivity]="data.dateOfFirstActivity" |
||||
|
[locale]="data.locale" |
||||
|
[marketData]="marketDataDetails" |
||||
|
[symbol]="data.symbol" |
||||
|
(marketDataChanged)="onMarketDataChanged($event)" |
||||
|
></gf-admin-market-data-detail> |
||||
|
<div class="row"> |
||||
|
<div class="col-6 mb-3"> |
||||
|
<gf-value |
||||
|
i18n |
||||
|
size="medium" |
||||
|
[isDate]="data.dateOfFirstActivity ? true : false" |
||||
|
[locale]="data.locale" |
||||
|
[value]="data.dateOfFirstActivity ?? '-'" |
||||
|
>First Buy Date</gf-value |
||||
|
> |
||||
|
</div> |
||||
|
<div class="col-6 mb-3"> |
||||
|
<gf-value |
||||
|
i18n |
||||
|
size="medium" |
||||
|
[locale]="data.locale" |
||||
|
[value]="assetProfile?.activitiesCount ?? 0" |
||||
|
>Transactions</gf-value |
||||
|
> |
||||
|
</div> |
||||
|
<div class="col-6 mb-3"> |
||||
|
<gf-value |
||||
|
i18n |
||||
|
size="medium" |
||||
|
[hidden]="!assetProfile?.assetClass" |
||||
|
[value]="assetProfile?.assetClass" |
||||
|
>Asset Class</gf-value |
||||
|
> |
||||
|
</div> |
||||
|
<div class="col-6 mb-3"> |
||||
|
<gf-value |
||||
|
i18n |
||||
|
size="medium" |
||||
|
[hidden]="!assetProfile?.assetSubClass" |
||||
|
[value]="assetProfile?.assetSubClass" |
||||
|
>Asset Sub Class</gf-value |
||||
|
> |
||||
|
</div> |
||||
<ng-container |
<ng-container |
||||
*ngIf="assetProfile?.countries?.length === 1 && assetProfile?.sectors?.length === 1; else charts" |
*ngIf="assetProfile?.countries?.length > 0 || assetProfile?.sectors?.length > 0" |
||||
> |
> |
||||
<div *ngIf="assetProfile?.sectors?.length === 1" class="col-6 mb-3"> |
<ng-container |
||||
<gf-value |
*ngIf="assetProfile?.countries?.length === 1 && assetProfile?.sectors?.length === 1; else charts" |
||||
i18n |
> |
||||
size="medium" |
<div *ngIf="assetProfile?.sectors?.length === 1" class="col-6 mb-3"> |
||||
[locale]="data.locale" |
<gf-value |
||||
[value]="assetProfile?.sectors[0].name" |
i18n |
||||
>Sector</gf-value |
size="medium" |
||||
> |
[locale]="data.locale" |
||||
</div> |
[value]="assetProfile?.sectors[0].name" |
||||
<div *ngIf="assetProfile?.countries?.length === 1" class="col-6 mb-3"> |
>Sector</gf-value |
||||
<gf-value |
> |
||||
i18n |
</div> |
||||
size="medium" |
<div *ngIf="assetProfile?.countries?.length === 1" class="col-6 mb-3"> |
||||
[locale]="data.locale" |
<gf-value |
||||
[value]="assetProfile?.countries[0].name" |
i18n |
||||
>Country</gf-value |
size="medium" |
||||
> |
[locale]="data.locale" |
||||
</div> |
[value]="assetProfile?.countries[0].name" |
||||
|
>Country</gf-value |
||||
|
> |
||||
|
</div> |
||||
|
</ng-container> |
||||
|
<ng-template #charts> |
||||
|
<div class="col-md-6 mb-3"> |
||||
|
<div class="h5" i18n>Sectors</div> |
||||
|
<gf-portfolio-proportion-chart |
||||
|
[colorScheme]="data.colorScheme" |
||||
|
[isInPercent]="true" |
||||
|
[keys]="['name']" |
||||
|
[maxItems]="10" |
||||
|
[positions]="sectors" |
||||
|
></gf-portfolio-proportion-chart> |
||||
|
</div> |
||||
|
<div class="col-md-6 mb-3"> |
||||
|
<div class="h5" i18n>Countries</div> |
||||
|
<gf-portfolio-proportion-chart |
||||
|
[colorScheme]="data.colorScheme" |
||||
|
[isInPercent]="true" |
||||
|
[keys]="['name']" |
||||
|
[maxItems]="10" |
||||
|
[positions]="countries" |
||||
|
></gf-portfolio-proportion-chart> |
||||
|
</div> |
||||
|
</ng-template> |
||||
</ng-container> |
</ng-container> |
||||
<ng-template #charts> |
</div> |
||||
<div class="col-md-6 mb-3"> |
<div class="mt-3"> |
||||
<div class="h5" i18n>Sectors</div> |
<mat-form-field appearance="outline" class="w-100"> |
||||
<gf-portfolio-proportion-chart |
<mat-label i18n>Symbol Mapping</mat-label> |
||||
[colorScheme]="data.colorScheme" |
<textarea |
||||
[isInPercent]="true" |
cdkTextareaAutosize |
||||
[keys]="['name']" |
formControlName="symbolMapping" |
||||
[maxItems]="10" |
matInput |
||||
[positions]="sectors" |
type="text" |
||||
></gf-portfolio-proportion-chart> |
></textarea> |
||||
</div> |
</mat-form-field> |
||||
<div class="col-md-6 mb-3"> |
</div> |
||||
<div class="h5" i18n>Countries</div> |
|
||||
<gf-portfolio-proportion-chart |
|
||||
[colorScheme]="data.colorScheme" |
|
||||
[isInPercent]="true" |
|
||||
[keys]="['name']" |
|
||||
[maxItems]="10" |
|
||||
[positions]="countries" |
|
||||
></gf-portfolio-proportion-chart> |
|
||||
</div> |
|
||||
</ng-template> |
|
||||
</ng-container> |
|
||||
</div> |
</div> |
||||
</div> |
|
||||
|
|
||||
<gf-dialog-footer |
<div class="d-flex justify-content-end" mat-dialog-actions> |
||||
mat-dialog-actions |
<button i18n mat-button type="button" (click)="onClose()">Cancel</button> |
||||
[deviceType]="data.deviceType" |
<button |
||||
(closeButtonClicked)="onClose()" |
color="primary" |
||||
></gf-dialog-footer> |
mat-flat-button |
||||
|
type="submit" |
||||
|
[disabled]="!(assetProfileForm.dirty && assetProfileForm.valid)" |
||||
|
> |
||||
|
<ng-container i18n>Save</ng-container> |
||||
|
</button> |
||||
|
</div> |
||||
|
</form> |
||||
|
Loading…
Reference in new issue