Browse Source

Migrate transaction table

pull/58/head
Thomas 4 years ago
parent
commit
ed74e69047
  1. 4
      apps/api/src/app/order/order.controller.ts
  2. 24
      apps/client/src/app/components/transactions-table/transactions-table.component.html
  3. 2
      apps/client/src/app/components/transactions-table/transactions-table.component.ts

4
apps/api/src/app/order/order.controller.ts

@ -70,8 +70,12 @@ export class OrderController {
); );
let orders = await this.orderService.orders({ let orders = await this.orderService.orders({
include: {
Account: {
include: { include: {
Platform: true Platform: true
}
}
}, },
orderBy: { date: 'desc' }, orderBy: { date: 'desc' },
where: { userId: impersonationUserId || this.request.user.id } where: { userId: impersonationUserId || this.request.user.id }

24
apps/client/src/app/components/transactions-table/transactions-table.component.html

@ -17,25 +17,21 @@
mat-table mat-table
[dataSource]="dataSource" [dataSource]="dataSource"
> >
<ng-container matColumnDef="platform"> <ng-container matColumnDef="account">
<th <th *matHeaderCellDef i18n mat-header-cell mat-sort-header>Account</th>
*matHeaderCellDef <td *matCellDef="let element" mat-cell>
class="d-none d-lg-table-cell text-center px-0" <div class="d-flex">
i18n
mat-header-cell
>
Platform
</th>
<td *matCellDef="let element" class="d-none d-lg-table-cell px-0" mat-cell>
<div class="d-flex justify-content-center">
<gf-symbol-icon <gf-symbol-icon
*ngIf="element.Platform?.url" *ngIf="element.Account?.Platform?.url"
[tooltip]="element.Platform?.name" class="mr-2"
[url]="element.Platform?.url" [tooltip]="element.Account?.Platform?.name"
[url]="element.Account?.Platform?.url"
></gf-symbol-icon> ></gf-symbol-icon>
<span class="d-none d-lg-block">{{ element.Account?.name }}</span>
</div> </div>
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="date"> <ng-container matColumnDef="date">
<th <th
*matHeaderCellDef *matHeaderCellDef

2
apps/client/src/app/components/transactions-table/transactions-table.component.ts

@ -68,7 +68,7 @@ export class TransactionsTableComponent
public ngOnChanges() { public ngOnChanges() {
this.displayedColumns = [ this.displayedColumns = [
'platform', 'account',
'date', 'date',
'type', 'type',
'symbol', 'symbol',

Loading…
Cancel
Save