Browse Source

Merge branch 'main' into feature/top-holdings-with-parents

pull/4044/head
Thomas Kaul 9 months ago
committed by GitHub
parent
commit
6fd707b68c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 25
      apps/api/src/app/admin/admin.service.ts
  3. 2
      apps/client/src/app/services/admin.service.ts
  4. 1
      libs/common/src/lib/interfaces/admin-users.interface.ts
  5. 8
      package-lock.json
  6. 2
      package.json

2
CHANGELOG.md

@ -10,10 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Added pagination parameters (`skip`, `take`) to the endpoint `GET api/v1/admin/user` - Added pagination parameters (`skip`, `take`) to the endpoint `GET api/v1/admin/user`
- Added pagination response (`count`) to the endpoint `GET api/v1/admin/user`
### Changed ### Changed
- Extended the allocations by ETF holding on the allocations page by the parent ETFs (experimental) - Extended the allocations by ETF holding on the allocations page by the parent ETFs (experimental)
- Upgraded `countries-and-timezones` from version `3.4.1` to `3.7.2`
- Upgraded `Nx` from version `20.0.6` to `20.1.2` - Upgraded `Nx` from version `20.0.6` to `20.1.2`
## 2.123.0 - 2024-11-16 ## 2.123.0 - 2024-11-16

25
apps/api/src/app/admin/admin.service.ts

@ -140,7 +140,7 @@ export class AdminService {
const [settings, transactionCount, userCount] = await Promise.all([ const [settings, transactionCount, userCount] = await Promise.all([
this.propertyService.get(), this.propertyService.get(),
this.prismaService.order.count(), this.prismaService.order.count(),
this.prismaService.user.count() this.countUsersWithAnalytics()
]); ]);
return { return {
@ -436,7 +436,12 @@ export class AdminService {
skip?: number; skip?: number;
take?: number; take?: number;
}): Promise<AdminUsers> { }): Promise<AdminUsers> {
return { users: await this.getUsersWithAnalytics({ skip, take }) }; const [count, users] = await Promise.all([
this.countUsersWithAnalytics(),
this.getUsersWithAnalytics({ skip, take })
]);
return { count, users };
} }
public async patchAssetProfileData({ public async patchAssetProfileData({
@ -514,6 +519,22 @@ export class AdminService {
return response; return response;
} }
private async countUsersWithAnalytics() {
let where: Prisma.UserWhereInput;
if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) {
where = {
NOT: {
Analytics: null
}
};
}
return this.prismaService.user.count({
where
});
}
private getExtendedPrismaClient() { private getExtendedPrismaClient() {
Logger.debug('Connect extended prisma client', 'AdminService'); Logger.debug('Connect extended prisma client', 'AdminService');

2
apps/client/src/app/services/admin.service.ts

@ -159,7 +159,7 @@ export class AdminService {
public fetchUsers() { public fetchUsers() {
let params = new HttpParams(); let params = new HttpParams();
params = params.append('take', 100); params = params.append('take', 30);
return this.http.get<AdminUsers>('/api/v1/admin/user', { params }); return this.http.get<AdminUsers>('/api/v1/admin/user', { params });
} }

1
libs/common/src/lib/interfaces/admin-users.interface.ts

@ -1,6 +1,7 @@
import { Role } from '@prisma/client'; import { Role } from '@prisma/client';
export interface AdminUsers { export interface AdminUsers {
count: number;
users: { users: {
accountCount: number; accountCount: number;
country: string; country: string;

8
package-lock.json

@ -60,7 +60,7 @@
"class-transformer": "0.5.1", "class-transformer": "0.5.1",
"class-validator": "0.14.1", "class-validator": "0.14.1",
"color": "4.2.3", "color": "4.2.3",
"countries-and-timezones": "3.4.1", "countries-and-timezones": "3.7.2",
"countries-list": "3.1.1", "countries-list": "3.1.1",
"countup.js": "2.8.0", "countup.js": "2.8.0",
"date-fns": "3.6.0", "date-fns": "3.6.0",
@ -15270,9 +15270,9 @@
} }
}, },
"node_modules/countries-and-timezones": { "node_modules/countries-and-timezones": {
"version": "3.4.1", "version": "3.7.2",
"resolved": "https://registry.npmjs.org/countries-and-timezones/-/countries-and-timezones-3.4.1.tgz", "resolved": "https://registry.npmjs.org/countries-and-timezones/-/countries-and-timezones-3.7.2.tgz",
"integrity": "sha512-INeHGCony4XUUR8iGL/lmt9s1Oi+n+gFHeJAMfbV5hJfYeDOB8JG1oxz5xFQu5oBZoRCJe/87k1Vzue9DoIauA==", "integrity": "sha512-BHAMt4pKb3U3r/mRfiIlVnDhRd8m6VC20gwCWtpZGZkSsjZmnMDKFnnjWYGWhBmypQAqcQILFJwmEhIgWGVTmw==",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=8.x", "node": ">=8.x",

2
package.json

@ -106,7 +106,7 @@
"class-transformer": "0.5.1", "class-transformer": "0.5.1",
"class-validator": "0.14.1", "class-validator": "0.14.1",
"color": "4.2.3", "color": "4.2.3",
"countries-and-timezones": "3.4.1", "countries-and-timezones": "3.7.2",
"countries-list": "3.1.1", "countries-list": "3.1.1",
"countup.js": "2.8.0", "countup.js": "2.8.0",
"date-fns": "3.6.0", "date-fns": "3.6.0",

Loading…
Cancel
Save