From bcc1a6ba25457e484846413b000c9b8df97dd40c Mon Sep 17 00:00:00 2001
From: Aliye <aliye.tanriseven@mni.thm.de>
Date: Fri, 21 May 2021 14:29:02 +0200
Subject: [PATCH] insert options for tag-cleanup

This commit adds options for automaic spell checking, notation,
alphabetical sorting, randomly rotating individual words and displaying
the words with the highest weight.
---
 .../cloud-configuration.component.html        | 34 +++++++++++++++++++
 .../cloud-configuration.component.scss        |  4 +++
 .../cloud-configuration.component.ts          | 14 ++++++++
 src/assets/i18n/creator/de.json               | 16 ++++++++-
 src/assets/i18n/creator/en.json               | 16 ++++++++-
 src/assets/i18n/participant/de.json           | 16 ++++++++-
 src/assets/i18n/participant/en.json           | 16 ++++++++-
 7 files changed, 112 insertions(+), 4 deletions(-)

diff --git a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.html b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.html
index 81cd81400..313bb5d3b 100644
--- a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.html
+++ b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.html
@@ -128,5 +128,39 @@
     <div  class="weight-class-button button-row">
       <button (click)="toggleCleanupView()" mat-button class="primary">{{'tag-cloud-config.back-btn' | translate}}</button>
     </div>
+    <h2>{{'tag-cloud-config.cleanUpView' | translate}}</h2>
+    <div class="input-row special-settings automatic-spelling" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column">
+      <div class="input-row" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column">
+        <mat-slide-toggle matTooltip="{{'tag-cloud-config.automatic-spelling-tooltip' | translate}}" [checked]="automaticSpelling">{{'tag-cloud-config.automatic-spelling' | translate}}</mat-slide-toggle>
+      </div>
+    </div>
+      <div class="input-row special-settings automatic-spelling" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column">
+        <mat-radio-group matTooltip="{{'tag-cloud-config.notation-tooltip' | translate}}" aria-label="Notation:"> {{'tag-cloud-config.notation' | translate}}
+          <div><mat-radio-button value="1" [checked]="lowerCase">{{'tag-cloud-config.lowerCase' | translate}}</mat-radio-button> </div>
+          <div><mat-radio-button value="2" [checked]="capitalization">{{'tag-cloud-config.capitalization' | translate}}</mat-radio-button> </div>
+          <div><mat-radio-button value="3" [checked]="standard">{{'tag-cloud-config.standard' | translate}}</mat-radio-button> </div>
+        </mat-radio-group>
+      </div>
+      <div class="input-row special-settings alphabetical-sorting" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column">
+        <div class="input-row" fxLayout="row" fxLayoutGap="5px" fxLayout.xs="column">
+          <mat-slide-toggle matTooltip="{{'tag-cloud-config.alphabetical-sorting-tooltip' | translate}}" [checked]="alphabeticalSorting">{{'tag-cloud-config.alphabetical-sorting' | translate}}</mat-slide-toggle>
+        </div>
+      </div>
+      <div class="input-row" fxLayout="column" fxLayoutGap="5px">
+        <mat-label class="label-text" id=rotation>{{'tag-cloud-config.rotation' | translate}}</mat-label>
+        <mat-slider
+        matTooltip="{{'tag-cloud-config.rotation-tooltip' | translate}}" 
+                    [value]="rotation" min="0" max="360" step="10"
+                    [(ngModel)]="rotation" [ngModelOptions]="{standalone: true}" (change)="valueChanged()"
+                    [thumbLabel]="true"></mat-slider>
+      </div>
+      <div class="input-row" fxLayout="column" fxLayoutGap="5px">
+        <mat-form-field fxFlex fxLayout.xs="column">
+          <mat-label>{{'tag-cloud-config.highestWeight' | translate}}</mat-label>
+          <input #highestWeight matTooltip="{{'tag-cloud-config.highestWeight-tooltip' | translate}}" [value]="cloudParameters.highestWeight" matInput type="number"
+            [(ngModel)]="cloudParameters.highestWeight" [ngModelOptions]="{standalone: true}" (change)="valueChanged()"
+            min="0" max="150" step="1"/>
+        </mat-form-field>
+      </div>
   </div>
 </div>
