diff --git a/admin/.browserslistrc b/admin/.browserslistrc new file mode 100644 index 0000000..427441d --- /dev/null +++ b/admin/.browserslistrc @@ -0,0 +1,17 @@ +# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries + +# For the full list of supported browsers by the Angular framework, please see: +# https://angular.io/guide/browser-support + +# You can see what browsers were selected by your queries by running: +# npx browserslist + +last 1 Chrome version +last 1 Firefox version +last 2 Edge major versions +last 2 Safari major versions +last 2 iOS major versions +Firefox ESR +not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. diff --git a/admin/.editorconfig b/admin/.editorconfig new file mode 100644 index 0000000..59d9a3a --- /dev/null +++ b/admin/.editorconfig @@ -0,0 +1,16 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.ts] +quote_type = single + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/admin/.gitignore b/admin/.gitignore new file mode 100644 index 0000000..de51f68 --- /dev/null +++ b/admin/.gitignore @@ -0,0 +1,45 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc +# Only exists if Bazel was run +/bazel-out + +# dependencies +/node_modules + +# profiling files +chrome-profiler-events*.json + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# System Files +.DS_Store +Thumbs.db diff --git a/admin/README.md b/admin/README.md new file mode 100644 index 0000000..a653293 --- /dev/null +++ b/admin/README.md @@ -0,0 +1,27 @@ +# Admin + +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.10. + +## Development server + +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. + +## Code scaffolding + +Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. + +## Build + +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. + +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/angular.json b/admin/angular.json similarity index 57% rename from angular.json rename to admin/angular.json index 4f6d04d..62b77eb 100644 --- a/angular.json +++ b/admin/angular.json @@ -3,11 +3,14 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "frontend": { + "admin": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" + }, + "@schematics/angular:application": { + "strict": true } }, "root": "", @@ -17,12 +20,12 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "dist/frontend", + "outputPath": "dist/admin", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", - "aot": true, + "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", "src/assets" @@ -32,56 +35,57 @@ "src/styles.scss", "node_modules/bootstrap/scss/bootstrap.scss" ], - "scripts": [ - "node_modules/jquery/dist/jquery.js", - "node_modules/bootstrap/dist/js/bootstrap.js" - ] + "scripts": [] }, "configurations": { "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], - "optimization": true, - "outputHashing": "all", - "sourceMap": false, - "namedChunks": false, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, - "budgets": [ - { - "type": "initial", - "maximumWarning": "2mb", - "maximumError": "5mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "6kb", - "maximumError": "10kb" - } - ] + "outputHashing": "all" + }, + "development": { + "buildOptimizer": false, + "optimization": false, + "vendorChunk": true, + "extractLicenses": false, + "sourceMap": true, + "namedChunks": true } - } + }, + "defaultConfiguration": "production" }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "frontend:build" - }, "configurations": { "production": { - "browserTarget": "frontend:build:production" + "browserTarget": "admin:build:production" + }, + "development": { + "browserTarget": "admin:build:development" } - } + }, + "defaultConfiguration": "development" }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "frontend:build" + "browserTarget": "admin:build" } }, "test": { @@ -91,44 +95,19 @@ "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", + "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ - "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.scss" ], "scripts": [] } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "tsconfig.app.json", - "tsconfig.spec.json", - "e2e/tsconfig.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } - }, - "e2e": { - "builder": "@angular-devkit/build-angular:protractor", - "options": { - "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "frontend:serve" - }, - "configurations": { - "production": { - "devServerTarget": "frontend:serve:production" - } - } } } } }, - "defaultProject": "frontend" + "defaultProject": "admin" } diff --git a/karma.conf.js b/admin/karma.conf.js similarity index 95% rename from karma.conf.js rename to admin/karma.conf.js index 3635639..2023ed1 100644 --- a/karma.conf.js +++ b/admin/karma.conf.js @@ -25,7 +25,7 @@ module.exports = function (config) { suppressAll: true // removes the duplicated traces }, coverageReporter: { - dir: require('path').join(__dirname, './coverage/frontend'), + dir: require('path').join(__dirname, './coverage/admin'), subdir: '.', reporters: [ { type: 'html' }, diff --git a/admin/package.json b/admin/package.json new file mode 100644 index 0000000..1e0e314 --- /dev/null +++ b/admin/package.json @@ -0,0 +1,44 @@ +{ + "name": "admin", + "version": "0.0.0", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "watch": "ng build --watch --configuration development", + "test": "ng test" + }, + "private": true, + "dependencies": { + "@angular/animations": "~12.2.0", + "@angular/cdk": "^13.1.1", + "@angular/common": "~12.2.0", + "@angular/compiler": "~12.2.0", + "@angular/core": "~12.2.0", + "@angular/forms": "~12.2.0", + "@angular/material": "^13.1.1", + "@angular/platform-browser": "~12.2.0", + "@angular/platform-browser-dynamic": "~12.2.0", + "@angular/router": "~12.2.0", + "bootstrap": "^5.1.3", + "jquery": "^3.6.0", + "popper": "^1.0.1", + "rxjs": "~6.6.0", + "tslib": "^2.3.0", + "zone.js": "~0.11.4" + }, + "devDependencies": { + "@angular-devkit/build-angular": "~12.2.10", + "@angular/cli": "~12.2.10", + "@angular/compiler-cli": "~12.2.0", + "@types/jasmine": "~3.8.0", + "@types/node": "^12.11.1", + "jasmine-core": "~3.8.0", + "karma": "~6.3.0", + "karma-chrome-launcher": "~3.1.0", + "karma-coverage": "~2.0.3", + "karma-jasmine": "~4.0.0", + "karma-jasmine-html-reporter": "~1.7.0", + "typescript": "~4.3.5" + } +} diff --git a/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.html b/admin/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.html similarity index 100% rename from src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.html rename to admin/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.html diff --git a/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.scss b/admin/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.scss similarity index 100% rename from src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.scss rename to admin/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.scss diff --git a/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.spec.ts b/admin/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.spec.ts similarity index 100% rename from src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.spec.ts rename to admin/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.spec.ts diff --git a/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.ts b/admin/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.ts similarity index 94% rename from src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.ts rename to admin/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.ts index 3b89012..a0fa87f 100644 --- a/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.ts +++ b/admin/src/app/admin/adList/page-ad-list-admin/page-ad-list-admin.component.ts @@ -1,16 +1,15 @@ 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 {MatDialog} from "@angular/material/dialog"; import {MatSnackBar} from "@angular/material/snack-bar"; import {MatTableDataSource} from "@angular/material/table"; -import {Advert} from "../../../utils/interfaces/advert"; import {PopupDeleteAdAdminComponent} from "../popup-delete-ad-admin/popup-delete-ad-admin.component"; import {PopupVisualizeImagesAdminComponent} from "../popup-visualize-images-admin/popup-visualize-images-admin.component"; import {FormControl} from "@angular/forms"; -import {MessageService} from "../../../utils/services/message/message.service"; import {HttpParams} from "@angular/common/http"; +import {ThemeService} from "../../../utils/theme/theme.service"; +import {MessageService} from "../../../utils/message/message.service"; @@ -35,11 +34,10 @@ export interface AdvertWithCountViewsAndCompany { } - @Component({ - selector: 'app-page-ad-list-admin', - templateUrl: './page-ad-list-admin.component.html', - styleUrls: ['./page-ad-list-admin.component.scss'] + selector: 'app-page-ad-list-admin', + templateUrl: './page-ad-list-admin.component.html', + styleUrls: ['./page-ad-list-admin.component.scss'] }) export class PageAdListAdminComponent implements AfterViewInit { @@ -102,7 +100,7 @@ export class PageAdListAdminComponent implements AfterViewInit else { this.tabAdvertiser = retour.data.filter(x => x.role.name === "advertiser"); for(let advert of tabAdvert) this.tabAdvertWithCountViews.push(this.advertToAdvertWithCountViewsAndCompany(advert)); - this.dataSource = new MatTableDataSource(); + this.dataSource = new MatTableDataSource(); this.onFilter(); } } diff --git a/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.html b/admin/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.html similarity index 100% rename from src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.html rename to admin/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.html diff --git a/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.scss b/admin/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.scss similarity index 100% rename from src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.scss rename to admin/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.scss diff --git a/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.spec.ts b/admin/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.spec.ts similarity index 100% rename from src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.spec.ts rename to admin/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.spec.ts diff --git a/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.ts b/admin/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.ts similarity index 80% rename from src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.ts rename to admin/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.ts index 196f024..8470921 100644 --- a/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.ts +++ b/admin/src/app/admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component.ts @@ -1,13 +1,11 @@ import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../utils/services/message/message.service"; - - +import {MessageService} from "../../../utils/message/message.service"; @Component({ - selector: 'app-popup-delete-ad-admin', - templateUrl: './popup-delete-ad-admin.component.html', - styleUrls: ['./popup-delete-ad-admin.component.scss'] + selector: 'app-popup-delete-ad-admin', + templateUrl: './popup-delete-ad-admin.component.html', + styleUrls: ['./popup-delete-ad-admin.component.scss'] }) export class PopupDeleteAdAdminComponent implements OnInit { diff --git a/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.html b/admin/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.html similarity index 100% rename from src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.html rename to admin/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.html diff --git a/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.scss b/admin/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.scss similarity index 100% rename from src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.scss rename to admin/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.scss diff --git a/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.spec.ts b/admin/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.spec.ts similarity index 100% rename from src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.spec.ts rename to admin/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.spec.ts diff --git a/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.ts b/admin/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.ts similarity index 99% rename from src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.ts rename to admin/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.ts index 5b98819..634d051 100644 --- a/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.ts +++ b/admin/src/app/admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component.ts @@ -1,15 +1,12 @@ import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; - - @Component({ selector: 'app-popup-visualize-images-admin', templateUrl: './popup-visualize-images-admin.component.html', styleUrls: ['./popup-visualize-images-admin.component.scss'] }) -export class PopupVisualizeImagesAdminComponent implements OnInit -{ +export class PopupVisualizeImagesAdminComponent implements OnInit { tabImages = []; index: number = 0; nbImage: number = 0; diff --git a/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.html b/admin/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.html similarity index 100% rename from src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.html rename to admin/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.html diff --git a/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.scss b/admin/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.scss similarity index 100% rename from src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.scss rename to admin/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.scss diff --git a/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.spec.ts b/admin/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.spec.ts similarity index 100% rename from src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.spec.ts rename to admin/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.spec.ts diff --git a/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.ts b/admin/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.ts similarity index 82% rename from src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.ts rename to admin/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.ts index 75e599f..a282706 100644 --- a/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.ts +++ b/admin/src/app/admin/myProfil/page-profil-admin/page-profil-admin.component.ts @@ -1,22 +1,19 @@ import { Component, OnInit } from '@angular/core'; -import {User} from "../../../utils/interfaces/user"; -import {ThemeService} from "../../../utils/services/theme/theme.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; import {MatDialog} from "@angular/material/dialog"; import {MatSnackBar} from "@angular/material/snack-bar"; +import {MessageService} from "../../../utils/message/message.service"; +import {ProfilService} from "../../../utils/profil/profil.service"; import {PopupUpdateAdminComponent} from "../popup-update-admin/popup-update-admin.component"; -import {MessageService} from "../../../utils/services/message/message.service"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; - - @Component({ - selector: 'app-page-profil-admin', - templateUrl: './page-profil-admin.component.html', - styleUrls: ['./page-profil-admin.component.scss'] + selector: 'app-page-profil-admin', + templateUrl: './page-profil-admin.component.html', + styleUrls: ['./page-profil-admin.component.scss'] }) export class PageProfilAdminComponent implements OnInit { - admin: User = { + admin = { _id: "", login: "", hashPass: "", diff --git a/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.html b/admin/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.html similarity index 100% rename from src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.html rename to admin/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.html diff --git a/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.scss b/admin/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.scss similarity index 100% rename from src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.scss rename to admin/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.scss diff --git a/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.spec.ts b/admin/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.spec.ts similarity index 100% rename from src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.spec.ts rename to admin/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.spec.ts diff --git a/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.ts b/admin/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.ts similarity index 90% rename from src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.ts rename to admin/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.ts index 39bb3f0..2e11b68 100644 --- a/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.ts +++ b/admin/src/app/admin/myProfil/popup-update-admin/popup-update-admin.component.ts @@ -1,19 +1,17 @@ import {Component, Inject, OnInit} from '@angular/core'; -import {User} from "../../../utils/interfaces/user"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../utils/services/message/message.service"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; - +import {MessageService} from "../../../utils/message/message.service"; +import {ProfilService} from "../../../utils/profil/profil.service"; @Component({ - selector: 'app-popup-update-admin', - templateUrl: './popup-update-admin.component.html', - styleUrls: ['./popup-update-admin.component.scss'] + selector: 'app-popup-update-admin', + templateUrl: './popup-update-admin.component.html', + styleUrls: ['./popup-update-admin.component.scss'] }) export class PopupUpdateAdminComponent implements OnInit { - adminCopy: User; + adminCopy; newPassword: string = ""; confirmNewPassword: string = "" ; changePassword: boolean = false ; diff --git a/src/app/admin/userList/input-interests-admin/input-interests-admin.component.html b/admin/src/app/admin/userList/input-interests-admin/input-interests-admin.component.html similarity index 100% rename from src/app/admin/userList/input-interests-admin/input-interests-admin.component.html rename to admin/src/app/admin/userList/input-interests-admin/input-interests-admin.component.html diff --git a/src/app/admin/userList/input-interests-admin/input-interests-admin.component.scss b/admin/src/app/admin/userList/input-interests-admin/input-interests-admin.component.scss similarity index 100% rename from src/app/admin/userList/input-interests-admin/input-interests-admin.component.scss rename to admin/src/app/admin/userList/input-interests-admin/input-interests-admin.component.scss diff --git a/src/app/admin/userList/input-interests-admin/input-interests-admin.component.spec.ts b/admin/src/app/admin/userList/input-interests-admin/input-interests-admin.component.spec.ts similarity index 100% rename from src/app/admin/userList/input-interests-admin/input-interests-admin.component.spec.ts rename to admin/src/app/admin/userList/input-interests-admin/input-interests-admin.component.spec.ts diff --git a/src/app/admin/userList/input-interests-admin/input-interests-admin.component.ts b/admin/src/app/admin/userList/input-interests-admin/input-interests-admin.component.ts similarity index 98% rename from src/app/admin/userList/input-interests-admin/input-interests-admin.component.ts rename to admin/src/app/admin/userList/input-interests-admin/input-interests-admin.component.ts index 72ead85..c0b3560 100644 --- a/src/app/admin/userList/input-interests-admin/input-interests-admin.component.ts +++ b/admin/src/app/admin/userList/input-interests-admin/input-interests-admin.component.ts @@ -2,10 +2,10 @@ 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 {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 {MessageService} from "../../../utils/message/message.service"; diff --git a/src/app/admin/userList/page-user-list/page-user-list.component.html b/admin/src/app/admin/userList/page-user-list/page-user-list.component.html similarity index 100% rename from src/app/admin/userList/page-user-list/page-user-list.component.html rename to admin/src/app/admin/userList/page-user-list/page-user-list.component.html diff --git a/src/app/admin/userList/page-user-list/page-user-list.component.scss b/admin/src/app/admin/userList/page-user-list/page-user-list.component.scss similarity index 100% rename from src/app/admin/userList/page-user-list/page-user-list.component.scss rename to admin/src/app/admin/userList/page-user-list/page-user-list.component.scss diff --git a/src/app/admin/userList/page-user-list/page-user-list.component.spec.ts b/admin/src/app/admin/userList/page-user-list/page-user-list.component.spec.ts similarity index 100% rename from src/app/admin/userList/page-user-list/page-user-list.component.spec.ts rename to admin/src/app/admin/userList/page-user-list/page-user-list.component.spec.ts diff --git a/src/app/admin/userList/page-user-list/page-user-list.component.ts b/admin/src/app/admin/userList/page-user-list/page-user-list.component.ts similarity index 96% rename from src/app/admin/userList/page-user-list/page-user-list.component.ts rename to admin/src/app/admin/userList/page-user-list/page-user-list.component.ts index 42e0dad..995b053 100644 --- a/src/app/admin/userList/page-user-list/page-user-list.component.ts +++ b/admin/src/app/admin/userList/page-user-list/page-user-list.component.ts @@ -1,20 +1,19 @@ 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 {MatDialog} from "@angular/material/dialog"; import {MatSnackBar} from "@angular/material/snack-bar"; import {MatTableDataSource} from "@angular/material/table"; import {PopupDeleteUserComponent} from "../popup-delete-user/popup-delete-user.component"; import {PopupCreateUserComponent} from "../popup-create-user/popup-create-user.component"; -import {MessageService} from "../../../utils/services/message/message.service"; - +import {ThemeService} from "../../../utils/theme/theme.service"; +import {MessageService} from "../../../utils/message/message.service"; @Component({ - selector: 'app-page-user-list', - templateUrl: './page-user-list.component.html', - styleUrls: ['./page-user-list.component.scss'] + selector: 'app-page-user-list', + templateUrl: './page-user-list.component.html', + styleUrls: ['./page-user-list.component.scss'] }) export class PageUserListComponent implements AfterViewInit { diff --git a/src/app/admin/userList/popup-create-user/popup-create-user.component.html b/admin/src/app/admin/userList/popup-create-user/popup-create-user.component.html similarity index 100% rename from src/app/admin/userList/popup-create-user/popup-create-user.component.html rename to admin/src/app/admin/userList/popup-create-user/popup-create-user.component.html diff --git a/src/app/admin/userList/popup-create-user/popup-create-user.component.scss b/admin/src/app/admin/userList/popup-create-user/popup-create-user.component.scss similarity index 100% rename from src/app/admin/userList/popup-create-user/popup-create-user.component.scss rename to admin/src/app/admin/userList/popup-create-user/popup-create-user.component.scss diff --git a/src/app/admin/userList/popup-create-user/popup-create-user.component.spec.ts b/admin/src/app/admin/userList/popup-create-user/popup-create-user.component.spec.ts similarity index 100% rename from src/app/admin/userList/popup-create-user/popup-create-user.component.spec.ts rename to admin/src/app/admin/userList/popup-create-user/popup-create-user.component.spec.ts diff --git a/src/app/admin/userList/popup-create-user/popup-create-user.component.ts b/admin/src/app/admin/userList/popup-create-user/popup-create-user.component.ts similarity index 97% rename from src/app/admin/userList/popup-create-user/popup-create-user.component.ts rename to admin/src/app/admin/userList/popup-create-user/popup-create-user.component.ts index 40ca5cd..b5714a2 100644 --- a/src/app/admin/userList/popup-create-user/popup-create-user.component.ts +++ b/admin/src/app/admin/userList/popup-create-user/popup-create-user.component.ts @@ -1,8 +1,6 @@ import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../utils/services/message/message.service"; - - +import {MessageService} from "../../../utils/message/message.service"; @Component({ selector: 'app-popup-create-user', diff --git a/src/app/admin/userList/popup-delete-user/popup-delete-user.component.html b/admin/src/app/admin/userList/popup-delete-user/popup-delete-user.component.html similarity index 100% rename from src/app/admin/userList/popup-delete-user/popup-delete-user.component.html rename to admin/src/app/admin/userList/popup-delete-user/popup-delete-user.component.html diff --git a/src/app/admin/userList/popup-delete-user/popup-delete-user.component.scss b/admin/src/app/admin/userList/popup-delete-user/popup-delete-user.component.scss similarity index 100% rename from src/app/admin/userList/popup-delete-user/popup-delete-user.component.scss rename to admin/src/app/admin/userList/popup-delete-user/popup-delete-user.component.scss diff --git a/src/app/admin/userList/popup-delete-user/popup-delete-user.component.spec.ts b/admin/src/app/admin/userList/popup-delete-user/popup-delete-user.component.spec.ts similarity index 100% rename from src/app/admin/userList/popup-delete-user/popup-delete-user.component.spec.ts rename to admin/src/app/admin/userList/popup-delete-user/popup-delete-user.component.spec.ts diff --git a/admin/src/app/admin/userList/popup-delete-user/popup-delete-user.component.ts b/admin/src/app/admin/userList/popup-delete-user/popup-delete-user.component.ts new file mode 100644 index 0000000..cd8091c --- /dev/null +++ b/admin/src/app/admin/userList/popup-delete-user/popup-delete-user.component.ts @@ -0,0 +1,29 @@ +import {Component, Inject, OnInit} from '@angular/core'; +import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; +import {MessageService} from "../../../utils/message/message.service"; + +@Component({ + selector: 'app-popup-delete-user', + templateUrl: './popup-delete-user.component.html', + styleUrls: ['./popup-delete-user.component.scss'] +}) +export class PopupDeleteUserComponent implements OnInit +{ + user; + + constructor( public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data, + private messageService: MessageService ) { } + + ngOnInit(): void + { + this.user = this.data.user; + } + + onValidate(): void + { + // --- FAUX CODE --- + this.dialogRef.close(true); + } + +} diff --git a/src/app/admin/utils/navbar-admin/navbar-admin.component.html b/admin/src/app/admin/utils/navbar-admin/navbar-admin.component.html similarity index 100% rename from src/app/admin/utils/navbar-admin/navbar-admin.component.html rename to admin/src/app/admin/utils/navbar-admin/navbar-admin.component.html diff --git a/src/app/admin/utils/navbar-admin/navbar-admin.component.scss b/admin/src/app/admin/utils/navbar-admin/navbar-admin.component.scss similarity index 100% rename from src/app/admin/utils/navbar-admin/navbar-admin.component.scss rename to admin/src/app/admin/utils/navbar-admin/navbar-admin.component.scss diff --git a/src/app/admin/utils/navbar-admin/navbar-admin.component.spec.ts b/admin/src/app/admin/utils/navbar-admin/navbar-admin.component.spec.ts similarity index 100% rename from src/app/admin/utils/navbar-admin/navbar-admin.component.spec.ts rename to admin/src/app/admin/utils/navbar-admin/navbar-admin.component.spec.ts diff --git a/src/app/admin/utils/navbar-admin/navbar-admin.component.ts b/admin/src/app/admin/utils/navbar-admin/navbar-admin.component.ts similarity index 82% rename from src/app/admin/utils/navbar-admin/navbar-admin.component.ts rename to admin/src/app/admin/utils/navbar-admin/navbar-admin.component.ts index 5df617a..bbf07fb 100644 --- a/src/app/admin/utils/navbar-admin/navbar-admin.component.ts +++ b/admin/src/app/admin/utils/navbar-admin/navbar-admin.component.ts @@ -1,9 +1,7 @@ -import {Component} from '@angular/core'; +import { Component } from '@angular/core'; import {Router} from "@angular/router"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; -import {MessageService} from "../../../utils/services/message/message.service"; - - +import {ProfilService} from "../../../utils/profil/profil.service"; +import {MessageService} from "../../../utils/message/message.service"; @Component({ selector: 'app-navbar-admin', diff --git a/admin/src/app/app-routing.module.ts b/admin/src/app/app-routing.module.ts new file mode 100644 index 0000000..a61b1b1 --- /dev/null +++ b/admin/src/app/app-routing.module.ts @@ -0,0 +1,27 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import {PageLoginComponent} from "./beforeConnexion/login/page-login/page-login.component"; +import {PageRegisterComponent} from "./beforeConnexion/register/page-register/page-register.component"; +import {PageAdListAdminComponent} from "./admin/adList/page-ad-list-admin/page-ad-list-admin.component"; +import {PageProfilAdminComponent} from "./admin/myProfil/page-profil-admin/page-profil-admin.component"; +import {PageUserListComponent} from "./admin/userList/page-user-list/page-user-list.component"; + +const routes: Routes = [ + + // Before connexion + { path: '', component: PageLoginComponent }, + { path: 'login', component: PageLoginComponent }, + { path: 'register', component: PageRegisterComponent }, + + // Admin + { path: 'admin', component: PageUserListComponent }, + { path: 'admin/userList', component: PageUserListComponent }, + { path: 'admin/adList', component: PageAdListAdminComponent }, + { path: 'admin/myProfil', component: PageProfilAdminComponent }, +]; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule] +}) +export class AppRoutingModule { } diff --git a/admin/src/app/app.component.html b/admin/src/app/app.component.html new file mode 100644 index 0000000..d5d92f3 --- /dev/null +++ b/admin/src/app/app.component.html @@ -0,0 +1,2 @@ + + diff --git a/src/app/app.component.scss b/admin/src/app/app.component.scss similarity index 100% rename from src/app/app.component.scss rename to admin/src/app/app.component.scss diff --git a/src/app/app.component.spec.ts b/admin/src/app/app.component.spec.ts similarity index 77% rename from src/app/app.component.spec.ts rename to admin/src/app/app.component.spec.ts index 04c26ec..1391984 100644 --- a/src/app/app.component.spec.ts +++ b/admin/src/app/app.component.spec.ts @@ -20,16 +20,16 @@ describe('AppComponent', () => { expect(app).toBeTruthy(); }); - it(`should have as title 'frontend'`, () => { + it(`should have as title 'admin'`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; - expect(app.title).toEqual('frontend'); + expect(app.title).toEqual('admin'); }); it('should render title', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); - const compiled = fixture.nativeElement; - expect(compiled.querySelector('.content span').textContent).toContain('frontend app is running!'); + const compiled = fixture.nativeElement as HTMLElement; + expect(compiled.querySelector('.content span')?.textContent).toContain('admin app is running!'); }); }); diff --git a/src/app/app.component.ts b/admin/src/app/app.component.ts similarity index 80% rename from src/app/app.component.ts rename to admin/src/app/app.component.ts index 2cc7859..e81341b 100644 --- a/src/app/app.component.ts +++ b/admin/src/app/app.component.ts @@ -6,7 +6,5 @@ import { Component } from '@angular/core'; styleUrls: ['./app.component.scss'] }) export class AppComponent { - title = 'frontend'; - - themeIsLight = true; + title = 'admin'; } diff --git a/admin/src/app/app.module.ts b/admin/src/app/app.module.ts new file mode 100644 index 0000000..3537350 --- /dev/null +++ b/admin/src/app/app.module.ts @@ -0,0 +1,93 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; + +import { AppRoutingModule } from './app-routing.module'; +import { AppComponent } from './app.component'; +import { PageLoginComponent } from './beforeConnexion/login/page-login/page-login.component'; +import { PopupForgottenPasswordComponent } from './beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component'; +import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; +import {HttpClientModule} from "@angular/common/http"; +import {FormsModule, ReactiveFormsModule} from "@angular/forms"; +import {MatTableModule} from "@angular/material/table"; +import {MatSortModule} from "@angular/material/sort"; +import {MatRadioModule} from "@angular/material/radio"; +import {MatDialogModule} from "@angular/material/dialog"; +import {MatSnackBarModule} from "@angular/material/snack-bar"; +import {MatButtonModule} from "@angular/material/button"; +import {MatCheckboxModule} from "@angular/material/checkbox"; +import { PageRegisterComponent } from './beforeConnexion/register/page-register/page-register.component'; +import { PopupConfirmationComponent } from './beforeConnexion/register/popup-confirmation/popup-confirmation.component'; +import { InputInterestsRegisterComponent } from './beforeConnexion/register/input-interests-register/input-interests-register.component'; +import {MatFormFieldModule} from "@angular/material/form-field"; +import {MatChipsModule} from "@angular/material/chips"; +import {MatIconModule} from "@angular/material/icon"; +import {MatAutocompleteModule} from "@angular/material/autocomplete"; +import {MatStepperModule} from "@angular/material/stepper"; +import { NavbarBeforeConnexionComponent } from './beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component'; +import { PageProfilAdminComponent } from './admin/myProfil/page-profil-admin/page-profil-admin.component'; +import { PopupUpdateAdminComponent } from './admin/myProfil/popup-update-admin/popup-update-admin.component'; +import { PageAdListAdminComponent } from './admin/adList/page-ad-list-admin/page-ad-list-admin.component'; +import { PopupDeleteAdAdminComponent } from './admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component'; +import { PopupVisualizeImagesAdminComponent } from './admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component'; +import {MatDividerModule} from "@angular/material/divider"; +import {MatSelectModule} from "@angular/material/select"; +import {MatPaginatorModule} from "@angular/material/paginator"; +import {MatGridListModule} from "@angular/material/grid-list"; +import { PageUserListComponent } from './admin/userList/page-user-list/page-user-list.component'; +import { InputInterestsAdminComponent } from './admin/userList/input-interests-admin/input-interests-admin.component'; +import { PopupCreateUserComponent } from './admin/userList/popup-create-user/popup-create-user.component'; +import { PopupDeleteUserComponent } from './admin/userList/popup-delete-user/popup-delete-user.component'; +import {MatSlideToggleModule} from "@angular/material/slide-toggle"; +import { NavbarAdminComponent } from './admin/utils/navbar-admin/navbar-admin.component'; +import {MatInputModule} from "@angular/material/input"; + +@NgModule({ + declarations: [ + AppComponent, + PageLoginComponent, + PopupForgottenPasswordComponent, + PageRegisterComponent, + PopupConfirmationComponent, + InputInterestsRegisterComponent, + NavbarBeforeConnexionComponent, + PageProfilAdminComponent, + PopupUpdateAdminComponent, + PageAdListAdminComponent, + PopupDeleteAdAdminComponent, + PopupVisualizeImagesAdminComponent, + PageUserListComponent, + InputInterestsAdminComponent, + PopupCreateUserComponent, + PopupDeleteUserComponent, + NavbarAdminComponent + ], + imports: [ + BrowserModule, + AppRoutingModule, + BrowserAnimationsModule, + MatTableModule, + MatSortModule, + MatRadioModule, + FormsModule, + HttpClientModule, + MatDialogModule, + MatButtonModule, + MatCheckboxModule, + MatSnackBarModule, + MatFormFieldModule, + MatInputModule, + MatChipsModule, + MatIconModule, + MatAutocompleteModule, + ReactiveFormsModule, + MatStepperModule, + MatDividerModule, + MatSelectModule, + MatPaginatorModule, + MatGridListModule, + MatSlideToggleModule, + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/src/app/beforeConnexion/login/page-login/page-login.component.html b/admin/src/app/beforeConnexion/login/page-login/page-login.component.html similarity index 100% rename from src/app/beforeConnexion/login/page-login/page-login.component.html rename to admin/src/app/beforeConnexion/login/page-login/page-login.component.html diff --git a/src/app/beforeConnexion/login/page-login/page-login.component.scss b/admin/src/app/beforeConnexion/login/page-login/page-login.component.scss similarity index 100% rename from src/app/beforeConnexion/login/page-login/page-login.component.scss rename to admin/src/app/beforeConnexion/login/page-login/page-login.component.scss diff --git a/src/app/beforeConnexion/login/page-login/page-login.component.spec.ts b/admin/src/app/beforeConnexion/login/page-login/page-login.component.spec.ts similarity index 93% rename from src/app/beforeConnexion/login/page-login/page-login.component.spec.ts rename to admin/src/app/beforeConnexion/login/page-login/page-login.component.spec.ts index 5cb4241..a4ee677 100644 --- a/src/app/beforeConnexion/login/page-login/page-login.component.spec.ts +++ b/admin/src/app/beforeConnexion/login/page-login/page-login.component.spec.ts @@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { PageLoginComponent } from './page-login.component'; -describe('PageConnexionComponent', () => { +describe('PageLoginComponent', () => { let component: PageLoginComponent; let fixture: ComponentFixture; diff --git a/src/app/beforeConnexion/login/page-login/page-login.component.ts b/admin/src/app/beforeConnexion/login/page-login/page-login.component.ts similarity index 86% rename from src/app/beforeConnexion/login/page-login/page-login.component.ts rename to admin/src/app/beforeConnexion/login/page-login/page-login.component.ts index 6ee3e78..555e496 100644 --- a/src/app/beforeConnexion/login/page-login/page-login.component.ts +++ b/admin/src/app/beforeConnexion/login/page-login/page-login.component.ts @@ -1,18 +1,18 @@ import {Component, OnInit} from '@angular/core'; -import {MessageService} from "../../../utils/services/message/message.service"; import {Router} from "@angular/router"; -import {ThemeService} from "../../../utils/services/theme/theme.service"; import {MatDialog} from "@angular/material/dialog"; import {PopupForgottenPasswordComponent} from "../popup-forgotten-password/popup-forgotten-password.component"; import {MatSnackBar} from "@angular/material/snack-bar"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; +import {ProfilService} from "../../../utils/profil/profil.service"; +import {MessageService} from "../../../utils/message/message.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; @Component({ - selector: 'app-page-login', - templateUrl: './page-login.component.html', - styleUrls: ['./page-login.component.scss'] + selector: 'app-page-login', + templateUrl: './page-login.component.html', + styleUrls: ['./page-login.component.scss'] }) export class PageLoginComponent implements OnInit { @@ -33,8 +33,8 @@ export class PageLoginComponent implements OnInit ngOnInit(): void {} - onSeConnecter(): void - { + onSeConnecter(): void + { this.checkError(); if(!this.hasError) @@ -47,10 +47,10 @@ export class PageLoginComponent implements OnInit .post('user/auth', data) .subscribe( retour => this.onSeConnecterCallback(retour), err => this.onSeConnecterCallback(err)); } - } + } - onSeConnecterCallback(retour): void + onSeConnecterCallback(retour: any): void { if(retour.status !== "success") { console.log(retour); diff --git a/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.html b/admin/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.html similarity index 100% rename from src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.html rename to admin/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.html diff --git a/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.scss b/admin/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.scss similarity index 100% rename from src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.scss rename to admin/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.scss diff --git a/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.spec.ts b/admin/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.spec.ts similarity index 100% rename from src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.spec.ts rename to admin/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.spec.ts diff --git a/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.ts b/admin/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.ts similarity index 100% rename from src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.ts rename to admin/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.ts diff --git a/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.html b/admin/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.html similarity index 100% rename from src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.html rename to admin/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.html diff --git a/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.scss b/admin/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.scss similarity index 100% rename from src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.scss rename to admin/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.scss diff --git a/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.spec.ts b/admin/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.spec.ts similarity index 100% rename from src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.spec.ts rename to admin/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.spec.ts diff --git a/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.ts b/admin/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.ts similarity index 98% rename from src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.ts rename to admin/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.ts index 537cf45..8dba84e 100644 --- a/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.ts +++ b/admin/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.ts @@ -2,10 +2,10 @@ 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 {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 {MessageService} from "../../../utils/message/message.service"; diff --git a/src/app/beforeConnexion/register/page-register/page-register.component.html b/admin/src/app/beforeConnexion/register/page-register/page-register.component.html similarity index 83% rename from src/app/beforeConnexion/register/page-register/page-register.component.html rename to admin/src/app/beforeConnexion/register/page-register/page-register.component.html index 4d7b629..fb6e3ac 100644 --- a/src/app/beforeConnexion/register/page-register/page-register.component.html +++ b/admin/src/app/beforeConnexion/register/page-register/page-register.component.html @@ -11,7 +11,7 @@
- + Utilisateur standard    Annonceur @@ -64,21 +64,21 @@ Pseudo - +
Mot de passe - +
Confirmation mot de passe - + @@ -89,12 +89,12 @@ Email - +
- + Homme     Femme @@ -105,7 +105,8 @@ Date de naissance + (ngModelChange)="user.dateOfBirth = $event" + [ngModelOptions]="{standalone: true}"> @@ -127,35 +128,35 @@ Entreprise - +
Pseudo - +
Email - +
Mot de passe - +
Confirmation mot de passe - + diff --git a/src/app/beforeConnexion/register/page-register/page-register.component.scss b/admin/src/app/beforeConnexion/register/page-register/page-register.component.scss similarity index 100% rename from src/app/beforeConnexion/register/page-register/page-register.component.scss rename to admin/src/app/beforeConnexion/register/page-register/page-register.component.scss diff --git a/src/app/beforeConnexion/register/page-register/page-register.component.spec.ts b/admin/src/app/beforeConnexion/register/page-register/page-register.component.spec.ts similarity index 100% rename from src/app/beforeConnexion/register/page-register/page-register.component.spec.ts rename to admin/src/app/beforeConnexion/register/page-register/page-register.component.spec.ts diff --git a/src/app/beforeConnexion/register/page-register/page-register.component.ts b/admin/src/app/beforeConnexion/register/page-register/page-register.component.ts similarity index 91% rename from src/app/beforeConnexion/register/page-register/page-register.component.ts rename to admin/src/app/beforeConnexion/register/page-register/page-register.component.ts index 833a656..788c8be 100644 --- a/src/app/beforeConnexion/register/page-register/page-register.component.ts +++ b/admin/src/app/beforeConnexion/register/page-register/page-register.component.ts @@ -1,17 +1,16 @@ import { Component } from '@angular/core'; -import {MessageService} from "../../../utils/services/message/message.service"; +import {PopupConfirmationComponent} from "../popup-confirmation/popup-confirmation.component"; +import {MessageService} from "../../../utils/message/message.service"; import {Router} from "@angular/router"; import {MatDialog} from "@angular/material/dialog"; -import {PopupConfirmationComponent} from "../popup-confirmation/popup-confirmation.component"; -import {ThemeService} from "../../../utils/services/theme/theme.service"; -import {User} from "../../../utils/interfaces/user"; +import {ThemeService} from "../../../utils/theme/theme.service"; @Component({ - selector: 'app-page-register', - templateUrl: './page-register.component.html', - styleUrls: ['./page-register.component.scss'] + selector: 'app-page-register', + templateUrl: './page-register.component.html', + styleUrls: ['./page-register.component.scss'] }) export class PageRegisterComponent { @@ -19,7 +18,7 @@ export class PageRegisterComponent confirmPassword: string = ""; hasError: boolean = false; errorMessage: string = ""; - user: User = { + user = { _id: "", login: "", hashPass: "", diff --git a/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.html b/admin/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.html similarity index 100% rename from src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.html rename to admin/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.html diff --git a/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.scss b/admin/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.scss similarity index 100% rename from src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.scss rename to admin/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.scss diff --git a/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.spec.ts b/admin/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.spec.ts similarity index 100% rename from src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.spec.ts rename to admin/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.spec.ts diff --git a/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.ts b/admin/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.ts similarity index 67% rename from src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.ts rename to admin/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.ts index 2152f9b..59e3325 100644 --- a/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.ts +++ b/admin/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.ts @@ -1,12 +1,10 @@ import {Component, Inject} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; - - @Component({ - selector: 'app-popup-confirmation', - templateUrl: './popup-confirmation.component.html', - styleUrls: ['./popup-confirmation.component.scss'] + selector: 'app-popup-confirmation', + templateUrl: './popup-confirmation.component.html', + styleUrls: ['./popup-confirmation.component.scss'] }) export class PopupConfirmationComponent { diff --git a/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.html b/admin/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.html similarity index 100% rename from src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.html rename to admin/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.html diff --git a/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.scss b/admin/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.scss similarity index 100% rename from src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.scss rename to admin/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.scss diff --git a/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.spec.ts b/admin/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.spec.ts similarity index 100% rename from src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.spec.ts rename to admin/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.spec.ts diff --git a/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.ts b/admin/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.ts similarity index 99% rename from src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.ts rename to admin/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.ts index 3085e5c..4a3f05e 100644 --- a/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.ts +++ b/admin/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.ts @@ -1,6 +1,5 @@ import {Component, Input} from '@angular/core'; - @Component({ selector: 'app-navbar-before-connexion', templateUrl: './navbar-before-connexion.component.html', diff --git a/src/app/utils/services/message/message.service.spec.ts b/admin/src/app/utils/message/message.service.spec.ts similarity index 100% rename from src/app/utils/services/message/message.service.spec.ts rename to admin/src/app/utils/message/message.service.spec.ts diff --git a/src/app/utils/services/message/message.service.ts b/admin/src/app/utils/message/message.service.ts similarity index 94% rename from src/app/utils/services/message/message.service.ts rename to admin/src/app/utils/message/message.service.ts index a50e75c..c20d5b1 100644 --- a/src/app/utils/services/message/message.service.ts +++ b/admin/src/app/utils/message/message.service.ts @@ -1,9 +1,7 @@ import { Injectable } from '@angular/core'; import {HttpClient, HttpParams} from "@angular/common/http"; -import {environment} from "../../../../environments/environment"; import {Observable} from "rxjs"; - - +import {environment} from "../../../environments/environment"; @Injectable({ providedIn: 'root' diff --git a/src/app/utils/services/profil/profil.service.spec.ts b/admin/src/app/utils/profil/profil.service.spec.ts similarity index 100% rename from src/app/utils/services/profil/profil.service.spec.ts rename to admin/src/app/utils/profil/profil.service.spec.ts diff --git a/src/app/utils/services/profil/profil.service.ts b/admin/src/app/utils/profil/profil.service.ts similarity index 87% rename from src/app/utils/services/profil/profil.service.ts rename to admin/src/app/utils/profil/profil.service.ts index 86ed4a2..4bbe5ea 100644 --- a/src/app/utils/services/profil/profil.service.ts +++ b/admin/src/app/utils/profil/profil.service.ts @@ -1,8 +1,7 @@ -import {Injectable} from '@angular/core'; - +import { Injectable } from '@angular/core'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class ProfilService { diff --git a/src/app/utils/services/theme/theme.service.spec.ts b/admin/src/app/utils/theme/theme.service.spec.ts similarity index 100% rename from src/app/utils/services/theme/theme.service.spec.ts rename to admin/src/app/utils/theme/theme.service.spec.ts diff --git a/src/app/utils/services/theme/theme.service.ts b/admin/src/app/utils/theme/theme.service.ts similarity index 99% rename from src/app/utils/services/theme/theme.service.ts rename to admin/src/app/utils/theme/theme.service.ts index bc69016..00768e5 100644 --- a/src/app/utils/services/theme/theme.service.ts +++ b/admin/src/app/utils/theme/theme.service.ts @@ -5,6 +5,7 @@ import { Injectable } from '@angular/core'; }) export class ThemeService { + isLightTheme = true; getClassTheme(): string @@ -12,4 +13,5 @@ export class ThemeService if(this.isLightTheme) return "lightTheme" ; else return "darkTheme" } + } diff --git a/src/assets/.gitkeep b/admin/src/assets/.gitkeep similarity index 100% rename from src/assets/.gitkeep rename to admin/src/assets/.gitkeep diff --git a/src/assets/darkBackground.webp b/admin/src/assets/darkBackground.webp similarity index 100% rename from src/assets/darkBackground.webp rename to admin/src/assets/darkBackground.webp diff --git a/src/assets/lightBackground.jpg b/admin/src/assets/lightBackground.jpg similarity index 100% rename from src/assets/lightBackground.jpg rename to admin/src/assets/lightBackground.jpg diff --git a/src/assets/logo.png b/admin/src/assets/logo.png similarity index 100% rename from src/assets/logo.png rename to admin/src/assets/logo.png diff --git a/src/assets/logo_plateforms/dailymotion.png b/admin/src/assets/logo_plateforms/dailymotion.png similarity index 100% rename from src/assets/logo_plateforms/dailymotion.png rename to admin/src/assets/logo_plateforms/dailymotion.png diff --git a/src/assets/logo_plateforms/youtube.png b/admin/src/assets/logo_plateforms/youtube.png similarity index 100% rename from src/assets/logo_plateforms/youtube.png rename to admin/src/assets/logo_plateforms/youtube.png diff --git a/src/assets/play.png b/admin/src/assets/play.png similarity index 100% rename from src/assets/play.png rename to admin/src/assets/play.png diff --git a/src/assets/profil.png b/admin/src/assets/profil.png similarity index 100% rename from src/assets/profil.png rename to admin/src/assets/profil.png diff --git a/src/assets/uploadFile.png b/admin/src/assets/uploadFile.png similarity index 100% rename from src/assets/uploadFile.png rename to admin/src/assets/uploadFile.png diff --git a/admin/src/environments/environment.prod.ts b/admin/src/environments/environment.prod.ts new file mode 100644 index 0000000..8d9f516 --- /dev/null +++ b/admin/src/environments/environment.prod.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + debutUrl: "https://polynotfound.herokuapp.com/api/" +}; diff --git a/src/environments/environment.ts b/admin/src/environments/environment.ts similarity index 79% rename from src/environments/environment.ts rename to admin/src/environments/environment.ts index 31c7c5f..6c4970f 100644 --- a/src/environments/environment.ts +++ b/admin/src/environments/environment.ts @@ -1,5 +1,5 @@ // This file can be replaced during build by using the `fileReplacements` array. -// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// `ng build` replaces `environment.ts` with `environment.prod.ts`. // The list of file replacements can be found in `angular.json`. export const environment = { @@ -14,4 +14,4 @@ export const environment = { * This import should be commented out in production mode because it will have a negative impact * on performance if an error is thrown. */ -// import 'zone.js/dist/zone-error'; // Included with Angular CLI. +// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. diff --git a/src/favicon.ico b/admin/src/favicon.ico similarity index 100% rename from src/favicon.ico rename to admin/src/favicon.ico diff --git a/src/index.html b/admin/src/index.html similarity index 53% rename from src/index.html rename to admin/src/index.html index 75eed02..0e892e2 100644 --- a/src/index.html +++ b/admin/src/index.html @@ -6,9 +6,6 @@ - - - diff --git a/src/main.ts b/admin/src/main.ts similarity index 100% rename from src/main.ts rename to admin/src/main.ts diff --git a/src/polyfills.ts b/admin/src/polyfills.ts similarity index 96% rename from src/polyfills.ts rename to admin/src/polyfills.ts index 3e93392..373f538 100644 --- a/src/polyfills.ts +++ b/admin/src/polyfills.ts @@ -57,9 +57,9 @@ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js/dist/zone'; // Included with Angular CLI. +import 'zone.js'; // Included with Angular CLI. + /*************************************************************************************************** * APPLICATION IMPORTS */ -import '@angular/localize/init'; diff --git a/admin/src/styles.scss b/admin/src/styles.scss new file mode 100644 index 0000000..90d4ee0 --- /dev/null +++ b/admin/src/styles.scss @@ -0,0 +1 @@ +/* You can add global styles to this file, and also import other style files */ diff --git a/src/test.ts b/admin/src/test.ts similarity index 86% rename from src/test.ts rename to admin/src/test.ts index 50193eb..b4dd603 100644 --- a/src/test.ts +++ b/admin/src/test.ts @@ -1,6 +1,6 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/dist/zone-testing'; +import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, @@ -17,8 +17,10 @@ declare const require: { // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, - platformBrowserDynamicTesting() + platformBrowserDynamicTesting(), + { teardown: { destroyAfterEach: true }}, ); + // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); // And load the modules. diff --git a/tsconfig.app.json b/admin/tsconfig.app.json similarity index 100% rename from tsconfig.app.json rename to admin/tsconfig.app.json diff --git a/tsconfig.json b/admin/tsconfig.json similarity index 100% rename from tsconfig.json rename to admin/tsconfig.json diff --git a/tsconfig.spec.json b/admin/tsconfig.spec.json similarity index 100% rename from tsconfig.spec.json rename to admin/tsconfig.spec.json diff --git a/app-backend/jwtRS256.key b/app-backend/jwtRS256.key new file mode 100644 index 0000000..be25b1d --- /dev/null +++ b/app-backend/jwtRS256.key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJJwIBAAKCAgEAlt1zgyBeUIHeCYz4vbxEdqtupPjwy7hqL2iFbGGoJUudbvw4 +LpRFmE0iw4cCuRGHwkO8vbqhCEJwpu7v5v/sYr3wOAioksr/PdHvbpKHMgLBUdnx +n2fGBiNn6vdKMddAjqYoGBvgIhER+A5YXQ96IrVcvlu3ZJKfXx0alTZh8bsWV7PL +rkf4j9brG66ymYdjg3VMfltQoLnV+MsubJp8WVSP7MnqJ09js2Kg7/FpvhZDhk1o +/ky4ZZ3V6gpwVl16jApBpn6DRqpnOx1i67P19remDrFgCnKMpdHU9cg4zK7NqMVo +Q5ZD1R/w6hu+y8UIpWFBQoby7GuAoUGmzAWvHrDDLJfAAnrYJmhDu7YOew5M+bAO +BfVC3jO0gCO7Eu1TAbdkoBwvlFErorGlZxGRm79BlOmd590Ri+JvLHcek9KG3Yo4 +2M171QfYOK+167SJ+yGmIXadCENAEun7ocoNPZm4SMkJC2BfS9k00j83FhVPbE/v +z0x8iGlCDQRxO/ML2YvT47bHiXpbDXz/iXE6m1YIVhabUW6xLt4LaHxSJ5hf5/4p +OF7YCxfgFssL4QQKIxsac3eEOyMpUhudVXhH3TBaKipzUdmtY99zhP+u4cKnqAUV +k3Esd15IJ3q3eOWd+s4sugTqZQ0eeHlvnRScTF0Fskrxt5uxbmrAHJ/JlgcCAwEA +AQKCAgAkcCZXNHkzLrrHScJGaXOLygo2VF4shkU3YCJhtBCduW60AL09GtjYWUEd +Qr24n3BPznaGyM3eJdX5q9pLy+J3UvLzRbwZgGg3sT4IUeHPhXTV5TMD0le04dZW +nRXRhfD0w1MJx6nR8JeLd0OGbpeMTIuy+ooIA5X0rh3ejj0H2q0hz65RUNbLPxiY +HhDLHjU96hXoqvuFZn000zZKSuHf3ZnJklc42Wb2S8sdSQzGObBjfszuJu+es4mY +Np89bOSNcGi84u+oIL5AO+/JiDTPOzojcFoHC/XGkzDBkHOPlGTd75goQuHtVwKk +OMFTjCpzb1MI03lW+vwddrLnsjPCcfY76v+5ASryMh5LFvIOaAXYrPaHU9vcaytJ +hmyiVvviPf0VbpwBqkI3MPajoFNk8uScrRQe6frhHyOgmQLIpijaZ44PV9pZYED8 +EVULn0VQzyidF2T6JMU1/Zq6/Bk29uhqUPLof42jhi/jqCX0uJAnyqOHO2ZzMF5d +xI55xFHJ+f3Zac5TacyOGA+7fsziyVWKXe73wk8RBgIbUiK0x273zvykIKJ1W19M +2ihfr8fBjLgPpfeUont2cDX90hJUkEJhsi0PwQhfZS9WtH0Z88pBjO1OZsIfRdZP +Y542RH1U1vl730CQTHl6YcqsEHV1rL0nxsBmBMjRA277xrqd0QKCAQEAxL7tjbXe +IKAy3TvXBdLzRpZjWF/6NDCvpHicfjujx7/6yxyaIg5KbWNzRI4RTuAetPuPP1V0 +7ygAR49RZTkZxzSG0JjpzkXoPjydTBDqIazJ0X1tS7ltnVMil6wiX8vm2DnlAB/S +fki5JK9x+jY/YrRIbkGp1LNMOG57pxRn3vQoJl4X1lmjTgqLiJR8lOlS/Ur07b6s +yzsBinuWTtPrB5eCHFdn7nQPoHzUdbJHO/DOs0fmp1mbQ/IbFs4vSUay/KetBjDE +4YbUyBRd6J7KIFEy2SlCeg1eyCQGK2cbghlBX7ljdWQmYaSK8QHlDRkbJaYw1q2P +9Hi+HZhXR0YxuQKCAQEAxE0ff5b1fDsZYvJU4CZ73AWxjF4hlM2KMcJ37H53tVjq +EpsQadxz2qFMZ60Nvk9lSzLMsXePgVChIXgL5s5GMesInqxbIUaQJ+fnwJaMYU+6 +OYrilV64IqUSC36Arecsm39faYk+y4I34Zqtn6iJeuiifGaVZr66uuKS820wq92g +rVnsjSjWZw4F1Zh0X9hZRqteKPQZRcqT6Nnrb48Ko0GcC7MyeXAYjEGZi9EGBiWh +xM5zzzmK1H3TrJyXopbmIxauKy+Uvzhbu8XiaCP2LJy5JKGoN39CYLZ5fD+gtHhU +oycRyCNzv512QPngBc5L+qm27FB/nUcePYhNn3DlvwKCAQAqu/nnTPiJh6JksWm8 +Bxz2WRYNDRPQoD6Wb+g19whVC9sSoQzNluMNrYtM+brCsiWZVAbCT/KNO9gLsxKP +9P4nab5assweFMskMZBNBGOGmvxfN2o1B3rKsFMUNLxmqGhk0PZvt3nGGk+0qzML +kRrlepk88aBM5gEJRN4w5VrGb6wE4W02DtRM0DeMnAwPYDq5b72Rolfv8Mod5Ug5 +qQgk5wDI3SdjAOygBF01j1qvp1eOU3DDKtBxyrWdl31n4iZggJ8xeAhboCi5qMrZ +CxyGNnzf9HlO/3Z17HU2mje8Y3Xyr9btmapIjS/st2ekF67w149GIf7hsBRDY2KZ +xaJpAoIBABg5zGFaqAEk6gUkEwV2umJ08Wx5UXujwiJR9ariELP4vSp+qI/n/QRG +U7+Xw9Jwyfd11X0xXCyBXuFah118p30RnIa4jqaUpsXGAPvrmHeJ91mSolP81Iyy +AoAYpJjRptep6ISFw5IqB+t3w2Wozw60FxlzL4z2jOTzgV85YoBTYbkDGAZzu8IM +IPwzTGlnsdze2UgEl/nc/lQGUN/7rzxmpHNtMhV6mAz3K5Ptv+iSTFyVfgVc/J0s +yirLSItwRAagje4WeS0AL5IE4eQoTAFFdjPnH3N56R82ZdfHonWjRA6+i5s/hNFp +BWcPb25H/2h3+XNAm/80/65oW+wJatECggEAfsCp+hf3lwV5RbI155z+7aAG8vsh +09r4Dw3VjtaKfhZBqk0LsiqHr8J+v49Fo0Q5nJzMEyqIN47jrLuKcqV8f43CIIuP +Rq3QpulJIisbSfhth4gJRhjpFzYAc+JLUftCNJXAii/yr0fFUg+O3XUwwwsdbDK5 +QV2N0lCRGyN1WUVH/Zm7NPeaLDz4xv4YWtz7Yj8bepbKgD8gHV4UCuApULbEwSQp +uUPksMHLIz+1DKhZVgu+/ldz1sCV7Tomj/MMONQh0jgdfpOILfSad7M/f3rHtuDt +DQHiWGLseNypmBZtaFDz1P+NkkFeSBlabbEpVOoTCUwTjIqfXPNyj/zTTQ== +-----END RSA PRIVATE KEY----- diff --git a/app-backend/jwtRS256.key.pub b/app-backend/jwtRS256.key.pub index 6b52055..d89cfa5 100644 --- a/app-backend/jwtRS256.key.pub +++ b/app-backend/jwtRS256.key.pub @@ -1,14 +1,14 @@ -----BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtW31Xj62sjbJVBxnn0G2 -Habc22q7/pFIBdfn8+OsajdNVnmtfRNOsSXZP8sNhXt1QLPSgxZ/wogG0fLXIX2+ -ewzPgqrwTnr+quJ1DZ6RqOY3G1PGOibgk25aHkIXJ/gTPk1yTT6pjUmKiaGKM8pt -M2wGwugCdEH5Wndgby8Jej30v/PPzyPxTSXrIWDeaSMX+jQyFZTGgEdgL7JvjkTj -qLtfWKIAcEeO4PzOlRXVvbzBoYphBiZqkbzEeuOjSLPxgy4cQdbqVMlJ/lZt0SBO -MLiIUBTufLcJS3ApesiZWWfUCq+pFFdhEABc9qrtVumzhmzWAv2rKVrHRXbguxc/ -eHKlRjAE4qmnNnTP2fsAuQIPkXVHOPWdXM1IBwnhXVB+XhxEHSANx/2oeKS6fO/e -1oNJCiVkHin9gC8vkU9seEN73lNKZ5wPXMqTYUGA65dCY+8li+n/1pveJOJozFk7 -amkmOAPTi44lBJmxRm88XBHC3TXz6tFqX3phMqFDcQs2D9s3/2UylK0dSH5MSLnb -9x24/ykO4RlPRVCC90vwlxzbnb0rfQVlT4dKcE6OIyXw3UsqIqFnXWmm+hnGu4QH -Ysr+i1VIhPOs9YdZwlqhzcPTuNcdxmxy9ZfZ8KlLIWbAMbSH+obwm4w+HYTZjspe -2MwrKGgzpl4YW7ct/ViqeQMCAwEAAQ== +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlt1zgyBeUIHeCYz4vbxE +dqtupPjwy7hqL2iFbGGoJUudbvw4LpRFmE0iw4cCuRGHwkO8vbqhCEJwpu7v5v/s +Yr3wOAioksr/PdHvbpKHMgLBUdnxn2fGBiNn6vdKMddAjqYoGBvgIhER+A5YXQ96 +IrVcvlu3ZJKfXx0alTZh8bsWV7PLrkf4j9brG66ymYdjg3VMfltQoLnV+MsubJp8 +WVSP7MnqJ09js2Kg7/FpvhZDhk1o/ky4ZZ3V6gpwVl16jApBpn6DRqpnOx1i67P1 +9remDrFgCnKMpdHU9cg4zK7NqMVoQ5ZD1R/w6hu+y8UIpWFBQoby7GuAoUGmzAWv +HrDDLJfAAnrYJmhDu7YOew5M+bAOBfVC3jO0gCO7Eu1TAbdkoBwvlFErorGlZxGR +m79BlOmd590Ri+JvLHcek9KG3Yo42M171QfYOK+167SJ+yGmIXadCENAEun7ocoN +PZm4SMkJC2BfS9k00j83FhVPbE/vz0x8iGlCDQRxO/ML2YvT47bHiXpbDXz/iXE6 +m1YIVhabUW6xLt4LaHxSJ5hf5/4pOF7YCxfgFssL4QQKIxsac3eEOyMpUhudVXhH +3TBaKipzUdmtY99zhP+u4cKnqAUVk3Esd15IJ3q3eOWd+s4sugTqZQ0eeHlvnRSc +TF0Fskrxt5uxbmrAHJ/JlgcCAwEAAQ== -----END PUBLIC KEY----- diff --git a/src/app/admin/userList/popup-delete-user/popup-delete-user.component.ts b/src/app/admin/userList/popup-delete-user/popup-delete-user.component.ts deleted file mode 100644 index 35e8d9e..0000000 --- a/src/app/admin/userList/popup-delete-user/popup-delete-user.component.ts +++ /dev/null @@ -1,47 +0,0 @@ -import {Component, Inject, OnInit} from '@angular/core'; -import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../utils/services/message/message.service"; - - - -@Component({ - selector: 'app-popup-delete-user', - templateUrl: './popup-delete-user.component.html', - styleUrls: ['./popup-delete-user.component.scss'] -}) -export class PopupDeleteUserComponent implements OnInit -{ - user; - - constructor( public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data, - private messageService: MessageService ) { } - - ngOnInit(): void - { - this.user = this.data.user; - } - - onValidate(): void - { - // --- FAUX CODE --- - this.dialogRef.close(true); - - // --- VRAI CODE --- - /* - this.messageService - .sendMessage("user/delete", {"advert": this.advert}) - .subscribe( retour => { - - if(retour.status === "error") { - console.log(retour); - this.dialogRef.close(); - } - else { - this.dialogRef.close(true); - } - }); - */ - } - -} diff --git a/src/app/app.component.html b/src/app/app.component.html deleted file mode 100644 index 0680b43..0000000 --- a/src/app/app.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/app/app.module.ts b/src/app/app.module.ts deleted file mode 100644 index 133f928..0000000 --- a/src/app/app.module.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; - -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { PageLoginComponent } from './beforeConnexion/login/page-login/page-login.component'; -import { PageRegisterComponent } from './beforeConnexion/register/page-register/page-register.component'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; -import {FormsModule, ReactiveFormsModule} from "@angular/forms"; -import { PageSearchComponent } from './user/search/page-search/page-search.component'; -import {HttpClientModule} from "@angular/common/http"; -import { PopupConfirmationComponent } from './beforeConnexion/register/popup-confirmation/popup-confirmation.component'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatButtonModule} from "@angular/material/button"; -import { AdvertComponent } from './user/utils/components/advert/advert.component'; -import { VideoGridComponent } from './user/search/video-grid/video-grid.component'; -import {MatIconModule} from "@angular/material/icon"; -import { PopupAddVideoToPlaylistsComponent } from './user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component'; -import {MatInputModule} from "@angular/material/input"; -import {MatDividerModule} from "@angular/material/divider"; -import {MatCheckboxModule} from "@angular/material/checkbox"; -import {MatFormFieldModule} from "@angular/material/form-field"; -import {MatSnackBarModule} from "@angular/material/snack-bar"; -import {MatGridListModule} from "@angular/material/grid-list"; -import { PageMyPlaylistsComponent } from './user/myPlaylists/page-my-playlists/page-my-playlists.component'; -import { PlaylistListComponent } from './user/myPlaylists/playlist-list/playlist-list.component'; -import {VideoListComponent} from "./user/myPlaylists/video-list/video-list.component"; -import { PopupCreateOrUpdatePlaylistComponent } from './user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component'; -import { PageHistoryUserComponent } from './user/history/page-history-user/page-history-user.component'; -import {MatTableModule} from '@angular/material/table'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import {MatSortModule} from "@angular/material/sort"; -import { PageAdListAdvertiserComponent } from './advertiser/adList/page-ad-list-advertiser/page-ad-list-advertiser.component'; -import { PopupDeleteAdAdvertiserComponent } from './advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component'; -import { PopupAddOrUpdateAdComponent } from './advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component'; -import { PopupVisualizeAdAdvertiserComponent } from './advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component'; -import { InputInterestsAdComponent } from './advertiser/adList/input-interests-ad/input-interests-ad.component'; -import {MatChipsModule} from "@angular/material/chips"; -import {MatAutocompleteModule} from "@angular/material/autocomplete"; -import {MatSelectModule} from "@angular/material/select"; -import { PopupVisualizeImagesAdvertiserComponent } from './advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component'; -import {IvyCarouselModule} from "angular-responsive-carousel"; -import { DragAndDropComponent } from './advertiser/adList/drag-and-drop/drag-and-drop.component'; -import { DragAndDropDirective } from './advertiser/utils/dragAndDrop/drag-and-drop.directive'; -import { PageProfilUserComponent } from './user/myProfil/page-profil-user/page-profil-user.component'; -import { NavbarUserComponent } from './user/utils/components/navbar-user/navbar-user.component'; -import { NavbarAdvertiserComponent } from './advertiser/utils/navbar-advertiser/navbar-advertiser.component'; -import { NavbarAdminComponent } from './admin/utils/navbar-admin/navbar-admin.component'; -import { PageProfilAdvertiserComponent } from './advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component'; -import { PopupUpdateAdvertiserComponent } from './advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component'; -import { PopupUpdateUserComponent } from './user/myProfil/popup-update-user/popup-update-user.component'; -import { NavbarBeforeConnexionComponent } from './beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component'; -import {MatRadioModule} from "@angular/material/radio"; -import { InputInterestsProfilComponent } from './user/myProfil/input-interests-profil/input-interests-profil.component'; -import { PageProfilAdminComponent } from './admin/myProfil/page-profil-admin/page-profil-admin.component'; -import { PopupUpdateAdminComponent } from './admin/myProfil/popup-update-admin/popup-update-admin.component'; -import {MatStepperModule} from "@angular/material/stepper"; -import { InputInterestsRegisterComponent } from './beforeConnexion/register/input-interests-register/input-interests-register.component'; -import {MatPaginatorModule} from "@angular/material/paginator"; -import { PageAdListAdminComponent } from './admin/adList/page-ad-list-admin/page-ad-list-admin.component'; -import { PopupDeleteAdAdminComponent } from './admin/adList/popup-delete-ad-admin/popup-delete-ad-admin.component'; -import { PopupVisualizeImagesAdminComponent } from './admin/adList/popup-visualize-images-admin/popup-visualize-images-admin.component'; -import { PageUserListComponent } from './admin/userList/page-user-list/page-user-list.component'; -import { PopupDeleteUserComponent } from './admin/userList/popup-delete-user/popup-delete-user.component'; -import { PopupCreateUserComponent } from './admin/userList/popup-create-user/popup-create-user.component'; -import { InputInterestsAdminComponent } from './admin/userList/input-interests-admin/input-interests-admin.component'; -import { PageWatchingVideoComponent } from './user/watching/page-watching-video/page-watching-video.component'; -import {MatDatepickerModule} from "@angular/material/datepicker"; -import { PagesPopularityComponent } from './advertiser/pages-popularity/pages-popularity.component'; -import { ChartsModule } from 'ng2-charts'; -import { PopupDeletePlaylistComponent } from './user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component'; -import { PopupForgottenPasswordComponent } from './beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component'; - - -@NgModule({ - declarations: [ - AppComponent, - PageLoginComponent, - PageRegisterComponent, - PageSearchComponent, - PopupConfirmationComponent, - AdvertComponent, - VideoGridComponent, - PopupAddVideoToPlaylistsComponent, - PageMyPlaylistsComponent, - VideoListComponent, - PlaylistListComponent, - VideoListComponent, - PopupCreateOrUpdatePlaylistComponent, - PageHistoryUserComponent, - PageAdListAdvertiserComponent, - PopupDeleteAdAdvertiserComponent, - PopupAddOrUpdateAdComponent, - PopupVisualizeAdAdvertiserComponent, - InputInterestsAdComponent, - PopupVisualizeImagesAdvertiserComponent, - DragAndDropComponent, - DragAndDropDirective, - PageProfilUserComponent, - NavbarUserComponent, - NavbarAdvertiserComponent, - NavbarAdminComponent, - PageProfilAdvertiserComponent, - PopupUpdateAdvertiserComponent, - PopupUpdateUserComponent, - NavbarBeforeConnexionComponent, - InputInterestsProfilComponent, - PageProfilAdminComponent, - PopupUpdateAdminComponent, - InputInterestsRegisterComponent, - PageAdListAdminComponent, - PopupDeleteAdAdminComponent, - PopupVisualizeImagesAdminComponent, - PageUserListComponent, - PopupDeleteUserComponent, - PopupCreateUserComponent, - InputInterestsAdminComponent, - PageWatchingVideoComponent, - PagesPopularityComponent, - PopupDeletePlaylistComponent, - PopupForgottenPasswordComponent, - ], - imports: [ - BrowserModule, - AppRoutingModule, - BrowserAnimationsModule, - MatSlideToggleModule, - FormsModule, - HttpClientModule, - MatDialogModule, - MatButtonModule, - MatIconModule, - MatInputModule, - MatDividerModule, - MatCheckboxModule, - MatFormFieldModule, - MatSnackBarModule, - MatGridListModule, - MatTableModule, - NgbModule, - MatSortModule, - MatChipsModule, - ReactiveFormsModule, - MatAutocompleteModule, - MatSelectModule, - IvyCarouselModule, - MatRadioModule, - MatStepperModule, - MatPaginatorModule, - MatDatepickerModule, - ChartsModule - ], - providers: [], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.scss b/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.scss deleted file mode 100644 index c7acb4b..0000000 --- a/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -mat-form-field { - width: 100%; -} diff --git a/src/app/utils/interfaces/advert.ts b/src/app/utils/interfaces/advert.ts deleted file mode 100644 index 55da7c0..0000000 --- a/src/app/utils/interfaces/advert.ts +++ /dev/null @@ -1,39 +0,0 @@ -export interface Advert -{ - _id: string, - userId: string, - title: string, - url: string, - images: { - url: string, - description: string, - }[], - interests: string[], - comment: string, - views: Date[], - isVisible: boolean, - isActive: boolean, - createdAt: Date, - updatedAt: Date, -} - - - -export interface AdvertWithCountViews { - id: string, - userId: string, - title: string, - url: string, - images: { - url: string, - description: string, - }[], - interests: string[], - comment: string, - views: Date[], - countViews: number, - isVisible: boolean, - isActive: boolean, - createdAt: Date, - updatedAt: Date, -} diff --git a/src/app/utils/interfaces/playlist.ts b/src/app/utils/interfaces/playlist.ts deleted file mode 100644 index 4ffa611..0000000 --- a/src/app/utils/interfaces/playlist.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface PlaylistDB -{ - _id: string, - userId: string, - name: string, - videoIds: string[], - isActive: boolean - createdAt: Date, - updatedAt: Date -} diff --git a/src/app/utils/interfaces/user.ts b/src/app/utils/interfaces/user.ts deleted file mode 100644 index f46977f..0000000 --- a/src/app/utils/interfaces/user.ts +++ /dev/null @@ -1,33 +0,0 @@ -export interface User -{ - _id: string, - email: string, - hashPass: string, - login: string, - role: { - name: string, - permission: number, - isAccepted: boolean, - }, - profileImageUrl: string, - dateOfBirth: Date, - gender: string, - interests: any[], - company: string, - isActive: boolean, - lastConnexion: Date, - createdAt: Date, - updatedAt: Date -} - - -interface VideoCategorie -{ - id: number - interest: string - categories: { - id: string - name: string - source: string - } -} diff --git a/src/app/utils/interfaces/video.ts b/src/app/utils/interfaces/video.ts deleted file mode 100644 index 1c93427..0000000 --- a/src/app/utils/interfaces/video.ts +++ /dev/null @@ -1,32 +0,0 @@ -export interface VideoDB -{ - _id: string, - userId: string, - videoId: string, - source: string, - tags: string[], - interest: string, - watchedDates: Date[], - createdAt: Date, - updatedAt: Date -} - - -export interface VideoAll -{ - _id: string, - userId: string, - videoId: string, - source: string, - tags: String[], - interest: string, - watchedDates: Date[], - createdAt: Date, - updatedAt: Date - - title: string, - views: number, - publishedAt: Date, - description: string, - imageUrl: string -} diff --git a/src/app/utils/services/fictitiousDatas/fictitiousAdverts/fictitious-adverts.service.spec.ts b/src/app/utils/services/fictitiousDatas/fictitiousAdverts/fictitious-adverts.service.spec.ts deleted file mode 100644 index 0cd9f3c..0000000 --- a/src/app/utils/services/fictitiousDatas/fictitiousAdverts/fictitious-adverts.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { FictitiousAdvertsService } from './fictitious-adverts.service'; - -describe('FictitiousAdvertsService', () => { - let service: FictitiousAdvertsService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(FictitiousAdvertsService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/utils/services/fictitiousDatas/fictitiousAdverts/fictitious-adverts.service.ts b/src/app/utils/services/fictitiousDatas/fictitiousAdverts/fictitious-adverts.service.ts deleted file mode 100644 index 2dd7702..0000000 --- a/src/app/utils/services/fictitiousDatas/fictitiousAdverts/fictitious-adverts.service.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { Injectable } from '@angular/core'; -import {Advert} from "../../../interfaces/advert"; -import {FictitiousUtilsService} from "../fictitiousUtils/fictitious-utils.service"; - - - -const TAB_ADVERT: Advert[] = [ - { - _id: "idNutella", - userId: "userId", - title: "pot de nutella XXL", - url: "https://www.nutella.com/fr/fr/", - images: [ - { url: "nutella_v_1.jpeg", description: "image nutella 1" }, - { url: "nutella_v_2.png", description: "image nutella 2" }, - { url: "nutella_v_3.jpg", description: "image nutella 3" } - ], - interests: [ "rock", "basket" ], - comment: "pub pour vacances de noêl", - views: [ - new Date(2021,10,1), - new Date(2021,10,2), - new Date(2021,10,3), - new Date(2021,10,3), - new Date(2021,10,5), - new Date(2021,10,5), - new Date(2021,10,5), - new Date(2021,10,5), - new Date(2021,10,5), - new Date(2021,10,7) - ], - isVisible: true, - isActive: true, - createdAt: new Date(), - updatedAt: new Date(), - }, - { - _id: "idRolex", - userId: "userId", - title: "Rolex", - url: "https://www.rolex.com", - images: [ - { url: "rolex_v_1.jpg", description: "rolex 1" }, - { url: "rolex_v_2.png", description: "rolex 2" }, - ], - interests: [ "rock", "rap" ], - comment: "pub pour cette année", - views: [ - new Date(2021,10,5), - new Date(2021,10,6), - new Date(2021,10,7), - new Date(2021,10,8), - new Date(2021,10,8), - new Date(2021,10,8), - new Date(2021,10,25), - new Date(2021,10,25), - new Date(2021,10,25), - new Date(2021,10,27) - ], - isVisible: true, - isActive: true, - createdAt: new Date(), - updatedAt: new Date(), - }, - { - _id: "idAlbion", - userId: "userId", - title: "Albion new version", - url: "https://www.rolex.com", - images: [ - { url: "rolex_v_1.jpg", description: "albion 1" }, - { url: "rolex_v_2.png", description: "albion 2" }, - ], - interests: [ "rock", "rap" ], - comment: "pub pour cette année", - views: [ - new Date(2021,10,3), - new Date(2021,10,4), - new Date(2021,10,4), - new Date(2021,10,5), - new Date(2021,10,5), - new Date(2021,10,6), - new Date(2021,10,6), - new Date(2021,10,8), - new Date(2021,10,8), - new Date(2021,10,8) - ], - isVisible: true, - isActive: true, - createdAt: new Date(), - updatedAt: new Date(), - } -]; - - - -@Injectable({ - providedIn: 'root' -}) -export class FictitiousAdvertsService -{ - - constructor(private fictitiousUtilsService: FictitiousUtilsService) {} - - - getAdvert(): Advert - { - const idx = Math.floor(Math.random() * TAB_ADVERT.length); - let advert = Object.assign({}, TAB_ADVERT[idx]); - advert._id = advert._id + this.fictitiousUtilsService.makeid(5); - advert.interests = advert.interests.slice(); - advert.isVisible = (Math.random() < 0.5); - return advert; - } - - - getTabAdvert(n: number): Advert[] - { - let tabAdvert = []; - for(let i=0 ; i { - let service: FictitiousUsersService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(FictitiousUsersService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/utils/services/fictitiousDatas/fictitiousUsers/fictitious-users.service.ts b/src/app/utils/services/fictitiousDatas/fictitiousUsers/fictitious-users.service.ts deleted file mode 100644 index e629e97..0000000 --- a/src/app/utils/services/fictitiousDatas/fictitiousUsers/fictitious-users.service.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { Injectable } from '@angular/core'; -import {User} from "../../../interfaces/user"; -import {FictitiousUtilsService} from "../fictitiousUtils/fictitious-utils.service"; - - - -const USER: User = { - _id: "ririId", - login: "Riri", - hashPass: "agourgroou", - email: "riri@gmail.com", - role: { - name: "user", - permission: 0, - isAccepted: true, - - }, - profileImageUrl: "https://www.figurines-goodies.com/1185-thickbox_default/huey-duck-tales-disney-funko-pop.jpg", - dateOfBirth: new Date(), - gender: "man", - interests: ["foot", "jeux-vidéo"], - company: "", - isActive: true, - lastConnexion: new Date(), - createdAt: new Date(), - updatedAt: new Date() -}; - -const ADVERTISER: User = { - _id: "fifiId", - login: "Fifi", - hashPass: "agourgroou", - email: "fifi@gmail.com", - role: { - name: "advertiser", - permission: 5, - isAccepted: true, - - }, - profileImageUrl: "https://www.figurines-goodies.com/1188-large_default/dewey-duck-tales-disney-funko-pop.jpg", - dateOfBirth: null, - gender: "", - interests: [], - company: "My company", - isActive: true, - lastConnexion: new Date(), - createdAt: new Date(), - updatedAt: new Date(), -}; - -const ADMIN: User = { - _id: "loulouId", - login: "Loulou", - hashPass: "agourgroou", - email: "loulou@gmail.com", - role: { - name: "admin", - permission: 5, - isAccepted: true, - }, - profileImageUrl: "https://www.reference-gaming.com/assets/media/product/41195/figurine-pop-duck-tales-n-309-loulou.jpg?format=product-cover-large&k=1519639530", - dateOfBirth: null, - gender: "", - interests: [], - company: "", - isActive: true, - lastConnexion: new Date(), - createdAt: new Date(), - updatedAt: new Date(), -}; - - - -@Injectable({ - providedIn: 'root' -}) -export class FictitiousUsersService -{ - - constructor(private fictitiousUtilsService: FictitiousUtilsService) { } - - private getUserOrAdvertiserOrAdmin(modele: User): User - { - const res = Object.assign({}, modele); - res._id += this.fictitiousUtilsService.makeid(5); - res.login += (Math.floor(Math.random() * 1000)).toString(); - res.email = res.login + "@gmail.com" ; - res.role.isAccepted = (Math.random() < 0.5); - res.isActive = (Math.random() < 0.5); - res.dateOfBirth = this.fictitiousUtilsService.randomDate(new Date(1900, 0, 1), new Date()); - res.lastConnexion = this.fictitiousUtilsService.randomDate(new Date(2000, 0, 1), new Date()); - return res; - } - - getUser(): User { - return this.getUserOrAdvertiserOrAdmin(USER); - } - - getAdvertiser(): User { - return this.getUserOrAdvertiserOrAdmin(ADVERTISER); - } - - getAdmin(): User { - return this.getUserOrAdvertiserOrAdmin(ADMIN); - } - - getTabUser(n: number): User[] - { - const res: User[] = []; - for(let i=0 ; i { - let service: FictitiousUtilsService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(FictitiousUtilsService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/utils/services/fictitiousDatas/fictitiousUtils/fictitious-utils.service.ts b/src/app/utils/services/fictitiousDatas/fictitiousUtils/fictitious-utils.service.ts deleted file mode 100644 index 4c06ecf..0000000 --- a/src/app/utils/services/fictitiousDatas/fictitiousUtils/fictitious-utils.service.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Injectable } from '@angular/core'; - - -@Injectable({ - providedIn: 'root' -}) -export class FictitiousUtilsService -{ - - makeid(length) - { - let res = ''; - const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - for( let i = 0; i < length; i++ ) { - const k = Math.floor(Math.random() * characters.length); - res += characters.charAt(k); - } - return res; - } - - - randomDate(start, end): Date - { - return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime())); - } - - - getTags(): string[] - { - return [ "musique", "rap", "rock", "sport", "foot", "basket", "tennis", "film", "action", "aventure", "horreur", "romance", "comedie"]; - } - -} diff --git a/src/app/utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service.spec.ts b/src/app/utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service.spec.ts deleted file mode 100644 index e604845..0000000 --- a/src/app/utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { FictitiousVideosService } from './fictitious-videos.service'; - -describe('FictitiousVideosService', () => { - let service: FictitiousVideosService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(FictitiousVideosService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service.ts b/src/app/utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service.ts deleted file mode 100644 index e0e0b4a..0000000 --- a/src/app/utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service.ts +++ /dev/null @@ -1,289 +0,0 @@ -import { Injectable } from '@angular/core'; -import {VideoAll} from "../../../interfaces/video"; -import {PlaylistDB} from "../../../interfaces/playlist"; -import {FictitiousUtilsService} from "../fictitiousUtils/fictitious-utils.service"; - - - -const TAB_VIDEO: VideoAll[] = [ - { - _id: "Mowgli", - //videoId: "https://www.youtube.com/watch?v=medPORJ8KO0", - videoId: "medPORJ8KO0", - userId: "userId", - source: "youtube", - tags: [ "rap", "musique" ], - interest: "PNL", - watchedDates: [ - new Date(2021, 10, 15), - new Date(2021, 10, 16), - new Date(2021, 10, 17), - new Date(2021, 10, 18), - new Date(2021, 10, 19), - new Date(2021, 10, 20), - ], - createdAt: new Date(), - updatedAt: new Date(), - - title: "PNL - Mowgli", - views: 999999999, - publishedAt: new Date(), - imageUrl: "https://i.ytimg.com/vi/CaeH7TRnI3s/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCr4TMUqy_Lqi9_zh7efICrF_V_Vw", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. " - }, - { - _id: "Mexico", - //videoId: "https://www.youtube.com/watch?v=LZx6oeNeoWM", - videoId: "LZx6oeNeoWM", - userId: "userId", - source: "youtube", - tags: [ "rap", "musique" ], - interest: "PNL", - watchedDates: [new Date()], - createdAt: new Date(), - updatedAt: new Date(), - - title: "PNL - Mexico", - views: 999999, - publishedAt: new Date(), - imageUrl: "https://i.ytimg.com/vi/LZx6oeNeoWM/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAIJsokYSLBB3TrnKhX5V1beCTrpQ", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. " - }, - { - _id: "Luz de luna", - //videoId: "https://www.youtube.com/watch?v=fGoPhSV2Jic", - videoId: "fGoPhSV2Jic", - userId: "userId", - source: "youtube", - tags: [ "rap", "musique" ], - interest: "PNL", - watchedDates: [new Date()], - createdAt: new Date(), - updatedAt: new Date(), - - title: "PNL - Luz de luna", - views: 999999, - publishedAt: new Date(), - imageUrl: "https://i.ytimg.com/vi/fGoPhSV2Jic/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBICz3ZfnjAXQNZQniiCTRLbdyLcg", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. " - }, - { - _id: "Blanka", - //videoId: "https://www.youtube.com/watch?v=u8bHjdljyLw", - videoId: "u8bHjdljyLw", - userId: "userId", - source: "youtube", - tags: [ "rap", "musique" ], - interest: "PNL", - watchedDates: [new Date()], - createdAt: new Date(), - updatedAt: new Date(), - - title: "PNL - Blanka", - views: 999999, - publishedAt: new Date(), - imageUrl: "https://i.ytimg.com/vi/PCwZnN4zDiY/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCaA-xe5rkkYJbNCbSg0z27Lm1Hgw", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. " - }, - { - _id: "Mowgli 2", - //videoId: "https://www.dailymotion.com/video/x7ahxdn", - videoId: "x7ahxdn", - userId: "userId", - source: "dailymotion", - tags: [ "rap", "musique" ], - interest: "PNL", - watchedDates: [new Date()], - createdAt: new Date(), - updatedAt: new Date(), - - title: "PNL - Mowgli 2", - views: 999999, - publishedAt: new Date(), - imageUrl: "https://i.ytimg.com/vi/tno1qRfO894/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCOBBR6c3woXXIbOSdU06quQcN7pw", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. " - }, - { - _id: "Etre humain", - //videoId: "https://www.youtube.com/watch?v=gfVo39B92Ow", - videoId: "gfVo39B92Ow", - userId: "userId", - source: "youtube", - tags: [ "rap", "musique" ], - interest: "Nekfeu", - watchedDates: [new Date()], - createdAt: new Date(), - updatedAt: new Date(), - - title: "PNL - Etre humain", - views: 999999, - publishedAt: new Date(), - imageUrl: "https://i.ytimg.com/vi/gfVo39B92Ow/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCPJpBqTYk5Nj3RSgase3GdbT7_Pg", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. " - }, - { - _id: "Humanoide", - //videoId: "https://www.youtube.com/watch?v=MiyIg__WNOw", - videoId: "MiyIg__WNOw", - userId: "userId", - source: "youtube", - tags: [ "rap", "musique" ], - interest: "Nekfeu", - watchedDates: [new Date()], - createdAt: new Date(), - updatedAt: new Date(), - - title: "Nekfeu - Humanoide", - views: 999999, - publishedAt: new Date(), - imageUrl: "https://i.ytimg.com/vi/MiyIg__WNOw/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDboAq0TRqXBFGgXdpOD_HOsRZucw", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. ", - }, - { - _id: "Dernier soupir", - //videoId: "https://youtu.be/0GqjIF-4QQM?list=PLqeKQSn3LuAmpF-uIu39RIQRQkUzVol5l", - videoId: "0GqjIF-4QQM", - userId: "userId", - source: "youtube", - tags: [ "rap", "musique" ], - interest: "Nekfeu", - watchedDates: [new Date()], - createdAt: new Date(), - updatedAt: new Date(), - - title: "Nekfeu - Dernier soupir", - views: 999999, - publishedAt: new Date(), - imageUrl: "https://i.ytimg.com/vi/-S5IKBvT34c/hqdefault.jpg?sqp=-oaymwEcCOADEI4CSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLC1kVCIB2bQGmOH74I5puXIhn7HRQ", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. ", - }, - { - _id: "Les prélis", - //videoId: "https://www.dailymotion.com/video/x4trtkd", - videoId: "x4trtkd", - userId: "userId", - source: "dailymotion", - tags: [ "rap", "musique" ], - interest: "Columbine", - watchedDates: [new Date()], - createdAt: new Date(), - updatedAt: new Date(), - - title: "Columbine - Les prélis", - views: 999999, - publishedAt: new Date(), - imageUrl: "https://s2.dmcdn.net/v/HPPjj1NtysAaAttYk/x240", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. ", - }, - { - _id: "Pierre feuille ciseau", - //videoId: "https://www.dailymotion.com/video/x6agl6i", - videoId: "x6agl6i", - userId: "userId", - source: "dailymotion", - tags: [ "rap", "musique" ], - interest: "Columbine", - watchedDates: [new Date()], - createdAt: new Date(), - updatedAt: new Date(), - - title: "Columbine - Pierre feuille ciseau", - views: 999999, - publishedAt: new Date(), - imageUrl: "https://i.ytimg.com/vi/tTo7CrPlbpI/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAhC5bWURH9R8Icdkv6LWRgsW2G-Q", - description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. ", - }, -]; - - - -@Injectable({ - providedIn: 'root' -}) -export class FictitiousVideosService -{ - - constructor(private fictitiousUtilsService: FictitiousUtilsService) {} - - - getVideoAll(): VideoAll - { - const index = Math.floor(Math.random() * TAB_VIDEO.length); - return TAB_VIDEO[index]; - } - - - getVideoByVideoId(videoId: string): VideoAll - { - return TAB_VIDEO.find(video => video.videoId === videoId); - } - - - getTabVideoAll(nbVideo: number): VideoAll[] - { - let tabVideo = []; - for(let i=0 ; i x._id), - isActive: true, - createdAt: new Date(), - updatedAt: new Date() - }); - } - - return tabPlaylist; - } - - - getNoRandomTabPlaylistDB(nbPlaylist: number): PlaylistDB[] - { - let tabPlaylist: PlaylistDB[] = []; - - for(let i = 0; i < nbPlaylist; i++) - { - const videoIds = []; - for(let j=0 ; j(); + this.dataSource = new MatTableDataSource(); this.onFilter(); } } @@ -101,7 +96,7 @@ export class PageAdListAdvertiserComponent implements AfterViewInit } - onVisualizeImages(advert: AdvertWithCountViews) + onVisualizeImages(advert: any) { if(advert.images.length !== 0) { @@ -156,7 +151,7 @@ export class PageAdListAdvertiserComponent implements AfterViewInit } - onUpdate(advertToUpdate: AdvertWithCountViews): void + onUpdate(advertToUpdate: any): void { const config = { width: '75%', @@ -190,7 +185,7 @@ export class PageAdListAdvertiserComponent implements AfterViewInit } - onDelete(advert: AdvertWithCountViews): void + onDelete(advert: any): void { const config = { data: { advert: advert } @@ -287,7 +282,7 @@ export class PageAdListAdvertiserComponent implements AfterViewInit } - advertToAdvertWithCountViews(advert): AdvertWithCountViews + advertToAdvertWithCountViews(advert) { return { id: advert.id, diff --git a/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.html b/userAndAdvertiser/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.html similarity index 100% rename from src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.html rename to userAndAdvertiser/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.html diff --git a/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.scss b/userAndAdvertiser/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.scss similarity index 100% rename from src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.scss rename to userAndAdvertiser/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.scss diff --git a/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.spec.ts b/userAndAdvertiser/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.spec.ts similarity index 100% rename from src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.spec.ts rename to userAndAdvertiser/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.spec.ts diff --git a/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.ts b/userAndAdvertiser/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.ts similarity index 96% rename from src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.ts rename to userAndAdvertiser/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.ts index 32831f9..e927f68 100644 --- a/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.ts +++ b/userAndAdvertiser/src/app/advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component.ts @@ -1,13 +1,12 @@ import {Component, Inject, OnInit} from '@angular/core'; -import {Advert} from "../../../utils/interfaces/advert"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../utils/services/message/message.service"; -import {ThemeService} from "../../../utils/services/theme/theme.service"; +import {MessageService} from "../../../utils/message/message.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; -const ADVERT_VIDE: Advert = { +const ADVERT_VIDE = { _id: "", userId: "", title: "", diff --git a/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.html b/userAndAdvertiser/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.html similarity index 100% rename from src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.html rename to userAndAdvertiser/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.html diff --git a/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.scss b/userAndAdvertiser/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.scss similarity index 100% rename from src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.scss rename to userAndAdvertiser/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.scss diff --git a/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.spec.ts b/userAndAdvertiser/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.spec.ts similarity index 100% rename from src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.spec.ts rename to userAndAdvertiser/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.spec.ts diff --git a/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.ts b/userAndAdvertiser/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.ts similarity index 93% rename from src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.ts rename to userAndAdvertiser/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.ts index 1de96ef..c137557 100644 --- a/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.ts +++ b/userAndAdvertiser/src/app/advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component.ts @@ -1,6 +1,6 @@ import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../utils/services/message/message.service"; +import {MessageService} from "../../../utils/message/message.service"; diff --git a/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.html b/userAndAdvertiser/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.html similarity index 100% rename from src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.html rename to userAndAdvertiser/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.html diff --git a/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.scss b/userAndAdvertiser/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.scss similarity index 100% rename from src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.scss rename to userAndAdvertiser/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.scss diff --git a/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.spec.ts b/userAndAdvertiser/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.spec.ts similarity index 100% rename from src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.spec.ts rename to userAndAdvertiser/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.spec.ts diff --git a/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.ts b/userAndAdvertiser/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.ts similarity index 82% rename from src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.ts rename to userAndAdvertiser/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.ts index 1e65834..80f5e09 100644 --- a/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.ts +++ b/userAndAdvertiser/src/app/advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component.ts @@ -1,7 +1,6 @@ import {Component, Inject, OnInit} from '@angular/core'; -import {ThemeService} from "../../../utils/services/theme/theme.service"; import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from "@angular/material/dialog"; -import {Advert} from "../../../utils/interfaces/advert"; +import {ThemeService} from "../../../utils/theme/theme.service"; @@ -12,7 +11,7 @@ import {Advert} from "../../../utils/interfaces/advert"; }) export class PopupVisualizeAdAdvertiserComponent implements OnInit { - advert: Advert; + advert: any; constructor( public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, diff --git a/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.html b/userAndAdvertiser/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.html similarity index 100% rename from src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.html rename to userAndAdvertiser/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.html diff --git a/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.scss b/userAndAdvertiser/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.scss similarity index 100% rename from src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.scss rename to userAndAdvertiser/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.scss diff --git a/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.spec.ts b/userAndAdvertiser/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.spec.ts similarity index 100% rename from src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.spec.ts rename to userAndAdvertiser/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.spec.ts diff --git a/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.ts b/userAndAdvertiser/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.ts similarity index 100% rename from src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.ts rename to userAndAdvertiser/src/app/advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component.ts diff --git a/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.html b/userAndAdvertiser/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.html similarity index 100% rename from src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.html rename to userAndAdvertiser/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.html diff --git a/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.scss b/userAndAdvertiser/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.scss similarity index 100% rename from src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.scss rename to userAndAdvertiser/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.scss diff --git a/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.spec.ts b/userAndAdvertiser/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.spec.ts similarity index 100% rename from src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.spec.ts rename to userAndAdvertiser/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.spec.ts diff --git a/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.ts b/userAndAdvertiser/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.ts similarity index 88% rename from src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.ts rename to userAndAdvertiser/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.ts index de60d59..ee16328 100644 --- a/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.ts +++ b/userAndAdvertiser/src/app/advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component.ts @@ -1,11 +1,10 @@ import { Component, OnInit } from '@angular/core'; -import {User} from "../../../utils/interfaces/user"; -import {ThemeService} from "../../../utils/services/theme/theme.service"; import {MatDialog} from "@angular/material/dialog"; import {MatSnackBar} from "@angular/material/snack-bar"; import {PopupUpdateAdvertiserComponent} from "../popup-update-advertiser/popup-update-advertiser.component"; -import {MessageService} from "../../../utils/services/message/message.service"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; +import {MessageService} from "../../../utils/message/message.service"; +import {ProfilService} from "../../../utils/profil/profil.service"; @@ -16,7 +15,7 @@ import {ProfilService} from "../../../utils/services/profil/profil.service"; }) export class PageProfilAdvertiserComponent implements OnInit { - advertiser: User = { + advertiser = { _id: "", login: "", hashPass: "", diff --git a/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.html b/userAndAdvertiser/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.html similarity index 100% rename from src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.html rename to userAndAdvertiser/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.html diff --git a/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.scss b/userAndAdvertiser/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.scss similarity index 100% rename from src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.scss rename to userAndAdvertiser/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.scss diff --git a/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.spec.ts b/userAndAdvertiser/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.spec.ts similarity index 100% rename from src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.spec.ts rename to userAndAdvertiser/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.spec.ts diff --git a/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.ts b/userAndAdvertiser/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.ts similarity index 94% rename from src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.ts rename to userAndAdvertiser/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.ts index 8d4de8a..b93fdef 100644 --- a/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.ts +++ b/userAndAdvertiser/src/app/advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component.ts @@ -1,8 +1,7 @@ import {Component, Inject, OnInit} from '@angular/core'; -import {User} from "../../../utils/interfaces/user"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../utils/services/message/message.service"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; +import {MessageService} from "../../../utils/message/message.service"; +import {ProfilService} from "../../../utils/profil/profil.service"; @@ -13,7 +12,7 @@ import {ProfilService} from "../../../utils/services/profil/profil.service"; }) export class PopupUpdateAdvertiserComponent implements OnInit { - advertiserCopy: User; + advertiserCopy; newPassword: string = ""; confirmNewPassword: string = "" ; changePassword: boolean = false ; diff --git a/src/app/advertiser/pages-popularity/pages-popularity.component.html b/userAndAdvertiser/src/app/advertiser/pages-popularity/pages-popularity.component.html similarity index 100% rename from src/app/advertiser/pages-popularity/pages-popularity.component.html rename to userAndAdvertiser/src/app/advertiser/pages-popularity/pages-popularity.component.html diff --git a/src/app/advertiser/pages-popularity/pages-popularity.component.scss b/userAndAdvertiser/src/app/advertiser/pages-popularity/pages-popularity.component.scss similarity index 100% rename from src/app/advertiser/pages-popularity/pages-popularity.component.scss rename to userAndAdvertiser/src/app/advertiser/pages-popularity/pages-popularity.component.scss diff --git a/src/app/advertiser/pages-popularity/pages-popularity.component.spec.ts b/userAndAdvertiser/src/app/advertiser/pages-popularity/pages-popularity.component.spec.ts similarity index 100% rename from src/app/advertiser/pages-popularity/pages-popularity.component.spec.ts rename to userAndAdvertiser/src/app/advertiser/pages-popularity/pages-popularity.component.spec.ts diff --git a/src/app/advertiser/pages-popularity/pages-popularity.component.ts b/userAndAdvertiser/src/app/advertiser/pages-popularity/pages-popularity.component.ts similarity index 94% rename from src/app/advertiser/pages-popularity/pages-popularity.component.ts rename to userAndAdvertiser/src/app/advertiser/pages-popularity/pages-popularity.component.ts index 991b8fa..298ec8d 100644 --- a/src/app/advertiser/pages-popularity/pages-popularity.component.ts +++ b/userAndAdvertiser/src/app/advertiser/pages-popularity/pages-popularity.component.ts @@ -3,11 +3,9 @@ import {FormControl} from "@angular/forms"; import {ChartDataSets} from "chart.js"; import {Label} from "ng2-charts"; import { Router} from "@angular/router"; -import {FictitiousAdvertsService} from "../../utils/services/fictitiousDatas/fictitiousAdverts/fictitious-adverts.service"; -import {FictitiousVideosService} from "../../utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service"; -import {ThemeService} from "../../utils/services/theme/theme.service"; -import {MessageService} from "../../utils/services/message/message.service"; import {HttpParams} from "@angular/common/http"; +import {ThemeService} from "../../utils/theme/theme.service"; +import {MessageService} from "../../utils/message/message.service"; @@ -53,8 +51,6 @@ export class PagesPopularityComponent implements OnInit constructor( private router: Router, public themeService: ThemeService, - private fictitiousAdvertsService: FictitiousAdvertsService, - private fictitiousVideosService: FictitiousVideosService, private messageService: MessageService ) {} diff --git a/src/app/advertiser/utils/dragAndDrop/drag-and-drop.directive.spec.ts b/userAndAdvertiser/src/app/advertiser/utils/dragAndDrop/drag-and-drop.directive.spec.ts similarity index 100% rename from src/app/advertiser/utils/dragAndDrop/drag-and-drop.directive.spec.ts rename to userAndAdvertiser/src/app/advertiser/utils/dragAndDrop/drag-and-drop.directive.spec.ts diff --git a/src/app/advertiser/utils/dragAndDrop/drag-and-drop.directive.ts b/userAndAdvertiser/src/app/advertiser/utils/dragAndDrop/drag-and-drop.directive.ts similarity index 100% rename from src/app/advertiser/utils/dragAndDrop/drag-and-drop.directive.ts rename to userAndAdvertiser/src/app/advertiser/utils/dragAndDrop/drag-and-drop.directive.ts diff --git a/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.html b/userAndAdvertiser/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.html similarity index 100% rename from src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.html rename to userAndAdvertiser/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.html diff --git a/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.scss b/userAndAdvertiser/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.scss similarity index 100% rename from src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.scss rename to userAndAdvertiser/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.scss diff --git a/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.spec.ts b/userAndAdvertiser/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.spec.ts similarity index 100% rename from src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.spec.ts rename to userAndAdvertiser/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.spec.ts diff --git a/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.ts b/userAndAdvertiser/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.ts similarity index 87% rename from src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.ts rename to userAndAdvertiser/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.ts index 7f403db..c65b5fe 100644 --- a/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.ts +++ b/userAndAdvertiser/src/app/advertiser/utils/navbar-advertiser/navbar-advertiser.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import {Router} from "@angular/router"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; -import {MessageService} from "../../../utils/services/message/message.service"; +import {ProfilService} from "../../../utils/profil/profil.service"; +import {MessageService} from "../../../utils/message/message.service"; diff --git a/src/app/app-routing.module.ts b/userAndAdvertiser/src/app/app-routing.module.ts similarity index 76% rename from src/app/app-routing.module.ts rename to userAndAdvertiser/src/app/app-routing.module.ts index df9fee2..d1888ec 100644 --- a/src/app/app-routing.module.ts +++ b/userAndAdvertiser/src/app/app-routing.module.ts @@ -1,22 +1,18 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import {PageLoginComponent} from './beforeConnexion/login/page-login/page-login.component'; +import {PageLoginComponent} from "./beforeConnexion/login/page-login/page-login.component"; import {PageRegisterComponent} from "./beforeConnexion/register/page-register/page-register.component"; import {PageSearchComponent} from "./user/search/page-search/page-search.component"; import {PageMyPlaylistsComponent} from "./user/myPlaylists/page-my-playlists/page-my-playlists.component"; +import {PageProfilUserComponent} from "./user/myProfil/page-profil-user/page-profil-user.component"; +import {PageWatchingVideoComponent} from "./user/watching/page-watching-video/page-watching-video.component"; import {PageHistoryUserComponent} from "./user/history/page-history-user/page-history-user.component"; import {PageAdListAdvertiserComponent} from "./advertiser/adList/page-ad-list-advertiser/page-ad-list-advertiser.component"; -import {PageProfilUserComponent} from "./user/myProfil/page-profil-user/page-profil-user.component"; -import {PageProfilAdvertiserComponent} from "./advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component"; -import {PageProfilAdminComponent} from "./admin/myProfil/page-profil-admin/page-profil-admin.component"; -import {PageAdListAdminComponent} from "./admin/adList/page-ad-list-admin/page-ad-list-admin.component"; -import {PageUserListComponent} from "./admin/userList/page-user-list/page-user-list.component"; -import {PageWatchingVideoComponent} from "./user/watching/page-watching-video/page-watching-video.component"; import {PagesPopularityComponent} from "./advertiser/pages-popularity/pages-popularity.component"; +import {PageProfilAdvertiserComponent} from "./advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component"; const routes: Routes = [ - // Before connexion { path: '', component: PageLoginComponent }, { path: 'login', component: PageLoginComponent }, @@ -36,16 +32,8 @@ const routes: Routes = [ { path: 'advertiser/myProfil', component: PageProfilAdvertiserComponent }, { path: 'advertiser/adsPopularity', component: PagesPopularityComponent }, { path: 'advertiser/subjectsPopularity', component: PagesPopularityComponent }, - - // Admin - { path: 'admin', component: PageUserListComponent }, - { path: 'admin/userList', component: PageUserListComponent }, - { path: 'admin/adList', component: PageAdListAdminComponent }, - { path: 'admin/myProfil', component: PageProfilAdminComponent }, - ]; - @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] diff --git a/userAndAdvertiser/src/app/app.component.html b/userAndAdvertiser/src/app/app.component.html new file mode 100644 index 0000000..d5d92f3 --- /dev/null +++ b/userAndAdvertiser/src/app/app.component.html @@ -0,0 +1,2 @@ + + diff --git a/userAndAdvertiser/src/app/app.component.scss b/userAndAdvertiser/src/app/app.component.scss new file mode 100644 index 0000000..22a5665 --- /dev/null +++ b/userAndAdvertiser/src/app/app.component.scss @@ -0,0 +1,24 @@ +::ng-deep snack-bar-container.custom-class { + //background: yellow; +} +::ng-deep .custom-class .mat-simple-snackbar { + //color: green; + justify-content: center; +} + + +// aura +::ng-deep .mat-checkbox-ripple .mat-ripple-element { + background-color: grey !important; +} + +// contenu coche +::ng-deep .mat-checkbox-checked.mat-accent .mat-checkbox-background { + background-color: black !important; +} + +// indeterminate +::ng-deep .mat-checkbox .mat-checkbox-frame { + border: solid 1px black !important; + background-color: white !important; +} diff --git a/userAndAdvertiser/src/app/app.component.spec.ts b/userAndAdvertiser/src/app/app.component.spec.ts new file mode 100644 index 0000000..ab837bf --- /dev/null +++ b/userAndAdvertiser/src/app/app.component.spec.ts @@ -0,0 +1,35 @@ +import { TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ + RouterTestingModule + ], + declarations: [ + AppComponent + ], + }).compileComponents(); + }); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it(`should have as title 'userAndAdvertiser'`, () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app.title).toEqual('userAndAdvertiser'); + }); + + it('should render title', () => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.nativeElement as HTMLElement; + expect(compiled.querySelector('.content span')?.textContent).toContain('userAndAdvertiser app is running!'); + }); +}); diff --git a/userAndAdvertiser/src/app/app.component.ts b/userAndAdvertiser/src/app/app.component.ts new file mode 100644 index 0000000..945afdf --- /dev/null +++ b/userAndAdvertiser/src/app/app.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'] +}) +export class AppComponent { + title = 'userAndAdvertiser'; +} diff --git a/userAndAdvertiser/src/app/app.module.ts b/userAndAdvertiser/src/app/app.module.ts new file mode 100644 index 0000000..dc1e214 --- /dev/null +++ b/userAndAdvertiser/src/app/app.module.ts @@ -0,0 +1,131 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; + +import { AppRoutingModule } from './app-routing.module'; +import { AppComponent } from './app.component'; +import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; +import {MatSlideToggleModule} from "@angular/material/slide-toggle"; +import {FormsModule, ReactiveFormsModule} from "@angular/forms"; +import {HttpClientModule} from "@angular/common/http"; +import {MatIconModule} from "@angular/material/icon"; +import {MatDialogModule} from "@angular/material/dialog"; +import {MatButtonModule} from "@angular/material/button"; +import {MatInputModule} from "@angular/material/input"; +import {MatCheckboxModule} from "@angular/material/checkbox"; +import {MatFormFieldModule} from "@angular/material/form-field"; +import {MatDividerModule} from "@angular/material/divider"; +import {MatSnackBarModule} from "@angular/material/snack-bar"; +import {MatGridListModule} from "@angular/material/grid-list"; +import {MatTableModule} from "@angular/material/table"; +import {MatSortModule} from "@angular/material/sort"; +import {MatChipsModule} from "@angular/material/chips"; +import {MatSelectModule} from "@angular/material/select"; +import {MatAutocompleteModule} from "@angular/material/autocomplete"; +import {MatRadioModule} from "@angular/material/radio"; +import {MatPaginatorModule} from "@angular/material/paginator"; +import {MatDatepickerModule} from "@angular/material/datepicker"; +import { ChartsModule } from 'ng2-charts'; +import {DragAndDropComponent} from "./advertiser/adList/drag-and-drop/drag-and-drop.component"; +import {InputInterestsAdComponent} from "./advertiser/adList/input-interests-ad/input-interests-ad.component"; +import {PageAdListAdvertiserComponent} from "./advertiser/adList/page-ad-list-advertiser/page-ad-list-advertiser.component"; +import {PopupAddOrUpdateAdComponent} from "./advertiser/adList/popup-add-or-update-ad/popup-add-or-update-ad.component"; +import {PopupDeleteAdAdvertiserComponent} from "./advertiser/adList/popup-delete-ad-advertiser/popup-delete-ad-advertiser.component"; +import {PopupVisualizeAdAdvertiserComponent} from "./advertiser/adList/popup-visualize-ad-advertiser/popup-visualize-ad-advertiser.component"; +import {PopupVisualizeImagesAdvertiserComponent} from "./advertiser/adList/popup-visualize-images-advertiser/popup-visualize-images-advertiser.component"; +import {NavbarAdvertiserComponent} from "./advertiser/utils/navbar-advertiser/navbar-advertiser.component"; +import {DragAndDropDirective} from "./advertiser/utils/dragAndDrop/drag-and-drop.directive"; +import {PageProfilAdvertiserComponent} from "./advertiser/myProfil/page-profil-advertiser/page-profil-advertiser.component"; +import {PopupUpdateAdvertiserComponent} from "./advertiser/myProfil/popup-update-advertiser/popup-update-advertiser.component"; +import {PagesPopularityComponent} from "./advertiser/pages-popularity/pages-popularity.component"; +import {NavbarUserComponent} from "./user/utils/components/navbar-user/navbar-user.component"; +import {PageHistoryUserComponent} from "./user/history/page-history-user/page-history-user.component"; +import {PageMyPlaylistsComponent} from "./user/myPlaylists/page-my-playlists/page-my-playlists.component"; +import {PlaylistListComponent} from "./user/myPlaylists/playlist-list/playlist-list.component"; +import {PopupCreateOrUpdatePlaylistComponent} from "./user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component"; +import {PopupDeletePlaylistComponent} from "./user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component"; +import {VideoListComponent} from "./user/myPlaylists/video-list/video-list.component"; +import {InputInterestsProfilComponent} from "./user/myProfil/input-interests-profil/input-interests-profil.component"; +import {PageProfilUserComponent} from "./user/myProfil/page-profil-user/page-profil-user.component"; +import {PopupUpdateUserComponent} from "./user/myProfil/popup-update-user/popup-update-user.component"; +import {PageSearchComponent} from "./user/search/page-search/page-search.component"; +import {VideoGridComponent} from "./user/search/video-grid/video-grid.component"; +import {PageWatchingVideoComponent} from "./user/watching/page-watching-video/page-watching-video.component"; +import {AdvertComponent} from "./user/utils/components/advert/advert.component"; +import {PopupAddVideoToPlaylistsComponent} from "./user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component"; +import {PageLoginComponent} from "./beforeConnexion/login/page-login/page-login.component"; +import {PopupForgottenPasswordComponent} from "./beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component"; +import {InputInterestsRegisterComponent} from "./beforeConnexion/register/input-interests-register/input-interests-register.component"; +import {PageRegisterComponent} from "./beforeConnexion/register/page-register/page-register.component"; +import {PopupConfirmationComponent} from "./beforeConnexion/register/popup-confirmation/popup-confirmation.component"; +import {NavbarBeforeConnexionComponent} from "./beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component"; +import {MatStepperModule} from "@angular/material/stepper"; + +@NgModule({ + declarations: [ + AppComponent, + DragAndDropDirective, + NavbarBeforeConnexionComponent, + PageLoginComponent, + PopupForgottenPasswordComponent, + InputInterestsRegisterComponent, + PageRegisterComponent, + PopupConfirmationComponent, + NavbarAdvertiserComponent, + DragAndDropComponent, + InputInterestsAdComponent, + PageAdListAdvertiserComponent, + PopupAddOrUpdateAdComponent, + PopupDeleteAdAdvertiserComponent, + PopupVisualizeAdAdvertiserComponent, + PopupVisualizeImagesAdvertiserComponent, + PageProfilAdvertiserComponent, + PopupUpdateAdvertiserComponent, + PagesPopularityComponent, + NavbarUserComponent, + PageHistoryUserComponent, + PageMyPlaylistsComponent, + PlaylistListComponent, + PopupCreateOrUpdatePlaylistComponent, + PopupDeletePlaylistComponent, + VideoListComponent, + InputInterestsProfilComponent, + PageProfilUserComponent, + PopupUpdateUserComponent, + PageSearchComponent, + VideoGridComponent, + PageWatchingVideoComponent, + AdvertComponent, + PopupAddVideoToPlaylistsComponent + ], + imports: [ + BrowserModule, + AppRoutingModule, + BrowserAnimationsModule, + MatSlideToggleModule, + FormsModule, + HttpClientModule, + MatDialogModule, + MatButtonModule, + MatIconModule, + MatInputModule, + MatDividerModule, + MatCheckboxModule, + MatFormFieldModule, + MatSnackBarModule, + MatGridListModule, + MatTableModule, + MatSortModule, + MatChipsModule, + ReactiveFormsModule, + MatAutocompleteModule, + MatSelectModule, + MatRadioModule, + MatPaginatorModule, + MatDatepickerModule, + ChartsModule, + MatStepperModule + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.html b/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.html new file mode 100644 index 0000000..675270e --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.html @@ -0,0 +1,36 @@ +
+
+ + + +
+
+ + +
+

StreamNotFound

+ User Icon +
+ + + + + + +
+ {{errorMessage}} +
+ + + + + + +
+
+ + +
+
diff --git a/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.scss b/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.scss new file mode 100644 index 0000000..8924202 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.scss @@ -0,0 +1,271 @@ +html { + background-color: #56baed; +} + +body { + font-family: "Poppins", sans-serif; + height: 100vh; +} + +a { + color: #5E89FF; + display:inline-block; + text-decoration: none; + font-weight: 400; +} + +h2 { + text-align: center; + font-size: 16px; + font-weight: 600; + text-transform: uppercase; + display:inline-block; + margin: 40px 8px 10px 8px; + color: #cccccc; +} + + + +/* STRUCTURE */ + +.wrapper { + display: flex; + align-items: center; + flex-direction: column; + justify-content: center; + width: 100%; + min-height: 80%; + padding: 20px; +} + +#formContent { + -webkit-border-radius: 10px 10px 10px 10px; + border-radius: 10px 10px 10px 10px; + background: #fff; + padding: 30px; + width: 90%; + max-width: 450px; + position: relative; + padding: 0px; + -webkit-box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3); + box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3); + text-align: center; +} + +#formFooter { + background-color: #f6f6f6; + border-top: 1px solid #dce8f1; + padding: 25px; + text-align: center; + -webkit-border-radius: 0 0 10px 10px; + border-radius: 0 0 10px 10px; +} + + + +/* TABS */ + +h2.inactive { + color: #cccccc; +} + +h2.active { + color: #0d0d0d; + border-bottom: 2px solid #5fbae9; +} + + + +/* FORM TYPOGRAPHY*/ + +input[type=button], input[type=submit], input[type=reset] { + background-color: #5E89FF; + border: none; + color: white; + padding: 15px 80px; + text-align: center; + text-decoration: none; + display: inline-block; + text-transform: uppercase; + font-size: 13px; + -webkit-box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4); + box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4); + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + margin: 5px 20px 40px 20px; + -webkit-transition: all 0.3s ease-in-out; + -moz-transition: all 0.3s ease-in-out; + -ms-transition: all 0.3s ease-in-out; + -o-transition: all 0.3s ease-in-out; + transition: all 0.3s ease-in-out; +} + +input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover { + background-color: #39ace7; +} + +input[type=button]:active, input[type=submit]:active, input[type=reset]:active { + -moz-transform: scale(0.95); + -webkit-transform: scale(0.95); + -o-transform: scale(0.95); + -ms-transform: scale(0.95); + transform: scale(0.95); +} + +input[type=text], input[type=password] { + background-color: #f6f6f6; + border: none; + color: #0d0d0d; + padding: 15px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 5px; + width: 85%; + border: 2px solid #f6f6f6; + -webkit-transition: all 0.5s ease-in-out; + -moz-transition: all 0.5s ease-in-out; + -ms-transition: all 0.5s ease-in-out; + -o-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} + + + +input[type=text]:focus, input[type=password]:focus { + background-color: #fff; + border-bottom: 2px solid #5fbae9; +} + +input[type=text]::placeholder, input[type=password]::placeholder { + color: #cccccc; +} + +.bg{ + margin: 0; + padding: 0; + height: 100vh; + width: 100vw; + overflow-y: hidden; + overflow-x: hidden; +} + +/* ANIMATIONS */ + +/* Simple CSS3 Fade-in-down Animation */ +.fadeInDown { + -webkit-animation-name: fadeInDown; + animation-name: fadeInDown; + -webkit-animation-duration: 1s; + animation-duration: 1s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +@-webkit-keyframes fadeInDown { + 0% { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInDown { + 0% { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +/* Simple CSS3 Fade-in Animation */ +@-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } +@-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } +@keyframes fadeIn { from { opacity:0; } to { opacity:1; } } + +.fadeIn { + opacity:0; + -webkit-animation:fadeIn ease-in 1; + -moz-animation:fadeIn ease-in 1; + animation:fadeIn ease-in 1; + + -webkit-animation-fill-mode:forwards; + -moz-animation-fill-mode:forwards; + animation-fill-mode:forwards; + + -webkit-animation-duration:1s; + -moz-animation-duration:1s; + animation-duration:1s; +} + +.fadeIn.first { + -webkit-animation-delay: 0.4s; + -moz-animation-delay: 0.4s; + animation-delay: 0.4s; +} + +.fadeIn.second { + -webkit-animation-delay: 0.6s; + -moz-animation-delay: 0.6s; + animation-delay: 0.6s; +} + +.fadeIn.third { + -webkit-animation-delay: 0.8s; + -moz-animation-delay: 0.8s; + animation-delay: 0.8s; +} + +.fadeIn.fourth { + -webkit-animation-delay: 1s; + -moz-animation-delay: 1s; + animation-delay: 1s; +} + +/* Simple CSS3 Fade-in Animation */ +.underlineHover:after { + display: block; + left: 0; + bottom: -10px; + width: 0; + height: 2px; + //background-color: #5E89FF; + background-color: #5E89FF; + content: ""; + transition: width 0.2s; +} + +.underlineHover:hover { + color: #0d0d0d; +} + +.underlineHover:hover:after{ + width: 100%; +} + +h1{ + color: black; +} + +/* OTHERS */ + +*:focus { + outline: none; +} + +#icon { + width:30%; +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.spec.ts b/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.spec.ts new file mode 100644 index 0000000..a4ee677 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PageLoginComponent } from './page-login.component'; + +describe('PageLoginComponent', () => { + let component: PageLoginComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PageLoginComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PageLoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.ts b/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.ts new file mode 100644 index 0000000..555e496 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/login/page-login/page-login.component.ts @@ -0,0 +1,101 @@ +import {Component, OnInit} from '@angular/core'; +import {Router} from "@angular/router"; +import {MatDialog} from "@angular/material/dialog"; +import {PopupForgottenPasswordComponent} from "../popup-forgotten-password/popup-forgotten-password.component"; +import {MatSnackBar} from "@angular/material/snack-bar"; +import {ProfilService} from "../../../utils/profil/profil.service"; +import {MessageService} from "../../../utils/message/message.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; + + + +@Component({ + selector: 'app-page-login', + templateUrl: './page-login.component.html', + styleUrls: ['./page-login.component.scss'] +}) +export class PageLoginComponent implements OnInit +{ + email: string = "" ; + password: string = "" ; + hasError: boolean = false; + errorMessage: string = ""; + + + constructor( private messageService: MessageService, + private router: Router, + public themeService: ThemeService, + public dialog: MatDialog, + private snackBar: MatSnackBar, + private profilService: ProfilService) { } + + + ngOnInit(): void {} + + + onSeConnecter(): void + { + this.checkError(); + + if(!this.hasError) + { + let data = { + email: this.email, + hashPass: this.password + }; + this.messageService + .post('user/auth', data) + .subscribe( retour => this.onSeConnecterCallback(retour), err => this.onSeConnecterCallback(err)); + } + } + + + onSeConnecterCallback(retour: any): void + { + if(retour.status !== "success") { + console.log(retour); + this.errorMessage = retour.error.reason; + this.hasError = true; + } + else { + 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'); + } + } + + + onForgottenPassword(): void + { + this.dialog + .open(PopupForgottenPasswordComponent, {width: '30%'}) + .afterClosed() + .subscribe(result => { + if((result !== null) && (result !== undefined)) + { + const config = { duration: 5000, panelClass: "custom-class" }; + this.snackBar.open( "Un mail de réinitialisation de mot de passe vous a été envoyé.", "", config); + } + }); + } + + + checkError(): void + { + if(this.email === "") { + this.errorMessage = "Veuillez remplir le champ email" ; + this.hasError = true; + } + else if(this.password === "") { + this.errorMessage = "Veuillez remplir le champ mot de passe" ; + this.hasError = true; + } + else { + this.errorMessage = "" ; + this.hasError = false; + } + } + +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.html b/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.html new file mode 100644 index 0000000..c34b58e --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.html @@ -0,0 +1,24 @@ +

Récupération du mot de passe

+ +
+ + +
+ + Email + + +
+ + +
+ {{errorMessage}} +
+ + + + + + + + diff --git a/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.scss b/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.scss new file mode 100644 index 0000000..fa75013 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.scss @@ -0,0 +1,12 @@ +h4 { + text-align: center; +} + +.myDiv { + text-align: center; + font-size: small; +} + +.myError { + text-align: center; +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.spec.ts b/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.spec.ts new file mode 100644 index 0000000..ebf101c --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PopupForgottenPasswordComponent } from './popup-forgotten-password.component'; + +describe('PopupForgottenPasswordComponent', () => { + let component: PopupForgottenPasswordComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PopupForgottenPasswordComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PopupForgottenPasswordComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.ts b/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.ts new file mode 100644 index 0000000..1ff70ce --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/login/popup-forgotten-password/popup-forgotten-password.component.ts @@ -0,0 +1,47 @@ +import { Component } from '@angular/core'; +import {MatDialogRef} from "@angular/material/dialog"; + + + +@Component({ + selector: 'app-popup-forgotten-password', + templateUrl: './popup-forgotten-password.component.html', + styleUrls: ['./popup-forgotten-password.component.scss'] +}) +export class PopupForgottenPasswordComponent +{ + email: string; + hasError: boolean = false; + errorMessage: string = ""; + + + constructor(public dialogRef: MatDialogRef) {} + + + // Click sur valider + onValidate() + { + if(this.email.length === 0) { + this.errorMessage = "Veuillez remplir le champ 'email'." ; + this.hasError = true; + } + else if(!this.isValidEmail(this.email)) { + this.errorMessage = "Email invalide." ; + this.hasError = true; + } + else { + this.errorMessage = "" ; + this.hasError = false; + this.dialogRef.close(true); + } + } + + + // Indique si email a bien le format d'un email + isValidEmail(email): boolean + { + let re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + return re.test(email); + } + +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.html b/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.html new file mode 100644 index 0000000..2a7c484 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.html @@ -0,0 +1,43 @@ + + + + + Centres d'intérêt + + + + + + + {{interest}} + + + + + + + + + + + + {{interest}} + + + + + + diff --git a/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.scss b/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.scss similarity index 100% rename from src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.scss rename to userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.scss diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.spec.ts b/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.spec.ts new file mode 100644 index 0000000..9917b1a --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { InputInterestsRegisterComponent } from './input-interests-register.component'; + +describe('InputInterestsRegisterComponent', () => { + let component: InputInterestsRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ InputInterestsRegisterComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(InputInterestsRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.ts b/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.ts new file mode 100644 index 0000000..8dba84e --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/input-interests-register/input-interests-register.component.ts @@ -0,0 +1,121 @@ +import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; +import {COMMA, ENTER} from "@angular/cdk/keycodes"; +import {FormControl} from "@angular/forms"; +import {Observable} from "rxjs"; +import {map, startWith} from "rxjs/operators"; +import {MatChipInputEvent} from "@angular/material/chips"; +import {MatAutocompleteSelectedEvent} from "@angular/material/autocomplete"; +import {MessageService} from "../../../utils/message/message.service"; + + + +@Component({ + selector: 'app-input-interests-register', + templateUrl: './input-interests-register.component.html', + styleUrls: ['./input-interests-register.component.scss'] +}) +export class InputInterestsRegisterComponent implements OnInit +{ + selectable = true; + removable = true; + separatorKeysCodes: number[] = [ENTER, COMMA]; + formControl = new FormControl(); + filteredInterests: Observable; + @Input() myInterests: string[] = []; + allInterests: string[] = []; + @Output() eventEmitter = new EventEmitter(); + @ViewChild('tagInput') tagInput: ElementRef; + interestsNotSelected: string[] = []; + + + constructor( private messageService: MessageService ) {} + + + ngOnInit(): void + { + this.filteredInterests = this.formControl.valueChanges.pipe( + startWith(null), + map((fruit: string | null) => fruit ? this._filter(fruit) : this.interestsNotSelected.slice())); + + this.messageService + .get("misc/getInterests") + .subscribe( retour => { + + if(retour.status !== "success") { + console.log(retour); + } + else { + this.allInterests = []; + for(let elt of retour.data) + { + this.allInterests.push(elt.interest); + this.interestsNotSelected.push(elt.interest); + } + } + }); + } + + + add(event: MatChipInputEvent): void + { + const value = (event.value || '').trim(); + const index = this.interestsNotSelected.indexOf(value); + if (value && (index !== -1) && (!this.myInterests.includes(value))) + { + this.myInterests.push(value); + event.chipInput!.clear(); + this.formControl.setValue(null); + this.eventEmitter.emit(this.myInterests); + this.interestsNotSelected.splice(index, 1); + } + } + + + remove(interest: string): void + { + // supprimer 'interest' de 'myInterest' + const index = this.myInterests.indexOf(interest); + if (index >= 0) this.myInterests.splice(index, 1); + this.eventEmitter.emit(this.myInterests); + + // remmettre 'interest' dans 'interestsNotSelected' + if(!this.interestsNotSelected.includes(interest)) + { + const indexOfAutres = this.interestsNotSelected.indexOf("Autres"); + if(indexOfAutres !== -1) + { + this.interestsNotSelected.splice(indexOfAutres, 1); + if(interest !== "Autres") this.interestsNotSelected.push(interest); + this.interestsNotSelected.sort(); + this.interestsNotSelected.push("Autres"); + } + else { + this.interestsNotSelected.push(interest); + if(interest !== "Autres") this.interestsNotSelected.sort(); + } + } + } + + + selected(event: MatAutocompleteSelectedEvent): void + { + const value = event.option.viewValue; + if(!this.myInterests.includes(value)) + { + this.myInterests.push(value); + const index = this.interestsNotSelected.indexOf(value); + this.interestsNotSelected.splice(index, 1); + } + this.tagInput.nativeElement.value = ''; + this.formControl.setValue(null); + this.eventEmitter.emit(this.myInterests); + } + + + private _filter(value: string): string[] + { + const filterValue = value.toLowerCase(); + return this.interestsNotSelected.filter(fruit => fruit.toLowerCase().includes(filterValue)); + } + +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.html b/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.html new file mode 100644 index 0000000..fb6e3ac --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.html @@ -0,0 +1,162 @@ +
+
+ + + + + + + + + +
+ + + Utilisateur standard    + Annonceur + + + +
+ +
+
+
+ + + + +
+ + + + +
+ {{errorMessage}} +
+ + +
+ + +
+
+
+ +
+ +
+
+ + + + + + + +
+
+ + +
+

Compte

+ + + + Pseudo + + +
+ + + + Mot de passe + + +
+ + + + Confirmation mot de passe + + +
+ + +
+

Informations personelles

+ + + + Email + + +
+ + + + Homme     + Femme + +

+ + + + Date de naissance + + + + + +
+ +
+
+ + + + + + + + + + + Entreprise + + +
+ + + + Pseudo + + +
+ + + + Email + + +
+ + + + Mot de passe + + +
+ + + + Confirmation mot de passe + + + +
diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.scss b/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.scss new file mode 100644 index 0000000..5f0dc53 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.scss @@ -0,0 +1,47 @@ +.myContainer { + width: 100vw; + height: 100vh; +} + + +mat-stepper { + width: 60%; + margin: 10vh auto; + border: solid 1px black; + border-radius: 20px; +} + + +.leftCol { + border-right: solid 1px #dcdcdc; +} + + +.myRow { + margin: 15px 0px 15px 0px; +} +.myLabel { + text-align: right; + padding: 0px 5px 0px 0px; + margin: 0px; + font-weight: bold; +} +.myValue { + text-align: left; + padding: 0px 0px 0px 5px; + margin: 0px; +} + + +// ------------------------------------------------------------------------- + + +::ng-deep .mat-radio-inner-circle { + color: black !important; + background-color: black !important; +} + +::ng-deep .mat-radio-outer-circle{ + color: black !important; + border: solid 1px gray !important; +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.spec.ts b/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.spec.ts new file mode 100644 index 0000000..5cff194 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PageRegisterComponent } from './page-register.component'; + +describe('PageRegisterComponent', () => { + let component: PageRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PageRegisterComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PageRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.ts b/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.ts new file mode 100644 index 0000000..788c8be --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/page-register/page-register.component.ts @@ -0,0 +1,134 @@ +import { Component } from '@angular/core'; +import {PopupConfirmationComponent} from "../popup-confirmation/popup-confirmation.component"; +import {MessageService} from "../../../utils/message/message.service"; +import {Router} from "@angular/router"; +import {MatDialog} from "@angular/material/dialog"; +import {ThemeService} from "../../../utils/theme/theme.service"; + + + +@Component({ + selector: 'app-page-register', + templateUrl: './page-register.component.html', + styleUrls: ['./page-register.component.scss'] +}) +export class PageRegisterComponent +{ + password: string = ""; + confirmPassword: string = ""; + hasError: boolean = false; + errorMessage: string = ""; + user = { + _id: "", + login: "", + hashPass: "", + email: "", + role: { + name: "user", + permission: 0, + isAccepted: false, + }, + profileImageUrl: "", + dateOfBirth: null, + gender: "man", + interests: [], + company: "", + isActive: true, + createdAt: new Date(), + updatedAt: new Date(), + lastConnexion: null + }; + + + constructor( private messageService: MessageService, + private router: Router, + public dialog: MatDialog, + public themeService: ThemeService ) { } + + + // Envoie de l'utilisateur au backend + onEnregistrer(): void + { + this.checkField(); + if(!this.hasError) + { + let data: any = Object.assign({}, this.user); + if(this.user.role.name === "user") data.role = "user" ; + else data.role = "advertiser"; + data.hashPass = this.password; + this.messageService + .post('user/create', data) + .subscribe(retour => this.onEnregistrerCallback(retour), err => this.onEnregistrerCallback(err)); + } + } + + + // Gestion de la réponse du backend + onEnregistrerCallback(retour): void + { + if(retour.status !== "success") { + console.log(retour); + } + else + { + const config = { + width: '25%', + data: {roleName: this.user.role.name} + }; + this.dialog + .open(PopupConfirmationComponent, config) + .afterClosed() + .subscribe(result => this.router.navigateByUrl( '/login' )); + } + } + + + // Check les champs saisies par l'utilisateur + checkField(): void + { + if((this.user.role.name === 'advertiser') && (this.user.company.length === 0)) { + this.errorMessage = "Veuillez remplir le champ 'entreprise'."; + this.hasError = true; + } + else if(this.user.login.length === 0) { + 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; + } + else if(!this.isValidEmail(this.user.email)) { + this.errorMessage = "Email invalide."; + this.hasError = true; + } + else if(this.password.length === 0) { + this.errorMessage = "Veuillez remplir le champ 'mot de passe'."; + this.hasError = true; + } + else if(this.password !== this.confirmPassword) { + this.errorMessage = "Le mot de passe est différent de sa confirmation."; + this.hasError = true; + } + else { + this.errorMessage = "" ; + this.hasError = false; + } + } + + + // Indique si email a bien le format d'un email + isValidEmail(email): boolean + { + let re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + return re.test(email); + } + + + // Récupère la liste des centres d'intérets (car celle-ci est remplie à l'aide d'un component intermédiaire) + onEventInputInterests(myInterets: string[]): void + { + this.user.interests = myInterets; + } + +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.html b/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.html new file mode 100644 index 0000000..1cd51fe --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.html @@ -0,0 +1,11 @@ +

+ Votre inscription a bien été effectuée. +

+ +

+ Votre inscription est en cours de validation. +

+ +
+ +
diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.scss b/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.scss new file mode 100644 index 0000000..85730e0 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.scss @@ -0,0 +1,7 @@ +p { + font-size: small; +} + +div { + font-size: small; +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.spec.ts b/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.spec.ts new file mode 100644 index 0000000..d6f9908 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PopupConfirmationComponent } from './popup-confirmation.component'; + +describe('PopupConfirmationComponent', () => { + let component: PopupConfirmationComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PopupConfirmationComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PopupConfirmationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.ts b/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.ts new file mode 100644 index 0000000..59e3325 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/register/popup-confirmation/popup-confirmation.component.ts @@ -0,0 +1,13 @@ +import {Component, Inject} from '@angular/core'; +import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; + +@Component({ + selector: 'app-popup-confirmation', + templateUrl: './popup-confirmation.component.html', + styleUrls: ['./popup-confirmation.component.scss'] +}) +export class PopupConfirmationComponent +{ + constructor( public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data) {} +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.html b/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.html new file mode 100644 index 0000000..d4ad9f5 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.html @@ -0,0 +1,40 @@ + +
+ +
+ + + + + + +
+ +
diff --git a/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.scss b/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.scss new file mode 100644 index 0000000..e1fefaa --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.scss @@ -0,0 +1,79 @@ +.navbar { + background-color: black; + height: 60px; + font-size: medium; + color: white; +} + + +.navbar-expand-lg { + border-bottom: solid; + border-color: white; + border-bottom-width: 2px; +} + + +// PolyNotFound +.navbar-brand { + font-family: cursive; + font-weight: bold; + font-size: x-large; + margin-left: 15px; + color: white; +} + + +// Recherche, Mes Playlists, Historique +.nav-link { + color: white; +} +.nav-link:hover { + color: grey; +} + + +// Bonton deconnexion +.btnDeconnexion { + font-size: medium; + margin: 0px 10px 0px 10px +} +.btnDeconnexion:hover { + color: grey; +} + + +.monLi { + margin: 0px 10px 0px 10px; +} + + +img { + border: solid 2px white; + border-radius: 50px; + margin: 0px 10px 0px 15px; + width: 40px; + height: 40px; +} +img:hover { + cursor: pointer; +} + + +// -------------------------------------------------------------------- + + +::ng-deep .mat-slide-toggle-thumb { + background-color: #c8c8c8; +} + +::ng-deep .mat-slide-toggle-bar { + background-color: #ffffff; +} + +::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb { + background-color: #ffffff; +} + +::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar { + background-color: #646464; +} diff --git a/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.spec.ts b/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.spec.ts new file mode 100644 index 0000000..f3f7f27 --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NavbarBeforeConnexionComponent } from './navbar-before-connexion.component'; + +describe('NavbarBeforeConnexionComponent', () => { + let component: NavbarBeforeConnexionComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ NavbarBeforeConnexionComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(NavbarBeforeConnexionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.ts b/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.ts new file mode 100644 index 0000000..4a3f05e --- /dev/null +++ b/userAndAdvertiser/src/app/beforeConnexion/utils/navbar-before-connexion/navbar-before-connexion.component.ts @@ -0,0 +1,11 @@ +import {Component, Input} from '@angular/core'; + +@Component({ + selector: 'app-navbar-before-connexion', + templateUrl: './navbar-before-connexion.component.html', + styleUrls: ['./navbar-before-connexion.component.scss'] +}) +export class NavbarBeforeConnexionComponent +{ + @Input() pour = "login"; +} diff --git a/src/app/user/history/page-history-user/page-history-user.component.html b/userAndAdvertiser/src/app/user/history/page-history-user/page-history-user.component.html similarity index 100% rename from src/app/user/history/page-history-user/page-history-user.component.html rename to userAndAdvertiser/src/app/user/history/page-history-user/page-history-user.component.html diff --git a/src/app/user/history/page-history-user/page-history-user.component.scss b/userAndAdvertiser/src/app/user/history/page-history-user/page-history-user.component.scss similarity index 100% rename from src/app/user/history/page-history-user/page-history-user.component.scss rename to userAndAdvertiser/src/app/user/history/page-history-user/page-history-user.component.scss diff --git a/src/app/user/history/page-history-user/page-history-user.component.spec.ts b/userAndAdvertiser/src/app/user/history/page-history-user/page-history-user.component.spec.ts similarity index 100% rename from src/app/user/history/page-history-user/page-history-user.component.spec.ts rename to userAndAdvertiser/src/app/user/history/page-history-user/page-history-user.component.spec.ts diff --git a/src/app/user/history/page-history-user/page-history-user.component.ts b/userAndAdvertiser/src/app/user/history/page-history-user/page-history-user.component.ts similarity index 87% rename from src/app/user/history/page-history-user/page-history-user.component.ts rename to userAndAdvertiser/src/app/user/history/page-history-user/page-history-user.component.ts index 53ec37d..5485ec1 100644 --- a/src/app/user/history/page-history-user/page-history-user.component.ts +++ b/userAndAdvertiser/src/app/user/history/page-history-user/page-history-user.component.ts @@ -1,12 +1,10 @@ import {AfterViewInit, Component, ViewChild} from '@angular/core'; -import {ThemeService} from "../../../utils/services/theme/theme.service"; -import {MessageService} from "../../../utils/services/message/message.service"; import {MatTableDataSource} from "@angular/material/table"; import {MatSort} from "@angular/material/sort"; import {MatPaginator} from "@angular/material/paginator"; -import {FictitiousVideosService} from "../../../utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service"; -import {VideoAll} from "../../../utils/interfaces/video"; import {Router} from "@angular/router"; +import {MessageService} from "../../../utils/message/message.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; @@ -25,7 +23,6 @@ export class PageHistoryUserComponent implements AfterViewInit constructor( public themeService: ThemeService, private messageService: MessageService, - private fictitiousVideosService: FictitiousVideosService, private router: Router ) { } @@ -93,7 +90,7 @@ export class PageHistoryUserComponent implements AfterViewInit } - onVideo(video: VideoAll): void + onVideo(video): void { this.messageService .put("video/update/"+video._id, {watchedDate: true}) diff --git a/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.html b/userAndAdvertiser/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.html similarity index 100% rename from src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.html rename to userAndAdvertiser/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.html diff --git a/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.scss b/userAndAdvertiser/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.scss similarity index 100% rename from src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.scss rename to userAndAdvertiser/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.scss diff --git a/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.spec.ts b/userAndAdvertiser/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.spec.ts similarity index 100% rename from src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.spec.ts rename to userAndAdvertiser/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.spec.ts diff --git a/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.ts b/userAndAdvertiser/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.ts similarity index 87% rename from src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.ts rename to userAndAdvertiser/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.ts index 877dde8..0b94523 100644 --- a/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.ts +++ b/userAndAdvertiser/src/app/user/myPlaylists/page-my-playlists/page-my-playlists.component.ts @@ -1,8 +1,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 {HttpParams} from "@angular/common/http"; +import {ThemeService} from "../../../utils/theme/theme.service"; +import {MessageService} from "../../../utils/message/message.service"; @@ -13,7 +12,7 @@ import {HttpParams} from "@angular/common/http"; }) export class PageMyPlaylistsComponent implements OnInit { - ad: Advert; // pub + ad; // pub playlist: any; // la playlist sélectionnée diff --git a/src/app/user/myPlaylists/playlist-list/playlist-list.component.html b/userAndAdvertiser/src/app/user/myPlaylists/playlist-list/playlist-list.component.html similarity index 100% rename from src/app/user/myPlaylists/playlist-list/playlist-list.component.html rename to userAndAdvertiser/src/app/user/myPlaylists/playlist-list/playlist-list.component.html diff --git a/src/app/user/myPlaylists/playlist-list/playlist-list.component.scss b/userAndAdvertiser/src/app/user/myPlaylists/playlist-list/playlist-list.component.scss similarity index 100% rename from src/app/user/myPlaylists/playlist-list/playlist-list.component.scss rename to userAndAdvertiser/src/app/user/myPlaylists/playlist-list/playlist-list.component.scss diff --git a/src/app/user/myPlaylists/playlist-list/playlist-list.component.spec.ts b/userAndAdvertiser/src/app/user/myPlaylists/playlist-list/playlist-list.component.spec.ts similarity index 100% rename from src/app/user/myPlaylists/playlist-list/playlist-list.component.spec.ts rename to userAndAdvertiser/src/app/user/myPlaylists/playlist-list/playlist-list.component.spec.ts diff --git a/src/app/user/myPlaylists/playlist-list/playlist-list.component.ts b/userAndAdvertiser/src/app/user/myPlaylists/playlist-list/playlist-list.component.ts similarity index 85% rename from src/app/user/myPlaylists/playlist-list/playlist-list.component.ts rename to userAndAdvertiser/src/app/user/myPlaylists/playlist-list/playlist-list.component.ts index f97fa1e..9d9dbc2 100644 --- a/src/app/user/myPlaylists/playlist-list/playlist-list.component.ts +++ b/userAndAdvertiser/src/app/user/myPlaylists/playlist-list/playlist-list.component.ts @@ -1,12 +1,10 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {ThemeService} from "../../../utils/services/theme/theme.service"; -import {PlaylistDB} from "../../../utils/interfaces/playlist"; import {MatDialog} from "@angular/material/dialog"; import {MatSnackBar} from "@angular/material/snack-bar"; import {PopupCreateOrUpdatePlaylistComponent} from "../popup-create-or-update-playlist/popup-create-or-update-playlist.component"; -import {FictitiousVideosService} from "../../../utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service"; import {PopupDeletePlaylistComponent} from "../popup-delete-playlist/popup-delete-playlist.component"; -import {MessageService} from "../../../utils/services/message/message.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; +import {MessageService} from "../../../utils/message/message.service"; @@ -17,17 +15,16 @@ import {MessageService} from "../../../utils/services/message/message.service"; }) export class PlaylistListComponent implements OnInit { - allPlaylists: PlaylistDB[] = []; // toutes les playlists - @Output() eventEmitter = new EventEmitter(); // pour envoyer au parent la playlist selectionner + allPlaylists: any[] = []; // toutes les playlists + @Output() eventEmitter = new EventEmitter(); // pour envoyer au parent la playlist selectionner search: string = "" ; // contenu de la barre de recherche - tabPlaylist: PlaylistDB[] = []; // playlist affichées - playlistFocusedOn: PlaylistDB; + tabPlaylist: any[] = []; // playlist affichées + playlistFocusedOn: any; constructor( public themeService: ThemeService, public dialog: MatDialog, public snackBar: MatSnackBar, - private fictitiousVideosService: FictitiousVideosService, private messageService: MessageService ) { } @@ -94,7 +91,7 @@ export class PlaylistListComponent implements OnInit // click sur update playlist - onUpdatePlaylist(playlistToUpdate: PlaylistDB): void + onUpdatePlaylist(playlistToUpdate): void { const config = { data: { @@ -127,7 +124,7 @@ export class PlaylistListComponent implements OnInit // click sur supprimer playlist - onDeletePlaylist(playlist: PlaylistDB): void + onDeletePlaylist(playlist): void { const config = {data: playlist}; this.dialog @@ -155,7 +152,7 @@ export class PlaylistListComponent implements OnInit // retourne la class CSS de conteneur de playlist - getClassOfPlaylistContainer(playlist: PlaylistDB): string + getClassOfPlaylistContainer(playlist): string { if(playlist === this.playlistFocusedOn) return "row btnPlaylist btnPlaylistFocus" ; else return "row btnPlaylist" ; diff --git a/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.html b/userAndAdvertiser/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.html similarity index 100% rename from src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.html rename to userAndAdvertiser/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.html diff --git a/userAndAdvertiser/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.scss b/userAndAdvertiser/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.spec.ts b/userAndAdvertiser/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.spec.ts similarity index 100% rename from src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.spec.ts rename to userAndAdvertiser/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.spec.ts diff --git a/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.ts b/userAndAdvertiser/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.ts similarity index 94% rename from src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.ts rename to userAndAdvertiser/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.ts index a6ce4b6..1be479b 100644 --- a/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.ts +++ b/userAndAdvertiser/src/app/user/myPlaylists/popup-create-or-update-playlist/popup-create-or-update-playlist.component.ts @@ -1,7 +1,6 @@ import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../utils/services/message/message.service"; -import {PlaylistDB} from "../../../utils/interfaces/playlist"; +import {MessageService} from "../../../utils/message/message.service"; @@ -19,7 +18,6 @@ export class PopupCreateOrUpdatePlaylistComponent implements OnInit action: string = ""; - constructor( public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, private messageService: MessageService) { } diff --git a/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.html b/userAndAdvertiser/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.html similarity index 100% rename from src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.html rename to userAndAdvertiser/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.html diff --git a/userAndAdvertiser/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.scss b/userAndAdvertiser/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.spec.ts b/userAndAdvertiser/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.spec.ts similarity index 100% rename from src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.spec.ts rename to userAndAdvertiser/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.spec.ts diff --git a/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.ts b/userAndAdvertiser/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.ts similarity index 93% rename from src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.ts rename to userAndAdvertiser/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.ts index 2cc06ec..dda9f5b 100644 --- a/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.ts +++ b/userAndAdvertiser/src/app/user/myPlaylists/popup-delete-playlist/popup-delete-playlist.component.ts @@ -1,6 +1,6 @@ import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../utils/services/message/message.service"; +import {MessageService} from "../../../utils/message/message.service"; @Component({ selector: 'app-popup-delete-playlist', diff --git a/src/app/user/myPlaylists/video-list/video-list.component.html b/userAndAdvertiser/src/app/user/myPlaylists/video-list/video-list.component.html similarity index 100% rename from src/app/user/myPlaylists/video-list/video-list.component.html rename to userAndAdvertiser/src/app/user/myPlaylists/video-list/video-list.component.html diff --git a/src/app/user/myPlaylists/video-list/video-list.component.scss b/userAndAdvertiser/src/app/user/myPlaylists/video-list/video-list.component.scss similarity index 100% rename from src/app/user/myPlaylists/video-list/video-list.component.scss rename to userAndAdvertiser/src/app/user/myPlaylists/video-list/video-list.component.scss diff --git a/src/app/user/myPlaylists/video-list/video-list.component.spec.ts b/userAndAdvertiser/src/app/user/myPlaylists/video-list/video-list.component.spec.ts similarity index 100% rename from src/app/user/myPlaylists/video-list/video-list.component.spec.ts rename to userAndAdvertiser/src/app/user/myPlaylists/video-list/video-list.component.spec.ts diff --git a/src/app/user/myPlaylists/video-list/video-list.component.ts b/userAndAdvertiser/src/app/user/myPlaylists/video-list/video-list.component.ts similarity index 92% rename from src/app/user/myPlaylists/video-list/video-list.component.ts rename to userAndAdvertiser/src/app/user/myPlaylists/video-list/video-list.component.ts index 0919e1a..25c4edb 100644 --- a/src/app/user/myPlaylists/video-list/video-list.component.ts +++ b/userAndAdvertiser/src/app/user/myPlaylists/video-list/video-list.component.ts @@ -1,10 +1,10 @@ import {Component, Input, OnChanges, SimpleChanges} from '@angular/core'; -import {ThemeService} from "../../../utils/services/theme/theme.service"; import {AddVideoToPlaylistsService} from "../../utils/services/addVideoToPlaylists/add-video-to-playlists.service"; -import {MessageService} from "../../../utils/services/message/message.service"; import {MatSnackBar} from "@angular/material/snack-bar"; import {Router} from "@angular/router"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; +import {MessageService} from "../../../utils/message/message.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; +import {ProfilService} from "../../../utils/profil/profil.service"; diff --git a/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.html b/userAndAdvertiser/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.html similarity index 100% rename from src/app/user/myProfil/input-interests-profil/input-interests-profil.component.html rename to userAndAdvertiser/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.html diff --git a/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.scss b/userAndAdvertiser/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.scss similarity index 100% rename from src/app/user/myProfil/input-interests-profil/input-interests-profil.component.scss rename to userAndAdvertiser/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.scss diff --git a/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.spec.ts b/userAndAdvertiser/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.spec.ts similarity index 100% rename from src/app/user/myProfil/input-interests-profil/input-interests-profil.component.spec.ts rename to userAndAdvertiser/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.spec.ts diff --git a/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.ts b/userAndAdvertiser/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.ts similarity index 98% rename from src/app/user/myProfil/input-interests-profil/input-interests-profil.component.ts rename to userAndAdvertiser/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.ts index 8ceb7c1..873052a 100644 --- a/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.ts +++ b/userAndAdvertiser/src/app/user/myProfil/input-interests-profil/input-interests-profil.component.ts @@ -2,10 +2,10 @@ 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 {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 {MessageService} from "../../../utils/message/message.service"; diff --git a/src/app/user/myProfil/page-profil-user/page-profil-user.component.html b/userAndAdvertiser/src/app/user/myProfil/page-profil-user/page-profil-user.component.html similarity index 100% rename from src/app/user/myProfil/page-profil-user/page-profil-user.component.html rename to userAndAdvertiser/src/app/user/myProfil/page-profil-user/page-profil-user.component.html diff --git a/src/app/user/myProfil/page-profil-user/page-profil-user.component.scss b/userAndAdvertiser/src/app/user/myProfil/page-profil-user/page-profil-user.component.scss similarity index 100% rename from src/app/user/myProfil/page-profil-user/page-profil-user.component.scss rename to userAndAdvertiser/src/app/user/myProfil/page-profil-user/page-profil-user.component.scss diff --git a/src/app/user/myProfil/page-profil-user/page-profil-user.component.spec.ts b/userAndAdvertiser/src/app/user/myProfil/page-profil-user/page-profil-user.component.spec.ts similarity index 100% rename from src/app/user/myProfil/page-profil-user/page-profil-user.component.spec.ts rename to userAndAdvertiser/src/app/user/myProfil/page-profil-user/page-profil-user.component.spec.ts diff --git a/src/app/user/myProfil/page-profil-user/page-profil-user.component.ts b/userAndAdvertiser/src/app/user/myProfil/page-profil-user/page-profil-user.component.ts similarity index 88% rename from src/app/user/myProfil/page-profil-user/page-profil-user.component.ts rename to userAndAdvertiser/src/app/user/myProfil/page-profil-user/page-profil-user.component.ts index 33ed891..be4615f 100644 --- a/src/app/user/myProfil/page-profil-user/page-profil-user.component.ts +++ b/userAndAdvertiser/src/app/user/myProfil/page-profil-user/page-profil-user.component.ts @@ -1,11 +1,10 @@ import { Component, OnInit } from '@angular/core'; -import {ThemeService} from "../../../utils/services/theme/theme.service"; -import {User} from "../../../utils/interfaces/user"; import {MatDialog} from "@angular/material/dialog"; import {MatSnackBar} from "@angular/material/snack-bar"; import {PopupUpdateUserComponent} from "../popup-update-user/popup-update-user.component"; -import {MessageService} from "../../../utils/services/message/message.service"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; +import {MessageService} from "../../../utils/message/message.service"; +import {ProfilService} from "../../../utils/profil/profil.service"; @@ -16,7 +15,7 @@ import {ProfilService} from "../../../utils/services/profil/profil.service"; }) export class PageProfilUserComponent implements OnInit { - user: User = { + user = { _id: "", login: "", hashPass: "", diff --git a/src/app/user/myProfil/popup-update-user/popup-update-user.component.html b/userAndAdvertiser/src/app/user/myProfil/popup-update-user/popup-update-user.component.html similarity index 100% rename from src/app/user/myProfil/popup-update-user/popup-update-user.component.html rename to userAndAdvertiser/src/app/user/myProfil/popup-update-user/popup-update-user.component.html diff --git a/src/app/user/myProfil/popup-update-user/popup-update-user.component.scss b/userAndAdvertiser/src/app/user/myProfil/popup-update-user/popup-update-user.component.scss similarity index 100% rename from src/app/user/myProfil/popup-update-user/popup-update-user.component.scss rename to userAndAdvertiser/src/app/user/myProfil/popup-update-user/popup-update-user.component.scss diff --git a/src/app/user/myProfil/popup-update-user/popup-update-user.component.spec.ts b/userAndAdvertiser/src/app/user/myProfil/popup-update-user/popup-update-user.component.spec.ts similarity index 100% rename from src/app/user/myProfil/popup-update-user/popup-update-user.component.spec.ts rename to userAndAdvertiser/src/app/user/myProfil/popup-update-user/popup-update-user.component.spec.ts diff --git a/src/app/user/myProfil/popup-update-user/popup-update-user.component.ts b/userAndAdvertiser/src/app/user/myProfil/popup-update-user/popup-update-user.component.ts similarity index 94% rename from src/app/user/myProfil/popup-update-user/popup-update-user.component.ts rename to userAndAdvertiser/src/app/user/myProfil/popup-update-user/popup-update-user.component.ts index 0e1c5d3..4c91d19 100644 --- a/src/app/user/myProfil/popup-update-user/popup-update-user.component.ts +++ b/userAndAdvertiser/src/app/user/myProfil/popup-update-user/popup-update-user.component.ts @@ -1,8 +1,7 @@ import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {User} from "../../../utils/interfaces/user"; -import {MessageService} from "../../../utils/services/message/message.service"; -import {ProfilService} from "../../../utils/services/profil/profil.service"; +import {MessageService} from "../../../utils/message/message.service"; +import {ProfilService} from "../../../utils/profil/profil.service"; @@ -13,7 +12,7 @@ import {ProfilService} from "../../../utils/services/profil/profil.service"; }) export class PopupUpdateUserComponent implements OnInit { - userCopy: User; + userCopy; newPassword: string = ""; confirmNewPassword: string = "" ; changePassword: boolean = false ; diff --git a/src/app/user/search/page-search/page-search.component.html b/userAndAdvertiser/src/app/user/search/page-search/page-search.component.html similarity index 100% rename from src/app/user/search/page-search/page-search.component.html rename to userAndAdvertiser/src/app/user/search/page-search/page-search.component.html diff --git a/src/app/user/search/page-search/page-search.component.scss b/userAndAdvertiser/src/app/user/search/page-search/page-search.component.scss similarity index 100% rename from src/app/user/search/page-search/page-search.component.scss rename to userAndAdvertiser/src/app/user/search/page-search/page-search.component.scss diff --git a/src/app/user/search/page-search/page-search.component.spec.ts b/userAndAdvertiser/src/app/user/search/page-search/page-search.component.spec.ts similarity index 100% rename from src/app/user/search/page-search/page-search.component.spec.ts rename to userAndAdvertiser/src/app/user/search/page-search/page-search.component.spec.ts diff --git a/src/app/user/search/page-search/page-search.component.ts b/userAndAdvertiser/src/app/user/search/page-search/page-search.component.ts similarity index 93% rename from src/app/user/search/page-search/page-search.component.ts rename to userAndAdvertiser/src/app/user/search/page-search/page-search.component.ts index 7ab145f..60b9826 100644 --- a/src/app/user/search/page-search/page-search.component.ts +++ b/userAndAdvertiser/src/app/user/search/page-search/page-search.component.ts @@ -1,9 +1,8 @@ import { Component, OnInit } from '@angular/core'; -import {MessageService} from "../../../utils/services/message/message.service"; -import {VideoAll} from "../../../utils/interfaces/video"; -import {ThemeService} from "../../../utils/services/theme/theme.service"; import {HttpParams} from "@angular/common/http"; import {ActivatedRoute} from "@angular/router"; +import {MessageService} from "../../../utils/message/message.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; @@ -22,7 +21,7 @@ let TAB_PLATEFORM = [ export class PageSearchComponent implements OnInit { tabPlateform = TAB_PLATEFORM; - tabVideo: VideoAll[] = []; + tabVideo: any[] = []; search: string = ""; ad1: any; ad2: any; diff --git a/src/app/user/search/video-grid/video-grid.component.html b/userAndAdvertiser/src/app/user/search/video-grid/video-grid.component.html similarity index 100% rename from src/app/user/search/video-grid/video-grid.component.html rename to userAndAdvertiser/src/app/user/search/video-grid/video-grid.component.html diff --git a/src/app/user/search/video-grid/video-grid.component.scss b/userAndAdvertiser/src/app/user/search/video-grid/video-grid.component.scss similarity index 100% rename from src/app/user/search/video-grid/video-grid.component.scss rename to userAndAdvertiser/src/app/user/search/video-grid/video-grid.component.scss diff --git a/src/app/user/search/video-grid/video-grid.component.spec.ts b/userAndAdvertiser/src/app/user/search/video-grid/video-grid.component.spec.ts similarity index 100% rename from src/app/user/search/video-grid/video-grid.component.spec.ts rename to userAndAdvertiser/src/app/user/search/video-grid/video-grid.component.spec.ts diff --git a/src/app/user/search/video-grid/video-grid.component.ts b/userAndAdvertiser/src/app/user/search/video-grid/video-grid.component.ts similarity index 90% rename from src/app/user/search/video-grid/video-grid.component.ts rename to userAndAdvertiser/src/app/user/search/video-grid/video-grid.component.ts index 6e13887..11dea65 100644 --- a/src/app/user/search/video-grid/video-grid.component.ts +++ b/userAndAdvertiser/src/app/user/search/video-grid/video-grid.component.ts @@ -1,8 +1,7 @@ -import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core'; -import {VideoAll} from "../../../utils/interfaces/video"; +import {Component, Input, OnChanges, SimpleChanges} from '@angular/core'; import {AddVideoToPlaylistsService} from "../../utils/services/addVideoToPlaylists/add-video-to-playlists.service"; import {Router} from "@angular/router"; -import {MessageService} from "../../../utils/services/message/message.service"; +import {MessageService} from "../../../utils/message/message.service"; @@ -13,7 +12,7 @@ import {MessageService} from "../../../utils/services/message/message.service"; }) export class VideoGridComponent implements OnChanges { - @Input() tabVideo: VideoAll[] = []; + @Input() tabVideo: any[] = []; @Input() search: string = ""; @Input() sources: string = ""; @Input() indexPage: number = 0; @@ -38,7 +37,7 @@ export class VideoGridComponent implements OnChanges } - onAddToPlaylist(video: VideoAll): void + onAddToPlaylist(video): void { this.addVideoToPlaylistsService.run(video.videoId, video.source, video.interest); } @@ -51,7 +50,7 @@ export class VideoGridComponent implements OnChanges } - onVideo(video: VideoAll): void + onVideo(video): void { const data = { source: video.source, interest: video.interest }; this.messageService @@ -60,7 +59,7 @@ export class VideoGridComponent implements OnChanges } - onVideoCallback(retour: any, video: VideoAll): void + onVideoCallback(retour: any, video): void { if(retour.status !== "success") { console.log(retour); diff --git a/src/app/user/utils/components/advert/advert.component.html b/userAndAdvertiser/src/app/user/utils/components/advert/advert.component.html similarity index 100% rename from src/app/user/utils/components/advert/advert.component.html rename to userAndAdvertiser/src/app/user/utils/components/advert/advert.component.html diff --git a/src/app/user/utils/components/advert/advert.component.scss b/userAndAdvertiser/src/app/user/utils/components/advert/advert.component.scss similarity index 100% rename from src/app/user/utils/components/advert/advert.component.scss rename to userAndAdvertiser/src/app/user/utils/components/advert/advert.component.scss diff --git a/src/app/user/utils/components/advert/advert.component.spec.ts b/userAndAdvertiser/src/app/user/utils/components/advert/advert.component.spec.ts similarity index 100% rename from src/app/user/utils/components/advert/advert.component.spec.ts rename to userAndAdvertiser/src/app/user/utils/components/advert/advert.component.spec.ts diff --git a/src/app/user/utils/components/advert/advert.component.ts b/userAndAdvertiser/src/app/user/utils/components/advert/advert.component.ts similarity index 100% rename from src/app/user/utils/components/advert/advert.component.ts rename to userAndAdvertiser/src/app/user/utils/components/advert/advert.component.ts diff --git a/src/app/user/utils/components/navbar-user/navbar-user.component.html b/userAndAdvertiser/src/app/user/utils/components/navbar-user/navbar-user.component.html similarity index 100% rename from src/app/user/utils/components/navbar-user/navbar-user.component.html rename to userAndAdvertiser/src/app/user/utils/components/navbar-user/navbar-user.component.html diff --git a/src/app/user/utils/components/navbar-user/navbar-user.component.scss b/userAndAdvertiser/src/app/user/utils/components/navbar-user/navbar-user.component.scss similarity index 100% rename from src/app/user/utils/components/navbar-user/navbar-user.component.scss rename to userAndAdvertiser/src/app/user/utils/components/navbar-user/navbar-user.component.scss diff --git a/src/app/user/utils/components/navbar-user/navbar-user.component.spec.ts b/userAndAdvertiser/src/app/user/utils/components/navbar-user/navbar-user.component.spec.ts similarity index 100% rename from src/app/user/utils/components/navbar-user/navbar-user.component.spec.ts rename to userAndAdvertiser/src/app/user/utils/components/navbar-user/navbar-user.component.spec.ts diff --git a/src/app/user/utils/components/navbar-user/navbar-user.component.ts b/userAndAdvertiser/src/app/user/utils/components/navbar-user/navbar-user.component.ts similarity index 85% rename from src/app/user/utils/components/navbar-user/navbar-user.component.ts rename to userAndAdvertiser/src/app/user/utils/components/navbar-user/navbar-user.component.ts index 5947c0b..ec8576e 100644 --- a/src/app/user/utils/components/navbar-user/navbar-user.component.ts +++ b/userAndAdvertiser/src/app/user/utils/components/navbar-user/navbar-user.component.ts @@ -1,7 +1,7 @@ import {Component} from '@angular/core'; import {Router} from "@angular/router"; -import {ProfilService} from "../../../../utils/services/profil/profil.service"; -import {MessageService} from "../../../../utils/services/message/message.service"; +import {ProfilService} from "../../../../utils/profil/profil.service"; +import {MessageService} from "../../../../utils/message/message.service"; diff --git a/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.html b/userAndAdvertiser/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.html similarity index 100% rename from src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.html rename to userAndAdvertiser/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.html diff --git a/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.scss b/userAndAdvertiser/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.scss similarity index 100% rename from src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.scss rename to userAndAdvertiser/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.scss diff --git a/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.spec.ts b/userAndAdvertiser/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.spec.ts similarity index 100% rename from src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.spec.ts rename to userAndAdvertiser/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.spec.ts diff --git a/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.ts b/userAndAdvertiser/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.ts similarity index 98% rename from src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.ts rename to userAndAdvertiser/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.ts index 6a2d58d..cfa0119 100644 --- a/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.ts +++ b/userAndAdvertiser/src/app/user/utils/components/popup-add-video-to-playlists/popup-add-video-to-playlists.component.ts @@ -1,6 +1,6 @@ import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; -import {MessageService} from "../../../../utils/services/message/message.service"; +import {MessageService} from "../../../../utils/message/message.service"; diff --git a/src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.spec.ts b/userAndAdvertiser/src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.spec.ts similarity index 100% rename from src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.spec.ts rename to userAndAdvertiser/src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.spec.ts diff --git a/src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.ts b/userAndAdvertiser/src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.ts similarity index 90% rename from src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.ts rename to userAndAdvertiser/src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.ts index 50a5606..e9df3c4 100644 --- a/src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.ts +++ b/userAndAdvertiser/src/app/user/utils/services/addVideoToPlaylists/add-video-to-playlists.service.ts @@ -1,9 +1,8 @@ import { Injectable } from '@angular/core'; -import {MessageService} from "../../../../utils/services/message/message.service"; import {MatDialog} from "@angular/material/dialog"; import {PopupAddVideoToPlaylistsComponent} from "../../components/popup-add-video-to-playlists/popup-add-video-to-playlists.component"; import {MatSnackBar} from "@angular/material/snack-bar"; -import {FictitiousVideosService} from "../../../../utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service"; +import {MessageService} from "../../../../utils/message/message.service"; @@ -20,7 +19,6 @@ export class AddVideoToPlaylistsService constructor( private messageService: MessageService, public dialog: MatDialog, - private fictitiousVideosService: FictitiousVideosService, private snackBar: MatSnackBar ) { } diff --git a/src/app/user/watching/page-watching-video/page-watching-video.component.html b/userAndAdvertiser/src/app/user/watching/page-watching-video/page-watching-video.component.html similarity index 100% rename from src/app/user/watching/page-watching-video/page-watching-video.component.html rename to userAndAdvertiser/src/app/user/watching/page-watching-video/page-watching-video.component.html diff --git a/src/app/user/watching/page-watching-video/page-watching-video.component.scss b/userAndAdvertiser/src/app/user/watching/page-watching-video/page-watching-video.component.scss similarity index 100% rename from src/app/user/watching/page-watching-video/page-watching-video.component.scss rename to userAndAdvertiser/src/app/user/watching/page-watching-video/page-watching-video.component.scss diff --git a/src/app/user/watching/page-watching-video/page-watching-video.component.spec.ts b/userAndAdvertiser/src/app/user/watching/page-watching-video/page-watching-video.component.spec.ts similarity index 100% rename from src/app/user/watching/page-watching-video/page-watching-video.component.spec.ts rename to userAndAdvertiser/src/app/user/watching/page-watching-video/page-watching-video.component.spec.ts diff --git a/src/app/user/watching/page-watching-video/page-watching-video.component.ts b/userAndAdvertiser/src/app/user/watching/page-watching-video/page-watching-video.component.ts similarity index 91% rename from src/app/user/watching/page-watching-video/page-watching-video.component.ts rename to userAndAdvertiser/src/app/user/watching/page-watching-video/page-watching-video.component.ts index b632ac6..4115a7a 100644 --- a/src/app/user/watching/page-watching-video/page-watching-video.component.ts +++ b/userAndAdvertiser/src/app/user/watching/page-watching-video/page-watching-video.component.ts @@ -1,14 +1,10 @@ import { Component, OnInit } from '@angular/core'; -import {VideoAll} from "../../../utils/interfaces/video"; -import {MessageService} from "../../../utils/services/message/message.service"; -import {FictitiousVideosService} from "../../../utils/services/fictitiousDatas/fictitiousVideos/fictitious-videos.service"; -import {FictitiousAdvertsService} from "../../../utils/services/fictitiousDatas/fictitiousAdverts/fictitious-adverts.service"; -import {ThemeService} from "../../../utils/services/theme/theme.service"; import {ActivatedRoute, Router} from "@angular/router"; import {AddVideoToPlaylistsService} from "../../utils/services/addVideoToPlaylists/add-video-to-playlists.service"; -import {PlaylistDB} from "../../../utils/interfaces/playlist"; import {DomSanitizer, SafeResourceUrl} from "@angular/platform-browser"; import {HttpParams} from "@angular/common/http"; +import {MessageService} from "../../../utils/message/message.service"; +import {ThemeService} from "../../../utils/theme/theme.service"; @@ -54,8 +50,6 @@ export class PageWatchingVideoComponent implements OnInit constructor( private messageService: MessageService, - private fictitiousVideosService: FictitiousVideosService, - private fictitiousAdvertsService: FictitiousAdvertsService, public themeService: ThemeService, private activatedRoute: ActivatedRoute, private router: Router, @@ -243,7 +237,7 @@ export class PageWatchingVideoComponent implements OnInit // retourne la classe CSS de videoCell - getClassOfVideoCell(video0: VideoAll): string + getClassOfVideoCell(video0): string { if(video0 === this.video) return "videoCell videoCellFocus" ; else return "videoCell" ; diff --git a/userAndAdvertiser/src/app/utils/message/message.service.spec.ts b/userAndAdvertiser/src/app/utils/message/message.service.spec.ts new file mode 100644 index 0000000..1db761b --- /dev/null +++ b/userAndAdvertiser/src/app/utils/message/message.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { MessageService } from './message.service'; + +describe('MessageService', () => { + let service: MessageService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(MessageService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/userAndAdvertiser/src/app/utils/message/message.service.ts b/userAndAdvertiser/src/app/utils/message/message.service.ts new file mode 100644 index 0000000..c20d5b1 --- /dev/null +++ b/userAndAdvertiser/src/app/utils/message/message.service.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import {HttpClient, HttpParams} from "@angular/common/http"; +import {Observable} from "rxjs"; +import {environment} from "../../../environments/environment"; + +@Injectable({ + providedIn: 'root' +}) +export class MessageService +{ + + constructor( private http: HttpClient ) { } + + post(url: string, data: any): Observable + { + const urlComplete = environment.debutUrl + url ; + return this.http.post(urlComplete, data, {withCredentials: true}); + } + + get(url: string, params:HttpParams = new HttpParams()): Observable + { + const urlComplete = environment.debutUrl + url ; + return this.http.get(urlComplete,{ withCredentials: true, params: params }); + } + + put(url: string, data: any): Observable + { + const urlComplete = environment.debutUrl + url ; + return this.http.put(urlComplete, data, {withCredentials: true}); + } + + delete(url: string): Observable + { + const urlComplete = environment.debutUrl + url ; + return this.http.delete(urlComplete,{withCredentials: true}); + } + +} diff --git a/userAndAdvertiser/src/app/utils/profil/profil.service.spec.ts b/userAndAdvertiser/src/app/utils/profil/profil.service.spec.ts new file mode 100644 index 0000000..5cee000 --- /dev/null +++ b/userAndAdvertiser/src/app/utils/profil/profil.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { ProfilService } from './profil.service'; + +describe('ProfilService', () => { + let service: ProfilService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(ProfilService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/userAndAdvertiser/src/app/utils/profil/profil.service.ts b/userAndAdvertiser/src/app/utils/profil/profil.service.ts new file mode 100644 index 0000000..4bbe5ea --- /dev/null +++ b/userAndAdvertiser/src/app/utils/profil/profil.service.ts @@ -0,0 +1,29 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class ProfilService +{ + + 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); + } + +} diff --git a/userAndAdvertiser/src/app/utils/theme/theme.service.spec.ts b/userAndAdvertiser/src/app/utils/theme/theme.service.spec.ts new file mode 100644 index 0000000..1c2957b --- /dev/null +++ b/userAndAdvertiser/src/app/utils/theme/theme.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { ThemeService } from './theme.service'; + +describe('ThemeService', () => { + let service: ThemeService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(ThemeService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/userAndAdvertiser/src/app/utils/theme/theme.service.ts b/userAndAdvertiser/src/app/utils/theme/theme.service.ts new file mode 100644 index 0000000..00768e5 --- /dev/null +++ b/userAndAdvertiser/src/app/utils/theme/theme.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class ThemeService +{ + + isLightTheme = true; + + getClassTheme(): string + { + if(this.isLightTheme) return "lightTheme" ; + else return "darkTheme" + } + +} diff --git a/userAndAdvertiser/src/assets/.gitkeep b/userAndAdvertiser/src/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/userAndAdvertiser/src/assets/darkBackground.webp b/userAndAdvertiser/src/assets/darkBackground.webp new file mode 100644 index 0000000..0d0692b Binary files /dev/null and b/userAndAdvertiser/src/assets/darkBackground.webp differ diff --git a/userAndAdvertiser/src/assets/lightBackground.jpg b/userAndAdvertiser/src/assets/lightBackground.jpg new file mode 100644 index 0000000..164cb51 Binary files /dev/null and b/userAndAdvertiser/src/assets/lightBackground.jpg differ diff --git a/userAndAdvertiser/src/assets/logo.png b/userAndAdvertiser/src/assets/logo.png new file mode 100644 index 0000000..93b9375 Binary files /dev/null and b/userAndAdvertiser/src/assets/logo.png differ diff --git a/userAndAdvertiser/src/assets/logo_plateforms/dailymotion.png b/userAndAdvertiser/src/assets/logo_plateforms/dailymotion.png new file mode 100644 index 0000000..d35ee8a Binary files /dev/null and b/userAndAdvertiser/src/assets/logo_plateforms/dailymotion.png differ diff --git a/userAndAdvertiser/src/assets/logo_plateforms/youtube.png b/userAndAdvertiser/src/assets/logo_plateforms/youtube.png new file mode 100644 index 0000000..5924c8d Binary files /dev/null and b/userAndAdvertiser/src/assets/logo_plateforms/youtube.png differ diff --git a/userAndAdvertiser/src/assets/play.png b/userAndAdvertiser/src/assets/play.png new file mode 100644 index 0000000..194f73b Binary files /dev/null and b/userAndAdvertiser/src/assets/play.png differ diff --git a/userAndAdvertiser/src/assets/profil.png b/userAndAdvertiser/src/assets/profil.png new file mode 100644 index 0000000..b35b2e4 Binary files /dev/null and b/userAndAdvertiser/src/assets/profil.png differ diff --git a/userAndAdvertiser/src/assets/uploadFile.png b/userAndAdvertiser/src/assets/uploadFile.png new file mode 100644 index 0000000..cff9f38 Binary files /dev/null and b/userAndAdvertiser/src/assets/uploadFile.png differ diff --git a/userAndAdvertiser/src/environments/environment.prod.ts b/userAndAdvertiser/src/environments/environment.prod.ts new file mode 100644 index 0000000..8d9f516 --- /dev/null +++ b/userAndAdvertiser/src/environments/environment.prod.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + debutUrl: "https://polynotfound.herokuapp.com/api/" +}; diff --git a/userAndAdvertiser/src/environments/environment.ts b/userAndAdvertiser/src/environments/environment.ts new file mode 100644 index 0000000..6c4970f --- /dev/null +++ b/userAndAdvertiser/src/environments/environment.ts @@ -0,0 +1,17 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false, + debutUrl: "http://127.0.0.1:3000/api/" +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. diff --git a/userAndAdvertiser/src/favicon.ico b/userAndAdvertiser/src/favicon.ico new file mode 100644 index 0000000..997406a Binary files /dev/null and b/userAndAdvertiser/src/favicon.ico differ diff --git a/userAndAdvertiser/src/index.html b/userAndAdvertiser/src/index.html new file mode 100644 index 0000000..0e892e2 --- /dev/null +++ b/userAndAdvertiser/src/index.html @@ -0,0 +1,13 @@ + + + + + StreamNotFound + + + + + + + + diff --git a/userAndAdvertiser/src/main.ts b/userAndAdvertiser/src/main.ts new file mode 100644 index 0000000..c7b673c --- /dev/null +++ b/userAndAdvertiser/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/userAndAdvertiser/src/polyfills.ts b/userAndAdvertiser/src/polyfills.ts new file mode 100644 index 0000000..373f538 --- /dev/null +++ b/userAndAdvertiser/src/polyfills.ts @@ -0,0 +1,65 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** + * IE11 requires the following for NgClass support on SVG elements + */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** + * Web Animations `@angular/platform-browser/animations` + * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. + * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). + */ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + * because those flags need to be set before `zone.js` being loaded, and webpack + * will put import in the top of bundle, so user need to create a separate file + * in this directory (for example: zone-flags.ts), and put the following flags + * into that file, and then add the following code before importing zone.js. + * import './zone-flags'; + * + * The flags allowed in zone-flags.ts are listed here. + * + * The following flags will work for all browsers. + * + * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + * + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + * + * (window as any).__Zone_enable_cross_context_check = true; + * + */ + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/userAndAdvertiser/src/styles.scss b/userAndAdvertiser/src/styles.scss new file mode 100644 index 0000000..90d4ee0 --- /dev/null +++ b/userAndAdvertiser/src/styles.scss @@ -0,0 +1 @@ +/* You can add global styles to this file, and also import other style files */ diff --git a/userAndAdvertiser/src/test.ts b/userAndAdvertiser/src/test.ts new file mode 100644 index 0000000..b4dd603 --- /dev/null +++ b/userAndAdvertiser/src/test.ts @@ -0,0 +1,27 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: { + context(path: string, deep?: boolean, filter?: RegExp): { + keys(): string[]; + (id: string): T; + }; +}; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting(), + { teardown: { destroyAfterEach: true }}, +); + +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/userAndAdvertiser/tsconfig.app.json b/userAndAdvertiser/tsconfig.app.json new file mode 100644 index 0000000..82d91dc --- /dev/null +++ b/userAndAdvertiser/tsconfig.app.json @@ -0,0 +1,15 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": [ + "src/main.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.d.ts" + ] +} diff --git a/userAndAdvertiser/tsconfig.json b/userAndAdvertiser/tsconfig.json new file mode 100644 index 0000000..4a4dc62 --- /dev/null +++ b/userAndAdvertiser/tsconfig.json @@ -0,0 +1,23 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "downlevelIteration": true, + "experimentalDecorators": true, + "moduleResolution": "node", + "importHelpers": true, + "target": "es2015", + "module": "es2020", + "lib": [ + "es2018", + "dom" + ] + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false + } +} diff --git a/userAndAdvertiser/tsconfig.spec.json b/userAndAdvertiser/tsconfig.spec.json new file mode 100644 index 0000000..092345b --- /dev/null +++ b/userAndAdvertiser/tsconfig.spec.json @@ -0,0 +1,18 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": [ + "jasmine" + ] + }, + "files": [ + "src/test.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +}