From 9c904ae4e14f021decd8ce7788628214752dca2c Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Fri, 30 Aug 2019 14:24:29 +0200
Subject: [PATCH] FIX #11292 TIME 0:15 add automplete size mode small

---
 .../app/folder/panel/panel-folder.component.html         | 2 +-
 src/frontend/app/header/header-panel.component.html      | 2 +-
 src/frontend/app/menu/menu-shortcut.component.html       | 8 ++++----
 .../plugins/autocomplete/autocomplete.component.html     | 4 ++--
 .../plugins/autocomplete/autocomplete.component.scss     | 9 +++++++++
 .../plugins/autocomplete/autocomplete.component.ts       | 2 ++
 6 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/frontend/app/folder/panel/panel-folder.component.html b/src/frontend/app/folder/panel/panel-folder.component.html
index 0aafce61a8b..00cdab40345 100644
--- a/src/frontend/app/folder/panel/panel-folder.component.html
+++ b/src/frontend/app/folder/panel/panel-folder.component.html
@@ -4,6 +4,6 @@
             <i class="fa fa-folder"></i>&nbsp;{{lang.folders}}
         </mat-panel-title>
     </mat-expansion-panel-header>
-    <plugin-autocomplete [labelPlaceholder]="lang.search" [labelList]="lang.search" [routeDatas]="['/rest/folders']" [targetSearchKey]="'label'"></plugin-autocomplete>
+    <plugin-autocomplete [size]="'small'" [labelPlaceholder]="lang.searchFolder" [labelList]="lang.searchFolder" [routeDatas]="['/rest/autocomplete/folders']" [targetSearchKey]="'idToDisplay'"></plugin-autocomplete>
     <folder-tree #folderTree [selectedId]="id" (refreshDocList)="refreshDocList()"></folder-tree>
 </mat-expansion-panel>
diff --git a/src/frontend/app/header/header-panel.component.html b/src/frontend/app/header/header-panel.component.html
index 9169c9b18b2..dd9629a435a 100644
--- a/src/frontend/app/header/header-panel.component.html
+++ b/src/frontend/app/header/header-panel.component.html
@@ -1,6 +1,6 @@
 <div class="panelHeader">
     <div class="panelHeader-logo">
-        <a href="#" title="{{lang.home}}" *ngIf="!appService.getViewMode()" style="margin-right: 30px;">
+        <a href="#" title="{{lang.home}}" style="margin-right: 30px;">
             <mat-icon class="maarchLogo" svgIcon="maarchLogoFull"></mat-icon>
         </a>
     </div>
diff --git a/src/frontend/app/menu/menu-shortcut.component.html b/src/frontend/app/menu/menu-shortcut.component.html
index b38e53a74a2..e8f4bf24087 100755
--- a/src/frontend/app/menu/menu-shortcut.component.html
+++ b/src/frontend/app/menu/menu-shortcut.component.html
@@ -1,5 +1,5 @@
 <mat-nav-list style="position:relative;">
-    <ng-container *ngIf="appService.getViewMode()">
+    <!--<ng-container *ngIf="appService.getViewMode()">
         <canvas class="header-bg" style="margin-top:-8px;background-image: url('static.php?filename=login-banner.jpg');background-size:cover;border-bottom: solid 1px white;width: 100%;height: 70px;"></canvas>
         <i title="{{lang.myProfileAccess}}" routerLink="/profile" style="cursor:pointer;z-index:1;color:white;position: absolute;left: 50%;top: 17px;background-image: url('static.php?filename=logo_only.svg');width: 70px;height: 70px;background-size: cover;background-position: top center;border-radius: 50%;border: solid white;background-color:white;transform: translateX(-50%);"></i>
         <mat-expansion-panel>
@@ -25,7 +25,7 @@
                 </mat-list-item>
             </mat-list>
         </mat-expansion-panel>
