Merge branch 'main' of github.com:ghostfolio/ghostfolio
All checks were successful
Docker image CD / build_and_push (push) Successful in 35m35s

This commit is contained in:
sudacode 2025-02-27 18:14:02 -08:00
commit 8462b4238f
5 changed files with 32 additions and 5 deletions

View File

@ -9,7 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Extended the export functionality by the platforms
- Extended the _Trackinsight_ data enhancer for asset profile data by `cusip` - Extended the _Trackinsight_ data enhancer for asset profile data by `cusip`
- Added _Storybook_ to the build process
## 2.141.0 - 2025-02-25 ## 2.141.0 - 2025-02-25

View File

@ -5,6 +5,7 @@ import { TagService } from '@ghostfolio/api/services/tag/tag.service';
import { Filter, Export } from '@ghostfolio/common/interfaces'; import { Filter, Export } from '@ghostfolio/common/interfaces';
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { Platform } from '@prisma/client';
@Injectable() @Injectable()
export class ExportService { export class ExportService {
@ -25,15 +26,37 @@ export class ExportService {
userCurrency: string; userCurrency: string;
userId: string; userId: string;
}): Promise<Export> { }): Promise<Export> {
const platforms: Platform[] = [];
const accounts = ( const accounts = (
await this.accountService.accounts({ await this.accountService.accounts({
include: {
Platform: true
},
orderBy: { orderBy: {
name: 'asc' name: 'asc'
}, },
where: { userId } where: { userId }
}) })
).map( ).map(
({ balance, comment, currency, id, isExcluded, name, platformId }) => { ({
balance,
comment,
currency,
id,
isExcluded,
name,
platformId,
Platform: platform
}) => {
if (
!platforms.some(({ id: currentPlatformId }) => {
return currentPlatformId === platform.id;
})
) {
platforms.push(platform);
}
return { return {
balance, balance,
comment, comment,
@ -76,6 +99,7 @@ export class ExportService {
return { return {
meta: { date: new Date().toISOString(), version: environment.version }, meta: { date: new Date().toISOString(), version: environment.version },
accounts, accounts,
platforms,
tags, tags,
activities: activities.map( activities: activities.map(
({ ({

View File

@ -1,4 +1,4 @@
import { Account, Order, Tag } from '@prisma/client'; import { Account, Order, Platform, Tag } from '@prisma/client';
export interface Export { export interface Export {
accounts: Omit<Account, 'createdAt' | 'updatedAt' | 'userId'>[]; accounts: Omit<Account, 'createdAt' | 'updatedAt' | 'userId'>[];
@ -16,6 +16,7 @@ export interface Export {
date: string; date: string;
version: string; version: string;
}; };
platforms: Platform[];
tags: Omit<Tag, 'userId'>[]; tags: Omit<Tag, 'userId'>[];
user: { settings: { currency: string } }; user: { settings: { currency: string } };
} }

View File

@ -41,7 +41,7 @@
"executor": "@storybook/angular:build-storybook", "executor": "@storybook/angular:build-storybook",
"outputs": ["{options.outputDir}"], "outputs": ["{options.outputDir}"],
"options": { "options": {
"outputDir": "dist/storybook/ui", "outputDir": "dist/apps/client/development/storybook",
"configDir": "libs/ui/.storybook", "configDir": "libs/ui/.storybook",
"browserTarget": "ui:build-storybook", "browserTarget": "ui:build-storybook",
"compodoc": false, "compodoc": false,
@ -61,7 +61,7 @@
"executor": "@nx/web:file-server", "executor": "@nx/web:file-server",
"options": { "options": {
"buildTarget": "ui:build-storybook", "buildTarget": "ui:build-storybook",
"staticFilePath": "dist/storybook/ui" "staticFilePath": "dist/storybook"
}, },
"configurations": { "configurations": {
"ci": { "ci": {

View File

@ -15,7 +15,7 @@
"affected:test": "nx affected:test", "affected:test": "nx affected:test",
"analyze:client": "nx run client:build:production --stats-json && webpack-bundle-analyzer -p 1234 dist/apps/client/en/stats.json", "analyze:client": "nx run client:build:production --stats-json && webpack-bundle-analyzer -p 1234 dist/apps/client/en/stats.json",
"angular": "node --max_old_space_size=32768 ./node_modules/@angular/cli/bin/ng", "angular": "node --max_old_space_size=32768 ./node_modules/@angular/cli/bin/ng",
"build:production": "nx run api:copy-assets && nx run api:build:production && nx run client:copy-assets && nx run client:build:production && npm run replace-placeholders-in-build", "build:production": "nx run api:copy-assets && nx run api:build:production && nx run client:copy-assets && nx run client:build:production && nx run ui:build-storybook && npm run replace-placeholders-in-build",
"build:storybook": "nx run ui:build-storybook", "build:storybook": "nx run ui:build-storybook",
"database:format-schema": "prisma format", "database:format-schema": "prisma format",
"database:generate-typings": "prisma generate", "database:generate-typings": "prisma generate",