From ea47fa0777efaafcb002cc1891d6f6f1062f8c90 Mon Sep 17 00:00:00 2001
From: Ahmet C <cetin.ahmet@live.de>
Date: Tue, 25 May 2021 00:00:50 +0200
Subject: [PATCH] Add Implementation for random-weight-angle slider

---
 .../cloud-configuration/cloud-configuration.component.html | 7 +++++--
 .../cloud-configuration/cloud-configuration.component.scss | 2 +-
 .../cloud-configuration/cloud-configuration.component.ts   | 7 +++++--
 3 files changed, 11 insertions(+), 5 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 5caca46f6..6a920d689 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
@@ -102,6 +102,7 @@
     </div>
     <h2>{{'tag-cloud-config.weight-class-settings' | translate}}</h2>
     <div *ngFor="let weightClass of weightClasses" class="weight-class-setting">
+      <div class ="weight-class-setting-content">
       <h3 class="weight-class-heading">{{'tag-cloud-config.weight-class' | translate}} {{weightClasses.indexOf(weightClass) + 1}}</h3>
       <div class="input-row" fxLayout="column" fxLayoutGap="5px">
         <div class="input-row" fxLayout="column" fxLayoutGap="5px">
@@ -117,8 +118,9 @@
           </div>
         </div>
       </div>
-      <div class="input-row" fxLayout="column" fxLayoutGap="5px">
-        <mat-label class="label-text">{{'tag-cloud-config.weight-number' | translate}}</mat-label>
+      
+      <div class="input-row" fxLayout="column" fxLayoutGap="5px" *ngIf="weightClass.actualTagNumber > 0 && !parent.dataManager.demoActive">
+        <mat-label class="label-text" >{{'tag-cloud-config.weight-number' | translate}}</mat-label>
         <mat-slider [value]="weightClass.maxTagNumber" min="0" [max]="weightClass.actualTagNumber" step="1"
                     [(ngModel)]="weightClass.maxTagNumber" [ngModelOptions]="{standalone: true}" (change)="valueChanged()"
                     [thumbLabel]="true" matTooltip="{{'tag-cloud-config.weight-number-tooltip' | translate}}"></mat-slider>
@@ -131,6 +133,7 @@
       </div>
     </div>
   </div>
+  </div>
   <div class="cloud-configuration-form" fxLayout="column" *ngIf="cleanUpView">
     <div  class="weight-class-button button-row">
       <button (click)="toggleCleanupView()" mat-button class="primary">{{'tag-cloud-config.back-btn' | translate}}</button>
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 064fc7557..faaf8bd4a 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
@@ -169,7 +169,7 @@ mat-divider {
   opacity: 0.2;
 }
 
-.weight-class-setting {
+.weight-class-setting-content {
   border-top: 3px solid var(--primary);
 }
 
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 79a1e61ad..325eaa4ed 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
@@ -101,6 +101,7 @@ export class CloudConfigurationComponent implements OnInit {
     this.parent.dataManager.getMetaData().subscribe((value)=>{
       this.countPerWeight = value.countPerWeight;
       this.parseArrayToJsonWeightClasses();
+      
     })
     this.extendedView = false;
     this.cleanUpView = false;
@@ -125,9 +126,10 @@ export class CloudConfigurationComponent implements OnInit {
 
   parseArrayToJsonWeightClasses() {
     this.cloudParameters.cloudWeightSettings.forEach((element, i) => {
-       this.weightClasses[i].maxTagNumber = element.maxVisibleElements;
        this.weightClasses[i].tagColor = element.color;
        this.weightClasses[i].actualTagNumber = this.countPerWeight[i];
+        this.weightClasses[i].rotationAngle = element.rotation;
+
     });
   }
 
@@ -135,6 +137,7 @@ export class CloudConfigurationComponent implements OnInit {
     this.weightClasses.forEach((element, i) => {
       this.cloudParameters.cloudWeightSettings[i].maxVisibleElements = element.maxTagNumber;
       this.cloudParameters.cloudWeightSettings[i].color = element.tagColor;
+      this.cloudParameters.cloudWeightSettings[i].rotation = element.rotationAngle;
     });
   }
 
@@ -145,7 +148,6 @@ export class CloudConfigurationComponent implements OnInit {
   }
 
   cancel() {
-    console.log("Parameterliste: " + JSON.stringify(this.cloudParameters));
     this.parent.tagCloudDataManager.demoActive = false;
     this.parent.setCloudParameters(this.defaultCloudParameters);
     this.parent.configurationOpen = false;
@@ -177,4 +179,5 @@ export class CloudConfigurationComponent implements OnInit {
     this.valueChanged();
   }
 
+
 }
-- 
GitLab