Browse Source

Merge branch 'ghostfolio:main' into patch-1

pull/2717/head
sadmimye 2 years ago
committed by GitHub
parent
commit
769f3d08b5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      CHANGELOG.md
  2. 6
      apps/api/src/app/order/order.controller.ts
  3. 6
      apps/api/src/app/order/order.service.ts
  4. 24
      apps/client/project.json
  5. 1
      apps/client/src/app/app.component.ts
  6. 2
      apps/client/src/app/components/admin-overview/admin-overview.component.ts
  7. 4
      apps/client/src/app/components/admin-overview/admin-overview.html
  8. 2
      apps/client/src/app/pages/user-account/user-account-page.component.ts
  9. 1
      package.json
  10. 10
      yarn.lock

15
CHANGELOG.md

@ -5,6 +5,21 @@ 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 version to the admin control panel
- Added pagination parameters (`skip`, `take`) to the endpoint `GET api/v1/order`
### Changed
- Harmonized the settings icon of the user account page
### Fixed
- Fixed the sidebar navigation on the user account page
## 2.7.0 - 2023-09-30 ## 2.7.0 - 2023-09-30
### Added ### Added

6
apps/api/src/app/order/order.controller.ts

@ -89,7 +89,9 @@ export class OrderController {
@Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId, @Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId,
@Query('accounts') filterByAccounts?: string, @Query('accounts') filterByAccounts?: string,
@Query('assetClasses') filterByAssetClasses?: string, @Query('assetClasses') filterByAssetClasses?: string,
@Query('tags') filterByTags?: string @Query('skip') skip?: number,
@Query('tags') filterByTags?: string,
@Query('take') take?: number
): Promise<Activities> { ): Promise<Activities> {
const filters = this.apiService.buildFiltersFromQueryParams({ const filters = this.apiService.buildFiltersFromQueryParams({
filterByAccounts, filterByAccounts,
@ -105,6 +107,8 @@ export class OrderController {
filters, filters,
userCurrency, userCurrency,
includeDrafts: true, includeDrafts: true,
skip: isNaN(skip) ? undefined : skip,
take: isNaN(take) ? undefined : take,
userId: impersonationUserId || this.request.user.id, userId: impersonationUserId || this.request.user.id,
withExcludedAccounts: true withExcludedAccounts: true
}); });

6
apps/api/src/app/order/order.service.ts

@ -230,6 +230,8 @@ export class OrderService {
public async getOrders({ public async getOrders({
filters, filters,
includeDrafts = false, includeDrafts = false,
skip,
take = Number.MAX_SAFE_INTEGER,
types, types,
userCurrency, userCurrency,
userId, userId,
@ -237,6 +239,8 @@ export class OrderService {
}: { }: {
filters?: Filter[]; filters?: Filter[];
includeDrafts?: boolean; includeDrafts?: boolean;
skip?: number;
take?: number;
types?: TypeOfOrder[]; types?: TypeOfOrder[];
userCurrency: string; userCurrency: string;
userId: string; userId: string;
@ -315,6 +319,8 @@ export class OrderService {
return ( return (
await this.orders({ await this.orders({
skip,
take,
where, where,
include: { include: {
// eslint-disable-next-line @typescript-eslint/naming-convention // eslint-disable-next-line @typescript-eslint/naming-convention

24
apps/client/project.json

@ -104,40 +104,40 @@
"options": { "options": {
"commands": [ "commands": [
{ {
"command": "mkdir -p dist/apps/client" "command": "shx mkdir -p dist/apps/client"
}, },
{ {
"command": "cp -r apps/client/src/assets dist/apps/client" "command": "shx cp -r apps/client/src/assets dist/apps/client"
}, },
{ {
"command": "cp -r apps/client/src/assets/.well-known dist/apps/client" "command": "shx cp -r apps/client/src/assets/.well-known dist/apps/client"
}, },
{ {
"command": "cp apps/client/src/assets/favicon.ico dist/apps/client" "command": "shx cp apps/client/src/assets/favicon.ico dist/apps/client"
}, },
{ {
"command": "cp apps/client/src/assets/index.html dist/apps/client" "command": "shx cp apps/client/src/assets/index.html dist/apps/client"
}, },
{ {
"command": "cp apps/client/src/assets/robots.txt dist/apps/client" "command": "shx cp apps/client/src/assets/robots.txt dist/apps/client"
}, },
{ {
"command": "cp apps/client/src/assets/site.webmanifest dist/apps/client" "command": "shx cp apps/client/src/assets/site.webmanifest dist/apps/client"
}, },
{ {
"command": "cp node_modules/ionicons/dist/index.js dist/apps/client" "command": "shx cp node_modules/ionicons/dist/index.js dist/apps/client"
}, },
{ {
"command": "cp node_modules/ionicons/dist/ionicons.js dist/apps/client" "command": "shx cp node_modules/ionicons/dist/ionicons.js dist/apps/client"
}, },
{ {
"command": "cp -r node_modules/ionicons/dist/ionicons dist/apps/client/ionicons" "command": "shx cp -r node_modules/ionicons/dist/ionicons dist/apps/client/ionicons"
}, },
{ {
"command": "cp CHANGELOG.md dist/apps/client/assets" "command": "shx cp CHANGELOG.md dist/apps/client/assets"
}, },
{ {
"command": "cp LICENSE dist/apps/client/assets" "command": "shx cp LICENSE dist/apps/client/assets"
} }
] ]
} }

1
apps/client/src/app/app.component.ts

@ -112,6 +112,7 @@ export class AppComponent implements OnDestroy, OnInit {
this.hasTabs = this.hasTabs =
(this.currentRoute === this.routerLinkAbout[0].slice(1) || (this.currentRoute === this.routerLinkAbout[0].slice(1) ||
this.currentRoute === 'account' ||
this.currentRoute === 'admin' || this.currentRoute === 'admin' ||
this.currentRoute === 'home' || this.currentRoute === 'home' ||
this.currentRoute === 'portfolio' || this.currentRoute === 'portfolio' ||

2
apps/client/src/app/components/admin-overview/admin-overview.component.ts

@ -1,5 +1,6 @@
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { MatCheckboxChange } from '@angular/material/checkbox'; import { MatCheckboxChange } from '@angular/material/checkbox';
import { environment } from '@ghostfolio/client/../environments/environment';
import { AdminService } from '@ghostfolio/client/services/admin.service'; import { AdminService } from '@ghostfolio/client/services/admin.service';
import { CacheService } from '@ghostfolio/client/services/cache.service'; import { CacheService } from '@ghostfolio/client/services/cache.service';
import { DataService } from '@ghostfolio/client/services/data.service'; import { DataService } from '@ghostfolio/client/services/data.service';
@ -42,6 +43,7 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
public transactionCount: number; public transactionCount: number;
public userCount: number; public userCount: number;
public user: User; public user: User;
public version = environment.version;
private unsubscribeSubject = new Subject<void>(); private unsubscribeSubject = new Subject<void>();

4
apps/client/src/app/components/admin-overview/admin-overview.html

@ -3,6 +3,10 @@
<div class="col"> <div class="col">
<mat-card appearance="outlined" class="mb-3"> <mat-card appearance="outlined" class="mb-3">
<mat-card-content> <mat-card-content>
<div class="d-flex my-3">
<div class="w-50" i18n>Version</div>
<div class="w-50">{{ version }}</div>
</div>
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="w-50" i18n>User Count</div> <div class="w-50" i18n>User Count</div>
<div class="w-50"> <div class="w-50">

2
apps/client/src/app/pages/user-account/user-account-page.component.ts

@ -30,7 +30,7 @@ export class UserAccountPageComponent implements OnDestroy, OnInit {
this.tabs = [ this.tabs = [
{ {
iconName: 'cog-outline', iconName: 'settings-outline',
label: $localize`Settings`, label: $localize`Settings`,
path: ['/account'] path: ['/account']
}, },

1
package.json

@ -194,6 +194,7 @@
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"replace-in-file": "7.0.1", "replace-in-file": "7.0.1",
"shx": "0.3.4",
"storybook": "7.0.9", "storybook": "7.0.9",
"ts-jest": "29.1.0", "ts-jest": "29.1.0",
"ts-node": "10.9.1", "ts-node": "10.9.1",

10
yarn.lock

@ -14264,7 +14264,7 @@ minimatch@^9.0.0, minimatch@^9.0.1:
dependencies: dependencies:
brace-expansion "^2.0.1" brace-expansion "^2.0.1"
minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6:
version "1.2.8" version "1.2.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
@ -16984,6 +16984,14 @@ shelljs@^0.8.5:
interpret "^1.0.0" interpret "^1.0.0"
rechoir "^0.6.2" rechoir "^0.6.2"
shx@0.3.4:
version "0.3.4"
resolved "https://registry.yarnpkg.com/shx/-/shx-0.3.4.tgz#74289230b4b663979167f94e1935901406e40f02"
integrity sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==
dependencies:
minimist "^1.2.3"
shelljs "^0.8.5"
side-channel@^1.0.4: side-channel@^1.0.4:
version "1.0.4" version "1.0.4"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"

Loading…
Cancel
Save