Browse Source

Bugfix/fix horizontal overflow in activities table (#676)

* Fix horizontal overflow in tables

* Update changelog
pull/680/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
bed3e5aae2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CHANGELOG.md
  2. 2
      apps/client/src/app/pages/about/about-page.component.ts
  3. 2
      apps/client/src/app/pages/about/changelog/changelog-page.component.ts
  4. 2
      apps/client/src/app/pages/account/account-page.component.ts
  5. 2
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  6. 28
      apps/client/src/app/pages/accounts/accounts-page.html
  7. 4
      apps/client/src/app/pages/accounts/accounts-page.scss
  8. 2
      apps/client/src/app/pages/blog/2021/07/hallo-ghostfolio/hallo-ghostfolio-page.component.ts
  9. 2
      apps/client/src/app/pages/blog/2021/07/hello-ghostfolio/hello-ghostfolio-page.component.ts
  10. 2
      apps/client/src/app/pages/blog/2022/01/first-months-in-open-source/first-months-in-open-source-page.component.ts
  11. 2
      apps/client/src/app/pages/blog/blog-page.component.ts
  12. 2
      apps/client/src/app/pages/landing/landing-page.component.ts
  13. 2
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
  14. 2
      apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
  15. 2
      apps/client/src/app/pages/portfolio/portfolio-page.component.ts
  16. 2
      apps/client/src/app/pages/portfolio/report/report-page.component.ts
  17. 2
      apps/client/src/app/pages/portfolio/transactions/transactions-page.component.ts
  18. 2
      apps/client/src/app/pages/pricing/pricing-page.component.ts
  19. 2
      apps/client/src/app/pages/public/public-page.component.ts
  20. 2
      apps/client/src/app/pages/register/register-page.component.ts
  21. 2
      apps/client/src/app/pages/resources/resources-page.component.ts
  22. 2
      apps/client/src/app/pages/webauthn/webauthn-page.component.ts
  23. 4
      apps/client/src/styles.scss
  24. 602
      libs/ui/src/lib/activities-table/activities-table.component.html
  25. 64
      libs/ui/src/lib/activities-table/activities-table.component.scss

5
CHANGELOG.md

@ -17,6 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed the _Admin_ user from the database seeding - Removed the _Admin_ user from the database seeding
- Assigned the role `ADMIN` on sign up (only if there is no admin yet) - Assigned the role `ADMIN` on sign up (only if there is no admin yet)
### Fixed
- Fixed the horizontal overflow in the accounts table
- Fixed the horizontal overflow in the activities table
### Todo ### Todo
- Apply data migration (`yarn database:migrate`) - Apply data migration (`yarn database:migrate`)

2
apps/client/src/app/pages/about/about-page.component.ts

@ -11,7 +11,7 @@ import { takeUntil } from 'rxjs/operators';
import { environment } from '../../../environments/environment'; import { environment } from '../../../environments/environment';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-about-page', selector: 'gf-about-page',
styleUrls: ['./about-page.scss'], styleUrls: ['./about-page.scss'],
templateUrl: './about-page.html' templateUrl: './about-page.html'

2
apps/client/src/app/pages/about/changelog/changelog-page.component.ts

@ -2,7 +2,7 @@ import { Component, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-changelog-page', selector: 'gf-changelog-page',
styleUrls: ['./changelog-page.scss'], styleUrls: ['./changelog-page.scss'],
templateUrl: './changelog-page.html' templateUrl: './changelog-page.html'

2
apps/client/src/app/pages/account/account-page.component.ts

@ -31,7 +31,7 @@ import { catchError, switchMap, takeUntil } from 'rxjs/operators';
import { CreateOrUpdateAccessDialog } from './create-or-update-access-dialog/create-or-update-access-dialog.component'; import { CreateOrUpdateAccessDialog } from './create-or-update-access-dialog/create-or-update-access-dialog.component';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-account-page', selector: 'gf-account-page',
styleUrls: ['./account-page.scss'], styleUrls: ['./account-page.scss'],
templateUrl: './account-page.html' templateUrl: './account-page.html'

2
apps/client/src/app/pages/accounts/accounts-page.component.ts

@ -16,7 +16,7 @@ import { takeUntil } from 'rxjs/operators';
import { CreateOrUpdateAccountDialog } from './create-or-update-account-dialog/create-or-update-account-dialog.component'; import { CreateOrUpdateAccountDialog } from './create-or-update-account-dialog/create-or-update-account-dialog.component';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-accounts-page', selector: 'gf-accounts-page',
styleUrls: ['./accounts-page.scss'], styleUrls: ['./accounts-page.scss'],
templateUrl: './accounts-page.html' templateUrl: './accounts-page.html'

28
apps/client/src/app/pages/accounts/accounts-page.html

@ -1,19 +1,21 @@
<div class="container"> <div class="container">
<div class="row mb-3"> <div class="row">
<div class="col"> <div class="col">
<h3 class="d-flex justify-content-center mb-3" i18n>Accounts</h3> <h3 class="d-flex justify-content-center mb-3" i18n>Accounts</h3>
<gf-accounts-table <div class="accounts">
[accounts]="accounts" <gf-accounts-table
[baseCurrency]="user?.settings?.baseCurrency" [accounts]="accounts"
[deviceType]="deviceType" [baseCurrency]="user?.settings?.baseCurrency"
[locale]="user?.settings?.locale" [deviceType]="deviceType"
[showActions]="!hasImpersonationId && hasPermissionToDeleteAccount && !user.settings.isRestrictedView" [locale]="user?.settings?.locale"
[totalBalance]="totalBalance" [showActions]="!hasImpersonationId && hasPermissionToDeleteAccount && !user.settings.isRestrictedView"
[totalValue]="totalValue" [totalBalance]="totalBalance"
[transactionCount]="transactionCount" [totalValue]="totalValue"
(accountDeleted)="onDeleteAccount($event)" [transactionCount]="transactionCount"
(accountToUpdate)="onUpdateAccount($event)" (accountDeleted)="onDeleteAccount($event)"
></gf-accounts-table> (accountToUpdate)="onUpdateAccount($event)"
></gf-accounts-table>
</div>
</div> </div>
</div> </div>

4
apps/client/src/app/pages/accounts/accounts-page.scss

@ -1,6 +1,10 @@
:host { :host {
display: block; display: block;
.accounts {
overflow-x: auto;
}
.fab-container { .fab-container {
position: fixed; position: fixed;
right: 2rem; right: 2rem;

2
apps/client/src/app/pages/blog/2021/07/hallo-ghostfolio/hallo-ghostfolio-page.component.ts

@ -1,7 +1,7 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-hallo-ghostfolio-page', selector: 'gf-hallo-ghostfolio-page',
styleUrls: ['./hallo-ghostfolio-page.scss'], styleUrls: ['./hallo-ghostfolio-page.scss'],
templateUrl: './hallo-ghostfolio-page.html' templateUrl: './hallo-ghostfolio-page.html'

2
apps/client/src/app/pages/blog/2021/07/hello-ghostfolio/hello-ghostfolio-page.component.ts

@ -1,7 +1,7 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-hello-ghostfolio-page', selector: 'gf-hello-ghostfolio-page',
styleUrls: ['./hello-ghostfolio-page.scss'], styleUrls: ['./hello-ghostfolio-page.scss'],
templateUrl: './hello-ghostfolio-page.html' templateUrl: './hello-ghostfolio-page.html'

2
apps/client/src/app/pages/blog/2022/01/first-months-in-open-source/first-months-in-open-source-page.component.ts

@ -1,7 +1,7 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-first-months-in-open-source-page', selector: 'gf-first-months-in-open-source-page',
styleUrls: ['./first-months-in-open-source-page.scss'], styleUrls: ['./first-months-in-open-source-page.scss'],
templateUrl: './first-months-in-open-source-page.html' templateUrl: './first-months-in-open-source-page.html'

2
apps/client/src/app/pages/blog/blog-page.component.ts

@ -2,7 +2,7 @@ import { Component, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-blog-page', selector: 'gf-blog-page',
styleUrls: ['./blog-page.scss'], styleUrls: ['./blog-page.scss'],
templateUrl: './blog-page.html' templateUrl: './blog-page.html'

2
apps/client/src/app/pages/landing/landing-page.component.ts

@ -6,7 +6,7 @@ import { format } from 'date-fns';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-landing-page', selector: 'gf-landing-page',
styleUrls: ['./landing-page.scss'], styleUrls: ['./landing-page.scss'],
templateUrl: './landing-page.html' templateUrl: './landing-page.html'

2
apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

@ -20,7 +20,7 @@ import { Subject, Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-allocations-page', selector: 'gf-allocations-page',
styleUrls: ['./allocations-page.scss'], styleUrls: ['./allocations-page.scss'],
templateUrl: './allocations-page.html' templateUrl: './allocations-page.html'

2
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

@ -11,7 +11,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-analysis-page', selector: 'gf-analysis-page',
styleUrls: ['./analysis-page.scss'], styleUrls: ['./analysis-page.scss'],
templateUrl: './analysis-page.html' templateUrl: './analysis-page.html'

2
apps/client/src/app/pages/portfolio/portfolio-page.component.ts

@ -7,7 +7,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-portfolio-page', selector: 'gf-portfolio-page',
styleUrls: ['./portfolio-page.scss'], styleUrls: ['./portfolio-page.scss'],
templateUrl: './portfolio-page.html' templateUrl: './portfolio-page.html'

2
apps/client/src/app/pages/portfolio/report/report-page.component.ts

@ -7,7 +7,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-report-page', selector: 'gf-report-page',
styleUrls: ['./report-page.scss'], styleUrls: ['./report-page.scss'],
templateUrl: './report-page.html' templateUrl: './report-page.html'

2
apps/client/src/app/pages/portfolio/transactions/transactions-page.component.ts

@ -24,7 +24,7 @@ import { CreateOrUpdateTransactionDialog } from './create-or-update-transaction-
import { ImportTransactionDialog } from './import-transaction-dialog/import-transaction-dialog.component'; import { ImportTransactionDialog } from './import-transaction-dialog/import-transaction-dialog.component';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-transactions-page', selector: 'gf-transactions-page',
styleUrls: ['./transactions-page.scss'], styleUrls: ['./transactions-page.scss'],
templateUrl: './transactions-page.html' templateUrl: './transactions-page.html'

2
apps/client/src/app/pages/pricing/pricing-page.component.ts

@ -7,7 +7,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-pricing-page', selector: 'gf-pricing-page',
styleUrls: ['./pricing-page.scss'], styleUrls: ['./pricing-page.scss'],
templateUrl: './pricing-page.html' templateUrl: './pricing-page.html'

2
apps/client/src/app/pages/public/public-page.component.ts

@ -13,7 +13,7 @@ import { EMPTY, Subject } from 'rxjs';
import { catchError, takeUntil } from 'rxjs/operators'; import { catchError, takeUntil } from 'rxjs/operators';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-public-page', selector: 'gf-public-page',
styleUrls: ['./public-page.scss'], styleUrls: ['./public-page.scss'],
templateUrl: './public-page.html' templateUrl: './public-page.html'

2
apps/client/src/app/pages/register/register-page.component.ts

@ -14,7 +14,7 @@ import { takeUntil } from 'rxjs/operators';
import { ShowAccessTokenDialog } from './show-access-token-dialog/show-access-token-dialog.component'; import { ShowAccessTokenDialog } from './show-access-token-dialog/show-access-token-dialog.component';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-register-page', selector: 'gf-register-page',
styleUrls: ['./register-page.scss'], styleUrls: ['./register-page.scss'],
templateUrl: './register-page.html' templateUrl: './register-page.html'

2
apps/client/src/app/pages/resources/resources-page.component.ts

@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-resources-page', selector: 'gf-resources-page',
styleUrls: ['./resources-page.scss'], styleUrls: ['./resources-page.scss'],
templateUrl: './resources-page.html' templateUrl: './resources-page.html'

2
apps/client/src/app/pages/webauthn/webauthn-page.component.ts

@ -6,7 +6,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@Component({ @Component({
host: { class: 'mb-5' }, host: { class: 'page' },
selector: 'gf-webauthn-page', selector: 'gf-webauthn-page',
styleUrls: ['./webauthn-page.scss'], styleUrls: ['./webauthn-page.scss'],
templateUrl: './webauthn-page.html' templateUrl: './webauthn-page.html'

4
apps/client/src/styles.scss

@ -164,6 +164,10 @@ ngx-skeleton-loader {
min-width: unset !important; min-width: unset !important;
} }
.page {
padding-bottom: 5rem;
}
.svgMap-tooltip { .svgMap-tooltip {
border-bottom: none; border-bottom: none;

602
libs/ui/src/lib/activities-table/activities-table.component.html

@ -36,314 +36,334 @@
</mat-autocomplete> </mat-autocomplete>
</mat-form-field> </mat-form-field>
<table <div class="activities">
class="gf-table w-100" <table
matSort class="gf-table w-100"
matSortActive="date" matSort
matSortDirection="desc" matSortActive="date"
mat-table matSortDirection="desc"
[dataSource]="dataSource" mat-table
> [dataSource]="dataSource"
<ng-container matColumnDef="count"> >
<th <ng-container matColumnDef="count">
*matHeaderCellDef <th
class="d-none d-lg-table-cell px-1 text-right" *matHeaderCellDef
i18n class="d-none d-lg-table-cell px-1 text-right"
mat-header-cell i18n
></th> mat-header-cell
<td ></th>
*matCellDef="let element; let i = index" <td
class="d-none d-lg-table-cell px-1 text-right" *matCellDef="let element; let i = index"
mat-cell class="d-none d-lg-table-cell px-1 text-right"
> mat-cell
{{ dataSource.data.length - i }}
</td>
<td
*matFooterCellDef
class="d-none d-lg-table-cell px-1"
mat-footer-cell
></td>
</ng-container>
<ng-container matColumnDef="date">
<th *matHeaderCellDef class="px-1" i18n mat-header-cell mat-sort-header>
Date
</th>
<td *matCellDef="let element" class="px-1" mat-cell>
<div class="d-flex">
{{ element.date | date: defaultDateFormat }}
</div>
</td>
<td *matFooterCellDef class="px-1" i18n mat-footer-cell>Total</td>
</ng-container>
<ng-container matColumnDef="type">
<th *matHeaderCellDef class="px-1" i18n mat-header-cell mat-sort-header>
Type
</th>
<td *matCellDef="let element" mat-cell class="px-1">
<div
class="d-inline-flex p-1 type-badge"
[ngClass]="{
buy: element.type === 'BUY',
dividend: element.type === 'DIVIDEND',
sell: element.type === 'SELL'
}"
> >
<ion-icon {{ dataSource.data.length - i }}
[name]=" </td>
element.type === 'BUY' || element.type === 'DIVIDEND' <td
? 'arrow-forward-circle-outline' *matFooterCellDef
: 'arrow-back-circle-outline' class="d-none d-lg-table-cell px-1"
" mat-footer-cell
></ion-icon> ></td>
<span class="d-none d-lg-block mx-1">{{ element.type }}</span> </ng-container>
</div> <ng-container matColumnDef="date">
</td> <th *matHeaderCellDef class="px-1" i18n mat-header-cell mat-sort-header>
<td *matFooterCellDef class="px-1" mat-footer-cell></td> Date
</ng-container> </th>
<td *matCellDef="let element" class="px-1" mat-cell>
<div class="d-flex">
{{ element.date | date: defaultDateFormat }}
</div>
</td>
<td *matFooterCellDef class="px-1" i18n mat-footer-cell>Total</td>
</ng-container>
<ng-container matColumnDef="symbol"> <ng-container matColumnDef="type">
<th *matHeaderCellDef class="px-1" i18n mat-header-cell mat-sort-header> <th *matHeaderCellDef class="px-1" i18n mat-header-cell mat-sort-header>
Symbol Type
</th> </th>
<td *matCellDef="let element" class="px-1" mat-cell> <td *matCellDef="let element" mat-cell class="px-1">
<div class="d-flex align-items-center"> <div
{{ element.symbol | gfSymbol }} class="d-inline-flex p-1 type-badge"
<span *ngIf="element.isDraft" class="badge badge-secondary ml-1" i18n [ngClass]="{
>Draft</span buy: element.type === 'BUY',
dividend: element.type === 'DIVIDEND',
sell: element.type === 'SELL'
}"
> >
</div> <ion-icon
</td> [name]="
<td *matFooterCellDef class="px-1" mat-footer-cell></td> element.type === 'BUY' || element.type === 'DIVIDEND'
</ng-container> ? 'arrow-forward-circle-outline'
: 'arrow-back-circle-outline'
<ng-container matColumnDef="currency"> "
<th ></ion-icon>
*matHeaderCellDef <span class="d-none d-lg-block mx-1">{{ element.type }}</span>
class="d-none d-lg-table-cell px-1" </div>
i18n </td>
mat-header-cell <td *matFooterCellDef class="px-1" mat-footer-cell></td>
mat-sort-header </ng-container>
>
Currency
</th>
<td *matCellDef="let element" class="d-none d-lg-table-cell px-1" mat-cell>
{{ element.currency }}
</td>
<td *matFooterCellDef class="d-none d-lg-table-cell px-1" mat-footer-cell>
{{ baseCurrency }}
</td>
</ng-container>
<ng-container matColumnDef="quantity"> <ng-container matColumnDef="symbol">
<th <th *matHeaderCellDef class="px-1" i18n mat-header-cell mat-sort-header>
*matHeaderCellDef Symbol
class="d-none d-lg-table-cell justify-content-end px-1" </th>
i18n <td *matCellDef="let element" class="px-1" mat-cell>
mat-header-cell <div class="d-flex align-items-center">
mat-sort-header {{ element.symbol | gfSymbol }}
> <span *ngIf="element.isDraft" class="badge badge-secondary ml-1" i18n
Quantity >Draft</span
</th> >
<td *matCellDef="let element" class="d-none d-lg-table-cell px-1" mat-cell> </div>
<div class="d-flex justify-content-end"> </td>
<gf-value <td *matFooterCellDef class="px-1" mat-footer-cell></td>
[isCurrency]="true" </ng-container>
[locale]="locale"
[value]="isLoading ? undefined : element.quantity"
></gf-value>
</div>
</td>
<td
*matFooterCellDef
class="d-none d-lg-table-cell px-1"
mat-footer-cell
></td>
</ng-container>
<ng-container matColumnDef="unitPrice"> <ng-container matColumnDef="currency">
<th <th
*matHeaderCellDef *matHeaderCellDef
class="d-none d-lg-table-cell justify-content-end px-1" class="d-none d-lg-table-cell px-1"
i18n i18n
mat-header-cell mat-header-cell
mat-sort-header mat-sort-header
> >
Unit Price Currency
</th> </th>
<td *matCellDef="let element" class="d-none d-lg-table-cell px-1" mat-cell> <td
<div class="d-flex justify-content-end"> *matCellDef="let element"
<gf-value class="d-none d-lg-table-cell px-1"
[isCurrency]="true" mat-cell
[locale]="locale" >
[value]="isLoading ? undefined : element.unitPrice" {{ element.currency }}
></gf-value> </td>
</div> <td *matFooterCellDef class="d-none d-lg-table-cell px-1" mat-footer-cell>
</td> {{ baseCurrency }}
<td </td>
*matFooterCellDef </ng-container>
class="d-none d-lg-table-cell px-1"
mat-footer-cell
></td>
</ng-container>
<ng-container matColumnDef="fee"> <ng-container matColumnDef="quantity">
<th <th
*matHeaderCellDef *matHeaderCellDef
class="d-none d-lg-table-cell justify-content-end px-1" class="d-none d-lg-table-cell justify-content-end px-1"
i18n i18n
mat-header-cell mat-header-cell
mat-sort-header mat-sort-header
> >
Fee Quantity
</th> </th>
<td *matCellDef="let element" class="d-none d-lg-table-cell px-1" mat-cell> <td
<div class="d-flex justify-content-end"> *matCellDef="let element"
<gf-value class="d-none d-lg-table-cell px-1"
[isCurrency]="true" mat-cell
[locale]="locale" >
[value]="isLoading ? undefined : element.fee" <div class="d-flex justify-content-end">
></gf-value> <gf-value
</div> [isCurrency]="true"
</td> [locale]="locale"
<td *matFooterCellDef class="d-none d-lg-table-cell px-1" mat-footer-cell> [value]="isLoading ? undefined : element.quantity"
<div class="d-flex justify-content-end"> ></gf-value>
<gf-value </div>
[isCurrency]="true" </td>
[locale]="locale" <td
[value]="isLoading ? undefined : totalFees" *matFooterCellDef
></gf-value> class="d-none d-lg-table-cell px-1"
</div> mat-footer-cell
</td> ></td>
</ng-container> </ng-container>
<ng-container matColumnDef="value"> <ng-container matColumnDef="unitPrice">
<th <th
*matHeaderCellDef *matHeaderCellDef
class="justify-content-end px-1" class="d-none d-lg-table-cell justify-content-end px-1"
i18n i18n
mat-header-cell mat-header-cell
mat-sort-header mat-sort-header
> >
Value Unit Price
</th> </th>
<td *matCellDef="let element" class="px-1" mat-cell> <td
<div class="d-flex justify-content-end"> *matCellDef="let element"
<gf-value class="d-none d-lg-table-cell px-1"
[isCurrency]="true" mat-cell
[locale]="locale" >
[value]="isLoading ? undefined : element.value" <div class="d-flex justify-content-end">
></gf-value> <gf-value
</div> [isCurrency]="true"
</td> [locale]="locale"
<td *matFooterCellDef class="px-1" mat-footer-cell> [value]="isLoading ? undefined : element.unitPrice"
<div class="d-flex justify-content-end"> ></gf-value>
<gf-value </div>
[isCurrency]="true" </td>
[locale]="locale" <td
[value]="isLoading ? undefined : totalValue" *matFooterCellDef
></gf-value> class="d-none d-lg-table-cell px-1"
</div> mat-footer-cell
</td> ></td>
</ng-container> </ng-container>
<ng-container matColumnDef="account"> <ng-container matColumnDef="fee">
<th *matHeaderCellDef class="px-1" mat-header-cell> <th
<span class="d-none d-lg-block" i18n>Account</span> *matHeaderCellDef
</th> class="d-none d-lg-table-cell justify-content-end px-1"
<td *matCellDef="let element" class="px-1" mat-cell> i18n
<div class="d-flex"> mat-header-cell
<gf-symbol-icon mat-sort-header
*ngIf="element.Account?.Platform?.url" >
class="mr-1" Fee
[tooltip]="element.Account?.Platform?.name" </th>
[url]="element.Account?.Platform?.url" <td
></gf-symbol-icon> *matCellDef="let element"
<span class="d-none d-lg-block">{{ element.Account?.name }}</span> class="d-none d-lg-table-cell px-1"
</div> mat-cell
</td> >
<td *matFooterCellDef class="px-1" mat-footer-cell></td> <div class="d-flex justify-content-end">
</ng-container> <gf-value
[isCurrency]="true"
[locale]="locale"
[value]="isLoading ? undefined : element.fee"
></gf-value>
</div>
</td>
<td *matFooterCellDef class="d-none d-lg-table-cell px-1" mat-footer-cell>
<div class="d-flex justify-content-end">
<gf-value
[isCurrency]="true"
[locale]="locale"
[value]="isLoading ? undefined : totalFees"
></gf-value>
</div>
</td>
</ng-container>
<ng-container matColumnDef="actions"> <ng-container matColumnDef="value">
<th *matHeaderCellDef class="px-1 text-center" mat-header-cell> <th
<button *matHeaderCellDef
*ngIf=" class="justify-content-end px-1"
hasPermissionToExportActivities || hasPermissionToImportActivities i18n
" mat-header-cell
class="mx-1 no-min-width px-2" mat-sort-header
mat-button
[matMenuTriggerFor]="activitiesMenu"
(click)="$event.stopPropagation()"
> >
<ion-icon name="ellipsis-vertical"></ion-icon> Value
</button> </th>
<mat-menu #activitiesMenu="matMenu" xPosition="before"> <td *matCellDef="let element" class="px-1" mat-cell>
<div class="d-flex justify-content-end">
<gf-value
[isCurrency]="true"
[locale]="locale"
[value]="isLoading ? undefined : element.value"
></gf-value>
</div>
</td>
<td *matFooterCellDef class="px-1" mat-footer-cell>
<div class="d-flex justify-content-end">
<gf-value
[isCurrency]="true"
[locale]="locale"
[value]="isLoading ? undefined : totalValue"
></gf-value>
</div>
</td>
</ng-container>
<ng-container matColumnDef="account">
<th *matHeaderCellDef class="px-1" mat-header-cell>
<span class="d-none d-lg-block" i18n>Account</span>
</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>
<td *matFooterCellDef class="px-1" mat-footer-cell></td>
</ng-container>
<ng-container matColumnDef="actions">
<th *matHeaderCellDef class="px-1 text-center" mat-header-cell>
<button <button
*ngIf="hasPermissionToImportActivities" *ngIf="
class="align-items-center d-flex" hasPermissionToExportActivities || hasPermissionToImportActivities
mat-menu-item "
(click)="onImport()" class="mx-1 no-min-width px-2"
mat-button
[matMenuTriggerFor]="activitiesMenu"
(click)="$event.stopPropagation()"
> >
<ion-icon class="mr-2" name="cloud-upload-outline"></ion-icon> <ion-icon name="ellipsis-vertical"></ion-icon>
<span i18n>Import</span>
</button> </button>
<mat-menu #activitiesMenu="matMenu" xPosition="before">
<button
*ngIf="hasPermissionToImportActivities"
class="align-items-center d-flex"
mat-menu-item
(click)="onImport()"
>
<ion-icon class="mr-2" name="cloud-upload-outline"></ion-icon>
<span i18n>Import</span>
</button>
<button
*ngIf="hasPermissionToExportActivities"
class="align-items-center d-flex"
mat-menu-item
(click)="onExport()"
>
<ion-icon class="mr-2" name="cloud-download-outline"></ion-icon>
<span i18n>Export</span>
</button>
</mat-menu>
</th>
<td *matCellDef="let element" class="px-1 text-center" mat-cell>
<button <button
*ngIf="hasPermissionToExportActivities" *ngIf="this.showActions"
class="align-items-center d-flex" class="mx-1 no-min-width px-2"
mat-menu-item mat-button
(click)="onExport()" [matMenuTriggerFor]="activityMenu"
(click)="$event.stopPropagation()"
> >
<ion-icon class="mr-2" name="cloud-download-outline"></ion-icon> <ion-icon name="ellipsis-vertical"></ion-icon>
<span i18n>Export</span>
</button>
</mat-menu>
</th>
<td *matCellDef="let element" class="px-1 text-center" mat-cell>
<button
*ngIf="this.showActions"
class="mx-1 no-min-width px-2"
mat-button
[matMenuTriggerFor]="activityMenu"
(click)="$event.stopPropagation()"
>
<ion-icon name="ellipsis-vertical"></ion-icon>
</button>
<mat-menu #activityMenu="matMenu" xPosition="before">
<button i18n mat-menu-item (click)="onUpdateActivity(element)">
Edit
</button> </button>
<button i18n mat-menu-item (click)="onCloneActivity(element)"> <mat-menu #activityMenu="matMenu" xPosition="before">
Clone <button i18n mat-menu-item (click)="onUpdateActivity(element)">
</button> Edit
<button i18n mat-menu-item (click)="onDeleteActivity(element.id)"> </button>
Delete <button i18n mat-menu-item (click)="onCloneActivity(element)">
</button> Clone
</mat-menu> </button>
</td> <button i18n mat-menu-item (click)="onDeleteActivity(element.id)">
<td *matFooterCellDef class="px-1" mat-footer-cell></td> Delete
</ng-container> </button>
</mat-menu>
</td>
<td *matFooterCellDef class="px-1" mat-footer-cell></td>
</ng-container>
<tr *matHeaderRowDef="displayedColumns" mat-header-row></tr> <tr *matHeaderRowDef="displayedColumns" mat-header-row></tr>
<tr <tr
*matRowDef="let row; columns: displayedColumns" *matRowDef="let row; columns: displayedColumns"
mat-row mat-row
(click)=" (click)="
hasPermissionToOpenDetails && hasPermissionToOpenDetails &&
!row.isDraft && !row.isDraft &&
onOpenPositionDialog({ onOpenPositionDialog({
dataSource: row.dataSource, dataSource: row.dataSource,
symbol: row.symbol symbol: row.symbol
}) })
" "
[ngClass]="{ 'cursor-pointer': hasPermissionToOpenDetails && !row.isDraft }" [ngClass]="{
></tr> 'cursor-pointer': hasPermissionToOpenDetails && !row.isDraft
<tr }"
*matFooterRowDef="displayedColumns" ></tr>
mat-footer-row <tr
[ngClass]="{ 'd-none': isLoading || dataSource.data.length === 0 }" *matFooterRowDef="displayedColumns"
></tr> mat-footer-row
</table> [ngClass]="{ 'd-none': isLoading || dataSource.data.length === 0 }"
></tr>
</table>
</div>
<ngx-skeleton-loader <ngx-skeleton-loader
*ngIf="isLoading" *ngIf="isLoading"

64
libs/ui/src/lib/activities-table/activities-table.component.scss

@ -14,45 +14,49 @@
min-height: 1.5rem !important; min-height: 1.5rem !important;
} }
.mat-table { .activities {
td { overflow-x: auto;
&.mat-footer-cell {
border-top: 1px solid .mat-table {
rgba( td {
var(--palette-foreground-divider), &.mat-footer-cell {
var(--palette-foreground-divider-alpha) border-top: 1px solid
); rgba(
var(--palette-foreground-divider),
var(--palette-foreground-divider-alpha)
);
}
} }
}
th { th {
::ng-deep { ::ng-deep {
.mat-sort-header-container { .mat-sort-header-container {
justify-content: inherit; justify-content: inherit;
}
} }
} }
}
.mat-row { .mat-row {
.type-badge { .type-badge {
background-color: rgba(var(--palette-foreground-text), 0.05); background-color: rgba(var(--palette-foreground-text), 0.05);
border-radius: 1rem; border-radius: 1rem;
line-height: 1em; line-height: 1em;
ion-icon { ion-icon {
font-size: 1rem; font-size: 1rem;
} }
&.buy { &.buy {
color: var(--green); color: var(--green);
} }
&.dividend { &.dividend {
color: var(--blue); color: var(--blue);
} }
&.sell { &.sell {
color: var(--orange); color: var(--orange);
}
} }
} }
} }

Loading…
Cancel
Save