From 72a1e4b8c521488e4e3eaf0b5e37f0d1551e5d78 Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Wed, 26 Jun 2019 14:50:12 +0200
Subject: [PATCH] fix some issues

---
 lang/en.json                                          |  6 ++++--
 lang/fr.json                                          | 11 +++++++----
 .../connection/ldap/ldap.component.html               |  7 +++++--
 .../administration/connection/ldap/ldap.component.ts  |  8 ++++----
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/lang/en.json b/lang/en.json
index 0dabe87055..0cad9841c2 100755
--- a/lang/en.json
+++ b/lang/en.json
@@ -206,7 +206,7 @@
 		"connectionModeUpdated" : "Connection mode updated",
 		"changeConnectionWarn" : "This cause a change in login mechanics for users !",
 		"uri" : "IP / Alias",
-		"baseDN" : "DN base",
+		"baseDN" : "DN base (required for open ldap)",
 		"prefix" : "Connection prefix",
 		"suffix" : "Connection suffix",
 		"connectionTest" : "Test connection",
@@ -237,6 +237,8 @@
 		"beginSendTest" : "Begin send test",
 		"emailSendFailed" : "Email send failed",
 		"emailSendInProgress" : "Email send in progress",
-		"emailSendSuccess" : "Email send success"
+		"emailSendSuccess" : "Email send success",
+		"manage_groupsAlt" : "Group(s)",
+		"groupCreation" : "Add a group"
 	}
 }
diff --git a/lang/fr.json b/lang/fr.json
index 431cb30963..f7d8afe8b9 100755
--- a/lang/fr.json
+++ b/lang/fr.json
@@ -207,9 +207,9 @@
 		"connectionModeUpdated" : "Mode de connexion mise à jour",
 		"changeConnectionWarn" : "Cela entraine un changement de mécanique de connexion à l'application !",
 		"uri" : "IP / Alias",
-		"baseDN" : "Base DN",
-		"prefix" : "Prefix de connexion",
-		"suffix" : "Suffix de connexion",
+		"baseDN" : "Base DN (obligatoire pour open ldap)",
+		"prefix" : "Préfixe de connexion",
+		"suffix" : "Suffixe de connexion",
 		"connectionTest" : "Tester la connexion",
 		"testAlt" : "Tester",
 		"connectionInProgress" : "Connexion en cours",
@@ -238,6 +238,9 @@
 		"beginSendTest" : "Commencer le test",
 		"emailSendFailed" : "Échec d'envoi",
 		"emailSendInProgress" : "En cours d'envoi",
-		"emailSendSuccess" : "Envoi réussi"
+		"emailSendSuccess" : "Envoi réussi",
+		"manage_groupsAlt" : "Groupe(s)",
+		"groupCreation" : "Ajouter un groupe"
+
 	}
 }
diff --git a/src/frontend/app/administration/connection/ldap/ldap.component.html b/src/frontend/app/administration/connection/ldap/ldap.component.html
index ce16c45176..49bc93d151 100644
--- a/src/frontend/app/administration/connection/ldap/ldap.component.html
+++ b/src/frontend/app/administration/connection/ldap/ldap.component.html
@@ -33,16 +33,19 @@
         </mat-form-field>
         <mat-form-field class="input-row">
           <input name="dn" matInput placeholder="{{'lang.baseDN' | translate}}" [(ngModel)]="ldap.value.baseDN">
-          <mat-hint>
+          <mat-hint align="end">
             ex: dc=maarch,dc=com
           </mat-hint>
         </mat-form-field>
         <mat-form-field class="input-row">
           <input name="prefix" matInput placeholder="{{'lang.prefix' | translate}}" [(ngModel)]="ldap.value.prefix">
+          <mat-hint align="end">
+            ex: MAARCH
+          </mat-hint>
         </mat-form-field>
         <mat-form-field class="input-row">
           <input name="suffix" matInput placeholder="{{'lang.suffix' | translate}}" [(ngModel)]="ldap.value.suffix">
-          <mat-hint>
+          <mat-hint align="end">
             ex: @maarch.com
           </mat-hint>
         </mat-form-field>
diff --git a/src/frontend/app/administration/connection/ldap/ldap.component.ts b/src/frontend/app/administration/connection/ldap/ldap.component.ts
index 257f3bee4c..7b197f7c48 100644
--- a/src/frontend/app/administration/connection/ldap/ldap.component.ts
+++ b/src/frontend/app/administration/connection/ldap/ldap.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, Input } from '@angular/core';
+import { Component, OnInit, ViewChild } from '@angular/core';
 import { SignaturesContentService } from '../../../service/signatures.service';
 import { NotificationService } from '../../../service/notification.service';
 import { HttpClient } from '@angular/common/http';
@@ -43,7 +43,7 @@ export class LdapComponent implements OnInit {
     title: string = '';
 
     // tslint:disable-next-line:no-input-rename
-    @Input('snavRight') snavRight: MatSidenav;
+    @ViewChild('snavRight') snavRight: MatSidenav;
 
     constructor(public http: HttpClient, private translate: TranslateService, private route: ActivatedRoute, private router: Router, public signaturesService: SignaturesContentService, public notificationService: NotificationService, public dialog: MatDialog) {
     }
@@ -168,10 +168,10 @@ export class LdapComponent implements OnInit {
             )
             .subscribe({
                 next: (data: any) => {
-                    this.ldapTest.result = data.info;
+                    this.ldapTest.result = data.informations;
                     if (data.connection) {
                         this.snavRight.close();
-                        this.notificationService.success('ldapConnectionSucceeded');
+                        this.notificationService.success('lang.ldapConnectionSucceeded');
                     }
                 },
             });
-- 
GitLab