Récupération des notes de l'utilisateur connecté sur la page

develop
Yanaël GRETTE 4 years ago
parent a7e47f98d2
commit 6406c624c3
  1. 1
      src/app/notes/notes.component.html
  2. 45
      src/app/notes/notes.component.ts
  3. 2
      src/app/notes/notes.routing.module.ts
  4. 2
      src/app/shared/api-swagger/api/notes.service.ts
  5. 9
      src/app/shared/nav-menu/nav-menu-commercial/nav-menu-commercial.component.html
  6. 1
      src/app/shared/utils/paths.ts

@ -1 +1,2 @@
<app-nav-menu></app-nav-menu>
<h2>Liste de vos notes</h2>

@ -1,17 +1,52 @@
import { Component, OnInit } from "@angular/core";
import { NotesService } from "@shared/api-swagger";
import { CollaborateurDTO, NotesService } from "@shared/api-swagger";
import { cles } from "@shared/utils/cles";
import { Subscription } from "rxjs";
@Component({
selector: "app-notes",
templateUrl: "./notes.component.html"
})
export class NotesComponent implements OnInit {
asc: boolean = true;
numPage: number = 1;
parPage: number= 15;
texte: string = "";
tri: string = "";
notesSubscriber: Subscription;
id: string;
constructor(private notesService: NotesService) {
}
ngOnInit() {}
ngOnInit() {
this.recupererId();
}
recupererId() {
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined){
setTimeout( () => this.recupererId(), 1000);
}
else {
const collaborateurConnecte : CollaborateurDTO = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee));
this.id = collaborateurConnecte.id;
this.updateDataSource();
}
}
updateDataSource() {
this.notesSubscriber = this.notesService.getNotesAuteur(this.id, this.asc, this.numPage, this.parPage, this.texte, this.tri).subscribe(
notes => { console.log(notes)},
err => console.log(err)
);
}
}

@ -9,7 +9,7 @@ import { AuthGuard } from "@shared/auth/auth.guard";
import { paths_notes } from "@shared/utils/paths";
const routes: Routes = [
{path: paths_notes.notesAuteur, component: NotesComponent, canActivate: [AuthGuard]},
{path: "", component: NotesComponent, canActivate: [AuthGuard]},
]

@ -272,7 +272,7 @@ export class NotesService {
const consumes: string[] = [
];
return this.httpClient.request<Array<AffichageNoteDTO>>('get',`${this.basePath}/notes/${encodeURIComponent(String(idAuteur))}`,
return this.httpClient.request<Array<AffichageNoteDTO>>('get',`${this.basePath}/notes/auteur/${encodeURIComponent(String(idAuteur))}`,
{
params: queryParameters,
withCredentials: this.configuration.withCredentials,

@ -6,5 +6,12 @@
<button mat-menu-item routerLink="/collaborateurs">Liste de tous les collaborateurs</button>
<button mat-menu-item>Liste des collaborateurs suivis</button>
</mat-menu>
<button mat-button routerLink="/formations">Liste des formations</button>
<button mat-button>EP effectués</button>
<button mat-button [matMenuTriggerFor]="menuNotes">
<span>Notes</span>
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menuNotes="matMenu">
<button mat-menu-item routerLink="/notes">Vos notes</button>
</mat-menu>

@ -104,7 +104,6 @@ const paths_engagements = {
const paths_notes = {
base: "/notes",
path: "notes",
notesAuteur: "auteur/:id",
ajoutNote: "nouvellenote",
get: ":id",
edit: ":id/edit"

Loading…
Cancel
Save