2021-04-13 21:53:58 +02:00
|
|
|
<mat-form-field appearance="outline" class="w-100">
|
|
|
|
<ion-icon class="mr-1" matPrefix name="search-outline"></ion-icon>
|
2021-05-11 17:55:55 +02:00
|
|
|
<mat-chip-list #chipList aria-label="Search keywords">
|
|
|
|
<mat-chip
|
|
|
|
*ngFor="let searchKeyword of searchKeywords"
|
|
|
|
matChipRemove
|
|
|
|
[removable]="true"
|
|
|
|
(removed)="removeKeyword(searchKeyword)"
|
|
|
|
>
|
|
|
|
{{ searchKeyword }}
|
|
|
|
<ion-icon class="ml-2" matPrefix name="close-outline"></ion-icon>
|
|
|
|
</mat-chip>
|
|
|
|
<input
|
|
|
|
#searchInput
|
|
|
|
name="close-outline"
|
|
|
|
placeholder="Search for account, currency, symbol or type..."
|
|
|
|
[formControl]="searchControl"
|
|
|
|
[matAutocomplete]="autocomplete"
|
|
|
|
[matChipInputFor]="chipList"
|
|
|
|
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
|
|
|
|
(matChipInputTokenEnd)="addKeyword($event)"
|
|
|
|
/>
|
|
|
|
</mat-chip-list>
|
|
|
|
<mat-autocomplete
|
|
|
|
#autocomplete="matAutocomplete"
|
|
|
|
(optionSelected)="keywordSelected($event)"
|
|
|
|
>
|
|
|
|
<mat-option
|
|
|
|
*ngFor="let transaction of filteredTransactions | async"
|
|
|
|
[value]="transaction"
|
|
|
|
>
|
|
|
|
{{ transaction }}
|
|
|
|
</mat-option>
|
|
|
|
</mat-autocomplete>
|
2021-04-13 21:53:58 +02:00
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
<table
|
2021-05-12 20:32:34 +02:00
|
|
|
class="gf-table w-100"
|
2021-04-13 21:53:58 +02:00
|
|
|
matSort
|
|
|
|
matSortActive="date"
|
|
|
|
matSortDirection="desc"
|
|
|
|
mat-table
|
|
|
|
[dataSource]="dataSource"
|
|
|
|
>
|
|
|
|
<ng-container matColumnDef="date">
|
|
|
|
<th
|
|
|
|
*matHeaderCellDef
|
2021-05-12 20:32:34 +02:00
|
|
|
class="justify-content-center px-1"
|
2021-04-13 21:53:58 +02:00
|
|
|
i18n
|
|
|
|
mat-header-cell
|
|
|
|
mat-sort-header
|
|
|
|
>
|
|
|
|
Date
|
|
|
|
</th>
|
2021-05-12 20:32:34 +02:00
|
|
|
<td *matCellDef="let element" class="px-1" mat-cell>
|
2021-04-13 21:53:58 +02:00
|
|
|
<div class="d-flex justify-content-center">
|
|
|
|
{{ element.date | date: defaultDateFormat }}
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<ng-container matColumnDef="type">
|
|
|
|
<th
|
|
|
|
*matHeaderCellDef
|
2021-05-12 20:32:34 +02:00
|
|
|
class="justify-content-center px-1"
|
2021-04-13 21:53:58 +02:00
|
|
|
i18n
|
|
|
|
mat-header-cell
|
|
|
|
mat-sort-header
|
|
|
|
>
|
|
|
|
Type
|
|
|
|
</th>
|
2021-05-12 20:32:34 +02:00
|
|
|
<td mat-cell *matCellDef="let element" class="px-1 text-center">
|
2021-04-13 21:53:58 +02:00
|
|
|
<div
|
|
|
|
class="d-inline-flex justify-content-center pl-1 pr-2 py-1 type-badge"
|
|
|
|
[ngClass]="element.type == 'BUY' ? 'buy' : 'sell'"
|
|
|
|
>
|
|
|
|
<ion-icon
|
|
|
|
class="mr-1"
|
|
|
|
[name]="
|
|
|
|
element.type === 'BUY'
|
|
|
|
? 'arrow-forward-circle-outline'
|
|
|
|
: 'arrow-back-circle-outline'
|
|
|
|
"
|
|
|
|
></ion-icon>
|
|
|
|
<span>{{ element.type }}</span>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<ng-container matColumnDef="symbol">
|
2021-05-12 20:32:34 +02:00
|
|
|
<th *matHeaderCellDef class="px-1" i18n mat-header-cell mat-sort-header>
|
|
|
|
Symbol
|
|
|
|
</th>
|
|
|
|
<td *matCellDef="let element" class="px-1" mat-cell>
|
|
|
|
{{ element.symbol | gfSymbol }}
|
|
|
|
</td>
|
2021-04-13 21:53:58 +02:00
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<ng-container matColumnDef="currency">
|
|
|
|
<th
|
|
|
|
*matHeaderCellDef
|
2021-05-12 20:32:34 +02:00
|
|
|
class="d-none d-lg-table-cell justify-content-center px-1"
|
2021-04-13 21:53:58 +02:00
|
|
|
mat-header-cell
|
|
|
|
i18n
|
|
|
|
mat-sort-header
|
|
|
|
>
|
|
|
|
Currency
|
|
|
|
</th>
|
2021-05-12 20:32:34 +02:00
|
|
|
<td *matCellDef="let element" class="d-none d-lg-table-cell px-1" mat-cell>
|
2021-04-13 21:53:58 +02:00
|
|
|
<div class="d-flex justify-content-center">
|
|
|
|
{{ element.currency }}
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<ng-container matColumnDef="quantity">
|
|
|
|
<th
|
|
|
|
*matHeaderCellDef
|
2021-05-12 20:32:34 +02:00
|
|
|
class="d-none d-lg-table-cell justify-content-end px-1"
|
2021-04-13 21:53:58 +02:00
|
|
|
i18n
|
|
|
|
mat-header-cell
|
|
|
|
mat-sort-header
|
|
|
|
>
|
|
|
|
Quantity
|
|
|
|
</th>
|
2021-05-12 20:32:34 +02:00
|
|
|
<td *matCellDef="let element" class="d-none d-lg-table-cell px-1" mat-cell>
|
2021-04-13 21:53:58 +02:00
|
|
|
<div class="d-flex justify-content-end">
|
|
|
|
<gf-value
|
2021-04-25 17:41:53 +02:00
|
|
|
[isCurrency]="true"
|
2021-04-13 21:53:58 +02:00
|
|
|
[locale]="locale"
|
|
|
|
[value]="isLoading ? undefined : element.quantity"
|
|
|
|
></gf-value>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<ng-container matColumnDef="unitPrice">
|
|
|
|
<th
|
|
|
|
*matHeaderCellDef
|
2021-05-12 20:32:34 +02:00
|
|
|
class="d-none d-lg-table-cell justify-content-end px-1"
|
2021-04-13 21:53:58 +02:00
|
|
|
i18n
|
|
|
|
mat-header-cell
|
|
|
|
mat-sort-header
|
|
|
|
>
|
|
|
|
Unit Price
|
|
|
|
</th>
|
2021-05-12 20:32:34 +02:00
|
|
|
<td *matCellDef="let element" class="d-none d-lg-table-cell px-1" mat-cell>
|
2021-04-13 21:53:58 +02:00
|
|
|
<div class="d-flex justify-content-end">
|
|
|
|
<gf-value
|
2021-04-25 17:41:53 +02:00
|
|
|
[isCurrency]="true"
|
2021-04-13 21:53:58 +02:00
|
|
|
[locale]="locale"
|
|
|
|
[value]="isLoading ? undefined : element.unitPrice"
|
|
|
|
></gf-value>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<ng-container matColumnDef="fee">
|
|
|
|
<th
|
|
|
|
*matHeaderCellDef
|
2021-05-12 20:32:34 +02:00
|
|
|
class="d-none d-lg-table-cell justify-content-end px-1"
|
2021-04-13 21:53:58 +02:00
|
|
|
i18n
|
|
|
|
mat-header-cell
|
|
|
|
mat-sort-header
|
|
|
|
>
|
|
|
|
Fee
|
|
|
|
</th>
|
2021-05-12 20:32:34 +02:00
|
|
|
<td *matCellDef="let element" class="d-none d-lg-table-cell px1" mat-cell>
|
2021-04-13 21:53:58 +02:00
|
|
|
<div class="d-flex justify-content-end">
|
|
|
|
<gf-value
|
2021-04-25 17:41:53 +02:00
|
|
|
[isCurrency]="true"
|
2021-04-13 21:53:58 +02:00
|
|
|
[locale]="locale"
|
|
|
|
[value]="isLoading ? undefined : element.fee"
|
|
|
|
></gf-value>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</ng-container>
|
|
|
|
|
2021-05-12 20:32:34 +02:00
|
|
|
<ng-container matColumnDef="account">
|
|
|
|
<th *matHeaderCellDef class="px-1" i18n mat-header-cell mat-sort-header>
|
|
|
|
Account
|
|
|
|
</th>
|
|
|
|
<td *matCellDef="let element" class="px-1" mat-cell>
|
|
|
|
<div class="d-flex">
|
|
|
|
<gf-symbol-icon
|
|
|
|
*ngIf="element.Account?.Platform?.url"
|
|
|
|
class="mr-1"
|
|
|
|
[tooltip]="element.Account?.Platform?.name"
|
|
|
|
[url]="element.Account?.Platform?.url"
|
|
|
|
></gf-symbol-icon>
|
|
|
|
<span class="d-none d-lg-block">{{ element.Account?.name }}</span>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</ng-container>
|
|
|
|
|
2021-04-13 21:53:58 +02:00
|
|
|
<ng-container matColumnDef="actions">
|
2021-05-12 20:32:34 +02:00
|
|
|
<th *matHeaderCellDef class="px-1 text-center" i18n mat-header-cell></th>
|
|
|
|
<td *matCellDef="let element" class="px-1 text-center" mat-cell>
|
2021-04-13 21:53:58 +02:00
|
|
|
<button
|
|
|
|
class="mx-1 no-min-width px-2"
|
|
|
|
mat-button
|
|
|
|
[matMenuTriggerFor]="accountMenu"
|
|
|
|
(click)="$event.stopPropagation()"
|
|
|
|
>
|
|
|
|
<ion-icon name="ellipsis-vertical"></ion-icon>
|
|
|
|
</button>
|
|
|
|
<mat-menu #accountMenu="matMenu" xPosition="before">
|
|
|
|
<button i18n mat-menu-item (click)="onUpdateTransaction(element)">
|
|
|
|
Edit
|
|
|
|
</button>
|
2021-05-05 12:01:56 +02:00
|
|
|
<button i18n mat-menu-item (click)="onCloneTransaction(element)">
|
|
|
|
Clone
|
|
|
|
</button>
|
2021-04-13 21:53:58 +02:00
|
|
|
<button i18n mat-menu-item (click)="onDeleteTransaction(element.id)">
|
|
|
|
Delete
|
|
|
|
</button>
|
|
|
|
</mat-menu>
|
|
|
|
</td>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr>
|
|
|
|
<tr
|
|
|
|
*matRowDef="let row; columns: displayedColumns"
|
|
|
|
mat-row
|
2021-04-21 21:15:49 +02:00
|
|
|
(click)="onOpenPositionDialog({ symbol: row.symbol, title: '' })"
|
2021-04-13 21:53:58 +02:00
|
|
|
></tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<ngx-skeleton-loader
|
|
|
|
*ngIf="isLoading"
|
|
|
|
animation="pulse"
|
|
|
|
class="px-4 py-3"
|
|
|
|
[theme]="{
|
|
|
|
height: '1.5rem',
|
|
|
|
width: '100%'
|
|
|
|
}"
|
|
|
|
></ngx-skeleton-loader>
|