@ -36,309 +36,335 @@
< / 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 = "val ue" >
< ng-container matColumnDef = "unitPric e" >
< 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
>
>
Valu e
Unit Pric e
< / 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
class="mx-1 no-min-width px-2"
class="justify-content-end px-1 "
mat-button
i18 n
[matMenuTriggerFor]="activitiesMenu"
mat-header-cell
(click)="$event.stopPropagation()"
mat-sort-header
>
>
< 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
[isAbsolute]="true"
[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
class="align-items-center d-flex"
*ngIf="this.showActions"
mat-menu-item
class="mx-1 no-min-width px-2"
(click)="onExport()"
mat-button
[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
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"