diff --git a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.scss b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.scss
index 17086c6ce..23310d6e4 100644
--- a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.scss
+++ b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.scss
@@ -193,3 +193,7 @@ mat-divider {
   border-bottom: 2px solid var(--primary);
   padding: 10px 0;
 }
+
+#rotation{
+  margin-top: 10px;
+}
\ No newline at end of file
diff --git a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.ts b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.ts
index 61c06aef5..87542cdd2 100644
--- a/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.ts
+++ b/src/app/components/shared/_dialogs/cloud-configuration/cloud-configuration.component.ts
@@ -16,6 +16,13 @@ export class CloudConfigurationComponent implements OnInit{
   oldCloudParameters: CloudParameters;
   extendedView: boolean;
   cleanUpView: boolean;
+  automaticSpelling: boolean;
+  lowerCase: boolean;
+  capitalization: boolean;
+  standard: boolean;
+  alphabeticalSorting: boolean;
+  rotation: number;
+  highestWeight: number;
   weightClasses: WeightClass[]=[
     {maxTagNumber: 20,
     tagColor: '#8800ff'},
@@ -51,6 +58,13 @@ export class CloudConfigurationComponent implements OnInit{
     this.parseArrayToJsonWeightClasses();
     this.extendedView = false;
     this.cleanUpView = false;
+    this.automaticSpelling = true;
+    this.lowerCase = true;
+    this.capitalization = false;
+    this.standard = false;
+    this.alphabeticalSorting = true;
+    this.rotation = 360;
+    this.highestWeight = 100;
   }
 
   fontColorChanged(value: string){
diff --git a/src/assets/i18n/creator/de.json b/src/assets/i18n/creator/de.json
index 348dfe6fb..b218f72dd 100644
--- a/src/assets/i18n/creator/de.json
+++ b/src/assets/i18n/creator/de.json
@@ -369,6 +369,20 @@
     "weight-color": "Schriftfarbe",
     "weight-number": "max. Anzahl Schlüsselwörter",
     "weight-color-tooltip": "Auswahl der Schriftfarbe",
-    "weight-number-tooltip": "maximale Anzahl der Schlüsselwörter festlegen"
+    "weight-number-tooltip": "maximale Anzahl der Schlüsselwörter festlegen",
+    "automatic-spelling": "Automatische Rechtschreibung",
+    "notation": "Notation:",
+    "lowerCase": "Kleinschreibung",
+    "capitalization": "Großschreibung",
+    "standard": "Standard",
+    "alphabetical-sorting": "Alphabetische Sortierung",
+    "cleanUpView": "Tag-Cleanup Einstellungen",
+    "rotation": "Drehgrad zufälliger Einträge",
+    "highestWeight": "Anzahl Tags mit max. Gewichtung",
+    "automatic-spelling-tooltip": "automatische Überprüfung der Rechtschreibung",
+    "notation-tooltip": "Einstellung der Schreibweise: klein, groß, standard",
+    "alphabetical-sorting-tooltip": "Alphabetische Sortierung",
+    "rotation-tooltip": "Einige Einträge zufällig um x Grad drehen",
+    "highestWeight-tooltip": "x Tags mit der höchsten Gewichtung anzeigen"
   }
 }
diff --git a/src/assets/i18n/creator/en.json b/src/assets/i18n/creator/en.json
index 5eaee11f3..96ec945e4 100644
--- a/src/assets/i18n/creator/en.json
+++ b/src/assets/i18n/creator/en.json
@@ -370,6 +370,20 @@
     "weight-color": "Font color",
     "weight-number": "max. number of keywords",
     "weight-color-tooltip": "select font-color",
-    "weight-number-tooltip": "select maximal number of keywords"
+    "weight-number-tooltip": "select maximal number of keywords",
+    "automatic-spelling": "Automatic spelling",
+    "notation": "Notation:",
+    "lowerCase": "Lower case",
+    "capitalization": "Capitalization",
+    "standard": "Standard",
+    "alphabetical-sorting": "Alphabetical sorting",
+    "cleanUpView": "Tag-Cleanup Settings",
+    "rotation": "rotation of random entries",
+    "highestWeight": "Number of tags with highest weight",
+    "automatic-spelling-tooltip": "automatic spelling check",
+    "notation-tooltip": "Notation-Settings: small, large, standard",
+    "alphabetical-sorting-tooltip": "Alphabetical sorting",
+    "rotation-tooltip": "rotate some entries randomly by x degrees",
+    "highestWeight-tooltip": "show x tags with the highest weight"
   }
 }
