Archived
Add the version revisions system.
This commit is contained in:
@@ -30,6 +30,7 @@ import { CreateUpdatePostComponent } from './posts/create-update/create-update-p
|
||||
import { ForbiddenComponent } from './forbidden/forbidden.component';
|
||||
import { SearchComponent } from './search/search.component';
|
||||
import { SigninComponent } from './signin/signin.component';
|
||||
import { VersionRevisionComponent } from './version-revisions/version-revisions.component';
|
||||
|
||||
// html components
|
||||
import { ProgressBarComponent } from './core/directives/progress-bar/progress-bar.component';
|
||||
@@ -48,6 +49,7 @@ import { ProfilEditionService } from './account-settings/profil-edition/profil-e
|
||||
import { HeaderService } from './header/header.service';
|
||||
import { CreateUpdatePostService } from './posts/create-update/create-update-post.service';
|
||||
import { SearchService } from './search/search.service';
|
||||
import { VersionRevisionService } from './version-revisions/version-revisions.service';
|
||||
|
||||
// Guards
|
||||
import { AuthGuard } from './core/guards/auth.guard';
|
||||
@@ -78,7 +80,8 @@ import { SigninService } from './signin/signin.service';
|
||||
SigninComponent,
|
||||
ProgressBarComponent,
|
||||
SpinnerComponent,
|
||||
SearchBarComponent
|
||||
SearchBarComponent,
|
||||
VersionRevisionComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
@@ -104,6 +107,7 @@ import { SigninService } from './signin/signin.service';
|
||||
HeaderService,
|
||||
CreateUpdatePostService,
|
||||
SearchService,
|
||||
VersionRevisionService,
|
||||
AuthGuard,
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
|
||||
@@ -14,6 +14,7 @@ import { CreateUpdatePostComponent } from './posts/create-update/create-update-p
|
||||
import { ForbiddenComponent } from './forbidden/forbidden.component';
|
||||
import { ProfilEditionComponent } from './account-settings/profil-edition/profil-edition.component';
|
||||
import { SearchComponent } from './search/search.component';
|
||||
import { VersionRevisionComponent } from './version-revisions/version-revisions.component';
|
||||
|
||||
import { AuthGuard } from './core/guards/auth.guard';
|
||||
|
||||
@@ -31,6 +32,7 @@ export const appRoutes: Routes = [
|
||||
{ path: 'accountSettings', component: AccountSettingsComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'changePassword', component: ChangePasswordComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'profilEdit', component: ProfilEditionComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'versionrevisions', component: VersionRevisionComponent },
|
||||
{ path: 'forbidden', component: ForbiddenComponent },
|
||||
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
||||
{ path: '**', component: NotFoundComponent }
|
||||
|
||||
@@ -2,7 +2,7 @@ export class Role {
|
||||
constructor(
|
||||
public id: number,
|
||||
public name: string
|
||||
) {}
|
||||
) { }
|
||||
}
|
||||
|
||||
export class User {
|
||||
@@ -15,7 +15,7 @@ export class User {
|
||||
public inscriptionDate: Date,
|
||||
public role: Role,
|
||||
public token: string
|
||||
) {}
|
||||
) { }
|
||||
}
|
||||
|
||||
export class Post {
|
||||
@@ -28,7 +28,7 @@ export class Post {
|
||||
public creationDate: Date,
|
||||
public author: User,
|
||||
public category: Category
|
||||
) {}
|
||||
) { }
|
||||
}
|
||||
|
||||
export class Category {
|
||||
@@ -36,14 +36,14 @@ export class Category {
|
||||
public id: number,
|
||||
public name: string,
|
||||
public listSubCategories: Array<Category>
|
||||
) {}
|
||||
) { }
|
||||
}
|
||||
|
||||
export class Image {
|
||||
constructor(
|
||||
public id: number,
|
||||
public link: string
|
||||
) {}
|
||||
) { }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,5 +54,21 @@ export class PasswordWrapper {
|
||||
public oldPassword: string,
|
||||
public newPassword: string,
|
||||
public confirmPassword: string
|
||||
) {}
|
||||
) { }
|
||||
}
|
||||
|
||||
export class Version {
|
||||
constructor(
|
||||
public id: number,
|
||||
public number: string,
|
||||
public active: boolean
|
||||
) { }
|
||||
}
|
||||
|
||||
export class VersionRevision {
|
||||
constructor(
|
||||
public id: number,
|
||||
public text: string,
|
||||
public version: Version
|
||||
) { }
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
<footer class="page-footer indigo center-on-small-only">
|
||||
<!-- fixed-bottom -->
|
||||
<!-- fixed-bottom -->
|
||||
<div class="footer-copyright">
|
||||
<div class="container">
|
||||
<span class="float-left">
|
||||
<span class="anticopy">©</span> 2017 Tous droits réservés -
|
||||
<i>{{appVersion}}</i>
|
||||
<i id="appVersion" routerLink="/versionrevisions" mdbTooltip="Notes de versions" placement="top" mdbRippleRadius>
|
||||
{{appVersion}}
|
||||
</i>
|
||||
</span>
|
||||
<span class="float-right">
|
||||
<a href="./assets/doc/codiki_user_manual.pdf" mdbTooltip="Manuel d'utilisation" placement="top" mdbRippleRadius>
|
||||
|
||||
@@ -13,3 +13,7 @@ span.anticopy {
|
||||
display: inline-block;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
#appVersion {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-lg-2">
|
||||
<h1>Versions</h1>
|
||||
<ul class="list-group">
|
||||
<a *ngFor="let version of versionsList">
|
||||
<li [className]="version.active ? 'list-group-item active' : 'list-group-item'"
|
||||
(click)="showVersionRevision(version)">
|
||||
{{version.number}}
|
||||
</li>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="versionRevisionsArea" class="col-md-9 col-lg-10">
|
||||
<ul *ngIf="versionRevisionsList.length">
|
||||
<li *ngFor="let versionRevision of versionRevisionsList">
|
||||
{{versionRevision.text}}
|
||||
</li>
|
||||
</ul>
|
||||
<h4 *ngIf="!versionRevisionsList.length">Aucune note de révisions pour cette version.</h4>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { VersionRevisionService } from './version-revisions.service';
|
||||
import { VersionRevision, Version } from '../core/entities';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-version-revisions',
|
||||
templateUrl: 'version-revisions.component.html',
|
||||
styles: [`
|
||||
#versionRevisionsArea {
|
||||
padding-top: 70px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
#versionRevisionsArea {
|
||||
padding-top: 20px;
|
||||
}
|
||||
}
|
||||
`]
|
||||
})
|
||||
export class VersionRevisionComponent implements OnInit {
|
||||
versionsList: Array<Version>;
|
||||
versionRevisionsList: Array<VersionRevision>;
|
||||
|
||||
constructor(
|
||||
private versionRevisionService: VersionRevisionService
|
||||
) {
|
||||
this.versionsList = [];
|
||||
this.versionRevisionsList = [];
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.versionRevisionService.getVersions().subscribe(versionsList => {
|
||||
this.versionsList = versionsList;
|
||||
this.showVersionRevision(this.versionsList[0]);
|
||||
});
|
||||
}
|
||||
|
||||
showVersionRevision(version: Version): void {
|
||||
this.versionsList.forEach(versionTmp => versionTmp.active = false);
|
||||
version.active = true;
|
||||
|
||||
this.versionRevisionService.findByVersionNumber(version.number).subscribe(versionRevisionsList => {
|
||||
this.versionRevisionsList = versionRevisionsList;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Version, VersionRevision } from '../core/entities';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
const VERSION_REVISIONS_URL = environment.apiUrl + '/api/versionrevisions';
|
||||
|
||||
@Injectable()
|
||||
export class VersionRevisionService {
|
||||
constructor(
|
||||
private http: HttpClient
|
||||
) {}
|
||||
|
||||
getVersions(): Observable<Array<Version>> {
|
||||
return this.http.get<Array<Version>>(`${VERSION_REVISIONS_URL}/versions`);
|
||||
}
|
||||
|
||||
findByVersionNumber(versionNumber: string): Observable<Array<VersionRevision>> {
|
||||
return this.http.get<Array<VersionRevision>>(`${VERSION_REVISIONS_URL}/${versionNumber}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user