From 8cacdc072c3b80edd2b83254470da7d9f5b7d6bf Mon Sep 17 00:00:00 2001
From: Ruben Bimberg <ruben.bimberg@mni.thm.de>
Date: Tue, 21 Sep 2021 16:23:10 +0200
Subject: [PATCH] Implement update for users

---
 .../topic-cloud-filter/topic-cloud-filter.component.html   | 5 ++---
 .../topic-cloud-filter/topic-cloud-filter.component.ts     | 7 ++++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.html b/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.html
index b9c538b80..b2f041120 100644
--- a/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.html
+++ b/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.html
@@ -79,7 +79,7 @@
     </mat-form-field>
   </mat-radio-group>
 
-  <mat-card *ngIf="user && user.role > 0 && hasNoKeywords"
+  <mat-card *ngIf="hasNoKeywords"
             class="noKeywords">
     <p>{{'topic-cloud-filter.info-no-keywords' | translate}}</p>
     <button mat-flat-button
@@ -90,8 +90,7 @@
     </button>
   </mat-card>
 
-  <app-worker-dialog [inlined]="true"
-                     *ngIf="user && user.role > 0"></app-worker-dialog>
+  <app-worker-dialog [inlined]="true"></app-worker-dialog>
 
   <ars-row ars-flex-box class="action-button-container">
     <ars-col>
diff --git a/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.ts b/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.ts
index b02423352..5807052e0 100644
--- a/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.ts
+++ b/src/app/components/shared/_dialogs/topic-cloud-filter/topic-cloud-filter.component.ts
@@ -19,6 +19,7 @@ import { Room } from '../../../../models/room';
 import { ThemeService } from '../../../../../theme/theme.service';
 import { Theme } from '../../../../../theme/Theme';
 import { ExplanationDialogComponent } from '../explanation-dialog/explanation-dialog.component';
+import { UserRole } from '../../../../models/user-roles.enum';
 
 class CommentsCount {
   comments: number;
@@ -165,9 +166,6 @@ export class TopicCloudFilterComponent implements OnInit {
   }
 
   private isUpdatable(): boolean {
-    if (this.comments.length < 3) {
-      return false;
-    }
     let count = 0;
     let newCount = 0;
     this.comments.forEach(comment => {
@@ -177,6 +175,9 @@ export class TopicCloudFilterComponent implements OnInit {
         count++;
       }
     });
+    if (this.user && this.user.role === UserRole.PARTICIPANT) {
+      return newCount < 1;
+    }
     if (count * 2 / 3 < newCount) {
       return false;
     }
-- 
GitLab