diff --git a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts index 2a18915490e9578207386b33aaf9088de128c9a1..70f6b4958ac309ec5c192616ae7ee2e6f963b8d3 100644 --- a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts +++ b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts @@ -6,6 +6,7 @@ import { UserRole } from '../../../../models/user-roles.enum'; import { TranslateService } from '@ngx-translate/core'; import { LanguageService } from '../../../../services/util/language.service'; import { TopicCloudAdminService } from '../../../../services/util/topic-cloud-admin.service'; +import { ProfanityFilterService } from '../../../../services/util/profanity-filter.service'; import { TopicCloudAdminData, Labels, spacyLabels, KeywordOrFulltext } from './TopicCloudAdminData'; import { User } from '../../../../models/user'; import { Comment } from '../../../../models/comment'; @@ -14,7 +15,6 @@ import { TSMap } from 'typescript-map'; import { RoomDataService } from '../../../../services/util/room-data.service'; import { ProfanityFilter } from '../../../../models/room'; - @Component({ selector: 'app-topic-cloud-administration', templateUrl: './topic-cloud-administration.component.html', @@ -69,7 +69,8 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { private langService: LanguageService, private topicCloudAdminService: TopicCloudAdminService, private commentService: CommentService, - private roomDataService: RoomDataService) { + private roomDataService: RoomDataService, + private profanityFilterService: ProfanityFilterService) { this.langService.langEmitter.subscribe(lang => { this.translateService.use(lang); }); @@ -78,8 +79,8 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { ngOnInit(): void { this.deviceType = localStorage.getItem('deviceType'); this.blacklistSubscription = this.topicCloudAdminService.getBlacklist().subscribe(list => this.blacklist = list); - this.profanitywordlist = this.topicCloudAdminService.getProfanityListFromStorage(); - this.profanitylistSubscription = this.topicCloudAdminService.getCustomProfanityList().subscribe(list => { + this.profanitywordlist = this.profanityFilterService.getProfanityListFromStorage(); + this.profanitylistSubscription = this.profanityFilterService.getCustomProfanityList().subscribe(list => { this.profanitywordlist = list; this.refreshKeywords(); }); @@ -246,7 +247,7 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { } getKeywordWithoutProfanity(keyword: string, lang: string): string { - return this.topicCloudAdminService.filterProfanityWords(keyword, this.censorPartialWordsCheck, this.censorLanguageSpecificCheck, lang); + return this.profanityFilterService.filterProfanityWords(keyword, this.censorPartialWordsCheck, this.censorLanguageSpecificCheck, lang); } sortQuestions(sortMode?: string) { @@ -414,7 +415,7 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { } addProfanityWord() { - this.topicCloudAdminService.addToProfanityList(this.newProfanityWord); + this.profanityFilterService.addToProfanityList(this.newProfanityWord); this.newProfanityWord = undefined; } @@ -424,7 +425,7 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { } removeWordFromProfanityList(word: string) { - this.topicCloudAdminService.removeFromProfanityList(word); + this.profanityFilterService.removeFromProfanityList(word); } removeWordFromBlacklist(word: string) { diff --git a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts index 1e5f971ae16f54bad4b9d18e6ca226bc52c26b72..77b32abda5c7f29d5fa3b4d559e558e36d3ad61a 100644 --- a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts +++ b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { Language } from '../../../../models/comment'; -import { TopicCloudAdminService } from '../../../../services/util/topic-cloud-admin.service'; +import { ProfanityFilterService } from '../../../../services/util/profanity-filter.service'; @Component({ selector: 'app-topic-dialog-comment', @@ -27,7 +27,7 @@ export class TopicDialogCommentComponent implements OnInit { public partsShort: string[]; public partsWithoutProfanityShort: string[]; - constructor(private topicCloudAdminService: TopicCloudAdminService) {} + constructor(private profanityFilterService: ProfanityFilterService) {} get partsOfQuestion() { return this.profanityFilter ? this.partsWithoutProfanity : this.parts; @@ -49,7 +49,7 @@ export class TopicDialogCommentComponent implements OnInit { if (!this.language) { return; } - this.questionWithoutProfanity = this.topicCloudAdminService. + this.questionWithoutProfanity = this.profanityFilterService. filterProfanityWords(this.question, this.partialWords, this.languageSpecific, this.language); this.partsWithoutProfanity = this.splitQuestion(this.questionWithoutProfanity); this.parts = this.splitQuestion(this.question);