From c0b5422836e06b1b997650cc91f5b675ae8d7aa0 Mon Sep 17 00:00:00 2001
From: Cindy <cindy.nacibide@teamdlab.com>
Date: Tue, 8 Dec 2020 17:41:53 +0100
Subject: [PATCH] [US TRTL-562][FIX TRTL-565] spinner on app profil + update
 font

---
 cas/cas-server/src/main/config/sass/cas.scss                 | 2 +-
 cas/cas-server/src/main/resources/static/css/cas.css         | 2 +-
 ui/ui-frontend-common/src/index.html                         | 2 +-
 ui/ui-frontend-common/src/sass/_theme.scss                   | 2 +-
 ui/ui-frontend/projects/demo/src/index.html                  | 2 +-
 .../app/shared/profiles-form/profiles-form.component.html    | 5 ++++-
 .../app/shared/profiles-form/profiles-form.component.spec.ts | 2 ++
 .../src/app/shared/profiles-form/profiles-form.component.ts  | 4 ++++
 .../src/app/shared/profiles-form/profiles-form.module.ts     | 2 ++
 ui/ui-frontend/projects/starter-kit/src/index.html           | 2 +-
 10 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/cas/cas-server/src/main/config/sass/cas.scss b/cas/cas-server/src/main/config/sass/cas.scss
index f10bb5fb5..3f71af3ac 100644
--- a/cas/cas-server/src/main/config/sass/cas.scss
+++ b/cas/cas-server/src/main/config/sass/cas.scss
@@ -2,7 +2,7 @@
 @import 'material-icons.css';
 @import 'theme';
 
-@import url('https://fonts.googleapis.com/css?family=Mulish');
+@import url('https://fonts.googleapis.com/css?family=Mulish:200,300,400,500,600,700,800,900');
 
 @import 'material-custom';
 @import 'login';
diff --git a/cas/cas-server/src/main/resources/static/css/cas.css b/cas/cas-server/src/main/resources/static/css/cas.css
index c270d1fc1..9d34e8b17 100644
--- a/cas/cas-server/src/main/resources/static/css/cas.css
+++ b/cas/cas-server/src/main/resources/static/css/cas.css
@@ -30,7 +30,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
  */
-@import url("https://fonts.googleapis.com/css?family=Mulish");
+@import url("https://fonts.googleapis.com/css?family=Mulish:200,300,400,500,600,700,800,900");
 .mat-menu-panel.nav-menu {
   border-radius: 10px;
   margin-top: 4px; }
diff --git a/ui/ui-frontend-common/src/index.html b/ui/ui-frontend-common/src/index.html
index 504ef608b..84809344b 100644
--- a/ui/ui-frontend-common/src/index.html
+++ b/ui/ui-frontend-common/src/index.html
@@ -11,7 +11,7 @@
   <link rel="dns-prefetch" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com">
   <link rel="dns-prefetch" href="https://fonts.gstatic.com">
-  <link href="https://fonts.googleapis.com/css?family=Mulish&display=swap" rel="stylesheet">
+  <link href="https://fonts.googleapis.com/css?family=Mulish:200,300,400,500,600,700,800,900&amp;display=swap" rel="stylesheet">
 </head>
 <body>
   <vitamui-common-root>
