Browse Source
Feature/refactor tag handling for exclude from analysis (#5306)
* Refactoring
pull/5312/head
Thomas Kaul
1 week ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
5 additions and
4 deletions
-
apps/api/src/app/user/user.service.ts
-
apps/api/src/services/tag/tag.service.ts
|
@ -28,6 +28,7 @@ import { |
|
|
DEFAULT_LANGUAGE_CODE, |
|
|
DEFAULT_LANGUAGE_CODE, |
|
|
PROPERTY_IS_READ_ONLY_MODE, |
|
|
PROPERTY_IS_READ_ONLY_MODE, |
|
|
PROPERTY_SYSTEM_MESSAGE, |
|
|
PROPERTY_SYSTEM_MESSAGE, |
|
|
|
|
|
TAG_ID_EXCLUDE_FROM_ANALYSIS, |
|
|
locale |
|
|
locale |
|
|
} from '@ghostfolio/common/config'; |
|
|
} from '@ghostfolio/common/config'; |
|
|
import { |
|
|
import { |
|
@ -121,7 +122,9 @@ export class UserService { |
|
|
const access = userData[0]; |
|
|
const access = userData[0]; |
|
|
const activitiesCount = userData[1]; |
|
|
const activitiesCount = userData[1]; |
|
|
const firstActivity = userData[2]; |
|
|
const firstActivity = userData[2]; |
|
|
let tags = userData[3]; |
|
|
let tags = userData[3].filter((tag) => { |
|
|
|
|
|
return tag.id !== TAG_ID_EXCLUDE_FROM_ANALYSIS; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
let systemMessage: SystemMessage; |
|
|
let systemMessage: SystemMessage; |
|
|
|
|
|
|
|
|
|
@ -1,5 +1,4 @@ |
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma/prisma.service'; |
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma/prisma.service'; |
|
|
import { TAG_ID_EXCLUDE_FROM_ANALYSIS } from '@ghostfolio/common/config'; |
|
|
|
|
|
|
|
|
|
|
|
import { Injectable } from '@nestjs/common'; |
|
|
import { Injectable } from '@nestjs/common'; |
|
|
import { Prisma, Tag } from '@prisma/client'; |
|
|
import { Prisma, Tag } from '@prisma/client'; |
|
@ -80,8 +79,7 @@ export class TagService { |
|
|
id, |
|
|
id, |
|
|
name, |
|
|
name, |
|
|
userId, |
|
|
userId, |
|
|
isUsed: |
|
|
isUsed: _count.activities > 0 |
|
|
_count.activities > 0 && ![TAG_ID_EXCLUDE_FROM_ANALYSIS].includes(id) |
|
|
|
|
|
})); |
|
|
})); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|