Commit d4c13e40 authored by Thomas Frion's avatar Thomas Frion
Browse files

Merge branch 'dev'

parents 78f9934f dc4c36ca
This diff is collapsed.
......@@ -193,7 +193,7 @@
<div class="tab-pane fade tab-source-code" id="c-source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Component } from &#x27;@angular/core&#x27;;
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Component, NgModule } from &#x27;@angular/core&#x27;;
/**
* @AppComponent :
......
......@@ -137,6 +137,12 @@
<li>
<a href="#authStatus">authStatus</a>
</li>
<li>
<a href="#error">error</a>
</li>
<li>
<a href="#loginForm">loginForm</a>
</li>
</ul>
</td>
</tr>
......@@ -176,12 +182,12 @@
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(authService: <a href="../classes/AuthService.html">AuthService</a>, router: <a href="https://angular.io/api/router/Router" target="_blank">Router</a>)</code>
<code>constructor(authService: <a href="../injectables/AuthService.html">AuthService</a>, router: <a href="https://angular.io/api/router/Router" target="_blank">Router</a>, fb: <a href="https://angular.io/api/forms/FormBuilder" target="_blank">FormBuilder</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="19" class="link-to-prism">src/app/auth-component/auth-component.component.ts:19</a></div>
<div class="io-line">Defined in <a href="" data-line="22" class="link-to-prism">src/app/auth-component/auth-component.component.ts:22</a></div>
</td>
</tr>
......@@ -202,7 +208,7 @@
<td>authService</td>
<td>
<code><a href="../classes/AuthService.html" target="_self" >AuthService</a></code>
<code><a href="../injectables/AuthService.html" target="_self" >AuthService</a></code>
</td>
<td>
......@@ -222,6 +228,18 @@
</td>
</tr>
<tr>
<td>fb</td>
<td>
<code><a href="https://angular.io/api/forms/FormBuilder" target="_blank" >FormBuilder</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
......@@ -262,8 +280,8 @@
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="23"
class="link-to-prism">src/app/auth-component/auth-component.component.ts:23</a></div>
<div class="io-line">Defined in <a href="" data-line="30"
class="link-to-prism">src/app/auth-component/auth-component.component.ts:30</a></div>
</td>
</tr>
......@@ -301,8 +319,8 @@
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="27"
class="link-to-prism">src/app/auth-component/auth-component.component.ts:27</a></div>
<div class="io-line">Defined in <a href="" data-line="38"
class="link-to-prism">src/app/auth-component/auth-component.component.ts:38</a></div>
</td>
</tr>
......@@ -340,8 +358,8 @@
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="37"
class="link-to-prism">src/app/auth-component/auth-component.component.ts:37</a></div>
<div class="io-line">Defined in <a href="" data-line="47"
class="link-to-prism">src/app/auth-component/auth-component.component.ts:47</a></div>
</td>
</tr>
......@@ -383,7 +401,61 @@
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="19" class="link-to-prism">src/app/auth-component/auth-component.component.ts:19</a></div>
<div class="io-line">Defined in <a href="" data-line="20" class="link-to-prism">src/app/auth-component/auth-component.component.ts:20</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="error"></a>
<span class="name">
<b>
error</b>
<a href="#error"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="22" class="link-to-prism">src/app/auth-component/auth-component.component.ts:22</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="loginForm"></a>
<span class="name">
<b>
loginForm</b>
<a href="#loginForm"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://angular.io/api/forms/FormGroup" target="_blank" >FormGroup</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="21" class="link-to-prism">src/app/auth-component/auth-component.component.ts:21</a></div>
</td>
</tr>
......@@ -397,6 +469,7 @@
<div class="tab-pane fade tab-source-code" id="c-source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Component, OnInit } from &#x27;@angular/core&#x27;;
import { FormBuilder, FormGroup } from &#x27;@angular/forms&#x27;;
import { Router } from &#x27;@angular/router&#x27;;
import { AuthService } from &#x27;../services/auth.service&#x27;;
......@@ -415,21 +488,30 @@ import { AuthService } from &#x27;../services/auth.service&#x27;;
export class AuthComponent implements OnInit {
authStatus: boolean;
loginForm: FormGroup;
error: any;
constructor(private authService: AuthService, private router: Router) { }
constructor(
private authService: AuthService,
private router: Router,
private fb: FormBuilder
) { }
ngOnInit() {
this.authStatus &#x3D; this.authService.isAuth;
this.loginForm &#x3D; this.fb.group({ // We create the login form
username: [],
password: [],
});
}
onSignIn() {
this.authService.signIn().then(
() &#x3D;&gt; {
console.log(&#x27;Sign in successful!&#x27;);
this.authStatus &#x3D; this.authService.isAuth;
this.router.navigate([&#x27;home&#x27;]);
}
);
const username &#x3D; this.loginForm.get(&#x27;username&#x27;).value;
const password &#x3D; this.loginForm.get(&#x27;password&#x27;).value;
this.authService.signIn({
username: username,
password: password
}, this);
}
onSignOut() {
......@@ -443,16 +525,25 @@ export class AuthComponent implements OnInit {
<div class="tab-pane fade " id="c-templateData">
<pre class="line-numbers"><code class="language-html">&lt;div class&#x3D;&quot;global&quot;&gt;
&lt;h1&gt; Authentification GendLoc &lt;/h1&gt;
&lt;div class&#x3D;&quot;authentification_box&quot;&gt;
&lt;form action&#x3D;&quot;&quot; method&#x3D;&quot;post&quot;&gt;
&lt;label&gt;Nom&lt;/label&gt;
&lt;input type&#x3D;&quot;text&quot; name&#x3D;&quot;username&quot; class&#x3D;&quot;input&quot; autocomplete&#x3D;&quot;off&quot; id&#x3D;&quot;username&quot;/&gt;
&lt;label&gt;Mot de passe &lt;/label&gt;
&lt;input type&#x3D;&quot;password&quot; name&#x3D;&quot;password&quot; class&#x3D;&quot;input&quot; autocomplete&#x3D;&quot;off&quot; id&#x3D;&quot;password&quot;/&gt;&lt;br/&gt;
&lt;button type&#x3D;&quot;submit&quot; class&#x3D;&quot;login&quot; *ngIf&#x3D;&quot;!authStatus&quot; (click)&#x3D;&quot;onSignIn()&quot;&gt;CONNEXION&lt;/button&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;h1&gt; Authentification GendLoc &lt;/h1&gt;
&lt;div class&#x3D;&quot;container-alert&quot; *ngIf&#x3D;&quot;error&quot;&gt;
&lt;p&gt;{{error}}&lt;/p&gt;
&lt;/div&gt;
&lt;div class&#x3D;&quot;authentification_box&quot;&gt;
&lt;form [formGroup]&#x3D;&quot;loginForm&quot; (ngSubmit)&#x3D;&quot;onSignIn()&quot;&gt;
&lt;div class&#x3D;&quot;input-group&quot;&gt;
&lt;label&gt;Nom d&#x27;utilisateur&lt;/label&gt;&lt;br&gt;
&lt;input type&#x3D;&quot;text&quot; name&#x3D;&quot;username&quot; class&#x3D;&quot;input&quot; autocomplete&#x3D;&quot;off&quot; id&#x3D;&quot;username&quot; formControlName&#x3D;&quot;username&quot;/&gt;
&lt;/div&gt;
&lt;div class&#x3D;&quot;input-group&quot;&gt;
&lt;label&gt;Mot de passe &lt;/label&gt;&lt;br&gt;
&lt;input type&#x3D;&quot;password&quot; name&#x3D;&quot;password&quot; class&#x3D;&quot;input&quot; autocomplete&#x3D;&quot;off&quot; id&#x3D;&quot;password&quot; formControlName&#x3D;&quot;password&quot;/&gt;
&lt;/div&gt;
&lt;button type&#x3D;&quot;submit&quot; class&#x3D;&quot;login&quot; *ngIf&#x3D;&quot;!authStatus&quot;&gt;CONNEXION&lt;/button&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;/div&gt;
</code></pre>
</div>
......@@ -461,80 +552,103 @@ export class AuthComponent implements OnInit {
<p class="comment">
<code>./auth-component.component.scss</code>
</p>
<pre class="line-numbers"><code class="language-scss">.global
{
margin:0 auto;
width:800px;
text-align:center;
font-family: &quot;Helvetica&quot;,Arial,sans-serif;
font-weight: 500;
}
.authentification_box
{
font-weight: bold;
width: 224px;
margin: 0px auto;
font-size:13px;
text-align: left;
padding: 20px;
background-color: #ffffff;
color: #333;
border: 1px solid #e5e5e5;
box-shadow: rgba(200,200,200,0.7) 0 4px 10px -1px;
/* vertical center */
position: absolute;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
}
h1
{
margin-top:10%;
}
.input
{
padding:10px;
border:1px solid #999999;
width:200px;
margin-bottom:10px;
border: 1px solid #e5e5e5;
background: #fbfbfb;
box-shadow: inset 1px 1px 2px rgba(200,200,200,0.2);
}
<pre class="line-numbers"><code class="language-scss">$border-color: #e5e5e5;
$shadow-color: rgb(200,200,200);
.global{
display: inline-block;
position: absolute;
transform: translate(-50%,-50%);
top: 50%;
left: 50%;
width:800px;
text-align:center;
font-family: &quot;Helvetica&quot;,Arial,sans-serif;
font-weight: 500;
h1{
margin: 20px 0;
}
.container-alert{
margin: 20px auto;
font-size: 11pt;
color: #f00;
font-style: italic;
}
.authentification_box{
display: inline-block;
font-weight: bold;
font-size: 13px;
text-align: left;
padding: 20px;
background: #fff;
color: #333;
border: 1px solid $border-color;
box-shadow: rgba($color: $shadow-color, $alpha: .7) 0 4px 10 -1px;
form{
display: inline-grid;
.input-group{
margin: 10px;
display: inline-block;
}
.input{
padding: 10px;
border: 1px solid $border-color;
width: 200px;
margin-top: 5px;
background: #fbfbfb;
box-shadow: inset 1px 1px 2px rgba($color: $shadow-color, $alpha: .2);
}
.login{
margin-top: 20px;
font-weight: bold;
padding: 12px 15px;
background: #33CC33;
color: #fff;
cursor: pointer;
text-decoration: none;
text-shadow: 0 1px 0px rgba($color: #000, $alpha: .15);
border-width: 1px 1px 3px;
border-style: solid;
border-color: #336600;
text-overflow: ellipsis;
display: -moz-inline-stack;
display: inline-block;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-shadow: 0 -1px 0 rgba($color: #fff, $alpha: .1) inset;
-moz-box-shadow: 0 -1px 0 rgba($color: #fff, $alpha: .1) inset;
box-shadow: 0 -1px 0 rgba($color: #fff, $alpha: .1)inset;
}
.login:hover {background-color: #3e8e41}
.login:active{
background-color: #3e8e41;
box-shadow: 0 5px #666;
transform: translateY(4px);
}
}
}
.login {
font-weight: bold;
padding: 12px 15px;
background: #33CC33;
color: #fff;
cursor: pointer;
text-decoration: none;
text-shadow: 0 1px 0px rgba(0,0,0,0.15);
border-width: 1px 1px 3px;
border-style: solid;
border-color: #336600;
text-overflow: ellipsis;
display: -moz-inline-stack;
display: inline-block;
vertical-align: middle;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-shadow: 0 -1px 0 rgba(255,255,255,0.1) inset;
-moz-box-shadow: 0 -1px 0 rgba(255,255,255,0.1) inset;
box-shadow: 0 -1px 0 rgba(255,255,255,0.1) inset;
}
.login:hover {background-color: #3e8e41}
.login:active {
background-color: #3e8e41;
box-shadow: 0 5px #666;
transform: translateY(4px);
}
</code></pre>
</div>
......@@ -563,7 +677,7 @@ h1
<script src="../js/libs/htmlparser.js"></script>
<script src="../js/libs/deep-iterator.js"></script>
<script>
var COMPONENT_TEMPLATE = '<div><div class="global"> <h1> Authentification GendLoc </h1> <div class="authentification_box"> <form action="" method="post"> <label>Nom</label> <input type="text" name="username" class="input" autocomplete="off" id="username"/> <label>Mot de passe </label> <input type="password" name="password" class="input" autocomplete="off" id="password"/><br/> <button type="submit" class="login" *ngIf="!authStatus" (click)="onSignIn()">CONNEXION</button> </form> </div></div></div>'
var COMPONENT_TEMPLATE = '<div><div class="global"> <h1> Authentification GendLoc </h1> <div class="container-alert" *ngIf="error"> <p>{{error}}</p> </div> <div class="authentification_box"> <form [formGroup]="loginForm" (ngSubmit)="onSignIn()"> <div class="input-group"> <label>Nom d\'utilisateur</label><br> <input type="text" name="username" class="input" autocomplete="off" id="username" formControlName="username"/> </div> <div class="input-group"> <label>Mot de passe </label><br> <input type="password" name="password" class="input" autocomplete="off" id="password" formControlName="password"/> </div> <button type="submit" class="login" *ngIf="!authStatus">CONNEXION</button> </form> </div></div></div>'
var COMPONENTS = [{'name': 'AppComponent', 'selector': 'app-root'},{'name': 'AppFrontComponent', 'selector': 'app-app-front'},{'name': 'AuthComponent', 'selector': 'app-auth-component'},{'name': 'CoordMapComponent', 'selector': 'app-coord-map'},{'name': 'ErrorPageComponent', 'selector': 'app-error-page'},{'name': 'MapComponent', 'selector': 'app-map'},{'name': 'SidebarLeftComponent', 'selector': 'app-sidebar-left'},{'name': 'SidebarRightComponent', 'selector': 'app-sidebar-right'}];
var DIRECTIVES = [];
var ACTUAL_COMPONENT = {'name': 'AuthComponent'};
......
......@@ -109,7 +109,7 @@
<td>AuthComponent</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/6)</span>
<span class="coverage-count">(0/8)</span>
</td>
</tr>
<tr class="low">
......@@ -148,6 +148,186 @@
<span class="coverage-count">(0/3)</span>
</td>
</tr>
<tr class="very-good">
<td>
<!-- miscellaneous -->
<a href="./interfaces/IApiService.html">src/app/services/api/api-client.interface.ts</a>
</td>
<td>interface</td>
<td>IApiService</td>
<td align="right" data-sort="100">
<span class="coverage-percent">100 %</span>
<span class="coverage-count">(5/5)</span>
</td>
</tr>
<tr class="very-good">
<td>
<!-- miscellaneous -->
<a href="./classes/ApiService.html">src/app/services/api/api.service.ts</a>
</td>
<td>class</td>
<td>ApiService</td>
<td align="right" data-sort="77">
<span class="coverage-percent">77 %</span>
<span class="coverage-count">(7/9)</span>
</td>
</tr>
<tr class="good">
<td>
<!-- miscellaneous -->
<a href="./injectables/ServiceApi.html">src/app/services/api/clients/service.api.ts</a>
</td>
<td>injectable</td>
<td>ServiceApi</td>
<td align="right" data-sort="53">
<span class="coverage-percent">53 %</span>
<span class="coverage-count">(7/13)</span>
</td>
</tr>
<tr class="good">
<td>
<!-- miscellaneous -->
<a href="./injectables/TokenApi.html">src/app/services/api/clients/token.api.ts</a>
</td>
<td>injectable</td>
<td>TokenApi</td>
<td align="right" data-sort="63">
<span class="coverage-percent">63 %</span>
<span class="coverage-count">(7/11)</span>
</td>
</tr>
<tr class="good">
<td>
<!-- miscellaneous -->
<a href="./injectables/UnitApi.html">src/app/services/api/clients/unit.api.ts</a>
</td>
<td>injectable</td>
<td>UnitApi</td>
<td align="right" data-sort="53">
<span class="coverage-percent">53 %</span>
<span class="coverage-count">(7/13)</span>
</td>
</tr>
<tr class="good">
<td>
<!-- miscellaneous -->
<a href="./injectables/UserApi.html">src/app/services/api/clients/user.api.ts</a>
</td>
<td>injectable</td>
<td>UserApi</td>
<td align="right" data-sort="53">
<span class="coverage-percent">53 %</span>
<span class="coverage-count">(7/13)</span>
</td>
</tr>
<tr class="good">
<td>
<!-- miscellaneous -->
<a href="./injectables/WebcamApi.html">src/app/services/api/clients/webcam.api.ts</a>
</td>
<td>injectable</td>
<td>WebcamApi</td>
<td align="right" data-sort="53">
<span class="coverage-percent">53 %</span>
<span class="coverage-count">(7/13)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./interfaces/Service.html">src/app/services/api/models/service.ts</a>
</td>
<td>interface</td>
<td>Service</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/7)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./interfaces/ServiceSettings.html">src/app/services/api/models/service.ts</a>
</td>
<td>interface</td>
<td>ServiceSettings</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/5)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./interfaces/Token.html">src/app/services/api/models/token.ts</a>
</td>
<td>interface</td>
<td>Token</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/3)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./interfaces/TokenRefresh.html">src/app/services/api/models/token.ts</a>
</td>
<td>interface</td>
<td>TokenRefresh</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/2)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./interfaces/Unit.html">src/app/services/api/models/unit.ts</a>
</td>
<td>interface</td>
<td>Unit</td>
<td align="right" data-sort="0">