Browse Source

Feature/add name to activities table (#1516)

* Add name to symbol column

* Update changelog
pull/1517/head
Thomas Kaul 2 years ago
committed by GitHub
parent
commit
c38ebec3be
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 2
      apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html
  3. 27
      libs/ui/src/lib/activities-table/activities-table.component.html
  4. 8
      libs/ui/src/lib/activities-table/activities-table.component.ts

1
CHANGELOG.md

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Added the name to the symbol column in the activities table
- Combined the name and symbol column in the holdings table (former positions table) - Combined the name and symbol column in the holdings table (former positions table)
## 1.218.0 - 2022-12-12 ## 1.218.0 - 2022-12-12

2
apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html

@ -223,7 +223,7 @@
[hasPermissionToOpenDetails]="false" [hasPermissionToOpenDetails]="false"
[locale]="data.locale" [locale]="data.locale"
[showActions]="false" [showActions]="false"
[showSymbolColumn]="false" [showNameColumn]="false"
(export)="onExport()" (export)="onExport()"
></gf-activities-table> ></gf-activities-table>
</div> </div>

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

@ -83,26 +83,31 @@
<td *matFooterCellDef class="px-1" mat-footer-cell></td> <td *matFooterCellDef class="px-1" mat-footer-cell></td>
</ng-container> </ng-container>
<ng-container matColumnDef="symbol"> <ng-container matColumnDef="nameWithSymbol">
<th <th
*matHeaderCellDef *matHeaderCellDef
class="px-1" class="px-1"
mat-header-cell mat-header-cell
mat-sort-header="SymbolProfile.symbol" mat-sort-header="SymbolProfile.symbol"
> >
<ng-container i18n>Symbol</ng-container> <ng-container i18n>Name</ng-container>
</th> </th>
<td *matCellDef="let element" class="px-1" mat-cell> <td *matCellDef="let element" class="px-1" mat-cell>
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<span *ngIf="isUUID(element.SymbolProfile.symbol); else symbol"> <div>
{{ element.SymbolProfile.name }} <span class="text-truncate">{{ element.SymbolProfile.name }}</span>
</span> <span
<ng-template #symbol> *ngIf="element.isDraft"
{{ element.SymbolProfile.symbol | gfSymbol }} class="badge badge-secondary ml-1"
</ng-template> i18n
<span *ngIf="element.isDraft" class="badge badge-secondary ml-1" i18n >Draft</span
>Draft</span >
> </div>
</div>
<div *ngIf="!isUUID(element.SymbolProfile.symbol)">
<small class="text-muted">{{
element.SymbolProfile.symbol | gfSymbol
}}</small>
</div> </div>
</td> </td>
<td *matFooterCellDef class="px-1" mat-footer-cell></td> <td *matFooterCellDef class="px-1" mat-footer-cell></td>

8
libs/ui/src/lib/activities-table/activities-table.component.ts

@ -41,7 +41,7 @@ export class ActivitiesTableComponent implements OnChanges, OnDestroy {
@Input() locale: string; @Input() locale: string;
@Input() pageSize = DEFAULT_PAGE_SIZE; @Input() pageSize = DEFAULT_PAGE_SIZE;
@Input() showActions: boolean; @Input() showActions: boolean;
@Input() showSymbolColumn = true; @Input() showNameColumn = true;
@Output() activityDeleted = new EventEmitter<string>(); @Output() activityDeleted = new EventEmitter<string>();
@Output() activityToClone = new EventEmitter<OrderWithAccount>(); @Output() activityToClone = new EventEmitter<OrderWithAccount>();
@ -86,7 +86,7 @@ export class ActivitiesTableComponent implements OnChanges, OnDestroy {
'count', 'count',
'date', 'date',
'type', 'type',
'symbol', 'nameWithSymbol',
'quantity', 'quantity',
'unitPrice', 'unitPrice',
'fee', 'fee',
@ -98,9 +98,9 @@ export class ActivitiesTableComponent implements OnChanges, OnDestroy {
'actions' 'actions'
]; ];
if (!this.showSymbolColumn) { if (!this.showNameColumn) {
this.displayedColumns = this.displayedColumns.filter((column) => { this.displayedColumns = this.displayedColumns.filter((column) => {
return column !== 'symbol'; return column !== 'nameWithSymbol';
}); });
} }

Loading…
Cancel
Save