Compare commits
8 commits
main
...
separation
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f80fee841f | ||
|
|
00df25e8ff | ||
|
|
e51fabfe64 | ||
|
|
eea9f714d6 | ||
|
|
007391f124 | ||
|
|
006e58a922 | ||
|
|
427d837b35 | ||
|
|
d62915bfe5 |
17
admin/.browserslistrc
Normal file
|
|
@ -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.
|
||||||
16
admin/.editorconfig
Normal file
|
|
@ -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
|
||||||
45
admin/.gitignore
vendored
Normal file
|
|
@ -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
|
||||||
27
admin/README.md
Normal file
|
|
@ -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.
|
||||||
|
|
@ -3,11 +3,14 @@
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"newProjectRoot": "projects",
|
"newProjectRoot": "projects",
|
||||||
"projects": {
|
"projects": {
|
||||||
"frontend": {
|
"admin": {
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"schematics": {
|
"schematics": {
|
||||||
"@schematics/angular:component": {
|
"@schematics/angular:component": {
|
||||||
"style": "scss"
|
"style": "scss"
|
||||||
|
},
|
||||||
|
"@schematics/angular:application": {
|
||||||
|
"strict": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "",
|
"root": "",
|
||||||
|
|
@ -17,12 +20,12 @@
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular-devkit/build-angular:browser",
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/frontend",
|
"outputPath": "dist/admin",
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
"main": "src/main.ts",
|
"main": "src/main.ts",
|
||||||
"polyfills": "src/polyfills.ts",
|
"polyfills": "src/polyfills.ts",
|
||||||
"tsConfig": "tsconfig.app.json",
|
"tsConfig": "tsconfig.app.json",
|
||||||
"aot": true,
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"src/favicon.ico",
|
"src/favicon.ico",
|
||||||
"src/assets"
|
"src/assets"
|
||||||
|
|
@ -32,56 +35,57 @@
|
||||||
"src/styles.scss",
|
"src/styles.scss",
|
||||||
"node_modules/bootstrap/scss/bootstrap.scss"
|
"node_modules/bootstrap/scss/bootstrap.scss"
|
||||||
],
|
],
|
||||||
"scripts": [
|
"scripts": []
|
||||||
"node_modules/jquery/dist/jquery.js",
|
|
||||||
"node_modules/bootstrap/dist/js/bootstrap.js"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "500kb",
|
||||||
|
"maximumError": "1mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "2kb",
|
||||||
|
"maximumError": "4kb"
|
||||||
|
}
|
||||||
|
],
|
||||||
"fileReplacements": [
|
"fileReplacements": [
|
||||||
{
|
{
|
||||||
"replace": "src/environments/environment.ts",
|
"replace": "src/environments/environment.ts",
|
||||||
"with": "src/environments/environment.prod.ts"
|
"with": "src/environments/environment.prod.ts"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optimization": true,
|
"outputHashing": "all"
|
||||||
"outputHashing": "all",
|
|
||||||
"sourceMap": false,
|
|
||||||
"namedChunks": false,
|
|
||||||
"extractLicenses": true,
|
|
||||||
"vendorChunk": false,
|
|
||||||
"buildOptimizer": true,
|
|
||||||
"budgets": [
|
|
||||||
{
|
|
||||||
"type": "initial",
|
|
||||||
"maximumWarning": "2mb",
|
|
||||||
"maximumError": "5mb"
|
|
||||||
},
|
},
|
||||||
{
|
"development": {
|
||||||
"type": "anyComponentStyle",
|
"buildOptimizer": false,
|
||||||
"maximumWarning": "6kb",
|
"optimization": false,
|
||||||
"maximumError": "10kb"
|
"vendorChunk": true,
|
||||||
}
|
"extractLicenses": false,
|
||||||
]
|
"sourceMap": true,
|
||||||
}
|
"namedChunks": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"defaultConfiguration": "production"
|
||||||
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"options": {
|
|
||||||
"browserTarget": "frontend:build"
|
|
||||||
},
|
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"browserTarget": "frontend:build:production"
|
"browserTarget": "admin:build:production"
|
||||||
}
|
},
|
||||||
|
"development": {
|
||||||
|
"browserTarget": "admin:build:development"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"defaultConfiguration": "development"
|
||||||
|
},
|
||||||
"extract-i18n": {
|
"extract-i18n": {
|
||||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "frontend:build"
|
"browserTarget": "admin:build"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
|
|
@ -91,44 +95,19 @@
|
||||||
"polyfills": "src/polyfills.ts",
|
"polyfills": "src/polyfills.ts",
|
||||||
"tsConfig": "tsconfig.spec.json",
|
"tsConfig": "tsconfig.spec.json",
|
||||||
"karmaConfig": "karma.conf.js",
|
"karmaConfig": "karma.conf.js",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"src/favicon.ico",
|
"src/favicon.ico",
|
||||||
"src/assets"
|
"src/assets"
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
|
|
||||||
"src/styles.scss"
|
"src/styles.scss"
|
||||||
],
|
],
|
||||||
"scripts": []
|
"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"
|
||||||
}
|
}
|
||||||
|
|
@ -25,7 +25,7 @@ module.exports = function (config) {
|
||||||
suppressAll: true // removes the duplicated traces
|
suppressAll: true // removes the duplicated traces
|
||||||
},
|
},
|
||||||
coverageReporter: {
|
coverageReporter: {
|
||||||
dir: require('path').join(__dirname, './coverage/frontend'),
|
dir: require('path').join(__dirname, './coverage/admin'),
|
||||||
subdir: '.',
|
subdir: '.',
|
||||||
reporters: [
|
reporters: [
|
||||||
{ type: 'html' },
|
{ type: 'html' },
|
||||||
44
admin/package.json
Normal file
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
import {AfterViewInit, Component, ViewChild} from '@angular/core';
|
import {AfterViewInit, Component, ViewChild} from '@angular/core';
|
||||||
import {MatSort} from "@angular/material/sort";
|
import {MatSort} from "@angular/material/sort";
|
||||||
import {MatPaginator} from "@angular/material/paginator";
|
import {MatPaginator} from "@angular/material/paginator";
|
||||||
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
|
||||||
import {MatDialog} from "@angular/material/dialog";
|
import {MatDialog} from "@angular/material/dialog";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
import {MatTableDataSource} from "@angular/material/table";
|
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 {PopupDeleteAdAdminComponent} from "../popup-delete-ad-admin/popup-delete-ad-admin.component";
|
||||||
import {PopupVisualizeImagesAdminComponent} from "../popup-visualize-images-admin/popup-visualize-images-admin.component";
|
import {PopupVisualizeImagesAdminComponent} from "../popup-visualize-images-admin/popup-visualize-images-admin.component";
|
||||||
import {FormControl} from "@angular/forms";
|
import {FormControl} from "@angular/forms";
|
||||||
import {MessageService} from "../../../utils/services/message/message.service";
|
|
||||||
import {HttpParams} from "@angular/common/http";
|
import {HttpParams} from "@angular/common/http";
|
||||||
|
import {ThemeService} from "../../../utils/theme/theme.service";
|
||||||
|
import {MessageService} from "../../../utils/message/message.service";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -35,7 +34,6 @@ export interface AdvertWithCountViewsAndCompany {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-ad-list-admin',
|
selector: 'app-page-ad-list-admin',
|
||||||
templateUrl: './page-ad-list-admin.component.html',
|
templateUrl: './page-ad-list-admin.component.html',
|
||||||
|
|
@ -102,7 +100,7 @@ export class PageAdListAdminComponent implements AfterViewInit
|
||||||
else {
|
else {
|
||||||
this.tabAdvertiser = retour.data.filter(x => x.role.name === "advertiser");
|
this.tabAdvertiser = retour.data.filter(x => x.role.name === "advertiser");
|
||||||
for(let advert of tabAdvert) this.tabAdvertWithCountViews.push(this.advertToAdvertWithCountViewsAndCompany(advert));
|
for(let advert of tabAdvert) this.tabAdvertWithCountViews.push(this.advertToAdvertWithCountViewsAndCompany(advert));
|
||||||
this.dataSource = new MatTableDataSource<Advert>();
|
this.dataSource = new MatTableDataSource<any>();
|
||||||
this.onFilter();
|
this.onFilter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import {Component, Inject, OnInit} from '@angular/core';
|
import {Component, Inject, OnInit} from '@angular/core';
|
||||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
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({
|
@Component({
|
||||||
selector: 'app-popup-delete-ad-admin',
|
selector: 'app-popup-delete-ad-admin',
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
import {Component, Inject, OnInit} from '@angular/core';
|
import {Component, Inject, OnInit} from '@angular/core';
|
||||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-popup-visualize-images-admin',
|
selector: 'app-popup-visualize-images-admin',
|
||||||
templateUrl: './popup-visualize-images-admin.component.html',
|
templateUrl: './popup-visualize-images-admin.component.html',
|
||||||
styleUrls: ['./popup-visualize-images-admin.component.scss']
|
styleUrls: ['./popup-visualize-images-admin.component.scss']
|
||||||
})
|
})
|
||||||
export class PopupVisualizeImagesAdminComponent implements OnInit
|
export class PopupVisualizeImagesAdminComponent implements OnInit {
|
||||||
{
|
|
||||||
tabImages = [];
|
tabImages = [];
|
||||||
index: number = 0;
|
index: number = 0;
|
||||||
nbImage: number = 0;
|
nbImage: number = 0;
|
||||||
|
|
@ -1,13 +1,10 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import {User} from "../../../utils/interfaces/user";
|
import {ThemeService} from "../../../utils/theme/theme.service";
|
||||||
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
|
||||||
import {MatDialog} from "@angular/material/dialog";
|
import {MatDialog} from "@angular/material/dialog";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
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 {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({
|
@Component({
|
||||||
selector: 'app-page-profil-admin',
|
selector: 'app-page-profil-admin',
|
||||||
|
|
@ -16,7 +13,7 @@ import {ProfilService} from "../../../utils/services/profil/profil.service";
|
||||||
})
|
})
|
||||||
export class PageProfilAdminComponent implements OnInit
|
export class PageProfilAdminComponent implements OnInit
|
||||||
{
|
{
|
||||||
admin: User = {
|
admin = {
|
||||||
_id: "",
|
_id: "",
|
||||||
login: "",
|
login: "",
|
||||||
hashPass: "",
|
hashPass: "",
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
import {Component, Inject, OnInit} from '@angular/core';
|
import {Component, Inject, OnInit} from '@angular/core';
|
||||||
import {User} from "../../../utils/interfaces/user";
|
|
||||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
||||||
import {MessageService} from "../../../utils/services/message/message.service";
|
import {MessageService} from "../../../utils/message/message.service";
|
||||||
import {ProfilService} from "../../../utils/services/profil/profil.service";
|
import {ProfilService} from "../../../utils/profil/profil.service";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
@ -13,7 +11,7 @@ import {ProfilService} from "../../../utils/services/profil/profil.service";
|
||||||
})
|
})
|
||||||
export class PopupUpdateAdminComponent implements OnInit
|
export class PopupUpdateAdminComponent implements OnInit
|
||||||
{
|
{
|
||||||
adminCopy: User;
|
adminCopy;
|
||||||
newPassword: string = "";
|
newPassword: string = "";
|
||||||
confirmNewPassword: string = "" ;
|
confirmNewPassword: string = "" ;
|
||||||
changePassword: boolean = false ;
|
changePassword: boolean = false ;
|
||||||
|
|
@ -2,10 +2,10 @@ import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} f
|
||||||
import {COMMA, ENTER} from "@angular/cdk/keycodes";
|
import {COMMA, ENTER} from "@angular/cdk/keycodes";
|
||||||
import {FormControl} from "@angular/forms";
|
import {FormControl} from "@angular/forms";
|
||||||
import {Observable} from "rxjs";
|
import {Observable} from "rxjs";
|
||||||
import {MessageService} from "../../../utils/services/message/message.service";
|
|
||||||
import {map, startWith} from "rxjs/operators";
|
import {map, startWith} from "rxjs/operators";
|
||||||
import {MatChipInputEvent} from "@angular/material/chips";
|
import {MatChipInputEvent} from "@angular/material/chips";
|
||||||
import {MatAutocompleteSelectedEvent} from "@angular/material/autocomplete";
|
import {MatAutocompleteSelectedEvent} from "@angular/material/autocomplete";
|
||||||
|
import {MessageService} from "../../../utils/message/message.service";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
import {AfterViewInit, Component, ViewChild} from '@angular/core';
|
import {AfterViewInit, Component, ViewChild} from '@angular/core';
|
||||||
import {MatSort} from "@angular/material/sort";
|
import {MatSort} from "@angular/material/sort";
|
||||||
import {MatPaginator} from "@angular/material/paginator";
|
import {MatPaginator} from "@angular/material/paginator";
|
||||||
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
|
||||||
import {MatDialog} from "@angular/material/dialog";
|
import {MatDialog} from "@angular/material/dialog";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
import {MatTableDataSource} from "@angular/material/table";
|
import {MatTableDataSource} from "@angular/material/table";
|
||||||
import {PopupDeleteUserComponent} from "../popup-delete-user/popup-delete-user.component";
|
import {PopupDeleteUserComponent} from "../popup-delete-user/popup-delete-user.component";
|
||||||
import {PopupCreateUserComponent} from "../popup-create-user/popup-create-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({
|
@Component({
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import {Component, Inject, OnInit} from '@angular/core';
|
import {Component, Inject, OnInit} from '@angular/core';
|
||||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
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({
|
@Component({
|
||||||
selector: 'app-popup-create-user',
|
selector: 'app-popup-create-user',
|
||||||
|
|
@ -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<PopupDeleteUserComponent>,
|
||||||
|
@Inject(MAT_DIALOG_DATA) public data,
|
||||||
|
private messageService: MessageService ) { }
|
||||||
|
|
||||||
|
ngOnInit(): void
|
||||||
|
{
|
||||||
|
this.user = this.data.user;
|
||||||
|
}
|
||||||
|
|
||||||
|
onValidate(): void
|
||||||
|
{
|
||||||
|
// --- FAUX CODE ---
|
||||||
|
this.dialogRef.close(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import {Router} from "@angular/router";
|
import {Router} from "@angular/router";
|
||||||
import {ProfilService} from "../../../utils/services/profil/profil.service";
|
import {ProfilService} from "../../../utils/profil/profil.service";
|
||||||
import {MessageService} from "../../../utils/services/message/message.service";
|
import {MessageService} from "../../../utils/message/message.service";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navbar-admin',
|
selector: 'app-navbar-admin',
|
||||||
27
admin/src/app/app-routing.module.ts
Normal file
|
|
@ -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 { }
|
||||||
2
admin/src/app/app.component.html
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
|
@ -20,16 +20,16 @@ describe('AppComponent', () => {
|
||||||
expect(app).toBeTruthy();
|
expect(app).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should have as title 'frontend'`, () => {
|
it(`should have as title 'admin'`, () => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
const app = fixture.componentInstance;
|
const app = fixture.componentInstance;
|
||||||
expect(app.title).toEqual('frontend');
|
expect(app.title).toEqual('admin');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render title', () => {
|
it('should render title', () => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const compiled = fixture.nativeElement;
|
const compiled = fixture.nativeElement as HTMLElement;
|
||||||
expect(compiled.querySelector('.content span').textContent).toContain('frontend app is running!');
|
expect(compiled.querySelector('.content span')?.textContent).toContain('admin app is running!');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -6,7 +6,5 @@ import { Component } from '@angular/core';
|
||||||
styleUrls: ['./app.component.scss']
|
styleUrls: ['./app.component.scss']
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
title = 'frontend';
|
title = 'admin';
|
||||||
|
|
||||||
themeIsLight = true;
|
|
||||||
}
|
}
|
||||||
93
admin/src/app/app.module.ts
Normal file
|
|
@ -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 { }
|
||||||
|
|
@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { PageLoginComponent } from './page-login.component';
|
import { PageLoginComponent } from './page-login.component';
|
||||||
|
|
||||||
describe('PageConnexionComponent', () => {
|
describe('PageLoginComponent', () => {
|
||||||
let component: PageLoginComponent;
|
let component: PageLoginComponent;
|
||||||
let fixture: ComponentFixture<PageLoginComponent>;
|
let fixture: ComponentFixture<PageLoginComponent>;
|
||||||
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {MessageService} from "../../../utils/services/message/message.service";
|
|
||||||
import {Router} from "@angular/router";
|
import {Router} from "@angular/router";
|
||||||
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
|
||||||
import {MatDialog} from "@angular/material/dialog";
|
import {MatDialog} from "@angular/material/dialog";
|
||||||
import {PopupForgottenPasswordComponent} from "../popup-forgotten-password/popup-forgotten-password.component";
|
import {PopupForgottenPasswordComponent} from "../popup-forgotten-password/popup-forgotten-password.component";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
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";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ export class PageLoginComponent implements OnInit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onSeConnecterCallback(retour): void
|
onSeConnecterCallback(retour: any): void
|
||||||
{
|
{
|
||||||
if(retour.status !== "success") {
|
if(retour.status !== "success") {
|
||||||
console.log(retour);
|
console.log(retour);
|
||||||
|
|
@ -2,10 +2,10 @@ import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} f
|
||||||
import {COMMA, ENTER} from "@angular/cdk/keycodes";
|
import {COMMA, ENTER} from "@angular/cdk/keycodes";
|
||||||
import {FormControl} from "@angular/forms";
|
import {FormControl} from "@angular/forms";
|
||||||
import {Observable} from "rxjs";
|
import {Observable} from "rxjs";
|
||||||
import {MessageService} from "../../../utils/services/message/message.service";
|
|
||||||
import {map, startWith} from "rxjs/operators";
|
import {map, startWith} from "rxjs/operators";
|
||||||
import {MatChipInputEvent} from "@angular/material/chips";
|
import {MatChipInputEvent} from "@angular/material/chips";
|
||||||
import {MatAutocompleteSelectedEvent} from "@angular/material/autocomplete";
|
import {MatAutocompleteSelectedEvent} from "@angular/material/autocomplete";
|
||||||
|
import {MessageService} from "../../../utils/message/message.service";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<mat-step label="Type de compte">
|
<mat-step label="Type de compte">
|
||||||
<form style="margin-top: 10px">
|
<form style="margin-top: 10px">
|
||||||
<!-- Choix du rôle -->
|
<!-- Choix du rôle -->
|
||||||
<mat-radio-group [(ngModel)]="user.role.name" (click)="hasError = false; errorMessage = '';">
|
<mat-radio-group [(ngModel)]="user.role.name" [ngModelOptions]="{standalone: true}" (click)="hasError = false; errorMessage = '';">
|
||||||
<mat-radio-button value="user">Utilisateur standard</mat-radio-button>
|
<mat-radio-button value="user">Utilisateur standard</mat-radio-button>
|
||||||
<mat-radio-button value="advertiser">Annonceur</mat-radio-button>
|
<mat-radio-button value="advertiser">Annonceur</mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
|
|
@ -64,21 +64,21 @@
|
||||||
<!-- Login -->
|
<!-- Login -->
|
||||||
<mat-form-field appearance="fill">
|
<mat-form-field appearance="fill">
|
||||||
<mat-label>Pseudo</mat-label>
|
<mat-label>Pseudo</mat-label>
|
||||||
<input matInput type="text" [(ngModel)]="user.login" required>
|
<input matInput type="text" [(ngModel)]="user.login" [ngModelOptions]="{standalone: true}" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- Mot de passe -->
|
<!-- Mot de passe -->
|
||||||
<mat-form-field appearance="fill">
|
<mat-form-field appearance="fill">
|
||||||
<mat-label>Mot de passe</mat-label>
|
<mat-label>Mot de passe</mat-label>
|
||||||
<input matInput type="password" [(ngModel)]="password" required>
|
<input matInput type="password" [(ngModel)]="password" [ngModelOptions]="{standalone: true}" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- Confirmation mot de passe -->
|
<!-- Confirmation mot de passe -->
|
||||||
<mat-form-field appearance="fill">
|
<mat-form-field appearance="fill">
|
||||||
<mat-label>Confirmation mot de passe</mat-label>
|
<mat-label>Confirmation mot de passe</mat-label>
|
||||||
<input matInput type="password" [(ngModel)]="confirmPassword" required>
|
<input matInput type="password" [(ngModel)]="confirmPassword" [ngModelOptions]="{standalone: true}" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -89,12 +89,12 @@
|
||||||
<!-- Email -->
|
<!-- Email -->
|
||||||
<mat-form-field appearance="fill">
|
<mat-form-field appearance="fill">
|
||||||
<mat-label>Email</mat-label>
|
<mat-label>Email</mat-label>
|
||||||
<input matInput type="email" [(ngModel)]="user.email" required>
|
<input matInput type="email" [(ngModel)]="user.email" [ngModelOptions]="{standalone: true}" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- gender -->
|
<!-- gender -->
|
||||||
<mat-radio-group [(ngModel)]="user.gender">
|
<mat-radio-group [(ngModel)]="user.gender" [ngModelOptions]="{standalone: true}">
|
||||||
<mat-radio-button value="man"> Homme </mat-radio-button>
|
<mat-radio-button value="man"> Homme </mat-radio-button>
|
||||||
<mat-radio-button value="woman"> Femme </mat-radio-button>
|
<mat-radio-button value="woman"> Femme </mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
|
|
@ -105,7 +105,8 @@
|
||||||
<mat-label>Date de naissance</mat-label>
|
<mat-label>Date de naissance</mat-label>
|
||||||
<input matInput type="date"
|
<input matInput type="date"
|
||||||
[ngModel] ="user.dateOfBirth | date:'yyyy-MM-dd'"
|
[ngModel] ="user.dateOfBirth | date:'yyyy-MM-dd'"
|
||||||
(ngModelChange)="user.dateOfBirth = $event">
|
(ngModelChange)="user.dateOfBirth = $event"
|
||||||
|
[ngModelOptions]="{standalone: true}">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<!-- interests -->
|
<!-- interests -->
|
||||||
|
|
@ -127,35 +128,35 @@
|
||||||
<!-- Entreprise -->
|
<!-- Entreprise -->
|
||||||
<mat-form-field appearance="fill">
|
<mat-form-field appearance="fill">
|
||||||
<mat-label>Entreprise</mat-label>
|
<mat-label>Entreprise</mat-label>
|
||||||
<input matInput type="text" [(ngModel)]="user.company" required>
|
<input matInput type="text" [(ngModel)]="user.company" [ngModelOptions]="{standalone: true}" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- Login -->
|
<!-- Login -->
|
||||||
<mat-form-field appearance="fill">
|
<mat-form-field appearance="fill">
|
||||||
<mat-label>Pseudo</mat-label>
|
<mat-label>Pseudo</mat-label>
|
||||||
<input matInput type="text" [(ngModel)]="user.login" required>
|
<input matInput type="text" [(ngModel)]="user.login" [ngModelOptions]="{standalone: true}" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- Email -->
|
<!-- Email -->
|
||||||
<mat-form-field appearance="fill">
|
<mat-form-field appearance="fill">
|
||||||
<mat-label>Email</mat-label>
|
<mat-label>Email</mat-label>
|
||||||
<input matInput type="email" [(ngModel)]="user.email" required>
|
<input matInput type="email" [(ngModel)]="user.email" [ngModelOptions]="{standalone: true}" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- Mot de passe -->
|
<!-- Mot de passe -->
|
||||||
<mat-form-field appearance="fill">
|
<mat-form-field appearance="fill">
|
||||||
<mat-label>Mot de passe</mat-label>
|
<mat-label>Mot de passe</mat-label>
|
||||||
<input matInput type="password" [(ngModel)]="password" required>
|
<input matInput type="password" [(ngModel)]="password" [ngModelOptions]="{standalone: true}" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- Confirmation mot de passe -->
|
<!-- Confirmation mot de passe -->
|
||||||
<mat-form-field appearance="fill">
|
<mat-form-field appearance="fill">
|
||||||
<mat-label>Confirmation mot de passe</mat-label>
|
<mat-label>Confirmation mot de passe</mat-label>
|
||||||
<input matInput type="password" [(ngModel)]="confirmPassword" required>
|
<input matInput type="password" [(ngModel)]="confirmPassword" [ngModelOptions]="{standalone: true}" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
import { Component } from '@angular/core';
|
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 {Router} from "@angular/router";
|
||||||
import {MatDialog} from "@angular/material/dialog";
|
import {MatDialog} from "@angular/material/dialog";
|
||||||
import {PopupConfirmationComponent} from "../popup-confirmation/popup-confirmation.component";
|
import {ThemeService} from "../../../utils/theme/theme.service";
|
||||||
import {ThemeService} from "../../../utils/services/theme/theme.service";
|
|
||||||
import {User} from "../../../utils/interfaces/user";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -19,7 +18,7 @@ export class PageRegisterComponent
|
||||||
confirmPassword: string = "";
|
confirmPassword: string = "";
|
||||||
hasError: boolean = false;
|
hasError: boolean = false;
|
||||||
errorMessage: string = "";
|
errorMessage: string = "";
|
||||||
user: User = {
|
user = {
|
||||||
_id: "",
|
_id: "",
|
||||||
login: "",
|
login: "",
|
||||||
hashPass: "",
|
hashPass: "",
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import {Component, Inject} from '@angular/core';
|
import {Component, Inject} from '@angular/core';
|
||||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-popup-confirmation',
|
selector: 'app-popup-confirmation',
|
||||||
templateUrl: './popup-confirmation.component.html',
|
templateUrl: './popup-confirmation.component.html',
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navbar-before-connexion',
|
selector: 'app-navbar-before-connexion',
|
||||||
templateUrl: './navbar-before-connexion.component.html',
|
templateUrl: './navbar-before-connexion.component.html',
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {HttpClient, HttpParams} from "@angular/common/http";
|
import {HttpClient, HttpParams} from "@angular/common/http";
|
||||||
import {environment} from "../../../../environments/environment";
|
|
||||||
import {Observable} from "rxjs";
|
import {Observable} from "rxjs";
|
||||||
|
import {environment} from "../../../environments/environment";
|
||||||
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
|
|
@ -5,6 +5,7 @@ import { Injectable } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class ThemeService
|
export class ThemeService
|
||||||
{
|
{
|
||||||
|
|
||||||
isLightTheme = true;
|
isLightTheme = true;
|
||||||
|
|
||||||
getClassTheme(): string
|
getClassTheme(): string
|
||||||
|
|
@ -12,4 +13,5 @@ export class ThemeService
|
||||||
if(this.isLightTheme) return "lightTheme" ;
|
if(this.isLightTheme) return "lightTheme" ;
|
||||||
else return "darkTheme"
|
else return "darkTheme"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 712 B After Width: | Height: | Size: 712 B |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
4
admin/src/environments/environment.prod.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
export const environment = {
|
||||||
|
production: true,
|
||||||
|
debutUrl: "https://polynotfound.herokuapp.com/api/"
|
||||||
|
};
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// This file can be replaced during build by using the `fileReplacements` array.
|
// 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`.
|
// The list of file replacements can be found in `angular.json`.
|
||||||
|
|
||||||
export const environment = {
|
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
|
* This import should be commented out in production mode because it will have a negative impact
|
||||||
* on performance if an error is thrown.
|
* 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.
|
||||||
|
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 948 B |
|
|
@ -6,9 +6,6 @@
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="assets/logo.png">
|
<link rel="icon" type="image/x-icon" href="assets/logo.png">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<app-root></app-root>
|
<app-root></app-root>
|
||||||
|
|
@ -57,9 +57,9 @@
|
||||||
/***************************************************************************************************
|
/***************************************************************************************************
|
||||||
* Zone JS is required by default for Angular itself.
|
* 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
|
* APPLICATION IMPORTS
|
||||||
*/
|
*/
|
||||||
import '@angular/localize/init';
|
|
||||||
1
admin/src/styles.scss
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
// 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 { getTestBed } from '@angular/core/testing';
|
||||||
import {
|
import {
|
||||||
BrowserDynamicTestingModule,
|
BrowserDynamicTestingModule,
|
||||||
|
|
@ -17,8 +17,10 @@ declare const require: {
|
||||||
// First, initialize the Angular testing environment.
|
// First, initialize the Angular testing environment.
|
||||||
getTestBed().initTestEnvironment(
|
getTestBed().initTestEnvironment(
|
||||||
BrowserDynamicTestingModule,
|
BrowserDynamicTestingModule,
|
||||||
platformBrowserDynamicTesting()
|
platformBrowserDynamicTesting(),
|
||||||
|
{ teardown: { destroyAfterEach: true }},
|
||||||
);
|
);
|
||||||
|
|
||||||
// Then we find all the tests.
|
// Then we find all the tests.
|
||||||
const context = require.context('./', true, /\.spec\.ts$/);
|
const context = require.context('./', true, /\.spec\.ts$/);
|
||||||
// And load the modules.
|
// And load the modules.
|
||||||