Commit 0abd49f7 authored by Thomas Frion's avatar Thomas Frion

Merge branch 'dev'

parents bb0619a4 d1770802
# CHANGELOG
## 2020-03-26
* Generation of the GendLoc application
* Creation component
## 2020-04-06
* Initialisation and reworking on the different components, files were deleted and modified
## 2020-04-27 & 2020-04-28
* Routing between the already existing components done
* Installation of the RxJS extension for the use of `Observables` in the application
* Creation of the services folder
* Creation of the `auth.services.ts` and `auth-guard.service.ts` files which are used for authentification purposes.
## 2020-04-29
* Installation of Compodoc
* Creation of the documentation pertaining to the GendLoc application
../CHANGELOG.md
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -219,8 +219,7 @@ export class AppComponent {
<p class="comment">
<code>./app.component.scss</code>
</p>
<pre class="line-numbers"><code class="language-scss">
</code></pre>
<pre class="line-numbers"><code class="language-scss"></code></pre>
</div>
<div class="tab-pane fade " id="c-tree">
......@@ -249,7 +248,7 @@ export class AppComponent {
<script src="../js/libs/deep-iterator.js"></script>
<script>
var COMPONENT_TEMPLATE = '<div><router-outlet></router-outlet></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 COMPONENTS = [{'name': 'AppComponent', 'selector': 'app-root'},{'name': 'AppFrontComponent', 'selector': 'app-app-front'},{'name': 'AuthComponent', 'selector': 'app-auth-component'},{'name': 'ErrorPageComponent', 'selector': 'app-error-page'},{'name': 'LogoutComponent', 'selector': 'app-logout'},{'name': 'MapComponent', 'selector': 'app-map'},{'name': 'SidebarLeftComponent', 'selector': 'app-sidebar-left'}];
var DIRECTIVES = [];
var ACTUAL_COMPONENT = {'name': 'AppComponent'};
</script>
......
......@@ -161,7 +161,7 @@
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="12" class="link-to-prism">src/app/app-front/app-front.component.ts:12</a></div>
<div class="io-line">Defined in <a href="" data-line="11" class="link-to-prism">src/app/app-front/app-front.component.ts:11</a></div>
</td>
</tr>
......@@ -200,8 +200,8 @@
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="16"
class="link-to-prism">src/app/app-front/app-front.component.ts:16</a></div>
<div class="io-line">Defined in <a href="" data-line="15"
class="link-to-prism">src/app/app-front/app-front.component.ts:15</a></div>
</td>
</tr>
......@@ -224,7 +224,6 @@
<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;;
/**
* @AppFrontComponent :
* Component needed to call and display the four components that make up the main page of the app
......@@ -246,20 +245,34 @@ export class AppFrontComponent implements OnInit {
</div>
<div class="tab-pane fade " id="c-templateData">
<pre class="line-numbers"><code class="language-html">&lt;app-sidebar-left&gt;&lt;/app-sidebar-left&gt;
&lt;!-- NOT DONE YET:
&lt;app-sidebar-right&gt;&lt;/app-sidebar-right&gt;
&lt;app-coord-map&gt;&lt;/app-coord-map&gt;
&lt;app-map&gt;&lt;/app-map&gt;
--&gt;
</code></pre>
<pre class="line-numbers"><code class="language-html">&lt;div class&#x3D;&quot;main-container&quot;&gt;
&lt;app-sidebar-left class&#x3D;&quot;left-menu&quot;&gt;&lt;/app-sidebar-left&gt;
&lt;app-map&gt;&lt;/app-map&gt;
&lt;/div&gt;</code></pre>
</div>
<div class="tab-pane fade " id="c-styleData">
<p class="comment">
<code>./app-front.component.scss</code>
</p>
<pre class="line-numbers"><code class="language-scss"></code></pre>
<pre class="line-numbers"><code class="language-scss">.main-container{
display: grid;
grid-template-columns: max-content auto;
height: 100vh;
.left-menu {
display: grid;
width: auto;
grid-template-columns: 40px calc(100% - 40px);
height: 100vh;
}
}
.right-menu{
position: absolute;
top: 100px;
right: 100px;
}</code></pre>
</div>
<div class="tab-pane fade " id="c-tree">
......@@ -287,8 +300,8 @@ export class AppFrontComponent implements OnInit {
<script src="../js/libs/htmlparser.js"></script>
<script src="../js/libs/deep-iterator.js"></script>
<script>
var COMPONENT_TEMPLATE = '<div><app-sidebar-left></app-sidebar-left><!-- NOT DONE YET:<app-sidebar-right></app-sidebar-right><app-coord-map></app-coord-map><app-map></app-map>--></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 COMPONENT_TEMPLATE = '<div><div class="main-container"> <app-sidebar-left class="left-menu"></app-sidebar-left> <app-map></app-map></div></div>'
var COMPONENTS = [{'name': 'AppComponent', 'selector': 'app-root'},{'name': 'AppFrontComponent', 'selector': 'app-app-front'},{'name': 'AuthComponent', 'selector': 'app-auth-component'},{'name': 'ErrorPageComponent', 'selector': 'app-error-page'},{'name': 'LogoutComponent', 'selector': 'app-logout'},{'name': 'MapComponent', 'selector': 'app-map'},{'name': 'SidebarLeftComponent', 'selector': 'app-sidebar-left'}];
var DIRECTIVES = [];
var ACTUAL_COMPONENT = {'name': 'AppFrontComponent'};
</script>
......
......@@ -305,7 +305,7 @@ export class ErrorPageComponent implements OnInit {
<script src="../js/libs/deep-iterator.js"></script>
<script>
var COMPONENT_TEMPLATE = '<div><div class="box"> <h2>Erreur 404</h2> <p>La page que vous cherchez n\'existe pas !</p> <p>The page you are looking for does not exist!</p></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 COMPONENTS = [{'name': 'AppComponent', 'selector': 'app-root'},{'name': 'AppFrontComponent', 'selector': 'app-app-front'},{'name': 'AuthComponent', 'selector': 'app-auth-component'},{'name': 'ErrorPageComponent', 'selector': 'app-error-page'},{'name': 'LogoutComponent', 'selector': 'app-logout'},{'name': 'MapComponent', 'selector': 'app-map'},{'name': 'SidebarLeftComponent', 'selector': 'app-sidebar-left'}];
var DIRECTIVES = [];
var ACTUAL_COMPONENT = {'name': 'ErrorPageComponent'};
</script>
......
This diff is collapsed.
This diff is collapsed.
......@@ -63,6 +63,8 @@
<b>@angular/platform-browser-dynamic</b> : ~9.0.7</li>
<li>
<b>@angular/router</b> : ~9.0.7</li>
<li>
<b>leaflet</b> : ^1.6.0</li>
<li>
<b>rxjs</b> : ~6.5.4</li>
<li>
......
......@@ -101,6 +101,9 @@
<li>
<a href="#canActivate">canActivate</a>
</li>
<li>
<a href="#getToken">getToken</a>
</li>
</ul>
</td>
</tr>
......@@ -124,7 +127,7 @@
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="13" class="link-to-prism">src/app/services/auth-guard.service.ts:13</a></div>
<div class="io-line">Defined in <a href="" data-line="14" class="link-to-prism">src/app/services/auth-guard.service.ts:14</a></div>
</td>
</tr>
......@@ -201,8 +204,8 @@
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="17"
class="link-to-prism">src/app/services/auth-guard.service.ts:17</a></div>
<div class="io-line">Defined in <a href="" data-line="18"
class="link-to-prism">src/app/services/auth-guard.service.ts:18</a></div>
</td>
</tr>
......@@ -218,6 +221,45 @@
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getToken"></a>
<span class="name">
<b>
getToken
</b>
<a href="#getToken"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getToken()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="28"
class="link-to-prism">src/app/services/auth-guard.service.ts:28</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Returns : </b> <code>Promise&lt;string&gt;</code>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
......@@ -225,12 +267,13 @@
<div class="tab-pane fade tab-source-code" id="c-source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot } from &#x27;@angular/router&#x27;;
import { Observable } from &#x27;rxjs-compat/Observable&#x27;;
import { AuthService } from &#x27;./auth.service&#x27;;
import { Injectable } from &#x27;@angular/core&#x27;;
import { Router } from &#x27;@angular/router&#x27;;
import { AuthService } from &#x27;src/app/pghm-api/auth.service&#x27;;
/**
* @Service:
* @service
*
* Service needed to guard the authentification process
*/
......@@ -240,14 +283,20 @@ export class AuthGuard implements CanActivate {
constructor(private authService: AuthService, public router: Router) { }
canActivate(): boolean{
if(!this.authService.loggedIn()) {
this.router.navigate([&#x27;auth&#x27;]);
return false;
} else {
return true;
}
}
return true;
// if(!this.authService.loggedIn()) {
// this.router.navigate([&#x27;auth&#x27;]);
// return false;
// } else {
// return true;
// }
}
getToken() : Promise&lt;string&gt; {
return this.authService.getToken();
}
}
</code></pre>
</div>
</div>
......
......@@ -4,6 +4,6 @@
<rect id="svg_2" height="20" width="40" y="0" x="92" stroke-width="1.5" stroke="#d8604b" fill="#d8604b" rx="7" ry="7"/>
<rect id="svg_3" height="20" width="22" y="0" x="92" stroke-width="1.5" stroke="#d8604b" fill="#d8604b"/>
<text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="12" id="svg_4" y="14" x="6" stroke-width="0" stroke="#5d5d5d" fill="#ffffff">documentation</text>
<text xml:space="preserve" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-size="12" id="svg_5" y="14" x="112" stroke-width="0" stroke="#5d5d5d" fill="#ffffff" style="text-anchor: middle">17%</text>
<text xml:space="preserve" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-size="12" id="svg_5" y="14" x="112" stroke-width="0" stroke="#5d5d5d" fill="#ffffff" style="text-anchor: middle">24%</text>
</g>
</svg>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
var ROUTES_INDEX = {"name":"<root>","kind":"module","className":"AppModule","children":[{"name":"routes","filename":"src/app/app-routing.module.ts","module":"AppRoutingModule","children":[{"path":"auth","component":"AuthComponent"},{"path":"home","canActivate":["AuthGuard"],"component":"AppFrontComponent"},{"path":"","redirectTo":"home","pathMatch":"full"},{"path":"not-found","component":"ErrorPageComponent"},{"path":"**","redirectTo":"not-found"}],"kind":"module"}]}
var ROUTES_INDEX = {"name":"<root>","kind":"module","className":"AppModule","children":[{"name":"routes","filename":"src/app/app-routing.module.ts","module":"AppRoutingModule","children":[{"path":"auth","component":"AuthComponent"},{"path":"home","canActivate":["AuthGuard"],"component":"AppFrontComponent"},{"path":"logout","component":"LogoutComponent"},{"path":"","redirectTo":"home","pathMatch":"full"},{"path":"not-found","component":"ErrorPageComponent"},{"path":"**","redirectTo":"not-found"}],"kind":"module"}]}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -20,6 +20,7 @@
"@angular/platform-browser": "~9.0.7",
"@angular/platform-browser-dynamic": "~9.0.7",
"@angular/router": "~9.0.7",
"angular-ng-autocomplete": "^2.0.1",
"leaflet": "^1.6.0",
"rxjs": "~6.5.4",
"rxjs-compat": "^6.5.5",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment