image video à la place de iframe

This commit is contained in:
MiharyR 2021-11-19 15:42:51 +01:00
parent 500b32626e
commit b045f507d2
92 changed files with 945 additions and 656 deletions

View file

@ -2,11 +2,13 @@ import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} f
import {COMMA, ENTER} from "@angular/cdk/keycodes";
import {FormControl} from "@angular/forms";
import {Observable} from "rxjs";
import {FictitiousDatasService} from "../../../utils/services/fictitiousDatas/fictitious-datas.service";
import {MessageService} from "../../../utils/services/message/message.service";
import {map, startWith} from "rxjs/operators";
import {MatChipInputEvent} from "@angular/material/chips";
import {MatAutocompleteSelectedEvent} from "@angular/material/autocomplete";
import {FictitiousUtilsService} from "../../../utils/services/fictitiousDatas/fictitiousUtils/fictitious-utils.service";
@Component({
selector: 'app-input-interests-admin',
@ -26,7 +28,7 @@ export class InputInterestsAdminComponent implements OnInit
@ViewChild('tagInput') tagInput: ElementRef<HTMLInputElement>;
constructor( private fictitiousDatasService: FictitiousDatasService,
constructor( private fictitiousUtilsService: FictitiousUtilsService,
private messageService: MessageService ) {}
@ -37,7 +39,7 @@ export class InputInterestsAdminComponent implements OnInit
map((fruit: string | null) => fruit ? this._filter(fruit) : this.allInterests.slice()));
// --- FAUX CODE ---
this.allInterests = this.fictitiousDatasService.getTags();
this.allInterests = this.fictitiousUtilsService.getTags();
this.allInterests.sort();
}

View file

@ -49,10 +49,10 @@
</ng-container>
<!-- Mail Column -->
<ng-container matColumnDef="mail">
<ng-container matColumnDef="email">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Mail </th>
<td mat-cell *matCellDef="let user">
{{user.mail}}
{{user.email}}
</td>
</ng-container>

View file

@ -2,7 +2,6 @@ import {AfterViewInit, Component, ViewChild} from '@angular/core';
import {MatSort} from "@angular/material/sort";
import {MatPaginator} from "@angular/material/paginator";
import {ThemeService} from "../../../utils/services/theme/theme.service";
import {FictitiousDatasService} from "../../../utils/services/fictitiousDatas/fictitious-datas.service";
import {MatDialog} from "@angular/material/dialog";
import {MatSnackBar} from "@angular/material/snack-bar";
import {MatTableDataSource} from "@angular/material/table";
@ -10,6 +9,7 @@ import {User} from "../../../utils/interfaces/user";
import {PopupVisualizeUserComponent} from "../popup-visualize-user/popup-visualize-user.component";
import {PopupDeleteUserComponent} from "../popup-delete-user/popup-delete-user.component";
import {PopupCreateUserComponent} from "../popup-create-user/popup-create-user.component";
import {FictitiousUsersService} from "../../../utils/services/fictitiousDatas/fictitiousUsers/fictitious-users.service";
@ -21,9 +21,9 @@ import {PopupCreateUserComponent} from "../popup-create-user/popup-create-user.c
export class PageUserListComponent implements AfterViewInit
{
displayedColumns: string[];
displayedColumnsUser: string[] = [ 'login', 'mail', 'dateOfBirth', 'age', 'sexe', 'interests', 'createdAt', 'lastConnexion', 'actions' ];
displayedColumnsAdvertiser: string[] = [ 'login', 'mail', 'createdAt', 'lastConnexion', 'isAccepted', 'actions' ];
displayedColumnsAdmin: string[] = [ 'login', 'mail', 'createdAt', 'lastConnexion', 'actions' ];
displayedColumnsUser: string[] = [ 'login', 'email', 'dateOfBirth', 'age', 'sexe', 'interests', 'createdAt', 'lastConnexion', 'actions' ];
displayedColumnsAdvertiser: string[] = [ 'login', 'email', 'createdAt', 'lastConnexion', 'isAccepted', 'actions' ];
displayedColumnsAdmin: string[] = [ 'login', 'email', 'createdAt', 'lastConnexion', 'actions' ];
tabUser: any[] = [];
tabAdvertiser: User[] = [];
@ -36,7 +36,7 @@ export class PageUserListComponent implements AfterViewInit
constructor( public themeService: ThemeService,
private fictitiousDatasService: FictitiousDatasService,
private fictitiousUsersService: FictitiousUsersService,
public dialog: MatDialog,
private snackBar: MatSnackBar ) { }
@ -44,9 +44,9 @@ export class PageUserListComponent implements AfterViewInit
ngAfterViewInit(): void
{
// --- FAUX CODE ---
this.tabUser = this.fictitiousDatasService.getTabUser(32);
this.tabAdvertiser = this.fictitiousDatasService.getTabAdvertiser(8);
this.tabAdmin = this.fictitiousDatasService.getTabAdmin(4);
this.tabUser = this.fictitiousUsersService.getTabUser(32);
this.tabAdvertiser = this.fictitiousUsersService.getTabAdvertiser(8);
this.tabAdmin = this.fictitiousUsersService.getTabAdmin(4);
for(const user of this.tabUser) user.age = this.getAge(user.dateOfBirth);

View file

@ -41,8 +41,8 @@
<!-- photo de profil -->
<div style="text-align: center">
<img [src]="user.profilePictureUrl" onerror="this.onerror=null; this.src='assets/profil.png'"><br>
<input title="lien vers image" type="text" [(ngModel)]="user.profilePictureUrl" style="width: 90%">
<img [src]="user.profileImageUrl" onerror="this.onerror=null; this.src='assets/profil.png'"><br>
<input title="lien vers image" type="text" [(ngModel)]="user.profileImageUrl" style="width: 90%">
</div><br>
<div class="row">
@ -53,7 +53,7 @@
<!-- Email -->
<mat-form-field appearance="fill">
<mat-label>Email</mat-label>
<input matInput type="email" [(ngModel)]="user.mail" required>
<input matInput type="email" [(ngModel)]="user.email" required>
</mat-form-field><br>
<!-- Login -->
@ -113,14 +113,14 @@
<!-- photo de profil -->
<div style="text-align: center">
<img [src]="user.profilePictureUrl" onerror="this.onerror=null; this.src='assets/profil.png'"><br>
<input title="lien vers image" type="text" [(ngModel)]="user.profilePictureUrl" style="width: 90%">
<img [src]="user.profileImageUrl" onerror="this.onerror=null; this.src='assets/profil.png'"><br>
<input title="lien vers image" type="text" [(ngModel)]="user.profileImageUrl" style="width: 90%">
</div><br>
<!-- email -->
<mat-form-field appearance="fill">
<mat-label>Email</mat-label>
<input matInput type="text" [(ngModel)]="user.mail">
<input matInput type="text" [(ngModel)]="user.email">
</mat-form-field><br>
<!-- login -->

View file

@ -29,12 +29,12 @@ export class PopupCreateUserComponent implements OnInit
_id: "",
login: "",
hashPass: "",
mail: "",
email: "",
role: {
name: "",
permission: 0,
},
profilePictureUrl: "",
profileImageUrl: "",
dateOfBirth: null,
gender: "man",
interests: [],
@ -68,7 +68,7 @@ export class PopupCreateUserComponent implements OnInit
this.errorMessage = "Veuillez remplir le champ 'login'.";
this.hasError = true;
}
else if(this.user.mail.length === 0) {
else if(this.user.email.length === 0) {
this.errorMessage = "Veuillez remplir le champ 'email'.";
this.hasError = true;
}
@ -76,7 +76,7 @@ export class PopupCreateUserComponent implements OnInit
this.errorMessage = "Veuillez remplir le champ 'date de naissance'.";
this.hasError = true;
}
else if(!this.isValidEmail(this.user.mail)) {
else if(!this.isValidEmail(this.user.email)) {
this.errorMessage = "Email invalide";
this.hasError = true;
}

View file

@ -12,7 +12,7 @@
<div class="col-6 myValue"> {{user.login}} </div>
</div>
<!-- mail -->
<!-- email -->
<div class="row myRow">
<div class="col-6 myLabel">Mail:</div>
<div class="col-6 myValue"> {{user.mail}} </div>