diff --git a/ui/ui-frontend-common/src/sass/_theme.scss b/ui/ui-frontend-common/src/sass/_theme.scss
index dcbcd20b4..c5d218c1c 100644
--- a/ui/ui-frontend-common/src/sass/_theme.scss
+++ b/ui/ui-frontend-common/src/sass/_theme.scss
@@ -32,7 +32,7 @@ html, body {
     font-family: 'Mulish', sans-serif;
     font-style: normal;
     font-weight: normal;
-    src: local('Mulish'), url(https://fonts.googleapis.com/css?family=Mulish&display=swap) format('woff2');
+    src: local('Mulish'), url(https://fonts.googleapis.com/css?family=Mulish:200,300,400,500,600,700,800,900&display=swap) format('woff2');
     font-display: optional;
   }
 
diff --git a/ui/ui-frontend/projects/demo/src/index.html b/ui/ui-frontend/projects/demo/src/index.html
index 934e6266f..fcb72a3cf 100644
--- a/ui/ui-frontend/projects/demo/src/index.html
+++ b/ui/ui-frontend/projects/demo/src/index.html
@@ -11,7 +11,7 @@
   <link rel="dns-prefetch" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com">
   <link rel="dns-prefetch" href="https://fonts.gstatic.com">
-  <link href="https://fonts.googleapis.com/css?family=Mulish&display=swap" rel="stylesheet">
+  <link href="https://fonts.googleapis.com/css?family=Mulish:200,300,400,500,600,700,800,900&amp;display=swap" rel="stylesheet">
 </head>
 <body>
   <demo-root></demo-root>
diff --git a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.html b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.html
index c3cd78fda..836952318 100644
--- a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.html
+++ b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.html
@@ -33,7 +33,10 @@
     <div *ngIf="!tenantIdentifier" class="col-3" i18n="Tenant@@profilesFormColumnHeaderTenant">Coffre</div>
     <div class="col-5" i18n="Profile@@profilesFormColumnHeaderProfile">Profil</div>
   </div>
-  <div class="vitamui-table-body">
+  <div *ngIf="loading" class="vitamui-min-content">
+    <mat-spinner class="vitamui-spinner medium"></mat-spinner>
+  </div>
+  <div *ngIf="!loading" class="vitamui-table-body">
     <div class="vitamui-table-rows" *ngFor="let id of profileIds; let index=index">
       <div class="vitamui-row d-flex align-items-center">
         <div class="col-3">{{ getApplicationFromId(id)?.name }}</div>
diff --git a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.spec.ts
index c06be6cc2..1416dcc7e 100644
--- a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.spec.ts
+++ b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.spec.ts
@@ -39,6 +39,7 @@
 import { Component, Directive, Input, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core';
 import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
 import { MatSelectModule } from '@angular/material/select';
 import { NoopAnimationsModule } from '@angular/platform-browser/animations';
 import { of } from 'rxjs';
@@ -162,6 +163,7 @@ describe('ProfilesFormComponent', () => {
       imports: [
         FormsModule,
         ReactiveFormsModule,
+        MatProgressSpinnerModule,
         MatSelectModule,
         NoopAnimationsModule,
         VitamUIAutocompleteModule,
diff --git a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts
index 9bd3db131..60bffa853 100644
--- a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts
+++ b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts
@@ -62,6 +62,8 @@ export class ProfilesFormComponent implements ControlValueAccessor, OnInit {
   profileIds: string[] = [];
   applicationsDetails: Application[] = [];
 
+  public loading = true;
+
   @Input()
   showLevel = false;
 
@@ -130,6 +132,7 @@ export class ProfilesFormComponent implements ControlValueAccessor, OnInit {
   }
 
   getProfiles() {
+    this.loading = true;
     const params = new HttpParams().set('filterApp', 'false');
     this.appApiService.getAllByParams(params).pipe(
       tap((applications) => this.applicationsDetails = applications.APPLICATION_CONFIGURATION),
@@ -138,6 +141,7 @@ export class ProfilesFormComponent implements ControlValueAccessor, OnInit {
       this.profiles = profiles;
       this.profileIds = this.profileIds.sort(byApplicationName(this.profiles, this.applicationsDetails));
       this.updateApplicationTree();
+      this.loading = false;
     });
   }
 
diff --git a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.module.ts b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.module.ts
index 0ed3fcbf5..61c715eea 100644
--- a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.module.ts
+++ b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.module.ts
@@ -37,6 +37,7 @@
 import { CommonModule } from '@angular/common';
 import { NgModule } from '@angular/core';
 import { ReactiveFormsModule } from '@angular/forms';
+import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
 import { MatSelectModule } from '@angular/material/select';
 import { MatTooltipModule } from '@angular/material/tooltip';
 
@@ -47,6 +48,7 @@ import { ProfilesFormComponent } from './profiles-form.component';
   imports: [
     CommonModule,
     ReactiveFormsModule,
+    MatProgressSpinnerModule,
     MatSelectModule,
     MatTooltipModule,
     VitamUICommonModule,
diff --git a/ui/ui-frontend/projects/starter-kit/src/index.html b/ui/ui-frontend/projects/starter-kit/src/index.html
index f822b47b3..9c51fd529 100644
--- a/ui/ui-frontend/projects/starter-kit/src/index.html
+++ b/ui/ui-frontend/projects/starter-kit/src/index.html
@@ -12,7 +12,7 @@
   <link rel="dns-prefetch" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com">
   <link rel="dns-prefetch" href="https://fonts.gstatic.com">
-  <link href="https://fonts.googleapis.com/css?family=Mulish&amp;display=swap" rel="stylesheet">
+  <link href="https://fonts.googleapis.com/css?family=Mulish:200,300,400,500,600,700,800,900&amp;display=swap" rel="stylesheet">
   <meta name="theme-color" content="#1976d2">
 </head>
 <body>
-- 
GitLab