Browse Source

Add tags (read-only)

pull/7460/head
Thomas Kaul 1 month ago
parent
commit
15a51631c7
  1. 15
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
  2. 4
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html
  3. 2
      libs/ui/src/lib/tags-selector/tags-selector.component.ts

15
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts

@ -20,7 +20,9 @@ import { GfActivitiesTableComponent } from '@ghostfolio/ui/activities-table';
import { GfDialogFooterComponent } from '@ghostfolio/ui/dialog-footer';
import { GfDialogHeaderComponent } from '@ghostfolio/ui/dialog-header';
import { GfHoldingsTableComponent } from '@ghostfolio/ui/holdings-table';
import { translate } from '@ghostfolio/ui/i18n';
import { DataService } from '@ghostfolio/ui/services';
import { GfTagsSelectorComponent } from '@ghostfolio/ui/tags-selector';
import { GfValueComponent } from '@ghostfolio/ui/value';
import {
@ -42,6 +44,7 @@ import { MatTableDataSource } from '@angular/material/table';
import { MatTabsModule } from '@angular/material/tabs';
import { NavigationStart, Router } from '@angular/router';
import { IonIcon } from '@ionic/angular/standalone';
import { Tag } from '@prisma/client';
import { Big } from 'big.js';
import { format, parseISO } from 'date-fns';
import { addIcons } from 'ionicons';
@ -69,6 +72,7 @@ import {
GfDialogHeaderComponent,
GfHoldingsTableComponent,
GfInvestmentChartComponent,
GfTagsSelectorComponent,
GfValueComponent,
IonIcon,
MatButtonModule,
@ -105,6 +109,7 @@ export class GfAccountDetailDialogComponent implements OnInit {
protected platformName: string;
protected sortColumn = 'date';
protected sortDirection: SortDirection = 'desc';
protected tags: Tag[];
protected totalItems: number;
protected user: User;
protected valueInBaseCurrency: number;
@ -231,6 +236,7 @@ export class GfAccountDetailDialogComponent implements OnInit {
interestInBaseCurrency,
name,
platform,
tags,
value,
valueInBaseCurrency
}) => {
@ -280,6 +286,15 @@ export class GfAccountDetailDialogComponent implements OnInit {
this.name = name;
this.platformName = platform?.name ?? '-';
this.tags =
tags?.map((tag) => {
return {
...tag,
name: translate(tag.name)
};
}) ?? [];
this.valueInBaseCurrency = valueInBaseCurrency;
this.changeDetectorRef.markForCheck();

4
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html

@ -158,6 +158,10 @@
/>
</mat-tab>
</mat-tab-group>
@if (user?.settings?.isExperimentalFeatures) {
<gf-tags-selector [readonly]="true" [tags]="tags" />
}
</div>
</div>

2
libs/ui/src/lib/tags-selector/tags-selector.component.ts

@ -167,7 +167,7 @@ export class GfTagsSelectorComponent
return id;
});
return this.tagsAvailable
return (this.tagsAvailable ?? [])
.filter(({ id, name }) => {
return (
!tagIds.includes(id) &&

Loading…
Cancel
Save