-    </ng-container>
+    </ng-container>-->
 </mat-nav-list>
 <mat-nav-list>
     <h3 mat-subheader>{{lang.shortcut}}</h3>
@@ -57,12 +57,12 @@
         </ng-container>
     </div>
 </mat-nav-list>
-<mat-nav-list *ngIf="appService.getViewMode()">
+<!--<mat-nav-list *ngIf="appService.getViewMode()">
     <a mat-list-item href="index.php?display=true&page=logout&logout=true">
         <mat-icon color="warn" mat-list-icon class="fa fa-sign-out-alt"></mat-icon>
         <p mat-line>
             {{lang.logout}}
         </p>
     </a>
-</mat-nav-list>
+</mat-nav-list>-->
 <mat-divider></mat-divider>
\ No newline at end of file
diff --git a/src/frontend/plugins/autocomplete/autocomplete.component.html b/src/frontend/plugins/autocomplete/autocomplete.component.html
index 3a55bf219eb..a2563e26c37 100644
--- a/src/frontend/plugins/autocomplete/autocomplete.component.html
+++ b/src/frontend/plugins/autocomplete/autocomplete.component.html
@@ -1,7 +1,7 @@
 <form>
-  <mat-form-field [appearance]="singleMode !== undefined ? 'standard' : 'outline'">
+  <mat-form-field [class.smallInput]="size === 'small'" [appearance]="singleMode !== undefined ? 'standard' : 'outline'">
     <mat-label *ngIf="singleMode !== undefined">{{placeholder}}</mat-label>
-    <mat-icon color="primary" class="fa fa-search" matPrefix></mat-icon>
+    <mat-icon *ngIf="size === 'default'" color="primary" class="fa fa-search" matPrefix></mat-icon>
     <input type="text" #autoCompleteInput [placeholder]="singleMode !== undefined ? '' : placeholder" aria-label="Number" matInput [formControl]="myControl"
       [matAutocomplete]="auto" (click)="$event.stopPropagation()" (focus)="resetAutocomplete()" [required]="required">
     <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectOpt($event)">
diff --git a/src/frontend/plugins/autocomplete/autocomplete.component.scss b/src/frontend/plugins/autocomplete/autocomplete.component.scss
index 095f7152ad6..ac19a452bf5 100644
--- a/src/frontend/plugins/autocomplete/autocomplete.component.scss
+++ b/src/frontend/plugins/autocomplete/autocomplete.component.scss
@@ -24,4 +24,13 @@
     width: 20px;
     display: flex;
     align-items: center;
+}
+
+.smallInput {
+    padding-left: 20px;
+    padding-right: 20px;
+    ::ng-deep.mat-form-field-infix {
+        padding : 0px;
+        padding-bottom: 5px;
+    }
 }
\ No newline at end of file
diff --git a/src/frontend/plugins/autocomplete/autocomplete.component.ts b/src/frontend/plugins/autocomplete/autocomplete.component.ts
index 818617aaa57..429ad5f706f 100644
--- a/src/frontend/plugins/autocomplete/autocomplete.component.ts
+++ b/src/frontend/plugins/autocomplete/autocomplete.component.ts
@@ -24,6 +24,7 @@ export class PluginAutocomplete implements OnInit {
         entity : 'fa-sitemap'
     }
 
+    @Input('size') size: string;
     @Input('singleMode') singleMode: boolean;
     @Input('required') required: boolean;
     @Input('datas') options: any;
@@ -46,6 +47,7 @@ export class PluginAutocomplete implements OnInit {
     ngOnInit() {
         this.optGroupLabel = this.optGroupLabel === undefined ? this.lang.availableValues : this.optGroupLabel;
         this.placeholder = this.placeholder === undefined ? this.lang.chooseValue : this.placeholder;
+        this.size = this.size === undefined ? 'default' : 'small';
 
         if (this.routeDatas !== undefined) {
             this.initAutocompleteRoute();
-- 
GitLab