diff --git a/package.json b/package.json
index dd9a09c..baf5802 100644
--- a/package.json
+++ b/package.json
@@ -14,8 +14,10 @@
"dependencies": {
"@angular/animations": "^12.2.11",
"@angular/cdk": "^12.2.11",
+ "@angular/cli": "~12.2.11",
"@angular/common": "^12.2.11",
"@angular/compiler": "^12.2.11",
+ "@angular/compiler-cli": "~12.2.11",
"@angular/core": "^12.2.11",
"@angular/forms": "^12.2.11",
"@angular/material": "^12.2.11",
@@ -24,28 +26,27 @@
"@angular/router": "^12.2.11",
"@ng-bootstrap/ng-bootstrap": "^10.0.0",
"angular-responsive-carousel": "^2.1.2",
- "bootstrap": "^5.1.3",
- "jquery": "^3.6.0",
- "popper": "^1.0.1",
- "rxjs": "~6.6.0",
- "tslib": "^2.0.0",
- "zone.js": "~0.11.3",
- "@angular/cli": "~12.2.11",
- "@angular/compiler-cli": "~12.2.11",
- "typescript": "~4.3.5",
"body-parser": "^1.19.0",
+ "bootstrap": "^5.1.3",
+ "chart.js": "^2.9.3",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"express": "^4.17.1",
+ "jquery": "^3.6.0",
"jsonwebtoken": "^8.5.1",
- "mongoose": "^6.0.12"
+ "mongoose": "^6.0.12",
+ "ng2-charts": "^2.2.3",
+ "popper": "^1.0.1",
+ "rxjs": "~6.6.0",
+ "tslib": "^2.0.0",
+ "typescript": "~4.3.5",
+ "zone.js": "~0.11.3"
},
"devDependencies": {
+ "@angular-devkit/build-angular": "~12.2.11",
"@angular/cli": "~12.2.11",
"@angular/compiler-cli": "~12.2.11",
- "typescript": "~4.3.5",
- "@angular-devkit/build-angular": "~12.2.11",
"@angular/localize": "^12.2.11",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
@@ -59,6 +60,7 @@
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
- "tslint": "~6.1.0"
+ "tslint": "~6.1.0",
+ "typescript": "~4.3.5"
}
}
diff --git a/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.html b/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.html
index 41e464d..d5d233a 100644
--- a/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.html
+++ b/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.html
@@ -21,7 +21,7 @@
-
+
@@ -30,18 +30,18 @@
non visible
-
+
- Tags
-
+ Sujets
+
- {{formControlTags.value ? formControlTags.value[0] : ''}}
- 1">
- (+{{formControlTags.value.length - 1}} {{formControlTags.value?.length === 2 ? 'autre' : 'autres'}})
+ {{formControlInterests.value ? formControlInterests.value[0] : ''}}
+ 1">
+ (+{{formControlInterests.value.length - 1}} {{formControlInterests.value?.length === 2 ? 'autre' : 'autres'}})
- {{topping}}
+ {{topping}}
diff --git a/src/app/admin/userList/popup-create-user/popup-create-user.component.ts b/src/app/admin/userList/popup-create-user/popup-create-user.component.ts
index 1b88942..141fe53 100644
--- a/src/app/admin/userList/popup-create-user/popup-create-user.component.ts
+++ b/src/app/admin/userList/popup-create-user/popup-create-user.component.ts
@@ -38,6 +38,7 @@ export class PopupCreateUserComponent implements OnInit
dateOfBirth: null,
gender: "man",
interests: [],
+ company: "",
isActive: false,
isAccepted: false,
createdAt: new Date(),
@@ -65,19 +66,15 @@ export class PopupCreateUserComponent implements OnInit
checkField(): void
{
if(this.user.login.length === 0) {
- this.errorMessage = "Veuillez remplir le champ 'login'.";
+ this.errorMessage = "Veuillez remplir le champ 'pseudo'.";
this.hasError = true;
}
else if(this.user.email.length === 0) {
this.errorMessage = "Veuillez remplir le champ 'email'.";
this.hasError = true;
}
- if((this.user.role.name === 'user') && ((this.user.dateOfBirth === undefined) || (this.user.dateOfBirth === null))) {
- this.errorMessage = "Veuillez remplir le champ 'date de naissance'.";
- this.hasError = true;
- }
else if(!this.isValidEmail(this.user.email)) {
- this.errorMessage = "Email invalide";
+ this.errorMessage = "Email invalide.";
this.hasError = true;
}
else if(this.password.length === 0) {
@@ -88,6 +85,14 @@ export class PopupCreateUserComponent implements OnInit
this.errorMessage = "Le mot de passe est différent de sa confirmation.";
this.hasError = true;
}
+ else if((this.user.role.name === 'user') && ((this.user.dateOfBirth === undefined) || (this.user.dateOfBirth === null))) {
+ this.errorMessage = "Veuillez remplir le champ 'date de naissance'.";
+ this.hasError = true;
+ }
+ else if((this.user.role.name === 'advertiser') && (this.user.company.length === 0)) {
+ this.errorMessage = "Veuillez remplir le champ 'entreprise'.";
+ this.hasError = true;
+ }
else {
this.errorMessage = "" ;
this.hasError = false;
diff --git a/src/app/admin/userList/popup-visualize-user/popup-visualize-user.component.html b/src/app/admin/userList/popup-visualize-user/popup-visualize-user.component.html
index 89124e7..3e0bf70 100644
--- a/src/app/admin/userList/popup-visualize-user/popup-visualize-user.component.html
+++ b/src/app/admin/userList/popup-visualize-user/popup-visualize-user.component.html
@@ -62,7 +62,7 @@
Rôle:
Utilisateur
- Annonceur
+ Annonceur
Admin
diff --git a/src/app/admin/navbar-admin/navbar-admin.component.html b/src/app/admin/utils/navbar-admin/navbar-admin.component.html
similarity index 60%
rename from src/app/admin/navbar-admin/navbar-admin.component.html
rename to src/app/admin/utils/navbar-admin/navbar-admin.component.html
index 563792a..90f0cbc 100644
--- a/src/app/admin/navbar-admin/navbar-admin.component.html
+++ b/src/app/admin/utils/navbar-admin/navbar-admin.component.html
@@ -6,24 +6,29 @@
-
+
+
+
+