corrections des erreurs remarquées par Wilfried
This commit is contained in:
parent
d1ac1b77f0
commit
939e5f4df1
33 changed files with 66 additions and 112 deletions
|
|
@ -33,9 +33,9 @@
|
|||
|
||||
<!-- Date Column -->
|
||||
<ng-container matColumnDef="date">
|
||||
<th mat-header-cell *matHeaderCellDef> Date </th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Date </th>
|
||||
<td mat-cell *matCellDef="let video">
|
||||
{{video.watchedDates[video.watchedDates.length-1] | date:'dd/LL/YYYY à HH:mm:ss'}}
|
||||
{{video.date | date:'dd/LL/YYYY à HH:mm:ss'}}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,15 @@ import {Router} from "@angular/router";
|
|||
|
||||
|
||||
|
||||
interface VideoHistory {
|
||||
imageUrl: string,
|
||||
title: string,
|
||||
date: Date,
|
||||
source: string,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-history-user',
|
||||
templateUrl: './page-history-user.component.html',
|
||||
|
|
@ -37,8 +46,10 @@ export class PageHistoryUserComponent implements AfterViewInit
|
|||
this.userHistoryService.clearTabVideoUrlClicked();
|
||||
|
||||
// --- FAUX CODE ---
|
||||
const tabVideo: VideoAll[] = this.fictitiousVideosService.getTabVideoAll(8);
|
||||
this.dataSource = new MatTableDataSource(tabVideo);
|
||||
const tabVideoAll: VideoAll[] = this.fictitiousVideosService.getTabVideoAll(8);
|
||||
let tabVideoHistory: VideoHistory[] = [];
|
||||
for(let videoAll of tabVideoAll) tabVideoHistory.push(this.videoAllToVideoHistory(videoAll));
|
||||
this.dataSource = new MatTableDataSource(tabVideoHistory);
|
||||
this.dataSource.sort = this.sort;
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource = this.dataSource;
|
||||
|
|
@ -67,15 +78,6 @@ export class PageHistoryUserComponent implements AfterViewInit
|
|||
}
|
||||
|
||||
|
||||
// Retourne la source de la video en fonction de l'url
|
||||
getSourceByUrl(url: string): string
|
||||
{
|
||||
if(url.includes("youtu")) return "Youtube" ;
|
||||
else if(url.includes("daily")) return "Dailymotion" ;
|
||||
else return "???" ;
|
||||
}
|
||||
|
||||
|
||||
// Supprime la video
|
||||
onDelete(video: VideoAll): void
|
||||
{
|
||||
|
|
@ -109,4 +111,15 @@ export class PageHistoryUserComponent implements AfterViewInit
|
|||
this.router.navigateByUrl(url);
|
||||
}
|
||||
|
||||
|
||||
videoAllToVideoHistory(videoAll: VideoAll): VideoHistory
|
||||
{
|
||||
return {
|
||||
imageUrl: videoAll.imageUrl,
|
||||
title: videoAll.title,
|
||||
date: videoAll.watchedDates[videoAll.watchedDates.length-1],
|
||||
source: videoAll.source,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<!-- login -->
|
||||
<div class="row myRow">
|
||||
<div class="col-8 myLabel">Login:</div>
|
||||
<div class="col-8 myLabel">Pseudo:</div>
|
||||
<div class="col-4 myValue"> {{user.login}} </div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<!-- login -->
|
||||
<div class="form-group row myRow">
|
||||
<label for="login" class="col-sm-6 col-form-label myLeftLabel">Login:</label>
|
||||
<label for="login" class="col-sm-6 col-form-label myLeftLabel">Pseudo:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control myValue" id="login" [(ngModel)]="userCopy.login">
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ export class PopupUpdateUserComponent implements OnInit
|
|||
checkField()
|
||||
{
|
||||
if(this.userCopy.login.length === 0) {
|
||||
this.errorMessage = "Veuillez remplir le champ 'login'." ;
|
||||
this.errorMessage = "Veuillez remplir le champ 'pseudo'." ;
|
||||
this.hasError = true;
|
||||
}
|
||||
else if(this.userCopy.email.length === 0) {
|
||||
|
|
|
|||
Reference in a new issue