From f2619e504d79c615f2a90c2aa591f66d0fdba01b Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Mon, 30 Sep 2019 18:15:59 +0200
Subject: [PATCH] FIX #11269 TIME 0:15 fix load elem input in admin indexing
 model

---
 .../indexing-form/indexing-form.component.html      |  2 +-
 .../indexing-form/indexing-form.component.scss      |  5 +++++
 .../indexing-form/indexing-form.component.ts        | 13 +++++++++----
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/frontend/app/indexation/indexing-form/indexing-form.component.html b/src/frontend/app/indexation/indexing-form/indexing-form.component.html
index 337839d40b9..7ee682369c2 100644
--- a/src/frontend/app/indexation/indexing-form/indexing-form.component.html
+++ b/src/frontend/app/indexation/indexing-form/indexing-form.component.html
@@ -15,7 +15,7 @@
         <div *ngIf="this['indexingModels_'+category].length > 0 || adminMode" class="banner"
             [style.borderColor]="currentPriorityColor">
             <div class="title" [style.color]="currentPriorityColor">
-                {{lang[category] | uppercase}} <small *ngIf="category === 'mail'" style="font-size: 50%;padding-right: 10px;" [title]="lang.category_id">{{lang['indexing_' + currentCategory]}}</small>
+                {{lang[category] | uppercase}} <small *ngIf="category === 'mail'" [title]="lang.category_id">{{lang['indexing_' + currentCategory] | titlecase}}</small>
                 <div class="title-divider"></div>
             </div>
             <div class="content">
diff --git a/src/frontend/app/indexation/indexing-form/indexing-form.component.scss b/src/frontend/app/indexation/indexing-form/indexing-form.component.scss
index 64fdc3c9930..f89501e8bcf 100644
--- a/src/frontend/app/indexation/indexing-form/indexing-form.component.scss
+++ b/src/frontend/app/indexation/indexing-form/indexing-form.component.scss
@@ -34,6 +34,11 @@
             background: white;
             height: 1px;
         }
+
+        small {
+            font-size: 50%;
+            padding-right: 10px;
+        }
     }
 
     .content {
diff --git a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts
index 251c6506314..3efcaad2469 100644
--- a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts
+++ b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts
@@ -220,7 +220,10 @@ export class IndexingFormComponent implements OnInit {
                 event.container.data,
                 event.previousIndex,
                 event.currentIndex);
-            this.initElemForm();
+            if (['destination', 'priority'].indexOf(event.item.data.identifier) > -1) {
+                this.initElemForm();
+            }
+
         }
     }
 
@@ -415,7 +418,7 @@ export class IndexingFormComponent implements OnInit {
                             if (elem.default_value !== '') {
                                 this.calcLimitDate(elem, elem.default_value);
                             }
-                            
+
                         }
                     });
                 });
@@ -485,7 +488,7 @@ export class IndexingFormComponent implements OnInit {
         if (!this.adminMode) {
             this.arrFormControl['mail­tracking'] = new FormControl({ value: '', disabled: this.adminMode ? true : false });
         }
-        
+
 
         this.fieldCategories.forEach(category => {
             this['indexingModels_' + category] = [];
@@ -653,7 +656,9 @@ export class IndexingFormComponent implements OnInit {
     }
 
     launchEvent(value: any, field: any) {
-        this[field.event](field, value);
+        if (field.event !== undefined) {
+            this[field.event](field, value);
+        }
     }
 
     calcLimitDate(field: any, value: any) {
-- 
GitLab