Browse Source

Feature/add platform logo to account selector in create or update activity dialog (#7524)

* Add platform logo to account selector

* Update changelog
pull/7528/head^2
Thomas Kaul 4 days ago
committed by GitHub
parent
commit
5bbdf52e19
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      CHANGELOG.md
  2. 1
      apps/api/src/app/user/user.service.ts
  3. 6
      apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
  4. 13
      apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html
  5. 5
      apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/interfaces/interfaces.ts

6
CHANGELOG.md

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Added
- Added the platform logo to the account selector in the create or update activity dialog
## 3.42.0 - 2026-08-04 ## 3.42.0 - 2026-08-04
### Changed ### Changed

1
apps/api/src/app/user/user.service.ts

@ -136,6 +136,7 @@ export class UserService {
where: { granteeUserId: id } where: { granteeUserId: id }
}), }),
this.prismaService.account.findMany({ this.prismaService.account.findMany({
include: { platform: true },
orderBy: { orderBy: {
name: 'asc' name: 'asc'
}, },

6
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts

@ -121,6 +121,12 @@ export class GfCreateOrUpdateActivityDialogComponent {
addIcons({ calendarClearOutline, refreshOutline }); addIcons({ calendarClearOutline, refreshOutline });
} }
protected get selectedAccount() {
return this.data.accounts.find(({ id }) => {
return id === this.activityForm.get('accountId')?.value;
});
}
public ngOnInit() { public ngOnInit() {
this.currencyOfAssetProfile = this.data.activity?.assetProfile?.currency; this.currencyOfAssetProfile = this.data.activity?.assetProfile?.currency;
this.hasPermissionToCreateOwnTag = hasPermission( this.hasPermissionToCreateOwnTag = hasPermission(

13
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html

@ -85,6 +85,19 @@
> >
<mat-label i18n>Account</mat-label> <mat-label i18n>Account</mat-label>
<mat-select formControlName="accountId"> <mat-select formControlName="accountId">
<mat-select-trigger>
<div class="d-flex">
@if (selectedAccount?.platform?.url) {
<gf-entity-logo
class="mr-1"
[tooltip]="selectedAccount?.platform?.name"
[url]="selectedAccount?.platform?.url"
/>
}
<span>{{ selectedAccount?.name }}</span>
</div>
</mat-select-trigger>
<mat-option [value]="null" /> <mat-option [value]="null" />
@for (account of data.accounts; track account) { @for (account of data.accounts; track account) {

5
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/interfaces/interfaces.ts

@ -1,9 +1,8 @@
import { Activity, User } from '@ghostfolio/common/interfaces'; import { Activity, User } from '@ghostfolio/common/interfaces';
import { AccountWithPlatform } from '@ghostfolio/common/types';
import { Account } from '@prisma/client';
export interface CreateOrUpdateActivityDialogParams { export interface CreateOrUpdateActivityDialogParams {
accounts: Account[]; accounts: AccountWithPlatform[];
activity: Partial<Omit<Activity, 'assetProfile' | 'id' | 'unitPrice'>> & { activity: Partial<Omit<Activity, 'assetProfile' | 'id' | 'unitPrice'>> & {
assetProfile: Activity['assetProfile'] | null; assetProfile: Activity['assetProfile'] | null;
id: string | null; id: string | null;

Loading…
Cancel
Save