From 09d7225cc371ff4450840c5914dbad00db6180fc Mon Sep 17 00:00:00 2001
From: Klaus Quibeldey-Cirkel <klaus.quibeldey-cirkel@mni.thm.de>
Date: Sun, 6 Dec 2020 10:48:02 +0100
Subject: [PATCH] adjust maxlength according to role

---
 .../_dialogs/create-comment/create-comment.component.html   | 4 ++--
 .../shared/comment-answer/comment-answer.component.html     | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/app/components/shared/_dialogs/create-comment/create-comment.component.html b/src/app/components/shared/_dialogs/create-comment/create-comment.component.html
index ac527ff6e..3f4d32f78 100644
--- a/src/app/components/shared/_dialogs/create-comment/create-comment.component.html
+++ b/src/app/components/shared/_dialogs/create-comment/create-comment.component.html
@@ -37,7 +37,7 @@
                       matTextareaAutosize
                       matAutosizeMinRows="5"
                       matAutosizeMaxRows="10"
-                      maxlength="500"
+                      maxlength="{{user.role === 3 ? 1000 : 500}}"
                       [formControl]="bodyForm"
                       aria-labelledby="ask-question-description"
                       autofocus
@@ -53,7 +53,7 @@
             </mat-hint>
             <mat-hint align="end">
               <span aria-hidden="true">
-                {{commentBody.value.length}} / 500
+                {{commentBody.value.length}} / {{user.role === 3 ? 1000 : 500}}
               </span>
             </mat-hint>
           </mat-form-field>
diff --git a/src/app/components/shared/comment-answer/comment-answer.component.html b/src/app/components/shared/comment-answer/comment-answer.component.html
index bf7da8b80..de1b456be 100644
--- a/src/app/components/shared/comment-answer/comment-answer.component.html
+++ b/src/app/components/shared/comment-answer/comment-answer.component.html
@@ -21,8 +21,8 @@
                       matInput
                       matTextareaAutosize
                       matAutosizeMinRows="3"
-                      matAutosizeMaxRows="8"
-                      maxlength="500"
+                      matAutosizeMaxRows="10"
+                      maxlength="1000"
                       name="answer">
             </textarea>
             <mat-hint align="start">
@@ -32,7 +32,7 @@
             </mat-hint>
             <mat-hint align="end">
             <span aria-hidden="true">
-              {{ answer ? answer.length : 0 }} / 500
+              {{ answer ? answer.length : 0 }} / 1000
             </span>
             </mat-hint>
           </mat-form-field>
-- 
GitLab