diff --git a/src/assets/i18n/participant/de.json b/src/assets/i18n/participant/de.json
index f82fa30c7..92d73ae28 100644
--- a/src/assets/i18n/participant/de.json
+++ b/src/assets/i18n/participant/de.json
@@ -298,6 +298,20 @@
     "weight-color": "Schriftfarbe",
     "weight-number": "max. Anzahl Schlüsselwörter",
     "weight-color-tooltip": "Auswahl der Schriftfarbe",
-    "weight-number-tooltip": "maximale Anzahl der Schlüsselwörter festlegen"
+    "weight-number-tooltip": "maximale Anzahl der Schlüsselwörter festlegen",
+    "automatic-spelling": "Automatische Rechtschreibung",
+    "notation": "Notation:",
+    "lowerCase": "Kleinschreibung",
+    "capitalization": "Großschreibung",
+    "standard": "Standard",
+    "alphabetical-sorting": "Alphabetische Sortierung",
+    "cleanUpView": "Tag-Cleanup Einstellungen",
+    "rotation": "Drehgrad zufälliger Einträge",
+    "highestWeight": "Anzahl Tags mit max. Gewichtung",
+    "automatic-spelling-tooltip": "automatische Überprüfung der Rechtschreibung",
+    "notation-tooltip": "Einstellung der Schreibweise: klein, groß, standard",
+    "alphabetical-sorting-tooltip": "Alphabetische Sortierung",
+    "rotation-tooltip": "Einige Einträge zufällig um x Grad drehen",
+    "highestWeight-tooltip": "x Tags mit der höchsten Gewichtung anzeigen"
   }
 }
diff --git a/src/assets/i18n/participant/en.json b/src/assets/i18n/participant/en.json
index 3383cfd16..9e72fc406 100644
--- a/src/assets/i18n/participant/en.json
+++ b/src/assets/i18n/participant/en.json
@@ -303,6 +303,20 @@
     "weight-color": "Font color",
     "weight-number": "max. number of keywords",
     "weight-color-tooltip": "select font-color",
-    "wieght-number-tooltip": "select maximal number of keywords"
+    "wieght-number-tooltip": "select maximal number of keywords",
+    "automatic-spelling": "Automatic spelling",
+    "notation": "Notation:",
+    "lowerCase": "Lower case",
+    "capitalization": "Capitalization",
+    "standard": "Standard",
+    "alphabetical-sorting": "Alphabetical sorting",
+    "cleanUpView": "Tag-Cleanup Settings",
+    "rotation": "rotation of random entries",
+    "highestWeight": "Number of tags with highest weight",
+    "automatic-spelling-tooltip": "automatic spelling check",
+    "notation-tooltip": "Notation-Settings: small, large, standard",
+    "alphabetical-sorting-tooltip": "Alphabetical sorting",
+    "rotation-tooltip": "rotate some entries randomly by x degrees",
+    "highestWeight-tooltip": "show x tags with the highest weight"
   }
 }
-- 
GitLab