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

View file

@ -0,0 +1 @@
{"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_"}],"uuid":"f9864709869549bfbc1b1ec367f5fa02"}

View file

View file

@ -0,0 +1 @@
{"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_"}],"uuid":"666ca4f24afb452da1676bf59b8a8305"}

View file

View file

@ -0,0 +1 @@
{"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_"}],"uuid":"bc2e321e20bc47f4b48e6dae54975c3d"}

View file

View file

@ -0,0 +1 @@
{"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_"}],"uuid":"b63ee8164a2c45c0b7e2f2b831197a48"}

View file

@ -48,7 +48,7 @@ export class PageProfilAdminComponent 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 PageProfilAdminComponent implements OnInit
}
else {
this.admin = retour.data;
this.profilService.id = retour.data.id;
}
}

View file

@ -67,7 +67,7 @@ export class PopupUpdateAdminComponent implements OnInit
profileImageUrl: this.adminCopy.profileImageUrl,
};
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) );
}
}
@ -80,6 +80,7 @@ export class PopupUpdateAdminComponent implements OnInit
this.dialogRef.close(null);
}
else {
this.profilService.setProfileImageUrl(this.adminCopy.profileImageUrl);
this.dialogRef.close(this.adminCopy);
}
}

View file

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

View file

@ -48,7 +48,7 @@ export class PageProfilAdvertiserComponent 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 PageProfilAdvertiserComponent implements OnInit
}
else {
this.advertiser = retour.data;
this.profilService.id = retour.data.id;
}
}

View file

@ -68,7 +68,7 @@ export class PopupUpdateAdvertiserComponent implements OnInit
company: this.advertiserCopy.company
};
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) );
}
}
@ -81,6 +81,7 @@ export class PopupUpdateAdvertiserComponent implements OnInit
this.dialogRef.close(null);
}
else {
this.profilService.setProfileImageUrl(this.advertiserCopy.profileImageUrl);
this.dialogRef.close(this.advertiserCopy);
}
}

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="">

View file

@ -58,8 +58,8 @@ export class PageLoginComponent implements OnInit
this.hasError = true;
}
else {
this.profilService.id = retour.data.id;
this.profilService.profileImageUrl = retour.data.profileImageUrl;
this.profilService.setId(retour.data.id);
this.profilService.setProfileImageUrl(retour.data.profileImageUrl);
if(retour.data.role.name === "user") this.router.navigateByUrl( '/user/search');
else if(retour.data.role.name === "advertiser") this.router.navigateByUrl( '/advertiser/adList');
else if(retour.data.role.name === "admin" || retour.data.role.name === "superAdmin") this.router.navigateByUrl( '/admin/userList');

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="">

View file

@ -1,10 +1,30 @@
import { Injectable } from '@angular/core';
import {Injectable} from '@angular/core';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class ProfilService
{
public id: string = "" ;
public profileImageUrl: string = "";
getId(): string
{
return localStorage.getItem('id');
}
getProfileImageUrl(): string
{
return localStorage.getItem('profileImageUrl');
}
setId(id: string): void
{
localStorage.setItem('id', id);
}
setProfileImageUrl(profileImageUrl: string): void
{
localStorage.setItem('profileImageUrl', profileImageUrl);
}
}