correction de tous les bugs niveaux 1 (faibles)

This commit is contained in:
MiharyR 2021-12-16 13:45:05 +01:00
parent b5bb8e7cc4
commit f2ced83246
26 changed files with 53 additions and 38 deletions

View file

@ -25,9 +25,7 @@
<!-- pub -->
<mat-grid-tile colspan="2" rowspan="1" class="cellulePub">
<div class="conteneurPub">
<!--
<app-advert [ad]="ad"></app-advert>
-->
<app-advert [ad]="ad" from="myPlaylists"></app-advert>
</div>
</mat-grid-tile>

View file

@ -2,9 +2,7 @@ import { Component, OnInit } from '@angular/core';
import {ThemeService} from "../../../utils/services/theme/theme.service";
import {Advert} from "../../../utils/interfaces/advert";
import {MessageService} from "../../../utils/services/message/message.service";
import {PlaylistDB} from "../../../utils/interfaces/playlist";
import {HttpParams} from "@angular/common/http";
import {subscribeOn} from "rxjs/operators";
@ -35,7 +33,7 @@ export class PageMyPlaylistsComponent implements OnInit
adCallback(retour: any): void
{
if(retour !== "success") {
if(retour.status !== "success") {
console.log(retour);
}
else {

View file

@ -96,8 +96,6 @@ export class PlaylistListComponent implements OnInit
// click sur update playlist
onUpdatePlaylist(playlistToUpdate: PlaylistDB): void
{
console.log(playlistToUpdate);
const config = {
data: {
action: "update",
@ -111,8 +109,6 @@ export class PlaylistListComponent implements OnInit
.afterClosed()
.subscribe(newName => {
console.log("nn:" + newName);
const config = { duration: 1500, panelClass: "custom-class" };
if((newName === null) || (newName === undefined)) {
this.snackBar.open("Opération annulée", "", config);
@ -123,6 +119,8 @@ export class PlaylistListComponent implements OnInit
index = this.tabPlaylist.findIndex( elt => (elt._id === playlistToUpdate._id));
this.tabPlaylist[index].name = newName;
this.snackBar.open(`La playlist '${playlistToUpdate.name}' a bien été mise à jour ✔`, "", config);
this.eventEmitter.emit(this.tabPlaylist[index]);
this.playlistFocusedOn = this.tabPlaylist[index]
}
});
}

View file

@ -29,8 +29,6 @@ export class VideoListComponent implements OnChanges
ngOnChanges(changes: SimpleChanges): void
{
console.log("ngOnChanges:");
console.log(this.playlist);
if((this.playlist !== null) && (this.playlist !== undefined)) this.videosInPlaylist = this.playlist.videos;
}
@ -57,11 +55,8 @@ export class VideoListComponent implements OnChanges
onDeleteCallback(retour: any, indexVideo: number): void
{
console.log("onDeleteCallback:" );
console.log(retour);
if(retour.status !== "success") {
//console.log(retour);
console.log(retour);
}
else {
this.playlist.videos.splice(indexVideo, 1);

View file

@ -48,7 +48,7 @@ export class PageProfilUserComponent implements OnInit
ngOnInit(): void
{
this.messageService
.get( "user/findOne/"+this.profilService.id)
.get( "user/findOne/"+this.profilService.getId())
.subscribe( retour => this.ngOnInitCallback(retour), err => this.ngOnInitCallback(err) )
}
@ -60,7 +60,6 @@ export class PageProfilUserComponent implements OnInit
}
else {
this.user = retour.data;
this.profilService.id = retour.data.id;
}
}

View file

@ -70,7 +70,7 @@ export class PopupUpdateUserComponent implements OnInit
interests: this.userCopy.interests,
};
this.messageService
.put("user/update/"+this.profilService.id, data)
.put("user/update/"+this.profilService.getId(), data)
.subscribe( ret => this.onValiderCallback(ret), err => this.onValiderCallback(err) );
}
}
@ -83,6 +83,7 @@ export class PopupUpdateUserComponent implements OnInit
this.dialogRef.close(null);
}
else {
this.profilService.setProfileImageUrl(this.userCopy.profileImageUrl);
this.dialogRef.close(this.userCopy);
}
}

View file

@ -45,9 +45,6 @@ export class PageSearchComponent implements OnInit
adCallback(retour: any): void
{
console.log("adCallback retour:");
console.log(retour);
if(retour.status !== "success") {
//console.log(retour);
}

View file

@ -11,6 +11,7 @@
max-height: 100%;
border: solid 3px black;
vertical-align: middle;
cursor: pointer;
}
.helper {
@ -27,6 +28,7 @@
border: solid 3px black;
position: fixed;
left: 1vw;
cursor: pointer;
}
#imgFromWatchingRight {
@ -35,4 +37,5 @@
border: solid 3px black;
position: fixed;
right: 1vw;
cursor: pointer;
}

View file

@ -32,7 +32,9 @@ export class AdvertComponent implements OnChanges
onClick(): void
{
if(this.ad.url !== "") document.location.href = this.ad.url;
if((this.ad.url !== "") && (this.ad.url !== null) && (this.ad.url !== undefined)) {
document.location.href = this.ad.url;
}
}
}

View file

@ -27,7 +27,7 @@
<!-- Mon profil -->
<img [src]=profilService.profileImageUrl
<img [src]=profilService.getProfileImageUrl()
onerror="this.onerror=null; this.src='assets/profil.png'"
[routerLink]="routes[4]"
alt="">