From 3b323148069a3be2c78511de4b45afbf5a15ceae Mon Sep 17 00:00:00 2001
From: Cindy <cindy.nacibide@teamdlab.com>
Date: Tue, 15 Dec 2020 10:58:54 +0100
Subject: [PATCH] fix tslint error

---
 .../input-color/color-error.enum.ts           | 10 ++--
 .../input-color/input-color.component.ts      | 51 ++++++++-----------
 .../graphic-identity-form.component.ts        |  3 +-
 .../src/app/subrogation/subrogation.module.ts |  2 +-
 4 files changed, 29 insertions(+), 37 deletions(-)

diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/color-error.enum.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/color-error.enum.ts
index d67fd93f7..8a4a176cf 100644
--- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/color-error.enum.ts
+++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/color-error.enum.ts
@@ -1,6 +1,6 @@
 export enum ColorErrorEnum {
-    NONE,
-    COLOR_INVALID,
-    COLOR_TOO_LIGHT,
-    COLOR_TOO_DARK
-  }
\ No newline at end of file
+  NONE,
+  COLOR_INVALID,
+  COLOR_TOO_LIGHT,
+  COLOR_TOO_DARK
+}
diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts
index a9681655e..0300950cb 100644
--- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts
+++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts
@@ -1,18 +1,16 @@
-import {Component, Input, OnInit, ViewChild} from '@angular/core';
-import {FormControl} from '@angular/forms';
-import {ColorErrorEnum} from './color-error.enum';
-import {ColorPickerDirective} from 'ngx-color-picker';
-import {hexToRgb, rgbToHsl} from 'ui-frontend-common';
+import { Component, Input, OnInit, ViewChild } from '@angular/core';
+import { FormControl } from '@angular/forms';
+import { ColorPickerDirective } from 'ngx-color-picker';
+import { hexToRgb, rgbToHsl } from 'ui-frontend-common';
+
+import { ColorErrorEnum } from './color-error.enum';
 
 @Component({
   selector: 'app-input-color',
   templateUrl: './input-color.component.html',
   styleUrls: ['./input-color.component.scss'],
 })
-
 export class InputColorComponent implements OnInit {
-
-  
   @Input() placeholder: string;
   @Input() disabled: boolean;
   @Input() colorInput: FormControl;
@@ -20,21 +18,18 @@ export class InputColorComponent implements OnInit {
 
   public color: string;
 
-  @ViewChild('colorPickerInput', {read: ColorPickerDirective, static: false})
+  @ViewChild('colorPickerInput', { read: ColorPickerDirective, static: false })
   private colorPicker: ColorPickerDirective;
+  public colorErrorEnum: typeof ColorErrorEnum = ColorErrorEnum;
+  public colorError: ColorErrorEnum = ColorErrorEnum.NONE;
 
-  public colorErrorEnum : typeof ColorErrorEnum = ColorErrorEnum;
-  public colorError : ColorErrorEnum = ColorErrorEnum.NONE;
-
-  constructor() {}
+  constructor() { }
 
   public ngOnInit(): void {
-
     this.color = this.colorInput.value;
     this.colorInput.valueChanges.subscribe((color: string) => {
       this.color = color;
-      if(this.checkWarning)
-      {
+      if (this.checkWarning) {
         this.checkColor500(color);
       }
     });
@@ -45,19 +40,16 @@ export class InputColorComponent implements OnInit {
     const rgbValue = hexToRgb(color);
     if (rgbValue) {
       const hslValue = rgbToHsl(rgbValue);
-      if(hslValue) {
-        if(hslValue.l > 60) {
+      if (hslValue) {
+        if (hslValue.l > 60) {
           this.colorError = ColorErrorEnum.COLOR_TOO_LIGHT;
-        }
-        else if(hslValue.l < 40) {
+        } else if (hslValue.l < 40) {
           this.colorError = ColorErrorEnum.COLOR_TOO_DARK;
         }
-      }
-      else{
+      } else {
         this.colorError = ColorErrorEnum.COLOR_INVALID;
       }
-    }
-    else {
+    } else {
       this.colorError = ColorErrorEnum.COLOR_INVALID;
     }
   }
@@ -69,19 +61,18 @@ export class InputColorComponent implements OnInit {
   }
 
   public openPicker(): void {
-    if ( ! this.disabled) {
+    if (!this.disabled) {
       this.colorPicker.openDialog();
     }
   }
 
   public forceHex(): void {
-    if (! this.colorInput.value.startsWith('#')) {
+    if (!this.colorInput.value.startsWith('#')) {
       this.colorInput.setValue('#' + this.colorInput.value);
     }
   }
 
   public handlePicker(pickerValue: string): void {
-
     // Avoid 3 chars hex to become 6 chars (ex. #123 becoming instantly #112233...)
     let inputValue: string = this.colorInput.value.toUpperCase();
     pickerValue = pickerValue.toUpperCase();
@@ -95,7 +86,10 @@ export class InputColorComponent implements OnInit {
 
     if (inputValue.length === 3 && pickerValue.length === 6) {
       for (let i = 0; i < 3; i++) {
-        if (inputValue.charAt(i) !== pickerValue.charAt(2 * i) || inputValue.charAt(i) !== pickerValue.charAt(2 * i + 1)) {
+        if (
+          inputValue.charAt(i) !== pickerValue.charAt(2 * i) ||
+          inputValue.charAt(i) !== pickerValue.charAt(2 * i + 1)
+        ) {
           continue;
         }
         return;
@@ -103,5 +97,4 @@ export class InputColorComponent implements OnInit {
     }
     this.colorInput.setValue('#' + pickerValue);
   }
-
 }
diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts
index 57055db2f..650237940 100644
--- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts
+++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts
@@ -41,8 +41,7 @@ export class GraphicIdentityFormComponent implements OnInit {
   }
 
   private applyTheme(): void {
-    if(this.graphicIdentityForm.valid)
-    {
+    if (this.graphicIdentityForm.valid) {
       const colors = this.themeService.getThemeColors(this.graphicIdentityForm.get('themeColors').value);
       this.themeService.overloadLocalTheme(colors, '#toOverride');
     }
diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.module.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.module.ts
index 4051523f6..e993211d1 100644
--- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.module.ts
+++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.module.ts
@@ -37,11 +37,11 @@
 import { CommonModule } from '@angular/common';
 import { NgModule } from '@angular/core';
 import { ReactiveFormsModule } from '@angular/forms';
-import { MatSidenavModule } from '@angular/material/sidenav';
 import { MatDialogModule } from '@angular/material/dialog';
 import { MatProgressBarModule } from '@angular/material/progress-bar';
 import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
 import { MatSelectModule } from '@angular/material/select';
+import { MatSidenavModule } from '@angular/material/sidenav';
 
 import { VitamUICommonModule } from 'ui-frontend-common';
 import { SharedModule } from '../shared/shared.module';
-- 
GitLab