diff --git a/src/app/components/logs-dashboard/logs-home/logs-home.component.html b/src/app/components/logs-dashboard/logs-home/logs-home.component.html index 2fbe18f28b01b3bcbcfbd47492e531caab4d7b88..99a4334f6f941c177c17682cb4c66de3ce178079 100644 --- a/src/app/components/logs-dashboard/logs-home/logs-home.component.html +++ b/src/app/components/logs-dashboard/logs-home/logs-home.component.html @@ -1,4 +1,6 @@ <div class="section page-container"> + <app-page-header [pageInfo]="pageHeaderInfo" [hideBackButton]="true"></app-page-header> + <div class="columns is-centered is-marginless"> <div class="input-field"> <form> diff --git a/src/app/components/logs-dashboard/logs-home/logs-home.component.ts b/src/app/components/logs-dashboard/logs-home/logs-home.component.ts index ef258bb0b6c205e4fa04642c075e8ac90a80ef8e..c31966ab29503618cbb1472a6dcbef91b2bd2818 100644 --- a/src/app/components/logs-dashboard/logs-home/logs-home.component.ts +++ b/src/app/components/logs-dashboard/logs-home/logs-home.component.ts @@ -3,6 +3,7 @@ import { DataLogsService } from 'src/app/services/data-logs.service'; import { ActivatedRoute, ParamMap } from '@angular/router'; import { ILogs } from 'src/app/models/logs.model'; import { ISimpleTab } from 'src/app/models/basic-tabs.model'; +import { IPageHeaderInfo } from 'src/app/models/page.model'; @Component({ selector: 'app-logs-home', @@ -10,6 +11,9 @@ import { ISimpleTab } from 'src/app/models/basic-tabs.model'; styleUrls: ['./logs-home.component.scss'], }) export class LogsHomeComponent implements OnInit { + pageHeaderInfo: IPageHeaderInfo = { + title: 'Data-Logs', + }; isDashboardDisplayed: boolean = false; uuid: string; allFields: any; diff --git a/src/app/components/logs-dashboard/logs-sessions/logs-sessions.component.html b/src/app/components/logs-dashboard/logs-sessions/logs-sessions.component.html index 21759f06ad06aa3f96c569ec72041ebe4dfec608..662b4135750accf5955838eb1776f6cb6f049fe2 100644 --- a/src/app/components/logs-dashboard/logs-sessions/logs-sessions.component.html +++ b/src/app/components/logs-dashboard/logs-sessions/logs-sessions.component.html @@ -3,7 +3,7 @@ <div class="section"> <div class="columns is-centered is-marginless"> <div class="column has-text-left"> - <h2>{{ childNbSessions }} Sessions trouvées</h2> + <h2>{{ childNbSessions }} sessions trouvées</h2> </div> </div> diff --git a/src/app/components/logs-dashboard/report/logs-data/logs-data.component.html b/src/app/components/logs-dashboard/report/logs-data/logs-data.component.html index 536cdecc79ca446e45615b340e4c7a688d343ee7..53a6627f531d46b977774e6ad5ae70700f156dd0 100644 --- a/src/app/components/logs-dashboard/report/logs-data/logs-data.component.html +++ b/src/app/components/logs-dashboard/report/logs-data/logs-data.component.html @@ -6,7 +6,6 @@ <div class="section"> <div class="columns is-centered is-marginless"> - <div class="column has-text-left"> <div *ngFor="let oneStepData of allStepsData"> <div class="mini-info-card" *ngIf="oneStepData" (click)='getLogsSelector(oneStepData._id.step);'> @@ -19,7 +18,6 @@ <p>total-time: {{oneStepData.totalHoursSpent}}h : {{oneStepData.totalMinutesSpent}}m : {{oneStepData.totalSecondsSpent}}s </p> </h3> - </span> </div> <div class="column is-5 has-text-left"></div> diff --git a/src/app/components/logs-dashboard/report/logs-pre-report/logs-pre-report.component.html b/src/app/components/logs-dashboard/report/logs-pre-report/logs-pre-report.component.html index 9b5e557de4614bc8f67f6fa7e76ab4c3e08d3b78..bed326d5c5c57dd3d34dfb125f779a684ea2313f 100644 --- a/src/app/components/logs-dashboard/report/logs-pre-report/logs-pre-report.component.html +++ b/src/app/components/logs-dashboard/report/logs-pre-report/logs-pre-report.component.html @@ -1,9 +1,8 @@ <ng-container *ngIf="nbObjects!==0"> - <div class="section page-container"> - <app-back-button [route]="'/datalogs'" [title]="'Retourner à la liste des slugs et sessionIds'"></app-back-button> + <div class="section page-container"> + <app-page-header [pageInfo]="pageHeaderInfo" [goToThisUrl]="previousUrl" [hideBackButton]="false"></app-page-header> - <h1>{{ title }}</h1> <div [ngClass]="{'hidden': isSession}"> <div class="section"> <div class="columns is-left is-marginless"> @@ -57,7 +56,7 @@ 0 </div> <div class="column is-1 actions"> - <a class="button button-gl " [routerLink]="['../../../../datalogs/report', id, session, 'slug']"> + <a class="button button-gl " [routerLink]="['/','datalogs','report', id, session, 'slug']"> <i class="fas fa-eye"></i> Voir </a> </div> diff --git a/src/app/components/logs-dashboard/report/logs-pre-report/logs-pre-report.component.ts b/src/app/components/logs-dashboard/report/logs-pre-report/logs-pre-report.component.ts index 61fc46b106cc869f051a3534d38316bfd2d5c433..b88b0af13caff4c60680ddbb79bcd344af5ba54e 100644 --- a/src/app/components/logs-dashboard/report/logs-pre-report/logs-pre-report.component.ts +++ b/src/app/components/logs-dashboard/report/logs-pre-report/logs-pre-report.component.ts @@ -4,6 +4,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { filter, switchMap } from 'rxjs/operators'; import { Format } from 'src/app/models/format.model'; import { DataLogsService } from 'src/app/services/data-logs.service'; +import { IPageHeaderInfo } from 'src/app/models/page.model'; @Component({ selector: 'app-logs-pre-report', @@ -11,7 +12,10 @@ import { DataLogsService } from 'src/app/services/data-logs.service'; styleUrls: ['./logs-pre-report.component.scss'], }) export class LogsPreReportComponent implements OnInit { - + pageHeaderInfo: IPageHeaderInfo = { + title: 'Data-Logs pre-report', + }; + previousUrl: string = '/datalogs'; responseArray: any = []; form: FormGroup; title: string; @@ -23,7 +27,7 @@ export class LogsPreReportComponent implements OnInit { constructor( private _dataLogsService: DataLogsService, - private _route: ActivatedRoute, + public _route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, ) { @@ -56,5 +60,7 @@ export class LogsPreReportComponent implements OnInit { }); } - + navigateByUrl() { + this._router.navigateByUrl(this.previousUrl); + } } diff --git a/src/app/components/logs-dashboard/report/logs-report/logs-report.component.html b/src/app/components/logs-dashboard/report/logs-report/logs-report.component.html index d20d630080d2a17fca0dad453b9d86c93448f581..e54d04c0b2c92586ea25962daf75aa62d00e1120 100644 --- a/src/app/components/logs-dashboard/report/logs-report/logs-report.component.html +++ b/src/app/components/logs-dashboard/report/logs-report/logs-report.component.html @@ -1,10 +1,6 @@ <ng-container> <div class="section page-container"> - - <app-back-button [routerLink]="previousUrl" [title]="'Retourner au pre-report'"></app-back-button> - - <h1>{{ title }}</h1> - + <app-page-header [pageInfo]="pageHeaderInfo" [goToThisUrl]='previousUrl' [hideBackButton]="false"></app-page-header> <app-logs-graph [childUuid]="uuid" [childSessionId]="sessionId" [childSlug]="slug"></app-logs-graph> <div class="columns is-centered "> diff --git a/src/app/components/logs-dashboard/report/logs-report/logs-report.component.ts b/src/app/components/logs-dashboard/report/logs-report/logs-report.component.ts index a0573e2b0989577f96192831b4775d2efb39a4ac..aa4b22915fbef84ea9713c3bf0427274d467a467 100644 --- a/src/app/components/logs-dashboard/report/logs-report/logs-report.component.ts +++ b/src/app/components/logs-dashboard/report/logs-report/logs-report.component.ts @@ -4,6 +4,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { filter, switchMap } from 'rxjs/operators'; import { Format } from 'src/app/models/format.model'; import { DataLogsService } from 'src/app/services/data-logs.service'; +import { IPageHeaderInfo } from 'src/app/models/page.model'; @Component({ selector: 'app-logs-report', @@ -11,18 +12,20 @@ import { DataLogsService } from 'src/app/services/data-logs.service'; styleUrls: ['./logs-report.component.scss'], }) export class LogsReportComponent implements OnInit { - + pageHeaderInfo: IPageHeaderInfo = { + title: 'Data-Logs Report', + }; responseArray: any = []; form: FormGroup; title: string; slug: string ; uuid:string; - previousUrl: string ; sessionId: string; serviceName:string; nbObjects: number = 0; urlCode: string = ''; isSession:boolean = false; + previousUrl: string; constructor( private _dataLogsService: DataLogsService, diff --git a/src/app/components/page-header/page-header.component.ts b/src/app/components/page-header/page-header.component.ts index 0d824ad8570f807af5ec8d8e5de919426a609ce4..be5e7df31d04a52cff8a46b3f43ac2caea301a25 100644 --- a/src/app/components/page-header/page-header.component.ts +++ b/src/app/components/page-header/page-header.component.ts @@ -16,15 +16,16 @@ export class PageHeaderComponent implements OnInit { ) { } @Input() pageInfo: IPageHeaderInfo; - @Input() customGoToPreviousPage: any; + @Input() goToThisUrl: any; @Input() hideBackButton: boolean; ngOnInit() { } goToPreviousPage() { - if (this.customGoToPreviousPage) { - this.customGoToPreviousPage(); + if (this.goToThisUrl) { + console.log('INSIDE GOTOTHISURL'); + this._router.navigate([this.goToThisUrl]); } else { const index = 1; // Start to retrieve the previous element let url = this._navigationHistoryService.getFromLast(index);