mirror of https://github.com/ghostfolio/ghostfolio
34 changed files with 1768 additions and 1533 deletions
@ -1,83 +0,0 @@ |
|||||
import { IOrder } from '@ghostfolio/api/services/interfaces/interfaces'; |
|
||||
|
|
||||
import { Account, SymbolProfile, Type as ActivityType } from '@prisma/client'; |
|
||||
import { v4 as uuidv4 } from 'uuid'; |
|
||||
|
|
||||
export class Order { |
|
||||
private account: Account; |
|
||||
private currency: string; |
|
||||
private fee: number; |
|
||||
private date: string; |
|
||||
private id: string; |
|
||||
private isDraft: boolean; |
|
||||
private quantity: number; |
|
||||
private symbol: string; |
|
||||
private symbolProfile: SymbolProfile; |
|
||||
private total: number; |
|
||||
private type: ActivityType; |
|
||||
private unitPrice: number; |
|
||||
|
|
||||
public constructor(data: IOrder) { |
|
||||
this.account = data.account; |
|
||||
this.currency = data.currency; |
|
||||
this.fee = data.fee; |
|
||||
this.date = data.date; |
|
||||
this.id = data.id || uuidv4(); |
|
||||
this.isDraft = data.isDraft; |
|
||||
this.quantity = data.quantity; |
|
||||
this.symbol = data.symbol; |
|
||||
this.symbolProfile = data.symbolProfile; |
|
||||
this.type = data.type; |
|
||||
this.unitPrice = data.unitPrice; |
|
||||
|
|
||||
this.total = this.quantity * data.unitPrice; |
|
||||
} |
|
||||
|
|
||||
public getAccount() { |
|
||||
return this.account; |
|
||||
} |
|
||||
|
|
||||
public getCurrency() { |
|
||||
return this.currency; |
|
||||
} |
|
||||
|
|
||||
public getDate() { |
|
||||
return this.date; |
|
||||
} |
|
||||
|
|
||||
public getFee() { |
|
||||
return this.fee; |
|
||||
} |
|
||||
|
|
||||
public getId() { |
|
||||
return this.id; |
|
||||
} |
|
||||
|
|
||||
public getIsDraft() { |
|
||||
return this.isDraft; |
|
||||
} |
|
||||
|
|
||||
public getQuantity() { |
|
||||
return this.quantity; |
|
||||
} |
|
||||
|
|
||||
public getSymbol() { |
|
||||
return this.symbol; |
|
||||
} |
|
||||
|
|
||||
getSymbolProfile() { |
|
||||
return this.symbolProfile; |
|
||||
} |
|
||||
|
|
||||
public getTotal() { |
|
||||
return this.total; |
|
||||
} |
|
||||
|
|
||||
public getType() { |
|
||||
return this.type; |
|
||||
} |
|
||||
|
|
||||
public getUnitPrice() { |
|
||||
return this.unitPrice; |
|
||||
} |
|
||||
} |
|
@ -1,115 +1,94 @@ |
|||||
<div class="container"> |
<div class="d-flex justify-content-end"> |
||||
<div class="row"> |
<a |
||||
<div class="col"> |
color="primary" |
||||
<div class="d-flex justify-content-end"> |
i18n |
||||
<a |
mat-flat-button |
||||
color="primary" |
[queryParams]="{ createPlatformDialog: true }" |
||||
i18n |
[routerLink]="[]" |
||||
mat-flat-button |
> |
||||
[queryParams]="{ createPlatformDialog: true }" |
Add Platform |
||||
[routerLink]="[]" |
</a> |
||||
> |
</div> |
||||
Add Platform |
<table |
||||
</a> |
class="gf-table w-100" |
||||
</div> |
mat-table |
||||
<table |
matSort |
||||
class="gf-table w-100" |
matSortActive="name" |
||||
mat-table |
matSortDirection="asc" |
||||
matSort |
[dataSource]="dataSource" |
||||
matSortActive="name" |
> |
||||
matSortDirection="asc" |
<ng-container matColumnDef="name"> |
||||
[dataSource]="dataSource" |
<th *matHeaderCellDef class="px-1" mat-header-cell mat-sort-header="name"> |
||||
> |
<ng-container i18n>Name</ng-container> |
||||
<ng-container matColumnDef="name"> |
</th> |
||||
<th |
<td *matCellDef="let element" class="px-1" mat-cell> |
||||
*matHeaderCellDef |
@if (element.url) { |
||||
class="px-1" |
<gf-asset-profile-icon |
||||
mat-header-cell |
class="d-inline mr-1" |
||||
mat-sort-header="name" |
[tooltip]="element.name" |
||||
> |
[url]="element.url" |
||||
<ng-container i18n>Name</ng-container> |
/> |
||||
</th> |
} |
||||
<td *matCellDef="let element" class="px-1" mat-cell> |
<span>{{ element.name }}</span> |
||||
@if (element.url) { |
</td></ng-container |
||||
<gf-asset-profile-icon |
> |
||||
class="d-inline mr-1" |
|
||||
[tooltip]="element.name" |
|
||||
[url]="element.url" |
|
||||
/> |
|
||||
} |
|
||||
<span>{{ element.name }}</span> |
|
||||
</td></ng-container |
|
||||
> |
|
||||
|
|
||||
<ng-container matColumnDef="url"> |
<ng-container matColumnDef="url"> |
||||
<th |
<th *matHeaderCellDef class="px-1" mat-header-cell mat-sort-header="url"> |
||||
*matHeaderCellDef |
<ng-container i18n>Url</ng-container> |
||||
class="px-1" |
</th> |
||||
mat-header-cell |
<td *matCellDef="let element" class="px-1" mat-cell> |
||||
mat-sort-header="url" |
{{ element.url }} |
||||
> |
</td> |
||||
<ng-container i18n>Url</ng-container> |
</ng-container> |
||||
</th> |
|
||||
<td *matCellDef="let element" class="px-1" mat-cell> |
|
||||
{{ element.url }} |
|
||||
</td> |
|
||||
</ng-container> |
|
||||
|
|
||||
<ng-container matColumnDef="accounts"> |
<ng-container matColumnDef="accounts"> |
||||
<th |
<th |
||||
*matHeaderCellDef |
*matHeaderCellDef |
||||
class="px-1" |
class="px-1" |
||||
mat-header-cell |
mat-header-cell |
||||
mat-sort-header="accountCount" |
mat-sort-header="accountCount" |
||||
> |
> |
||||
<ng-container i18n>Accounts</ng-container> |
<ng-container i18n>Accounts</ng-container> |
||||
</th> |
</th> |
||||
<td *matCellDef="let element" class="px-1" mat-cell> |
<td *matCellDef="let element" class="px-1 text-right" mat-cell> |
||||
{{ element.accountCount }} |
{{ element.accountCount }} |
||||
</td> |
</td> |
||||
</ng-container> |
</ng-container> |
||||
|
|
||||
<ng-container matColumnDef="actions" stickyEnd> |
<ng-container matColumnDef="actions" stickyEnd> |
||||
<th |
<th *matHeaderCellDef class="px-1 text-center" i18n mat-header-cell></th> |
||||
*matHeaderCellDef |
<td *matCellDef="let element" class="px-1 text-center" mat-cell> |
||||
class="px-1 text-center" |
<button |
||||
i18n |
class="mx-1 no-min-width px-2" |
||||
mat-header-cell |
mat-button |
||||
></th> |
[matMenuTriggerFor]="platformMenu" |
||||
<td *matCellDef="let element" class="px-1 text-center" mat-cell> |
(click)="$event.stopPropagation()" |
||||
<button |
> |
||||
class="mx-1 no-min-width px-2" |
<ion-icon name="ellipsis-horizontal" /> |
||||
mat-button |
</button> |
||||
[matMenuTriggerFor]="platformMenu" |
<mat-menu #platformMenu="matMenu" xPosition="before"> |
||||
(click)="$event.stopPropagation()" |
<button mat-menu-item (click)="onUpdatePlatform(element)"> |
||||
> |
<span class="align-items-center d-flex"> |
||||
<ion-icon name="ellipsis-horizontal" /> |
<ion-icon class="mr-2" name="create-outline" /> |
||||
</button> |
<span i18n>Edit</span> |
||||
<mat-menu #platformMenu="matMenu" xPosition="before"> |
</span> |
||||
<button mat-menu-item (click)="onUpdatePlatform(element)"> |
</button> |
||||
<span class="align-items-center d-flex"> |
<hr class="m-0" /> |
||||
<ion-icon class="mr-2" name="create-outline" /> |
<button |
||||
<span i18n>Edit</span> |
mat-menu-item |
||||
</span> |
[disabled]="element.accountCount > 0" |
||||
</button> |
(click)="onDeletePlatform(element.id)" |
||||
<hr class="m-0" /> |
> |
||||
<button |
<span class="align-items-center d-flex"> |
||||
mat-menu-item |
<ion-icon class="mr-2" name="trash-outline" /> |
||||
[disabled]="element.accountCount > 0" |
<span i18n>Delete</span> |
||||
(click)="onDeletePlatform(element.id)" |
</span> |
||||
> |
</button> |
||||
<span class="align-items-center d-flex"> |
</mat-menu> |
||||
<ion-icon class="mr-2" name="trash-outline" /> |
</td> |
||||
<span i18n>Delete</span> |
</ng-container> |
||||
</span> |
|
||||
</button> |
|
||||
</mat-menu> |
|
||||
</td> |
|
||||
</ng-container> |
|
||||
|
|
||||
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr> |
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr> |
||||
<tr *matRowDef="let row; columns: displayedColumns" mat-row></tr> |
<tr *matRowDef="let row; columns: displayedColumns" mat-row></tr> |
||||
</table> |
</table> |
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
@ -1,3 +1,15 @@ |
|||||
:host { |
:host { |
||||
display: block; |
display: block; |
||||
|
|
||||
|
.mat-mdc-progress-bar { |
||||
|
--mdc-linear-progress-active-indicator-height: 0.5rem; |
||||
|
--mdc-linear-progress-track-height: 0.5rem; |
||||
|
border-radius: 0.25rem; |
||||
|
|
||||
|
::ng-deep { |
||||
|
.mdc-linear-progress__buffer-bar { |
||||
|
background-color: rgb(var(--palette-background-unselected-chip)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
|
@ -1,108 +1,87 @@ |
|||||
<div class="container"> |
<div class="d-flex justify-content-end"> |
||||
<div class="row"> |
<a |
||||
<div class="col"> |
color="primary" |
||||
<div class="d-flex justify-content-end"> |
i18n |
||||
<a |
mat-flat-button |
||||
color="primary" |
[queryParams]="{ createTagDialog: true }" |
||||
i18n |
[routerLink]="[]" |
||||
mat-flat-button |
> |
||||
[queryParams]="{ createTagDialog: true }" |
Add Tag |
||||
[routerLink]="[]" |
</a> |
||||
> |
</div> |
||||
Add Tag |
<table |
||||
</a> |
class="gf-table w-100" |
||||
</div> |
mat-table |
||||
<table |
matSort |
||||
class="gf-table w-100" |
matSortActive="name" |
||||
mat-table |
matSortDirection="asc" |
||||
matSort |
[dataSource]="dataSource" |
||||
matSortActive="name" |
> |
||||
matSortDirection="asc" |
<ng-container matColumnDef="name"> |
||||
[dataSource]="dataSource" |
<th *matHeaderCellDef class="px-1" mat-header-cell mat-sort-header="name"> |
||||
> |
<ng-container i18n>Name</ng-container> |
||||
<ng-container matColumnDef="name"> |
</th> |
||||
<th |
<td *matCellDef="let element" class="px-1" mat-cell> |
||||
*matHeaderCellDef |
{{ element.name }} |
||||
class="px-1" |
</td> |
||||
mat-header-cell |
</ng-container> |
||||
mat-sort-header="name" |
|
||||
> |
|
||||
<ng-container i18n>Name</ng-container> |
|
||||
</th> |
|
||||
<td *matCellDef="let element" class="px-1" mat-cell> |
|
||||
{{ element.name }} |
|
||||
</td> |
|
||||
</ng-container> |
|
||||
|
|
||||
<ng-container matColumnDef="userId"> |
<ng-container matColumnDef="userId"> |
||||
<th |
<th *matHeaderCellDef class="px-1" mat-header-cell mat-sort-header="userId"> |
||||
*matHeaderCellDef |
<ng-container i18n>User</ng-container> |
||||
class="px-1" |
</th> |
||||
mat-header-cell |
<td *matCellDef="let element" class="px-1" mat-cell> |
||||
mat-sort-header="userId" |
<span class="text-monospace">{{ element.userId }}</span> |
||||
> |
</td> |
||||
<ng-container i18n>User</ng-container> |
</ng-container> |
||||
</th> |
|
||||
<td *matCellDef="let element" class="px-1" mat-cell> |
|
||||
<span class="text-monospace">{{ element.userId }}</span> |
|
||||
</td> |
|
||||
</ng-container> |
|
||||
|
|
||||
<ng-container matColumnDef="activities"> |
<ng-container matColumnDef="activities"> |
||||
<th |
<th |
||||
*matHeaderCellDef |
*matHeaderCellDef |
||||
class="px-1" |
class="px-1" |
||||
mat-header-cell |
mat-header-cell |
||||
mat-sort-header="activityCount" |
mat-sort-header="activityCount" |
||||
> |
> |
||||
<ng-container i18n>Activities</ng-container> |
<ng-container i18n>Activities</ng-container> |
||||
</th> |
</th> |
||||
<td *matCellDef="let element" class="px-1" mat-cell> |
<td *matCellDef="let element" class="px-1 text-right" mat-cell> |
||||
{{ element.activityCount }} |
{{ element.activityCount }} |
||||
</td> |
</td> |
||||
</ng-container> |
</ng-container> |
||||
|
|
||||
<ng-container matColumnDef="actions" stickyEnd> |
<ng-container matColumnDef="actions" stickyEnd> |
||||
<th |
<th *matHeaderCellDef class="px-1 text-center" i18n mat-header-cell></th> |
||||
*matHeaderCellDef |
<td *matCellDef="let element" class="px-1 text-center" mat-cell> |
||||
class="px-1 text-center" |
<button |
||||
i18n |
class="mx-1 no-min-width px-2" |
||||
mat-header-cell |
mat-button |
||||
></th> |
[matMenuTriggerFor]="tagMenu" |
||||
<td *matCellDef="let element" class="px-1 text-center" mat-cell> |
(click)="$event.stopPropagation()" |
||||
<button |
> |
||||
class="mx-1 no-min-width px-2" |
<ion-icon name="ellipsis-horizontal" /> |
||||
mat-button |
</button> |
||||
[matMenuTriggerFor]="tagMenu" |
<mat-menu #tagMenu="matMenu" xPosition="before"> |
||||
(click)="$event.stopPropagation()" |
<button mat-menu-item (click)="onUpdateTag(element)"> |
||||
> |
<span class="align-items-center d-flex"> |
||||
<ion-icon name="ellipsis-horizontal" /> |
<ion-icon class="mr-2" name="create-outline" /> |
||||
</button> |
<span i18n>Edit</span> |
||||
<mat-menu #tagMenu="matMenu" xPosition="before"> |
</span> |
||||
<button mat-menu-item (click)="onUpdateTag(element)"> |
</button> |
||||
<span class="align-items-center d-flex"> |
<hr class="m-0" /> |
||||
<ion-icon class="mr-2" name="create-outline" /> |
<button |
||||
<span i18n>Edit</span> |
mat-menu-item |
||||
</span> |
[disabled]="element.activityCount > 0" |
||||
</button> |
(click)="onDeleteTag(element.id)" |
||||
<hr class="m-0" /> |
> |
||||
<button |
<span class="align-items-center d-flex"> |
||||
mat-menu-item |
<ion-icon class="mr-2" name="trash-outline" /> |
||||
[disabled]="element.activityCount > 0" |
<span i18n>Delete</span> |
||||
(click)="onDeleteTag(element.id)" |
</span> |
||||
> |
</button> |
||||
<span class="align-items-center d-flex"> |
</mat-menu> |
||||
<ion-icon class="mr-2" name="trash-outline" /> |
</td> |
||||
<span i18n>Delete</span> |
</ng-container> |
||||
</span> |
|
||||
</button> |
|
||||
</mat-menu> |
|
||||
</td> |
|
||||
</ng-container> |
|
||||
|
|
||||
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr> |
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr> |
||||
<tr *matRowDef="let row; columns: displayedColumns" mat-row></tr> |
<tr *matRowDef="let row; columns: displayedColumns" mat-row></tr> |
||||
</table> |
</table> |
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
File diff suppressed because it is too large
File diff suppressed because it is too large
Loading…
Reference in new issue