Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
Yûki VACHOT 2021-11-01 20:08:52 +01:00
commit f774cf64bd
72 changed files with 2692 additions and 492 deletions

View file

@ -8,7 +8,7 @@ Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app w
## Code scaffolding ## 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`. Run `ng generate component component-title` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build ## Build

View file

@ -32,7 +32,10 @@
"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": {

238
package-lock.json generated
View file

@ -18,6 +18,8 @@
"@angular/platform-browser": "^12.2.11", "@angular/platform-browser": "^12.2.11",
"@angular/platform-browser-dynamic": "^12.2.11", "@angular/platform-browser-dynamic": "^12.2.11",
"@angular/router": "^12.2.11", "@angular/router": "^12.2.11",
"@ng-bootstrap/ng-bootstrap": "^10.0.0",
"angular-responsive-carousel": "^2.1.2",
"bootstrap": "^5.1.3", "bootstrap": "^5.1.3",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"popper": "^1.0.1", "popper": "^1.0.1",
@ -29,6 +31,7 @@
"@angular-devkit/build-angular": "~12.2.11", "@angular-devkit/build-angular": "~12.2.11",
"@angular/cli": "~12.2.11", "@angular/cli": "~12.2.11",
"@angular/compiler-cli": "~12.2.11", "@angular/compiler-cli": "~12.2.11",
"@angular/localize": "^12.2.11",
"@types/jasmine": "~3.6.0", "@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1", "@types/node": "^12.11.1",
"codelyzer": "^6.0.0", "codelyzer": "^6.0.0",
@ -520,6 +523,77 @@
"rxjs": "^6.5.3 || ^7.0.0" "rxjs": "^6.5.3 || ^7.0.0"
} }
}, },
"node_modules/@angular/localize": {
"version": "12.2.11",
"resolved": "https://registry.npmjs.org/@angular/localize/-/localize-12.2.11.tgz",
"integrity": "sha512-ZT4Jt80vTCPHhR4a9DP5+/CA1QYerMRwoIcWQUzTDS/PP3fL3pDIVBUNNqefANplAL39y52HYc8qnpEa8mbd8A==",
"dev": true,
"dependencies": {
"@babel/core": "7.8.3",
"glob": "7.1.7",
"yargs": "^17.0.0"
},
"bin": {
"localize-extract": "src/tools/src/extract/main.js",
"localize-migrate": "src/tools/src/migrate/main.js",
"localize-translate": "src/tools/src/translate/main.js"
},
"engines": {
"node": "^12.14.1 || >=14.0.0"
},
"peerDependencies": {
"@angular/compiler": "12.2.11",
"@angular/compiler-cli": "12.2.11"
}
},
"node_modules/@angular/localize/node_modules/@babel/core": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.3.tgz",
"integrity": "sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.8.3",
"@babel/generator": "^7.8.3",
"@babel/helpers": "^7.8.3",
"@babel/parser": "^7.8.3",
"@babel/template": "^7.8.3",
"@babel/traverse": "^7.8.3",
"@babel/types": "^7.8.3",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.1",
"json5": "^2.1.0",
"lodash": "^4.17.13",
"resolve": "^1.3.2",
"semver": "^5.4.1",
"source-map": "^0.5.0"
},
"engines": {
"node": ">=6.9.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/babel"
}
},
"node_modules/@angular/localize/node_modules/semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true,
"bin": {
"semver": "bin/semver"
}
},
"node_modules/@angular/localize/node_modules/source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/@angular/material": { "node_modules/@angular/material": {
"version": "12.2.11", "version": "12.2.11",
"resolved": "https://registry.npmjs.org/@angular/material/-/material-12.2.11.tgz", "resolved": "https://registry.npmjs.org/@angular/material/-/material-12.2.11.tgz",
@ -2401,6 +2475,21 @@
"schema-utils": "^2.7.0" "schema-utils": "^2.7.0"
} }
}, },
"node_modules/@ng-bootstrap/ng-bootstrap": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-10.0.0.tgz",
"integrity": "sha512-Sz+QaxjuyJYJ+zyUbf0TevgcgVesCPQiiFiggEzxKjzY5R+Hvq3YgryLdXf2r/ryePL+C3FXCcmmKpTM5bfczQ==",
"dependencies": {
"tslib": "^2.1.0"
},
"peerDependencies": {
"@angular/common": "^12.0.0",
"@angular/core": "^12.0.0",
"@angular/forms": "^12.0.0",
"@angular/localize": "^12.0.0",
"rxjs": "^6.5.5"
}
},
"node_modules/@ngtools/webpack": { "node_modules/@ngtools/webpack": {
"version": "12.2.11", "version": "12.2.11",
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.11.tgz", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.11.tgz",
@ -2554,16 +2643,6 @@
"read-package-json-fast": "^2.0.1" "read-package-json-fast": "^2.0.1"
} }
}, },
"node_modules/@popperjs/core": {
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz",
"integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==",
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
}
},
"node_modules/@schematics/angular": { "node_modules/@schematics/angular": {
"version": "12.2.11", "version": "12.2.11",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-12.2.11.tgz", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-12.2.11.tgz",
@ -3220,6 +3299,18 @@
"integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
"dev": true "dev": true
}, },
"node_modules/angular-responsive-carousel": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/angular-responsive-carousel/-/angular-responsive-carousel-2.1.2.tgz",
"integrity": "sha512-nOCEyL9R80kW876GY8KvXoPu9fHu3nEnA2RVoFZ3hnBLx/OIdebeKFTxfogWLgbI4S1xn+vOecY/a+GnAQNc8w==",
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^11.2.14",
"@angular/core": "^11.2.14"
}
},
"node_modules/ansi-colors": { "node_modules/ansi-colors": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
@ -21058,6 +21149,54 @@
"tslib": "^2.2.0" "tslib": "^2.2.0"
} }
}, },
"@angular/localize": {
"version": "12.2.11",
"resolved": "https://registry.npmjs.org/@angular/localize/-/localize-12.2.11.tgz",
"integrity": "sha512-ZT4Jt80vTCPHhR4a9DP5+/CA1QYerMRwoIcWQUzTDS/PP3fL3pDIVBUNNqefANplAL39y52HYc8qnpEa8mbd8A==",
"dev": true,
"requires": {
"@babel/core": "7.8.3",
"glob": "7.1.7",
"yargs": "^17.0.0"
},
"dependencies": {
"@babel/core": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.3.tgz",
"integrity": "sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.8.3",
"@babel/generator": "^7.8.3",
"@babel/helpers": "^7.8.3",
"@babel/parser": "^7.8.3",
"@babel/template": "^7.8.3",
"@babel/traverse": "^7.8.3",
"@babel/types": "^7.8.3",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.1",
"json5": "^2.1.0",
"lodash": "^4.17.13",
"resolve": "^1.3.2",
"semver": "^5.4.1",
"source-map": "^0.5.0"
}
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
},
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
}
}
},
"@angular/material": { "@angular/material": {
"version": "12.2.11", "version": "12.2.11",
"resolved": "https://registry.npmjs.org/@angular/material/-/material-12.2.11.tgz", "resolved": "https://registry.npmjs.org/@angular/material/-/material-12.2.11.tgz",
@ -22395,12 +22534,19 @@
"schema-utils": "^2.7.0" "schema-utils": "^2.7.0"
} }
}, },
"@ng-bootstrap/ng-bootstrap": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-10.0.0.tgz",
"integrity": "sha512-Sz+QaxjuyJYJ+zyUbf0TevgcgVesCPQiiFiggEzxKjzY5R+Hvq3YgryLdXf2r/ryePL+C3FXCcmmKpTM5bfczQ==",
"requires": {
"tslib": "^2.1.0"
}
},
"@ngtools/webpack": { "@ngtools/webpack": {
"version": "12.2.11", "version": "12.2.11",
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.11.tgz", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.11.tgz",
"integrity": "sha512-OgNClb9EhYR9lhVRR1RnWT1Xh75aI70IB4eQaDSiVOkBc6aymLzeskZ2WmkZWsDGlJBLOamnoB0XUPuU1GpmrQ==", "integrity": "sha512-OgNClb9EhYR9lhVRR1RnWT1Xh75aI70IB4eQaDSiVOkBc6aymLzeskZ2WmkZWsDGlJBLOamnoB0XUPuU1GpmrQ==",
"dev": true, "dev": true
"requires": {}
}, },
"@nodelib/fs.scandir": { "@nodelib/fs.scandir": {
"version": "2.1.5", "version": "2.1.5",
@ -22511,12 +22657,6 @@
"read-package-json-fast": "^2.0.1" "read-package-json-fast": "^2.0.1"
} }
}, },
"@popperjs/core": {
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz",
"integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==",
"peer": true
},
"@schematics/angular": { "@schematics/angular": {
"version": "12.2.11", "version": "12.2.11",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-12.2.11.tgz", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-12.2.11.tgz",
@ -22912,8 +23052,7 @@
"version": "1.8.0", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz",
"integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==",
"dev": true, "dev": true
"requires": {}
}, },
"acorn-jsx": { "acorn-jsx": {
"version": "3.0.1", "version": "3.0.1",
@ -23043,8 +23182,7 @@
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz",
"integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==",
"dev": true, "dev": true
"requires": {}
}, },
"ajv-formats": { "ajv-formats": {
"version": "2.1.0", "version": "2.1.0",
@ -23079,8 +23217,7 @@
"version": "3.5.2", "version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"dev": true, "dev": true
"requires": {}
}, },
"alphanum-sort": { "alphanum-sort": {
"version": "1.0.2", "version": "1.0.2",
@ -23088,6 +23225,14 @@
"integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
"dev": true "dev": true
}, },
"angular-responsive-carousel": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/angular-responsive-carousel/-/angular-responsive-carousel-2.1.2.tgz",
"integrity": "sha512-nOCEyL9R80kW876GY8KvXoPu9fHu3nEnA2RVoFZ3hnBLx/OIdebeKFTxfogWLgbI4S1xn+vOecY/a+GnAQNc8w==",
"requires": {
"tslib": "^2.0.0"
}
},
"ansi-colors": { "ansi-colors": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
@ -23755,8 +23900,7 @@
"bootstrap": { "bootstrap": {
"version": "5.1.3", "version": "5.1.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz",
"integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q=="
"requires": {}
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
@ -24544,8 +24688,7 @@
"version": "5.2.2", "version": "5.2.2",
"resolved": "https://registry.npmjs.org/circular-dependency-plugin/-/circular-dependency-plugin-5.2.2.tgz", "resolved": "https://registry.npmjs.org/circular-dependency-plugin/-/circular-dependency-plugin-5.2.2.tgz",
"integrity": "sha512-g38K9Cm5WRwlaH6g03B9OEz/0qRizI+2I7n+Gz+L5DxXJAPAiWQvwlYNm1V1jkdpUv95bOe/ASm2vfi/G560jQ==", "integrity": "sha512-g38K9Cm5WRwlaH6g03B9OEz/0qRizI+2I7n+Gz+L5DxXJAPAiWQvwlYNm1V1jkdpUv95bOe/ASm2vfi/G560jQ==",
"dev": true, "dev": true
"requires": {}
}, },
"class-utils": { "class-utils": {
"version": "0.3.6", "version": "0.3.6",
@ -24663,15 +24806,13 @@
"version": "9.0.0", "version": "9.0.0",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-9.0.0.tgz", "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-9.0.0.tgz",
"integrity": "sha512-ctjwuntPfZZT2mNj2NDIVu51t9cvbhl/16epc5xEwyzyDt76pX9UgwvY+MbXrf/C/FWwdtmNtfP698BKI+9leQ==", "integrity": "sha512-ctjwuntPfZZT2mNj2NDIVu51t9cvbhl/16epc5xEwyzyDt76pX9UgwvY+MbXrf/C/FWwdtmNtfP698BKI+9leQ==",
"dev": true, "dev": true
"requires": {}
}, },
"@angular/core": { "@angular/core": {
"version": "9.0.0", "version": "9.0.0",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-9.0.0.tgz", "resolved": "https://registry.npmjs.org/@angular/core/-/core-9.0.0.tgz",
"integrity": "sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w==", "integrity": "sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w==",
"dev": true, "dev": true
"requires": {}
}, },
"source-map": { "source-map": {
"version": "0.5.7", "version": "0.5.7",
@ -25630,8 +25771,7 @@
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-2.0.1.tgz", "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-2.0.1.tgz",
"integrity": "sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ==", "integrity": "sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ==",
"dev": true, "dev": true
"requires": {}
}, },
"csso": { "csso": {
"version": "4.2.0", "version": "4.2.0",
@ -27914,8 +28054,7 @@
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz",
"integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==",
"dev": true, "dev": true
"requires": {}
}, },
"ieee754": { "ieee754": {
"version": "1.2.1", "version": "1.2.1",
@ -28932,8 +29071,7 @@
"version": "1.7.0", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-1.7.0.tgz", "resolved": "https://registry.npmjs.org/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-1.7.0.tgz",
"integrity": "sha512-pzum1TL7j90DTE86eFt48/s12hqwQuiD+e5aXx2Dc9wDEn2LfGq6RoAxEZZjFiN0RDSCOnosEKRZWxbQ+iMpQQ==", "integrity": "sha512-pzum1TL7j90DTE86eFt48/s12hqwQuiD+e5aXx2Dc9wDEn2LfGq6RoAxEZZjFiN0RDSCOnosEKRZWxbQ+iMpQQ==",
"dev": true, "dev": true
"requires": {}
}, },
"karma-source-map-support": { "karma-source-map-support": {
"version": "1.4.0", "version": "1.4.0",
@ -31334,29 +31472,25 @@
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.0.1.tgz", "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.0.1.tgz",
"integrity": "sha512-lgZBPTDvWrbAYY1v5GYEv8fEO/WhKOu/hmZqmCYfrpD6eyDWWzAOsl2rF29lpvziKO02Gc5GJQtlpkTmakwOWg==", "integrity": "sha512-lgZBPTDvWrbAYY1v5GYEv8fEO/WhKOu/hmZqmCYfrpD6eyDWWzAOsl2rF29lpvziKO02Gc5GJQtlpkTmakwOWg==",
"dev": true, "dev": true
"requires": {}
}, },
"postcss-discard-duplicates": { "postcss-discard-duplicates": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.0.1.tgz", "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.0.1.tgz",
"integrity": "sha512-svx747PWHKOGpAXXQkCc4k/DsWo+6bc5LsVrAsw+OU+Ibi7klFZCyX54gjYzX4TH+f2uzXjRviLARxkMurA2bA==", "integrity": "sha512-svx747PWHKOGpAXXQkCc4k/DsWo+6bc5LsVrAsw+OU+Ibi7klFZCyX54gjYzX4TH+f2uzXjRviLARxkMurA2bA==",
"dev": true, "dev": true
"requires": {}
}, },
"postcss-discard-empty": { "postcss-discard-empty": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.0.1.tgz", "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.0.1.tgz",
"integrity": "sha512-vfU8CxAQ6YpMxV2SvMcMIyF2LX1ZzWpy0lqHDsOdaKKLQVQGVP1pzhrI9JlsO65s66uQTfkQBKBD/A5gp9STFw==", "integrity": "sha512-vfU8CxAQ6YpMxV2SvMcMIyF2LX1ZzWpy0lqHDsOdaKKLQVQGVP1pzhrI9JlsO65s66uQTfkQBKBD/A5gp9STFw==",
"dev": true, "dev": true
"requires": {}
}, },
"postcss-discard-overridden": { "postcss-discard-overridden": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.0.1.tgz", "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.0.1.tgz",
"integrity": "sha512-Y28H7y93L2BpJhrdUR2SR2fnSsT+3TVx1NmVQLbcnZWwIUpJ7mfcTC6Za9M2PG6w8j7UQRfzxqn8jU2VwFxo3Q==", "integrity": "sha512-Y28H7y93L2BpJhrdUR2SR2fnSsT+3TVx1NmVQLbcnZWwIUpJ7mfcTC6Za9M2PG6w8j7UQRfzxqn8jU2VwFxo3Q==",
"dev": true, "dev": true
"requires": {}
}, },
"postcss-double-position-gradients": { "postcss-double-position-gradients": {
"version": "1.0.0", "version": "1.0.0",
@ -31830,8 +31964,7 @@
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz",
"integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==",
"dev": true, "dev": true
"requires": {}
}, },
"postcss-modules-local-by-default": { "postcss-modules-local-by-default": {
"version": "4.0.0", "version": "4.0.0",
@ -31899,8 +32032,7 @@
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.0.1.tgz", "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.0.1.tgz",
"integrity": "sha512-6J40l6LNYnBdPSk+BHZ8SF+HAkS4q2twe5jnocgd+xWpz/mx/5Sa32m3W1AA8uE8XaXN+eg8trIlfu8V9x61eg==", "integrity": "sha512-6J40l6LNYnBdPSk+BHZ8SF+HAkS4q2twe5jnocgd+xWpz/mx/5Sa32m3W1AA8uE8XaXN+eg8trIlfu8V9x61eg==",
"dev": true, "dev": true
"requires": {}
}, },
"postcss-normalize-display-values": { "postcss-normalize-display-values": {
"version": "5.0.1", "version": "5.0.1",
@ -35017,8 +35149,7 @@
"version": "3.2.1", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.2.1.tgz", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.2.1.tgz",
"integrity": "sha512-1k9ZosJCRFaRbY6hH49JFlRB0fVSbmnyq1iTPjNxUmGVjBNEmwrrHPenhlp+Lgo51BojHSf6pl2FcqYaN3PfVg==", "integrity": "sha512-1k9ZosJCRFaRbY6hH49JFlRB0fVSbmnyq1iTPjNxUmGVjBNEmwrrHPenhlp+Lgo51BojHSf6pl2FcqYaN3PfVg==",
"dev": true, "dev": true
"requires": {}
}, },
"stylehacks": { "stylehacks": {
"version": "5.0.1", "version": "5.0.1",
@ -36700,8 +36831,7 @@
"version": "8.2.3", "version": "8.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
"dev": true, "dev": true
"requires": {}
}, },
"xml2js": { "xml2js": {
"version": "0.4.23", "version": "0.4.23",

View file

@ -21,6 +21,8 @@
"@angular/platform-browser": "^12.2.11", "@angular/platform-browser": "^12.2.11",
"@angular/platform-browser-dynamic": "^12.2.11", "@angular/platform-browser-dynamic": "^12.2.11",
"@angular/router": "^12.2.11", "@angular/router": "^12.2.11",
"@ng-bootstrap/ng-bootstrap": "^10.0.0",
"angular-responsive-carousel": "^2.1.2",
"bootstrap": "^5.1.3", "bootstrap": "^5.1.3",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"popper": "^1.0.1", "popper": "^1.0.1",
@ -32,6 +34,7 @@
"@angular-devkit/build-angular": "~12.2.11", "@angular-devkit/build-angular": "~12.2.11",
"@angular/cli": "~12.2.11", "@angular/cli": "~12.2.11",
"@angular/compiler-cli": "~12.2.11", "@angular/compiler-cli": "~12.2.11",
"@angular/localize": "^12.2.11",
"@types/jasmine": "~3.6.0", "@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1", "@types/node": "^12.11.1",
"codelyzer": "^6.0.0", "codelyzer": "^6.0.0",

View file

@ -0,0 +1,43 @@
<mat-form-field class="example-chip-list" appearance="fill">
<!-- ------------------------------------------------------------------------------------ -->
<mat-label>Tags</mat-label>
<!-- ------------------------------------------------------------------------------------ -->
<mat-chip-list #chipList aria-label="Fruit selection">
<mat-chip
*ngFor="let tag of myTags"
[selectable]="selectable"
[removable]="removable"
(removed)="remove(tag)">
{{tag}}
<button matChipRemove *ngIf="removable">
<mat-icon>cancel</mat-icon>
</button>
</mat-chip>
<input
placeholder="Tapez un tag et pressez 'Entré' pour l'inserer"
#tagInput
[formControl]="formControl"
[matAutocomplete]="auto"
[matChipInputFor]="chipList"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(matChipInputTokenEnd)="add($event)">
</mat-chip-list>
<!-- ------------------------------------------------------------------------------------ -->
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)">
<mat-option *ngFor="let tag of filteredTags | async" [value]="tag">
{{tag}}
</mat-option>
</mat-autocomplete>
<!-- ------------------------------------------------------------------------------------ -->
</mat-form-field>

View file

@ -0,0 +1,3 @@
mat-form-field {
width: 100%;
}

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BarTagsComponent } from './bar-tags.component';
describe('BarTagsComponent', () => {
let component: BarTagsComponent;
let fixture: ComponentFixture<BarTagsComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ BarTagsComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(BarTagsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,94 @@
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 {FictitiousDatasService} from "../../utils/services/fictitiousDatas/fictitious-datas.service";
import {MessageService} from "../../utils/services/message/message.service";
@Component({
selector: 'app-bar-tags',
templateUrl: './bar-tags.component.html',
styleUrls: ['./bar-tags.component.scss']
})
export class BarTagsComponent implements OnInit
{
selectable = true;
removable = true;
separatorKeysCodes: number[] = [ENTER, COMMA];
formControl = new FormControl();
filteredTags: Observable<string[]>;
@Input() myTags: string[] = [];
allTags: string[] = [];
@Output() eventEmitter = new EventEmitter<string[]>();
@ViewChild('tagInput') tagInput: ElementRef<HTMLInputElement>;
constructor( private fictitiousDatasService: FictitiousDatasService,
private messageService: MessageService ) {}
ngOnInit(): void
{
this.filteredTags = this.formControl.valueChanges.pipe(
startWith(null),
map((fruit: string | null) => fruit ? this._filter(fruit) : this.allTags.slice()));
// --- FAUX CODE ---
this.allTags = this.fictitiousDatasService.getTags();
this.allTags.sort();
// --- VRAI CODE ---
/*
this.messageService
.sendMessage("advertiser/get/tags", null)
.subscribe( retour => {
if(retour.status === "error") console.log(retour);
else {
this.allTags = retour.data.tags;
this.allTags.sort();
}
});
*/
}
add(event: MatChipInputEvent): void
{
const value = (event.value || '').trim();
if (value) this.myTags.push(value); // Add our fruit
event.chipInput!.clear(); // Clear the input value
this.formControl.setValue(null);
this.eventEmitter.emit(this.myTags);
}
remove(tag: string): void
{
const index = this.myTags.indexOf(tag);
if (index >= 0) this.myTags.splice(index, 1);
this.eventEmitter.emit(this.myTags);
}
selected(event: MatAutocompleteSelectedEvent): void
{
this.myTags.push(event.option.viewValue);
this.tagInput.nativeElement.value = '';
this.formControl.setValue(null);
this.eventEmitter.emit(this.myTags);
}
private _filter(value: string): string[]
{
const filterValue = value.toLowerCase();
return this.allTags.filter(fruit => fruit.toLowerCase().includes(filterValue));
}
}

View file

@ -0,0 +1,126 @@
<div [class]="themeService.getClassTheme()">
<div class="myContainer">
<app-nav-bar pour="advertiser"></app-nav-bar><br><br>
<!-- ---------------------------------------------------------------------------------- -->
<div style="text-align: center">
<input (keyup)="applyFilter($event)" placeholder="Filtre...">
</div>
<br>
<!-- ---------------------------------------------------------------------------------- -->
<button mat-button class="btnAjouter" (click)="onAdd()">
<mat-icon>add_circle</mat-icon> Ajouter une annonce
</button>
<br>
<!-- ---------------------------------------------------------------------------------- -->
<table mat-table [dataSource]="dataSource" matSort class="mat-elevation-z8">
<!-- Name Column -->
<ng-container matColumnDef="title">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Titre </th>
<td mat-cell *matCellDef="let advert">
{{advert.title}}
</td>
</ng-container>
<!-- Tags Column -->
<ng-container matColumnDef="tags">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Tags </th>
<td mat-cell *matCellDef="let advert">
<span *ngFor="let tag of advert.tags; let isLast = last;">
<span *ngIf="!isLast"> {{tag}}, </span>
<span *ngIf="isLast"> {{tag}} </span>
</span>
</td>
</ng-container>
<!-- Comment Column -->
<ng-container matColumnDef="comment">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Commentaire </th>
<td mat-cell *matCellDef="let advert">
{{advert.comment}}
</td>
</ng-container>
<!-- CreatedAt Column -->
<ng-container matColumnDef="createdAt">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Date de création </th>
<td mat-cell *matCellDef="let advert">
{{ advert.createdAt | date:'dd/LL/YYYY à HH:mm:ss' }}
</td>
</ng-container>
<!-- LastUpdate Column -->
<ng-container matColumnDef="lastUpdate">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Dernière modification </th>
<td mat-cell *matCellDef="let advert">
{{ advert.lastUpdate | date:'dd/LL/YYYY à HH:mm:ss' }}
</td>
</ng-container>
<!-- Views Column -->
<ng-container matColumnDef="views">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Vues </th>
<td mat-cell *matCellDef="let advert">
{{advert.views}}
</td>
</ng-container>
<!-- IsVisible Column -->
<ng-container matColumnDef="isVisible">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Visible </th>
<td mat-cell *matCellDef="let advert">
<span *ngIf="advert.isVisible"> <mat-icon>check</mat-icon> </span>
<span *ngIf="!advert.isVisible"></span>
</td>
</ng-container>
<!-- Update Column -->
<ng-container matColumnDef="update">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Modifier </th>
<td mat-cell *matCellDef="let advert">
<button mat-icon-button (click)="onUpdate(advert)">
<mat-icon>settings</mat-icon>
</button>
</td>
</ng-container>
<!-- Delete Column -->
<ng-container matColumnDef="delete">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Supprimer </th>
<td mat-cell *matCellDef="let advert">
<button mat-icon-button (click)="onDelete(advert)">
<mat-icon>delete</mat-icon>
</button>
</td>
</ng-container>
<!-- Visualisation Column -->
<ng-container matColumnDef="visualisation">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Visualisation </th>
<td mat-cell *matCellDef="let advert">
<button mat-icon-button (click)="onVisualize(advert)">
<mat-icon>aspect_ratio</mat-icon>
</button>
</td>
</ng-container>
<!-- Directives -->
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr class="mat-row" *matNoDataRow>
<td class="mat-cell" colspan="4"> Aucune vidéo ne correspond au filtre: "{{input.value}}" </td>
</tr>
</table>
<br><br>
</div>
</div>

View file

@ -0,0 +1,63 @@
.myContainer {
max-width: 100vw;
height: 100vh;
overflow-x: hidden;
}
// ----------------------------------------------------------
.btnAjouter {
margin-left: 3%;
font-size: larger;
padding: 5px 20px 5px 20px;
}
.lightTheme .btnAjouter {
border-top: solid 1px #dcdcdc;
border-right: solid 1px #dcdcdc;
border-left: solid 1px #dcdcdc;
color: black;
background-color: white;
}
.darkTheme .btnAjouter {
border-top: solid 1px white;
border-right: solid 1px white;
border-left: solid 1px white;
color: white;
background-color: black;
}
.darkTheme .btnAjouter:hover {
background-color: #646464;
color: black;
}
// ----------------------------------------------------------
table {
margin: 0 auto;
width: 94%;
}
.darkTheme table { border: solid 2px white; }
th.mat-sort-header-sorted {
color: black;
}
.lightTheme td {
}
.darkTheme td {
background-color: #646464;
color: white;
}
input {
width: 25%;
font-size: x-large;
border-radius: 5px;
}

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PageAdvertiserComponent } from './page-advertiser.component';
describe('PageAdvertiserComponent', () => {
let component: PageAdvertiserComponent;
let fixture: ComponentFixture<PageAdvertiserComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PageAdvertiserComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PageAdvertiserComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,143 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {MatSort} from "@angular/material/sort";
import {ThemeService} from "../../utils/services/theme/theme.service";
import {FictitiousDatasService} from "../../utils/services/fictitiousDatas/fictitious-datas.service";
import {MatTableDataSource} from "@angular/material/table";
import {Advert} from "../../utils/interfaces/advert";
import {MatDialog} from "@angular/material/dialog";
import {PopupAddOrUpdateAdComponent} from "../popup-add-or-update-ad/popup-add-or-update-ad.component";
import {MatSnackBar} from "@angular/material/snack-bar";
import {PopupDeleteAdComponent} from "../popup-delete-ad/popup-delete-ad.component";
import {PopupVisualizeAdComponent} from "../popup-visualize-ad/popup-visualize-ad.component";
@Component({
selector: 'app-page-advertiser',
templateUrl: './page-advertiser.component.html',
styleUrls: ['./page-advertiser.component.scss']
})
export class PageAdvertiserComponent implements OnInit
{
displayedColumns: string[] = [ 'title', 'tags', 'createdAt', 'lastUpdate', 'views', 'isVisible', 'update', 'delete', 'visualisation' ];
dataSource ;
@ViewChild(MatSort) sort: MatSort;
constructor( public themeService: ThemeService,
private fictitiousDatasService: FictitiousDatasService,
public dialog: MatDialog,
private snackBar: MatSnackBar ) { }
ngOnInit(): void
{
// --- FAUX CODE ---
const tabAdvert = this.fictitiousDatasService.getTabAdvert(8);
this.dataSource = new MatTableDataSource<Advert>(tabAdvert);
this.dataSource.sort = this.sort;
}
applyFilter(event: Event): void
{
const filterValue = (event.target as HTMLInputElement).value;
this.dataSource.filter = filterValue.trim().toLowerCase();
}
onVisualize(advert: Advert): void
{
const config = {
width: '50%',
data: { advert: advert }
};
this.dialog
.open(PopupVisualizeAdComponent, config)
.afterClosed()
.subscribe(retour => {});
}
onAdd(): void
{
const config = {
width: '50%',
data: { action: "add", advert: null }
};
this.dialog
.open(PopupAddOrUpdateAdComponent, config)
.afterClosed()
.subscribe( advertAdded => {
const config = { duration: 1000, panelClass: "custom-class" };
let message = "" ;
if((advertAdded === undefined) || (advertAdded === null)) {
message = "Opération annulée" ;
}
else {
this.dataSource.data.push(advertAdded);
this.dataSource.data = this.dataSource.data;
this.dataSource = this.dataSource;
message = "L'annoonce a bien été ajoutée ✔"
}
this.snackBar.open( message, "", config);
});
}
onUpdate(advertToUpdate: Advert): void
{
const config = {
width: '50%',
data: { action: "update", advert: advertToUpdate }
};
this.dialog
.open(PopupAddOrUpdateAdComponent, config)
.afterClosed()
.subscribe( advertUpdated => {
const config = { duration: 1000, panelClass: "custom-class" };
let message = "" ;
if((advertUpdated === undefined) || (advertUpdated === null)) {
message = "Opération annulée" ;
}
else {
const index = this.dataSource.data.findIndex( elt => (elt._id === advertToUpdate._id));
this.dataSource.data.splice(index, 1, advertUpdated);
this.dataSource.data = this.dataSource.data;
this.dataSource = this.dataSource;
message = "L'annonce a bien été modifiée ✔"
}
this.snackBar.open( message, "", config);
});
}
onDelete(advert: Advert): void
{
const config = {
data: { advert: advert }
};
this.dialog
.open(PopupDeleteAdComponent, config)
.afterClosed()
.subscribe( retour => {
const config = { duration: 1000, panelClass: "custom-class" };
let message = "" ;
if((retour === undefined) || (retour === null)) {
message = "Opération annulée" ;
}
else {
const index = this.dataSource.data.findIndex( elt => (elt._id === advert._id));
this.dataSource.data.splice(index, 1);
this.dataSource.data = this.dataSource.data;
this.dataSource = this.dataSource;
message = "L'annonce a bien été supprimée ✔" ;
}
this.snackBar.open( message, "", config);
});
}
}

View file

@ -0,0 +1,44 @@
<div [class]="themeService.getClassTheme()">
<!-- Navbar -->
<h1 mat-dialog-title>{{title}}</h1>
<!-- --------------------------------------------------------------------------------------------- -->
<mat-dialog-content>
<!-- Title -->
<mat-form-field appearance="fill">
<mat-label> Titre annonce </mat-label>
<input matInput type="text" [(ngModel)]="advert.title">
</mat-form-field>
<!-- Images -->
<br>
<mat-form-field appearance="fill">
<input matInput type="file" disabled>
</mat-form-field>
<!-- Tags -->
<app-bar-tags [myTags]="advert.tags" (eventEmitter)="onEventBarTags($event)"></app-bar-tags>
<!-- Comments -->
<mat-form-field class="commentContainer" appearance="fill">
<mat-label> Commentaire </mat-label>
<textarea matInput [(ngModel)]="advert.comment"></textarea>
</mat-form-field><br>
<!-- IsVisible -->
<mat-checkbox [(ngModel)]="advert.isVisible"> Visible </mat-checkbox>
</mat-dialog-content>
<!-- --------------------------------------------------------------------------------------------- -->
<!-- Actions -->
<mat-dialog-actions align="end">
<button mat-button (click)="dialogRef.close()">Annuler</button>
<button mat-button (click)="onValidate()" cdkFocusInitial>Valider</button>
</mat-dialog-actions>
</div>

View file

@ -0,0 +1,60 @@
.lightTheme, .darkTheme {
background-image: none;
}
h1 {
text-align: center;
font-size: xx-large;
padding-bottom: 10px;
}
// -------------------------------------------------------------------------
mat-dialog-content {
overflow-y: hidden;
//padding: 20px 20px 20px 20px;
}
.commentContainer {
width: 100%;
}
// -------------------------------------------------------------------------
// --- LightTheme ---
// aura
.lightTheme ::ng-deep .mat-checkbox-ripple .mat-ripple-element {
background-color: grey !important;
}
// contenu coche
.lightTheme ::ng-deep .mat-checkbox-checked.mat-accent .mat-checkbox-background {
background-color: black !important;
}
// indeterminate
.lightTheme ::ng-deep .mat-checkbox .mat-checkbox-frame {
border-color: black !important;
background-color: white !important;
}
// --- DarkTheme ---
// aura
.darTheme ::ng-deep .mat-checkbox-ripple .mat-ripple-element {
background-color: grey !important;
}
// contenu coche
.darkTheme ::ng-deep .mat-checkbox-checked.mat-accent .mat-checkbox-background {
background-color: black !important;
}
// indeterminate
.darkTheme ::ng-deep .mat-checkbox .mat-checkbox-frame {
border-color: white !important;
//background-color: white !important;
}

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PopupAddOrUpdateAdComponent } from './popup-add-or-update-ad.component';
describe('PopupAddOrUpdateAdComponent', () => {
let component: PopupAddOrUpdateAdComponent;
let fixture: ComponentFixture<PopupAddOrUpdateAdComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PopupAddOrUpdateAdComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PopupAddOrUpdateAdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,87 @@
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";
const ADVERT_VIDE = {
_id: "",
title: "",
advertiser: "",
images: [],
tags: [],
comment: "",
views: 0,
createdAt: new Date(),
lastUpdate: new Date(),
isVisible: true,
}
@Component({
selector: 'app-popup-add-or-update-ad',
templateUrl: './popup-add-or-update-ad.component.html',
styleUrls: ['./popup-add-or-update-ad.component.scss']
})
export class PopupAddOrUpdateAdComponent implements OnInit
{
advert: Advert;
urlBackend: string = "" ;
title: string = "" ;
constructor( public dialogRef: MatDialogRef<PopupAddOrUpdateAdComponent>,
@Inject(MAT_DIALOG_DATA) public data,
private messageService: MessageService,
public themeService: ThemeService ) { }
ngOnInit(): void
{
if(this.data.action === "add")
{
this.advert = Object.assign({}, ADVERT_VIDE);
this.advert.tags = [];
this.urlBackend = "advertiser/add/ad" ;
this.title = "Ajouter annonce" ;
}
else
{
this.advert = Object.assign({}, this.data.advert);
this.advert.tags = this.data.advert.tags.slice();
this.urlBackend = "advertiser/update/ad" ;
this.title = "Modifier annonce" ;
}
}
onValidate(): void
{
// --- FAUX CODE ---
this.dialogRef.close(this.advert);
// --- VRAI CODE ---
/*
this.messageService
.sendMessage(this.urlBackend, this.advert)
.subscribe( retour => {
if(retour.status === "error") {
console.log(retour);
this.dialogRef.close(this.advert);
}
else {
this.dialogRef.close(retour.data.advert);
}
});
*/
}
onEventBarTags(myTags: string[])
{
this.advert.tags = myTags;
}
}

View file

@ -0,0 +1,8 @@
<mat-dialog-content class="mat-typography">
Êtes-vous sûr de vouloir supprimer l'annonce <i>{{advert.title}}</i> ?
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button (click)="dialogRef.close();">Annuler</button>
<button mat-button (click)="onValidate()" cdkFocusInitial>Valider</button>
</mat-dialog-actions>

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PopupDeleteAdComponent } from './popup-delete-ad.component';
describe('PopupDeleteAdComponent', () => {
let component: PopupDeleteAdComponent;
let fixture: ComponentFixture<PopupDeleteAdComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PopupDeleteAdComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PopupDeleteAdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,51 @@
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 {Advert} from "../../utils/interfaces/advert";
@Component({
selector: 'app-popup-delete-ad',
templateUrl: './popup-delete-ad.component.html',
styleUrls: ['./popup-delete-ad.component.scss']
})
export class PopupDeleteAdComponent implements OnInit
{
advert: Advert;
constructor( public dialogRef: MatDialogRef<PopupDeleteAdComponent>,
@Inject(MAT_DIALOG_DATA) public data,
private messageService: MessageService) { }
ngOnInit(): void
{
this.advert = this.data.advert;
}
onValidate(): void
{
// --- FAUX CODE ---
this.dialogRef.close(true);
// --- VRAI CODE ---
/*
this.messageService
.sendMessage("advertiser/delete/ad", {"advert": this.advert})
.subscribe( retour => {
if(retour.status === "error") {
console.log(retour);
this.dialogRef.close();
}
else {
this.dialogRef.close(true);
}
});
*/
}
}

View file

@ -0,0 +1,73 @@
<div [class]="themeService.getClassTheme()">
<h1 mat-dialog-title>{{advert.title}}</h1>
<!-- ----------------------------------------------------------------------------------------------------------------- -->
<mat-divider></mat-divider>
<mat-dialog-content>
<!-- Images -->
<div class="row myRow">
<div class="col-6 myLabel" style="padding-top: 10px"> Images: </div>
<div class="col-6">
<button mat-icon-button (click)="onVisualizeImages(advert.images)">
<mat-icon>aspect_ratio</mat-icon>
</button>
</div>
</div>
<!-- Tags -->
<div class="row myRow">
<div class="col-6 myLabel"> Tags: </div>
<div class="col-6 myValue" style="border-left: solid 1px #e6e6e6">
<div *ngFor="let tag of advert.tags"> • {{tag}} </div>
</div>
</div>
<!-- Comment -->
<div class="row myRow">
<div class="col-6 myLabel"> Commentaire: </div>
<div class="col-6 myValue"> {{advert.comment}} </div>
</div>
<!-- Views -->
<div class="row myRow">
<label class="col-6 myLabel"> Vues: </label>
<div class="col-6 myValue"> {{advert.views}} </div>
</div>
<!-- Created at -->
<div class="row myRow">
<label class="col-6 myLabel"> Date de création: </label>
<div class="col-6 myValue">
{{ advert.createdAt | date:'dd/LL/YYYY à HH:mm:ss' }}
</div>
</div>
<!-- Last updtade -->
<div class="row myRow">
<label class="col-6 myLabel"> Date de dernière modification: </label>
<div class="col-6 myValue">
{{ advert.lastUpdate | date:'dd/LL/YYYY à HH:mm:ss' }}
</div>
</div>
<!-- IsVisible -->
<div class="row myRow">
<label class="col-6 myLabel"> Visibilité: </label>
<div class="col-6 myValue">
<mat-icon *ngIf="advert.isVisible">checked</mat-icon>
<mat-icon *ngIf="!advert.isVisible">close</mat-icon>
</div>
</div>
</mat-dialog-content>
<!-- ----------------------------------------------------------------------------------------------------------------- -->
<mat-dialog-actions align="end">
<button mat-button (click)="dialogRef.close()">Fermer</button>
</mat-dialog-actions>
</div>

View file

@ -0,0 +1,28 @@
.lightTheme, .darkTheme {
background-image: none;
}
h1 {
text-align: center;
font-size: xx-large;
}
.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;
}

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PopupVisualizeAdComponent } from './popup-visualize-ad.component';
describe('PopupVisualizeAdComponent', () => {
let component: PopupVisualizeAdComponent;
let fixture: ComponentFixture<PopupVisualizeAdComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PopupVisualizeAdComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PopupVisualizeAdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,46 @@
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 {PopupVisualizeImagesComponent} from "../popup-visualize-images/popup-visualize-images.component";
@Component({
selector: 'app-popup-visualize-ad',
templateUrl: './popup-visualize-ad.component.html',
styleUrls: ['./popup-visualize-ad.component.scss']
})
export class PopupVisualizeAdComponent implements OnInit
{
advert: Advert;
constructor( public dialogRef: MatDialogRef<PopupVisualizeAdComponent>,
@Inject(MAT_DIALOG_DATA) public data,
public themeService: ThemeService,
public dialog: MatDialog ) { }
ngOnInit(): void
{
this.advert = this.data.advert;
}
onVisualizeImages(images: any[])
{
const config = {
width: '400px',
height: '950px',
data: {
images: images,
width: 300,
height: 800,
}
};
this.dialog
.open(PopupVisualizeImagesComponent, config)
.afterClosed()
.subscribe(retour => {});
}
}

View file

@ -0,0 +1,13 @@
<div mat-dialog-title class="dialog-title">
<h2></h2>
<button mat-icon-button aria-label="close dialog" mat-dialog-close>
<mat-icon>close</mat-icon>
</button>
</div>
<div style="text-align: center; justify-content: center">
<carousel [images]="tabImages"
cellsToShow="1"
[height]="height"
[width]="width"></carousel>
</div>

View file

@ -0,0 +1,14 @@
carousel {
width: 100%;
margin: 0 auto;
text-align: center;
justify-content: center
}
.dialog-title {
display: flex;
justify-content: space-between;
align-items: center;
}

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PopupVisualizeImagesComponent } from './popup-visualize-images.component';
describe('PopupVisualizeImagesComponent', () => {
let component: PopupVisualizeImagesComponent;
let fixture: ComponentFixture<PopupVisualizeImagesComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PopupVisualizeImagesComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PopupVisualizeImagesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,35 @@
import {Component, Inject, OnInit} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from "@angular/material/dialog";
import {ThemeService} from "../../utils/services/theme/theme.service";
@Component({
selector: 'app-popup-visualize-images',
templateUrl: './popup-visualize-images.component.html',
styleUrls: ['./popup-visualize-images.component.scss']
})
export class PopupVisualizeImagesComponent implements OnInit
{
tabImages = [];
width: number = 0;
height: number = 0;
constructor( public dialogRef: MatDialogRef<PopupVisualizeImagesComponent>,
@Inject(MAT_DIALOG_DATA) public data ) { }
ngOnInit(): void
{
this.width = this.data.width;
this.height = this.data.height;
for(let couple of this.data.images)
{
const elt = { path: "assets/pub/"+couple.url };
this.tabImages.push(elt);
}
console.log(this.tabImages);
}
}

View file

@ -4,16 +4,31 @@ import {PageConnexionComponent} from './pourLes3Roles/page-connexion/page-connex
import {PageRegisterComponent} from './pourLes3Roles/register/page-register/page-register.component'; import {PageRegisterComponent} from './pourLes3Roles/register/page-register/page-register.component';
import {PageSearchComponent} from "./user/search/page-search/page-search.component"; import {PageSearchComponent} from "./user/search/page-search/page-search.component";
import {PageMyPlaylistsComponent} from "./user/myPlaylists/page-my-playlists/page-my-playlists.component"; import {PageMyPlaylistsComponent} from "./user/myPlaylists/page-my-playlists/page-my-playlists.component";
import {PageHistoriqueComponent} from "./user/historique/page-historique/page-historique.component"; import {PageHistoryUserComponent} from "./user/history/page-history-user/page-history-user.component";
import {PageMyProfilComponent} from "./utils/components/myProfil/page-my-profil/page-my-profil.component";
import {PageAdvertiserComponent} from "./advertiser/page-advertiser/page-advertiser.component";
const routes: Routes = [ const routes: Routes = [
{ path: '', component: PageConnexionComponent }, { path: '', component: PageConnexionComponent },
{ path: 'connexion', component: PageConnexionComponent }, { path: 'login', component: PageConnexionComponent },
{ path: 'register', component: PageRegisterComponent }, { path: 'register', component: PageRegisterComponent },
{ path: 'search', component: PageSearchComponent },
{ path: 'myPlaylists', component: PageMyPlaylistsComponent }, { path: 'user', component: PageSearchComponent },
{ path: 'historique', component: PageHistoriqueComponent } { path: 'user/search', component: PageSearchComponent },
{ path: 'user/myPlaylists', component: PageMyPlaylistsComponent },
{ path: 'user/history', component: PageHistoryUserComponent },
{ path: 'user/myProfil', component: PageMyProfilComponent },
{ path: 'advertiser', component: PageAdvertiserComponent },
{ path: 'advertiser/myProfil', component: PageMyProfilComponent },
/*
{ path: 'admin/userList', component: PageConnexionComponent },
{ path: 'admin/addUser', component: PageConnexionComponent },
{ path: 'admin/adList', component: PageConnexionComponent },
{ path: 'admin/myProfil', component: PageMyProfilComponent }
*/
]; ];

View file

@ -8,7 +8,7 @@ import { PageRegisterComponent } from './pourLes3Roles/register/page-register/pa
import { NavBarComponent } from './utils/components/nav-bar/nav-bar.component'; import { NavBarComponent } from './utils/components/nav-bar/nav-bar.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {FormsModule} from "@angular/forms"; import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import { PageSearchComponent } from './user/search/page-search/page-search.component'; import { PageSearchComponent } from './user/search/page-search/page-search.component';
import {HttpClientModule} from "@angular/common/http"; import {HttpClientModule} from "@angular/common/http";
import { PopupConfirmationComponent } from './pourLes3Roles/register/popup-confirmation/popup-confirmation.component'; import { PopupConfirmationComponent } from './pourLes3Roles/register/popup-confirmation/popup-confirmation.component';
@ -30,8 +30,22 @@ import { PageMyPlaylistsComponent } from './user/myPlaylists/page-my-playlists/p
import { PlaylistListComponent } from './user/myPlaylists/playlist-list/playlist-list.component'; import { PlaylistListComponent } from './user/myPlaylists/playlist-list/playlist-list.component';
import {VideoListComponent} from "./user/myPlaylists/video-list/video-list.component"; import {VideoListComponent} from "./user/myPlaylists/video-list/video-list.component";
import { PopupCreatePlaylistComponent } from './utils/components/popup-create-playlist/popup-create-playlist.component'; import { PopupCreatePlaylistComponent } from './utils/components/popup-create-playlist/popup-create-playlist.component';
import { PageHistoriqueComponent } from './user/historique/page-historique/page-historique.component'; import { PageHistoryUserComponent } from './user/history/page-history-user/page-history-user.component';
import {MatTableModule} from '@angular/material/table'; import {MatTableModule} from '@angular/material/table';
import { PageMyProfilComponent } from './utils/components/myProfil/page-my-profil/page-my-profil.component';
import { PopupPictureProfilUrlComponent } from './utils/components/myProfil/popup-picture-profil-url/popup-picture-profil-url.component';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import {MatSortModule} from "@angular/material/sort";
import { PageAdvertiserComponent } from './advertiser/page-advertiser/page-advertiser.component';
import { PopupDeleteAdComponent } from './advertiser/popup-delete-ad/popup-delete-ad.component';
import { PopupAddOrUpdateAdComponent } from './advertiser/popup-add-or-update-ad/popup-add-or-update-ad.component';
import { PopupVisualizeAdComponent } from './advertiser/popup-visualize-ad/popup-visualize-ad.component';
import { BarTagsComponent } from './advertiser/bar-tags/bar-tags.component';
import {MatChipsModule} from "@angular/material/chips";
import {MatAutocompleteModule} from "@angular/material/autocomplete";
import {MatSelectModule} from "@angular/material/select";
import { PopupVisualizeImagesComponent } from './advertiser/popup-visualize-images/popup-visualize-images.component';
import {IvyCarouselModule} from "angular-responsive-carousel";
@NgModule({ @NgModule({
@ -52,7 +66,15 @@ import {MatTableModule} from '@angular/material/table';
PlaylistListComponent, PlaylistListComponent,
VideoListComponent, VideoListComponent,
PopupCreatePlaylistComponent, PopupCreatePlaylistComponent,
PageHistoriqueComponent, PageHistoryUserComponent,
PageMyProfilComponent,
PopupPictureProfilUrlComponent,
PageAdvertiserComponent,
PopupDeleteAdComponent,
PopupAddOrUpdateAdComponent,
PopupVisualizeAdComponent,
BarTagsComponent,
PopupVisualizeImagesComponent,
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
@ -70,7 +92,14 @@ import {MatTableModule} from '@angular/material/table';
MatFormFieldModule, MatFormFieldModule,
MatSnackBarModule, MatSnackBarModule,
MatGridListModule, MatGridListModule,
MatTableModule MatTableModule,
NgbModule,
MatSortModule,
MatChipsModule,
ReactiveFormsModule,
MatAutocompleteModule,
MatSelectModule,
IvyCarouselModule
], ],
providers: [], providers: [],
bootstrap: [AppComponent] bootstrap: [AppComponent]

View file

@ -1,41 +1,40 @@
<div [class]="themeService.getClassTheme()"> <div [class]="themeService.getClassTheme()">
<div class="myContainer"> <div class="myContainer">
<div class="bg">
<app-nav-bar pour="3roles"></app-nav-bar>
<div class="boite"> <app-nav-bar pour="login"></app-nav-bar>
<h1> Connexion </h1>
<div class="wrapper fadeInDown">
<div id="formContent">
<!-- Icon -->
<div class="fadeIn first">
<h1 style="font-family: cursive; font-size: 45px; margin-top: 60px; margin-bottom: 20px">StreamNotFound</h1>
<img src="assets/logo.png" id="icon" alt="User Icon" style="margin-top: 20px"/>
</div>
<!-- Login Form -->
<form>
<input [(ngModel)]="pseudo" type="text" id="login" class="fadeIn second" name="login" placeholder="Login">
<input [(ngModel)]="password" type="password" id="password" class="fadeIn third" name="login" placeholder="Mot de passe">
<!-- Message d'erreur -->
<div *ngIf="hasError" style="text-align: center; margin-bottom: 20px;">
<span class="mat-error"> {{errorMessage}} </span>
</div>
<input type="submit" class="fadeIn fourth" value="Se connecter" (click)="onSeConnecter()">
</form>
<!-- Oubli mot de passe -->
<div id="formFooter">
<a class="underlineHover" href="https://disney.fandom.com/fr/wiki/Tristesse">J'ai oublié mon mot de passe</a>
</div>
<!-- Email -->
<div class="row">
<div class="col-4 label"> Email: &nbsp; </div>
<div class="col-8 champ">
<input type="text" [(ngModel)]="email">
</div> </div>
</div> </div>
<!-- Mot de passe -->
<div class="row">
<div class="col-4 label"> Mot de passe: &nbsp; </div>
<div class="col-8 champ">
<input type="text" [(ngModel)]="password">
</div>
</div>
<!-- Boutons -->
<div class="row">
<div class="col-6">
<button (click)="onSeConnecter()"> Se connecter </button>
</div>
<div class="col-6" style="text-align: right">
<button routerLink="/register"> S'inscrire </button>
</div>
</div>
<!-- Mot de passe oublié -->
<div style="text-align: right">
<a class="lien" href="https://pixar.fandom.com/wiki/Sadness"> Mot de passe oublié ? </a>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,64 +1,276 @@
.myContainer { html {
max-width: 100vw; background-color: #56baed;
}
body {
font-family: "Poppins", sans-serif;
height: 100vh; height: 100vh;
overflow-x: hidden;
font-size: x-large;
} }
h1 { a {
color: #5E89FF;
display:inline-block;
text-decoration: none;
font-weight: 400;
}
h2 {
text-align: center; text-align: center;
margin-bottom: 30px; font-size: 16px;
} font-weight: 600;
text-transform: uppercase;
.boite { display:inline-block;
margin-left: auto; margin: 40px 8px 10px 8px;
margin-right: auto; color: #cccccc;
width: 30%;
margin-top: 50vh;
transform: translateY(-100%);
border: solid 3px;
border-radius: 10px;
padding: 20px 40px 20px 20px;
background-color: #dcdcdc;
}
.lightTheme .boite {
border-color: black;
}
.darkTheme .boite {
border-color: white;
} }
.row { /* STRUCTURE */
margin: 25px 0px 25px 0px
.wrapper {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
width: 100%;
min-height: 100%;
padding: 20px;
} }
.label { #formContent {
text-align: right; -webkit-border-radius: 10px 10px 10px 10px;
margin-right: 0px; border-radius: 10px 10px 10px 10px;
background: #fff;
padding: 30px;
width: 90%;
max-width: 450px;
position: relative;
padding: 0px; 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;
} }
.champ { #formFooter {
margin: 0px; background-color: #f6f6f6;
padding: 0px; border-top: 1px solid #dce8f1;
padding: 25px;
text-align: center;
-webkit-border-radius: 0 0 10px 10px;
border-radius: 0 0 10px 10px;
} }
input {
/* 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;
}
.myContainer {
height: 100vh;
width: 100vw;
}
.bg{
margin: 0;
padding: 0;
height: 80vh;
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%; width: 100%;
} }
button { h1{
width: 100%;
margin-right: 0px;
}
.col-6 {
//text-align: center;
}
.lien {
text-decoration: underline;
color: black; color: black;
} }
/* OTHERS */
*:focus {
outline: none;
}
#icon {
width:30%;
}

View file

@ -1,9 +1,10 @@
import { Component, OnInit } from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {MessageService} from "../../utils/services/message/message.service"; 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 {ThemeService} from "../../utils/services/theme/theme.service";
@Component({ @Component({
selector: 'app-page-connexion', selector: 'app-page-connexion',
templateUrl: './page-connexion.component.html', templateUrl: './page-connexion.component.html',
@ -11,8 +12,11 @@ import {ThemeService} from "../../utils/services/theme/theme.service";
}) })
export class PageConnexionComponent implements OnInit export class PageConnexionComponent implements OnInit
{ {
email: string = "" pseudo: string = "" ;
password: string = "" password: string = "" ;
hasError: boolean = false;
errorMessage: string = "";
constructor( private messageService: MessageService, constructor( private messageService: MessageService,
private router: Router, private router: Router,
@ -23,23 +27,49 @@ export class PageConnexionComponent implements OnInit
onSeConnecter(): void onSeConnecter(): void
{
this.checkError();
if(!this.hasError)
{ {
let data = { let data = {
"email": this.email, "pseudo": this.pseudo,
"password": this.password "password": this.password
}; };
this.messageService this.messageService
.sendMessage('connexion', data) .sendMessage('connexion', data)
.subscribe( retour => this.maCallback(retour)) .subscribe( retour => this.maCallback(retour))
} }
}
maCallback(retour): void maCallback(retour): void
{ {
if(retour.status === "error") console.log(retour.data)
else {
console.log(retour.data) console.log(retour.data)
if(retour.status === "error") {
this.errorMessage = retour.data.reason;
this.hasError = true;
}
else {
//this.router.navigateByUrl( '/search' ); //this.router.navigateByUrl( '/search' );
} }
} }
checkError(): void
{
if(this.pseudo === "") {
this.errorMessage = "Veuillez remplir le champ login" ;
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;
}
}
} }

View file

@ -1,53 +1,72 @@
<div [class]="themeService.getClassTheme()"> <div [class]="themeService.getClassTheme()">
<div class="myContainer"> <div class="myContainer">
<div class="bg">
<app-nav-bar pour="3roles"></app-nav-bar>
<div class="boite"> <app-nav-bar pour="register"></app-nav-bar>
<h1> Inscription </h1>
<!-- Pseudo -->
<div class="row"> <div class="wrapper">
<div class="col-6 label"> Pseudo: &nbsp; </div> <div id="formContent">
<div class="col-6 champ">
<input type="text" [(ngModel)]="pseudo"> <!-- Icon -->
</div> <div style="margin: 10px 0px 20px 0px">
<img src="assets/logo.png" id="icon" alt="User Icon" style="margin-top: 20px"/>
</div> </div>
<!-- Login Form -->
<form>
<!-- Login -->
<mat-form-field appearance="fill">
<mat-label>Login</mat-label>
<input matInput type="text" [(ngModel)]="pseudo">
</mat-form-field>
<br>
<!-- Email --> <!-- Email -->
<div class="row"> <mat-form-field appearance="fill">
<div class="col-6 label"> Email: &nbsp; </div> <mat-label>Email</mat-label>
<div class="col-6 champ"> <input matInput type="email" [(ngModel)]="email">
<input type="email" [(ngModel)]="email"> </mat-form-field>
</div> <br>
</div>
<!-- Role -->
<mat-form-field appearance="fill">
<mat-label>Type de compte</mat-label>
<mat-select [(ngModel)]="role">
<mat-option value="user"> Utilisateur </mat-option>
<mat-option value="advertiser"> Annonceur </mat-option>
</mat-select>
</mat-form-field>
<br>
<!-- Mot de passe --> <!-- Mot de passe -->
<div class="row"> <mat-form-field appearance="fill">
<div class="col-6 label"> Mot de passe: &nbsp; </div> <mat-label>Mot de passe</mat-label>
<div class="col-6 champ"> <input matInput type="password" [(ngModel)]="password">
<input type="password" [(ngModel)]="password"> </mat-form-field>
</div> <br>
</div>
<!-- Confirmation mot de passe --> <!-- Confirmation mot de passe -->
<div class="row"> <mat-form-field appearance="fill">
<div class="col-6 label"> Confirmer le mot de passe: &nbsp; </div> <mat-label>Confirmation mot de passe</mat-label>
<div class="col-6 champ"> <input matInput type="password" [(ngModel)]="confirmPassword">
<input type="password" [(ngModel)]="confirmPassword"> </mat-form-field>
</div> <br>
</div>
<!-- Bouton valider -->
<div style="width: 100%; margin-top: 30px">
<button (click)="onValider()"> Valider </button>
</div>
<!-- Message d'erreur --> <!-- Message d'erreur -->
<div *ngIf="hasError" style="text-align: center"> <div *ngIf="hasError" style="text-align: center; margin-bottom: 20px;">
<span class="mat-error"> {{errorMessage}} </span> <span class="mat-error"> {{errorMessage}} </span>
</div> </div>
<!-- Valider -->
<input type="submit" class="fadeIn fourth" value="S'inscrire" (click)="onRegister()">
</form>
</div>
</div> </div>
</div>
</div> </div>
</div> </div>

View file

@ -1,58 +1,75 @@
.myContainer { body {
max-width: 100vw; font-family: "Poppins", sans-serif;
height: 100vh; height: 100vh;
}
.myContainer {
height: 100vh;
width: 100vw;
overflow-y: hidden;
overflow-x: hidden; overflow-x: hidden;
font-size: x-large;
} }
h1 { .bg{
text-align: center; height: 80vh;
margin-bottom: 30px; width: 100vw;
} }
.boite { .wrapper {
margin-left: auto; display: flex;
margin-right: auto; align-items: center;
width: 35%; flex-direction: column;
margin-top: 50vh; justify-content: center;
transform: translateY(-100%);
border: solid 3px;
border-radius: 10px;
padding: 20px 40px 20px 40px;
background-color: #dcdcdc;
}
.lightTheme .boite {
border-color: black;
}
.darkTheme .boite {
border-color: white;
}
input {
width: 100%; width: 100%;
min-height: 100%;
padding: 20px;
} }
.row {
margin: 15px 0px 15px 0px
}
.label { #formContent {
text-align: right; -webkit-border-radius: 10px 10px 10px 10px;
margin-right: 0px; border-radius: 10px 10px 10px 10px;
background: #fff;
padding: 30px;
width: 90%;
max-width: 450px;
position: relative;
padding: 0px; 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;
} }
.champ {
margin: 0px; #icon {
padding: 0px width:30%;
} }
button {
width: 100%; mat-form-field {
margin-right: 0px; width: 80%;
background-color: #969696; }
border: solid 2px black;
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;
box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4);
border-radius: 5px 5px 5px 5px;
margin: 5px 20px 40px 20px;
}
input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover {
background-color: #39ace7;
} }

View file

@ -15,6 +15,7 @@ export class PageRegisterComponent implements OnInit
pseudo: string = ""; pseudo: string = "";
email: string = "" ; email: string = "" ;
password: string = ""; password: string = "";
role: string = "";
confirmPassword: string = ""; confirmPassword: string = "";
hasError: boolean = false; hasError: boolean = false;
errorMessage: string = ""; errorMessage: string = "";
@ -36,45 +37,57 @@ export class PageRegisterComponent implements OnInit
} }
verifierChamps(): void checkField(): void
{ {
if(this.pseudo.length === 0) { if(this.pseudo.length === 0) {
this.errorMessage = "Veuillez remplir le champ 'pseudo'" this.errorMessage = "Veuillez remplir le champ 'pseudo'";
this.hasError = true; this.hasError = true;
} }
else if(this.email.length === 0) else if(this.email.length === 0)
{ {
this.errorMessage = "Veuillez remplir le champ 'email'" this.errorMessage = "Veuillez remplir le champ 'email'";
this.hasError = true; this.hasError = true;
} }
else if(!this.isValidEmail(this.email)) else if(!this.isValidEmail(this.email))
{ {
this.errorMessage = "Email invalide" this.errorMessage = "Email invalide";
this.hasError = true;
}
else if(this.role === "")
{
this.errorMessage = "Veuillez selectionner un type de compte";
this.hasError = true; this.hasError = true;
} }
else if(this.password.length === 0) else if(this.password.length === 0)
{ {
this.errorMessage = "Veuillez remplir le champ 'mot de passe'" this.errorMessage = "Veuillez remplir le champ 'mot de passe'";
this.hasError = true; this.hasError = true;
} }
else if(this.password !== this.confirmPassword) else if(this.password !== this.confirmPassword)
{ {
this.errorMessage = "Le mot de passe est différent de sa confirmation" this.errorMessage = "Le mot de passe est différent de sa confirmation";
this.hasError = true; this.hasError = true;
} }
else { else {
this.errorMessage = "" ;
this.hasError = false; this.hasError = false;
} }
console.log(this.errorMessage);
} }
onValider(): void onRegister(): void
{ {
this.verifierChamps() console.log(this.role);
console.log(this.hasError) this.checkField();
if(!this.hasError) if(!this.hasError)
{ {
let data = { "pseudo": this.pseudo, "email": this.email, "password": this.password } let data = {
"pseudo": this.pseudo,
"email": this.email,
"role": this.role,
"password": this.password
};
this.messageService this.messageService
.sendMessage('register', data) .sendMessage('register', data)
.subscribe(retour => this.maCallback(retour)) .subscribe(retour => this.maCallback(retour))
@ -94,4 +107,5 @@ export class PageRegisterComponent implements OnInit
.subscribe(result => this.router.navigateByUrl( '/connexion' )); .subscribe(result => this.router.navigateByUrl( '/connexion' ));
} }
} }
} }

View file

@ -49,9 +49,9 @@
</td> </td>
</ng-container> </ng-container>
<!-- Supprimer Column --> <!-- Action Column -->
<ng-container matColumnDef="effacer"> <ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Effacer </th> <th mat-header-cell *matHeaderCellDef mat-sort-header> Action </th>
<td mat-cell *matCellDef="let watchedVideo"> <td mat-cell *matCellDef="let watchedVideo">
<button mat-icon-button (click)="onDelete(watchedVideo)"> <button mat-icon-button (click)="onDelete(watchedVideo)">
<mat-icon >delete</mat-icon> <mat-icon >delete</mat-icon>

View file

@ -1,3 +1,9 @@
.myContainer {
max-width: 100vw;
height: 100vh;
overflow-x: hidden;
}
table { table {
margin: 0 auto; margin: 0 auto;
} }

View file

@ -1,20 +1,20 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PageHistoriqueComponent } from './page-historique.component'; import { PageHistoryUserComponent } from './page-history-user.component';
describe('PageHistoriqueComponent', () => { describe('PageHistoriqueComponent', () => {
let component: PageHistoriqueComponent; let component: PageHistoryUserComponent;
let fixture: ComponentFixture<PageHistoriqueComponent>; let fixture: ComponentFixture<PageHistoryUserComponent>;
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ PageHistoriqueComponent ] declarations: [ PageHistoryUserComponent ]
}) })
.compileComponents(); .compileComponents();
}); });
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(PageHistoriqueComponent); fixture = TestBed.createComponent(PageHistoryUserComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });

View file

@ -6,43 +6,43 @@ import {WatchedVideo} from "../../../utils/interfaces/watchedVideo";
import {MatTableDataSource} from "@angular/material/table"; import {MatTableDataSource} from "@angular/material/table";
import {MatSort} from "@angular/material/sort"; import {MatSort} from "@angular/material/sort";
import {VideoUrlService} from "../../../utils/services/videoUrl/video-url.service"; import {VideoUrlService} from "../../../utils/services/videoUrl/video-url.service";
import {HistoriqueService} from "../../../utils/services/historique/historique.service"; import {UserHistoryService} from "../../../utils/services/userHistory/userHistory.service";
@Component({ @Component({
selector: 'app-page-historique', selector: 'app-page-history-user',
templateUrl: './page-historique.component.html', templateUrl: './page-history-user.component.html',
styleUrls: ['./page-historique.component.scss'] styleUrls: ['./page-history-user.component.scss']
}) })
export class PageHistoriqueComponent implements OnInit export class PageHistoryUserComponent implements OnInit
{ {
displayedColumns: string[] = [ 'aperçu', 'titre', 'date', 'source', 'effacer' ]; displayedColumns: string[] = [ 'aperçu', 'titre', 'date', 'source', 'action' ];
dataSource ; dataSource ;
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;
constructor( public themeService: ThemeService, constructor( public themeService: ThemeService,
private messageService: MessageService, private messageService: MessageService,
private fictitiousDataService: FictitiousDatasService, private fictitiousDatasService: FictitiousDatasService,
public videoUrlService: VideoUrlService, public videoUrlService: VideoUrlService,
private historiqueService: HistoriqueService ) { } private userHistoryService: UserHistoryService ) { }
ngOnInit(): void ngOnInit(): void
{ {
this.historiqueService.clearTabVideoUrlClicked(); this.userHistoryService.clearTabVideoUrlClicked();
// --- FAUX CODE --- // --- FAUX CODE ---
const tabWatchedVideo = this.fictitiousDataService.getTabWatchedVideo(8); const tabWatchedVideo = this.fictitiousDatasService.getTabWatchedVideo(8);
this.dataSource = new MatTableDataSource(tabWatchedVideo); this.dataSource = new MatTableDataSource(tabWatchedVideo);
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort;
// --- VRAI CODE --- // --- VRAI CODE ---
/* /*
this.messageService this.messageService
.sendMessage( "user/get/historique", null ) .sendMessage( "user/get/history", null )
.subscribe( retour => { .subscribe( retour => {
if(retour.status === "error") console.log(retour); if(retour.status === "error") console.log(retour);
@ -99,7 +99,7 @@ export class PageHistoriqueComponent implements OnInit
onIframeClick(watchedVideo: WatchedVideo) onIframeClick(watchedVideo: WatchedVideo)
{ {
console.log("onIframeClick: " + watchedVideo.title); console.log("onIframeClick: " + watchedVideo.title);
this.historiqueService.addWatchedVideoToHistorique(watchedVideo); this.userHistoryService.addWatchedVideoToHistorique(watchedVideo);
} }
} }

View file

@ -7,7 +7,7 @@ import {AddVideoToPlaylistsService} from "../../../utils/services/addVideoToPlay
import {MessageService} from "../../../utils/services/message/message.service"; import {MessageService} from "../../../utils/services/message/message.service";
import {Playlist} from "../../../utils/interfaces/playlist"; import {Playlist} from "../../../utils/interfaces/playlist";
import {MatSnackBar} from "@angular/material/snack-bar"; import {MatSnackBar} from "@angular/material/snack-bar";
import {HistoriqueService} from "../../../utils/services/historique/historique.service"; import {UserHistoryService} from "../../../utils/services/userHistory/userHistory.service";
@ -27,7 +27,7 @@ export class VideoListComponent
public videoUrlService: VideoUrlService, public videoUrlService: VideoUrlService,
private addVideoToPlaylistService: AddVideoToPlaylistsService, private addVideoToPlaylistService: AddVideoToPlaylistsService,
private snackBar: MatSnackBar, private snackBar: MatSnackBar,
private historiqueService: HistoriqueService ) { } private historiqueService: UserHistoryService ) { }
onAdd(video: Video): void onAdd(video: Video): void

View file

@ -44,7 +44,7 @@ export class PageSearchComponent implements OnInit
// --- VRAI CODE --- // --- VRAI CODE ---
/* /*
let tabPlateformName = []; let tabPlateformName = [];
for(let plateform of this.tabPlateform) tabPlateformName.push(plateform.name); for(let plateform of this.tabPlateform) tabPlateformName.push(plateform.title);
let data = { search: "", plaateforms: tabPlateformName }; let data = { search: "", plaateforms: tabPlateformName };
this.messageService this.messageService
.sendMessage("user/searchVideo", data) .sendMessage("user/searchVideo", data)
@ -70,7 +70,7 @@ export class PageSearchComponent implements OnInit
let tabPlateformName = []; let tabPlateformName = [];
for(let plateform of this.tabPlateform) for(let plateform of this.tabPlateform)
{ {
if(plateform.isSelected) tabPlateformName.push(plateform.name); if(plateform.isSelected) tabPlateformName.push(plateform.title);
} }
let data = { "search": this.search, "plateforms": tabPlateformName }; let data = { "search": this.search, "plateforms": tabPlateformName };
this.messageService this.messageService

View file

@ -9,7 +9,7 @@ import {Video} from "../../../utils/interfaces/video";
import {ThemeService} from "../../../utils/services/theme/theme.service"; import {ThemeService} from "../../../utils/services/theme/theme.service";
import {WatchedVideo} from "../../../utils/interfaces/watchedVideo"; import {WatchedVideo} from "../../../utils/interfaces/watchedVideo";
import {MessageService} from "../../../utils/services/message/message.service"; import {MessageService} from "../../../utils/services/message/message.service";
import {HistoriqueService} from "../../../utils/services/historique/historique.service"; import {UserHistoryService} from "../../../utils/services/userHistory/userHistory.service";
@Component({ @Component({
selector: 'app-video-cell', selector: 'app-video-cell',
@ -26,7 +26,7 @@ export class VideoCellComponent implements OnInit
private addVideoToPlaylistsService: AddVideoToPlaylistsService, private addVideoToPlaylistsService: AddVideoToPlaylistsService,
public themeService: ThemeService, public themeService: ThemeService,
private messageService: MessageService, private messageService: MessageService,
private historiqueService: HistoriqueService ) {} private historiqueService: UserHistoryService ) {}
ngOnInit(): void ngOnInit(): void
{ {

View file

@ -1,11 +1,6 @@
import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core'; import {Component, Input, OnChanges} from '@angular/core';
import {Video} from "../../../utils/interfaces/video"; import {Video} from "../../../utils/interfaces/video";
import {VideoUrlService} from "../../../utils/services/videoUrl/video-url.service"; import {UserHistoryService} from "../../../utils/services/userHistory/userHistory.service";
import {AddVideoToPlaylistsService} from "../../../utils/services/addVideoToPlaylists/add-video-to-playlists.service";
import {ThemeService} from "../../../utils/services/theme/theme.service";
import {MessageService} from "../../../utils/services/message/message.service";
import {WatchedVideo} from "../../../utils/interfaces/watchedVideo";
import {HistoriqueService} from "../../../utils/services/historique/historique.service";
@Component({ @Component({
@ -19,7 +14,7 @@ export class VideoGridComponent implements OnChanges
tabTriplet = []; tabTriplet = [];
constructor(private historiqueService: HistoriqueService) {} constructor(private historiqueService: UserHistoryService) {}
ngOnChanges(): void ngOnChanges(): void

View file

@ -0,0 +1,74 @@
<div [class]="themeService.getClassTheme()">
<div class="myContainer">
<app-nav-bar [pour]="forNavbar"></app-nav-bar><br><br>
<div class="boite">
<!-- Photo de profil -->
<div style="text-align: center">
<img [src]="model.profilePictureUrl"
onerror="this.onerror=null; this.src='assets/profil.png'"
alt="">
<br>
<button mat-button (click)="onChangePP()"> Changer photo de profil</button>
</div>
<br>
<!-- Pseudo -->
<mat-form-field appearance="fill">
<mat-label>Pseudo</mat-label>
<input matInput type="text" [(ngModel)]="model.login">
</mat-form-field>
<br>
<!-- Email -->
<mat-form-field appearance="fill">
<mat-label>Email</mat-label>
<input matInput type="text" [(ngModel)]="model.mail">
</mat-form-field>
<br>
<!-- Role -->
<mat-form-field appearance="fill">
<mat-label>Type de compte</mat-label>
<input matInput type="text" *ngIf="model.role==='user'" value="Utilisateur" disabled>
<input matInput type="text" *ngIf="model.role==='advertiser'" value="Annonceur" disabled>
<input matInput type="text" *ngIf="model.role==='admin'" value="Admin" disabled>
</mat-form-field>
<br>
<!-- Modifier mot de passe -->
Modifier mot de passe:
<mat-checkbox [(ngModel)]="changePassword"></mat-checkbox>
<br>
<!-- Nouveau mot de passe -->
<div *ngIf="changePassword">
<!-- Nouveau mot de passe -->
<mat-form-field appearance="fill">
<mat-label>Nouveau mot de passe</mat-label>
<input matInput type="password" [(ngModel)]="model.newPassword">
</mat-form-field>
<br>
<!-- Confirmation npuveau mot de passe -->
<mat-form-field appearance="fill">
<mat-label>Confirmation nouveau mot de passe</mat-label>
<input matInput type="password" [(ngModel)]="confirmNewPassword">
</mat-form-field>
</div>
<br>
<!-- Bouton valider -->
<div style="width: 100%; text-align: center">
<button mat-button (click)="onEnregistrer()"> Enregistrer </button>
</div>
<!-- Message d'erreur -->
<div *ngIf="hasError" style="text-align: center; margin-top: 10px;">
<span class="mat-error"> {{errorMessage}} </span>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,67 @@
.myContainer {
max-width: 100vw;
height: 100vh;
overflow-x: hidden;
}
h1 {
text-align: center;
margin-bottom: 30px;
}
.boite {
margin-left: auto;
margin-right: auto;
width: 20%;
margin-top: 20px;
border: solid 3px;
border-radius: 10px;
padding: 20px 40px 20px 40px;
background-color: #ffffff;
text-align: center;
box-shadow: 10px 5px 5px black;
}
.lightTheme .boite {
border-color: black;
}
.darkTheme .boite {
border-color: white;
}
img {
margin: 0px 0px 10px 0px;
width: 5vw;
height: 5vw;
border: solid 2px black;
border-radius: 50%;
font-size: xxx-large;
}
mat-form-field {
padding: 2px 0px 2px 0px;
width: 70%;
}
button {
border: solid 1px black;
}
// -------------------------------------------------------------------------
// 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-color: black !important;
background-color: white !important;
}

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PageMyProfilComponent } from './page-my-profil.component';
describe('PageMyProfilComponent', () => {
let component: PageMyProfilComponent;
let fixture: ComponentFixture<PageMyProfilComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PageMyProfilComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PageMyProfilComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,164 @@
import { Component, OnInit } from '@angular/core';
import {MessageService} from "../../../services/message/message.service";
import {ThemeService} from "../../../services/theme/theme.service";
import {FictitiousDatasService} from "../../../services/fictitiousDatas/fictitious-datas.service";
import {MatDialog} from "@angular/material/dialog";
import {PopupAddVideoToPlaylistsComponent} from "../../popup-add-video-to-playlists/popup-add-video-to-playlists.component";
import {PopupPictureProfilUrlComponent} from "../popup-picture-profil-url/popup-picture-profil-url.component";
import {MatSnackBar} from "@angular/material/snack-bar";
import {Router} from "@angular/router";
@Component({
selector: 'app-page-my-profil',
templateUrl: './page-my-profil.component.html',
styleUrls: ['./page-my-profil.component.scss']
})
export class PageMyProfilComponent implements OnInit
{
model = {
_id: "",
profilePictureUrl: "",
login: "",
mail: "",
role: "",
newPassword: ""
};
confirmNewPassword: string = "" ;
changePassword: boolean = false ;
hasError: boolean = false;
errorMessage: string = "" ;
forNavbar: string = "" ;
constructor( private messageService: MessageService,
public themeService: ThemeService,
private fictitiousDatasService: FictitiousDatasService,
public dialog: MatDialog,
private snackBar: MatSnackBar,
private router: Router ) { }
ngOnInit(): void
{
// --- FAUX CODE ---
let profil ;
if(this.router.url.startsWith("/user")) {
profil = this.fictitiousDatasService.getUser();
this.forNavbar = "user";
}
else if(this.router.url.startsWith("/advertiser")) {
profil = this.fictitiousDatasService.getAdvertiser();
this.forNavbar = "advertiser";
}
else if(this.router.url.startsWith("/admin")) {
profil = this.fictitiousDatasService.getAdmin();
this.forNavbar = "admin";
}
this.model._id = profil._id;
this.model.profilePictureUrl = profil.profilePictureUrl;
this.model.login = profil.login;
this.model.mail = profil.mail;
this.model.role = profil.role;
// --- VRAI CODE ---
/*
this.messageService
.sendMessage("user/get/profil", null)
.subscribe( retour => {
if(retour.status === "error") console.log(retour);
else {
const profil = retour.data.profil;
this.model._id = profil._id;
this.model.profilePictureUrl = profil.profilePictureUrl;
this.model.pseudo = profil.pseudo;
this.model.email = profil.email;
this.model.role = profil.role;
this.model.newPassword = profil.newPassword;
}
});
*/
}
onEnregistrer()
{
console.log(this.model);
this.checkField();
// --- VRAI CODE ---
/*
if(!this.hasError)
{
this.messageService
.sendMessage("user/set/profil", this.model)
.subscribe( retour => {} );
}
*/
}
checkField()
{
if(this.model.login.length === 0) {
this.errorMessage = "Veuillez remplir le champ 'pseudo'"
this.hasError = true;
}
else if(this.model.mail.length === 0)
{
this.errorMessage = "Veuillez remplir le champ 'email'"
this.hasError = true;
}
else if(!this.isValidEmail(this.model.mail))
{
this.errorMessage = "Email invalide"
this.hasError = true;
}
else if(this.changePassword)
{
if (this.model.newPassword.length === 0) {
this.errorMessage = "Veuillez remplir le champ 'mot de passe'"
this.hasError = true;
} else if (this.model.newPassword !== this.confirmNewPassword) {
this.errorMessage = "Le mot de passe est différent de sa confirmation"
this.hasError = true;
}
}
else {
this.errorMessage = "" ;
this.hasError = false;
}
}
isValidEmail(email)
{
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);
}
onChangePP()
{
const config = {
width: '25%',
data: { profilePictureUrl: this.model.profilePictureUrl }
};
this.dialog
.open(PopupPictureProfilUrlComponent, config )
.afterClosed()
.subscribe(retour => {
if((retour === null) || (retour === undefined)) {
const config = { duration: 1000, panelClass: "custom-class" };
this.snackBar.open( "Opération annulé", "", config);
}
else {
this.model.profilePictureUrl = retour;
}
});
}
}

View file

@ -0,0 +1,9 @@
<div class="myContainer">
<img [src]="profilePictureUrl"
onerror="this.onerror=null; this.src='https://www.qualibre-formations.fr/wp-content/uploads/2020/02/icon_single.png'"
routerLink="/advertiser/myProfil"
alt="???">
<br>
<input [(ngModel)]="profilePictureUrl" placeholder="url de l'image"><br>
<button mat-button (click)="onValider()"> Valider </button>
</div>

View file

@ -0,0 +1,20 @@
.myContainer {
margin: 0px;
padding: 0px;
text-align: center;
}
img {
margin: 0px 0px 10px 0px;
width: 10vw;
height: 10vw;
border: solid 2px black;
border-radius: 50%;
font-size: xxx-large;
}
input {
margin: 0px;
margin: 0px 0px 10px 0px;
width: 100%;
}

View file

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PopupPictureProfilUrlComponent } from './popup-picture-profil-url.component';
describe('PopupPictureProfilUrlComponent', () => {
let component: PopupPictureProfilUrlComponent;
let fixture: ComponentFixture<PopupPictureProfilUrlComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PopupPictureProfilUrlComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PopupPictureProfilUrlComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,28 @@
import {Component, Inject, OnInit} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
@Component({
selector: 'app-popup-picture-profil-url',
templateUrl: './popup-picture-profil-url.component.html',
styleUrls: ['./popup-picture-profil-url.component.scss']
})
export class PopupPictureProfilUrlComponent implements OnInit
{
profilePictureUrl: string = "" ;
constructor( public dialogRef: MatDialogRef<PopupPictureProfilUrlComponent>,
@Inject(MAT_DIALOG_DATA) public data ) { }
ngOnInit(): void
{
this.profilePictureUrl = this.data.profilePictureUrl;
}
onValider()
{
this.dialogRef.close(this.profilePictureUrl);
}
}

View file

@ -1,41 +1,178 @@
<div [class]="themeService.getClassTheme()"> <!-- --------------------------------------------------------------------------------------------------------- -->
<!-- pour les 3 roles -->
<div *ngIf="pour === '3roles'">
<ul>
<li>
<a routerLink="/connexion" class="StreamNotFound"> StreamNotFound </a>
</li>
<li style="float:right; margin-right: 20px;">
<mat-slide-toggle (click)="onClick()"></mat-slide-toggle>
</li>
</ul>
</div>
<!-- pour User --> <!-- Login -->
<div *ngIf="pour === 'user'"> <div *ngIf="pour === 'login'">
<ul> <nav class="navbar navbar-expand-lg">
<li>
<a routerLink="/search" class="StreamNotFound"> StreamNotFound </a>
</li>
<li class="cliquable">
<a routerLink="/search"> Rechercher </a>
</li>
<li class="cliquable">
<a routerLink="/myPlaylists"> Mes playlists </a>
</li>
<li class="cliquable">
<a routerLink="/historique"> Historique </a>
</li>
<li style="float:right; margin-right: 20px;">
<a routerLink="/search">
<mat-icon>settings</mat-icon>
</a>
</li>
<li style="float:right; margin-right: 20px;">
<mat-slide-toggle (click)="onClick()"></mat-slide-toggle>
</li>
</ul>
</div>
<!-- PolyNotFound -->
<a class="navbar-brand" routerLink=""> StreamNotFound </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Rien -->
<div class="collapse navbar-collapse"></div>
<!-- Slide -->
<mat-slide-toggle (click)="onClick()" style="font-size: x-large; margin: 0px 50px 0px 10px;"></mat-slide-toggle>
<!-- S'inscrire -->
<button mat-button class="btnDeconnexion" routerLink="/register">
S'inscrire
</button>
</nav>
</div> </div>
<!-- --------------------------------------------------------------------------------------------------------- -->
<!-- Register -->
<div *ngIf="pour === 'register'">
<nav class="navbar navbar-expand-lg">
<!-- PolyNotFound -->
<a class="navbar-brand" routerLink=""> StreamNotFound </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Rien -->
<div class="collapse navbar-collapse"></div>
<!-- Slide -->
<mat-slide-toggle (click)="onClick()" style="font-size: x-large; margin: 0px 50px 0px 10px;"></mat-slide-toggle>
</nav>
</div>
<!-- --------------------------------------------------------------------------------------------------------- -->
<!-- User -->
<div *ngIf="pour === 'user'">
<nav class="navbar navbar-expand-lg">
<!-- PolyNotFound -->
<a class="navbar-brand" routerLink="/user/search"> StreamNotFound </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- [Recherche] [Mes Playlists] [Historique] -->
<div class="collapse navbar-collapse">
<ul class="navbar-nav">
<li class="nav-item active monLi">
<a class="nav-link" routerLink="/user/search"> Rechercher </a>
</li>
<li class="nav-item active monLi">
<a class="nav-link" routerLink="/user/myPlaylists"> Mes playlists </a>
</li>
<li class="nav-item active monLi">
<a class="nav-link" routerLink="/user/history"> Historique </a>
</li>
</ul>
</div>
<!-- Slide -->
<mat-slide-toggle (click)="onClick()" style="font-size: x-large; margin: 0px 10px 0px 10px;"></mat-slide-toggle>
<!-- Mon profil -->
<img [src]=urlImage
onerror="this.onerror=null; this.src='assets/profil.png'"
routerLink="/user/myProfil"
alt="">
<!-- Deconnexion -->
<button mat-button class="btnDeconnexion" (click)="onDeconnexion()" routerLink="/">
Deconnexion
</button>
</nav>
</div>
<!-- --------------------------------------------------------------------------------------------------------- -->
<!-- Advertiser -->
<div *ngIf="pour === 'advertiser'">
<nav class="navbar navbar-expand-lg">
<!-- PolyNotFound -->
<a class="navbar-brand" routerLink="/advertiser"> StreamNotFound </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Vide -->
<div class="collapse navbar-collapse"></div>
<!-- Slide -->
<mat-slide-toggle (click)="onClick()" style="font-size: x-large; margin: 0px 10px 0px 10px;"></mat-slide-toggle>
<!-- Mon profil -->
<img [src]=urlImage
onerror="this.onerror=null; this.src='assets/profil.png'"
routerLink="/advertiser/myProfil"
alt="">
<!-- Deconnexion -->
<button mat-button class="btnDeconnexion" (click)="onDeconnexion()" routerLink="/">
Deconnexion
</button>
</nav>
</div>
<!-- --------------------------------------------------------------------------------------------------------- -->
<!-- Admin -->
<div *ngIf="pour === 'admin'">
<nav class="navbar navbar-expand-lg">
<!-- PolyNotFound -->
<a class="navbar-brand" routerLink="/admin/userList"> StreamNotFound </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- [Recherche] [Mes Playlists] [Historique] -->
<div class="collapse navbar-collapse">
<ul class="navbar-nav">
<li class="nav-item active monLi">
<a class="nav-link" routerLink="/admin/userList"> Liste des utillisateurs </a>
</li>
<li class="nav-item active monLi">
<a class="nav-link" routerLink="/admin/addUser"> Ajouter un utilisateur </a>
</li>
<li class="nav-item active monLi">
<a class="nav-link" routerLink="/admin/adList"> Liste des pubs </a>
</li>
</ul>
</div>
<!-- Slide -->
<mat-slide-toggle (click)="onClick()" style="font-size: x-large; margin: 0px 10px 0px 10px;"></mat-slide-toggle>
<!-- Mon profil -->
<img [src]=urlImage
onerror="this.onerror=null; this.src='assets/profil.png'"
routerLink="/admin/myProfil"
alt="">
<!-- Deconnexion -->
<button mat-button class="btnDeconnexion" (click)="onDeconnexion()" routerLink="/">
Deconnexion
</button>
</nav>
</div>
<!-- --------------------------------------------------------------------------------------------------------- -->

View file

@ -1,55 +1,66 @@
.StreamNotFound { .navbar {
font-style: oblique;
font-family: cursive;
font-size: xx-large;
}
mat-icon {
margin-top: 2px;
font-size: xx-large;
}
mat-slide-toggle {
margin-top: 20px;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: black; background-color: black;
height: 70px; height: 75px;
color: white;
border-bottom: solid 2px white;
}
li {
float: left;
font-size: x-large; font-size: x-large;
background-color: black;
}
li a {
display: block;
color: white; color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
background-color: black;
} }
.cliquable a:hover:not(.active) { .navbar-expand-lg {
background-color: #c8c8c8; border-bottom: solid;
border-color: white;
border-bottom-width: 2px;
} }
// PolyNotFound
.navbar-brand {
font-family: cursive;
font-weight: bold;
//font-style: oblique 90deg;
font-size: xxx-large;
margin-left: 30px;
color: white;
}
// Recherche, Mes Playlists, Historique
.nav-link {
color: white;
}
.nav-link:hover {
color: grey;
}
// Bonton deconnexion
.btnDeconnexion {
font-size: x-large;
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: 50px;
height: 50px;
}
img:hover {
cursor: pointer;
}
// --------------------------------------------------------------------
::ng-deep .mat-slide-toggle-thumb { ::ng-deep .mat-slide-toggle-thumb {

View file

@ -1,19 +1,49 @@
import {Component, Input, OnInit} from '@angular/core'; import {Component, Input, OnInit} from '@angular/core';
import {ThemeService} from "../../services/theme/theme.service"; import {ThemeService} from "../../services/theme/theme.service";
@Component({ @Component({
selector: 'app-nav-bar', selector: 'app-nav-bar',
templateUrl: './nav-bar.component.html', templateUrl: './nav-bar.component.html',
styleUrls: ['./nav-bar.component.scss'] styleUrls: ['./nav-bar.component.scss']
}) })
export class NavBarComponent export class NavBarComponent implements OnInit
{ {
@Input() pour = "3roles"; @Input() pour = "login";
urlImage: string = "" ;
constructor(public themeService: ThemeService) { }
onClick(): void { constructor( public themeService: ThemeService ) { }
this.themeService.isLightTheme = !this.themeService.isLightTheme
ngOnInit(): void
{
// --- FAUX CODE ---
switch (this.pour)
{
case "user":
this.urlImage = "https://www.figurines-goodies.com/1185-thickbox_default/huey-duck-tales-disney-funko-pop.jpg" ;
break;
case "advertiser":
this.urlImage = "https://www.figurines-goodies.com/1188-large_default/dewey-duck-tales-disney-funko-pop.jpg" ;
break;
case "admin":
this.urlImage = "https://www.reference-gaming.com/assets/media/product/41195/figurine-pop-duck-tales-n-309-loulou.jpg" ;
break;
}
}
onClick(): void
{
this.themeService.isLightTheme = !this.themeService.isLightTheme;
}
onDeconnexion(): void
{
} }
} }

View file

@ -17,3 +17,23 @@ h3 {
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
// -------------------------------------------------------------------------
// 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-color: black !important;
background-color: white !important;
}

View file

@ -51,7 +51,7 @@ export class PopupCreatePlaylistComponent implements OnInit
if(!this.hasError) if(!this.hasError)
{ {
this.messageService this.messageService
.sendMessage("user/create/playlist", {name: this.data.name}) .sendMessage("user/create/playlist", {title: this.data.title})
.subscribe(retour => { .subscribe(retour => {
if (retour.status === "error") { if (retour.status === "error") {

View file

@ -1,13 +1,16 @@
export interface Advert export interface Advert
{ {
_id: string, _id: string,
title: string,
advertiser: string, advertiser: string,
images: { images: {
url: string, url: string,
description: string, description: string,
}[] }[],
text: string, tags: string[],
subjectTarget: any[] comment: string,
seen: number, views: number,
date: Date, createdAt: Date,
lastUpdate: Date,
isVisible: boolean,
} }

View file

@ -0,0 +1,9 @@
export interface User
{
_id: string,
login: string
hashPass: string
mail: string
role: any,
profilePictureUrl: string
}

View file

@ -3,6 +3,7 @@ import {Video} from "../../interfaces/video";
import {Playlist} from "../../interfaces/playlist"; import {Playlist} from "../../interfaces/playlist";
import {Advert} from "../../interfaces/advert"; import {Advert} from "../../interfaces/advert";
import {WatchedVideo} from "../../interfaces/watchedVideo"; import {WatchedVideo} from "../../interfaces/watchedVideo";
import {User} from "../../interfaces/user";
@ -87,25 +88,75 @@ const TAB_VIDEO = [
] ]
const TAB_ADVERT = [
{
_id: "idNutella",
title: "pot de nutella XXL",
advertiser: "nutella",
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" }
],
tags: [ "bon", "petit-déjeuner", "chocolat" ],
comment: "pub pour vacances de noêl",
views: 5,
createdAt: new Date(),
lastUpdate: new Date(),
isVisible: true
},
{
_id: "idRolex",
title: "Rolex",
advertiser: "rolex",
images: [
{ url: "rolex_v_1.jpg", description: "rolex 1" },
{ url: "rolex_v_2.png", description: "rolex 2" },
],
tags: [ "montre", "luxe", "suisse" ],
comment: "pub pour cette année",
views: 2,
createdAt: new Date(),
lastUpdate: new Date(),
isVisible: true
},
]
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class FictitiousDatasService export class FictitiousDatasService
{ {
constructor() { }
private 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;
}
getVideo(): Video
{
const idx = Math.floor(Math.random() * TAB_VIDEO.length);
let video = Object.assign({}, TAB_VIDEO[idx]);
video._id = video._id + this.makeid(5);
return video;
}
getTabVideo(n: number): Video[] getTabVideo(n: number): Video[]
{ {
let tabVideo = []; let tabVideo = [];
const l = TAB_VIDEO.length; for(let i=0 ; i<n ; i++) tabVideo.push(this.getVideo());
for(let i=0 ; i<n ; i++)
{
const idx = Math.floor(Math.random() * l);
tabVideo.push(TAB_VIDEO[idx]);
}
return tabVideo; return tabVideo;
} }
@ -131,30 +182,25 @@ export class FictitiousDatasService
getAdvert(): Advert getAdvert(): Advert
{ {
return { const idx = Math.floor(Math.random() * TAB_ADVERT.length);
_id: "monId", let advert = Object.assign({}, TAB_ADVERT[idx]);
advertiser: "nutella", advert._id = advert._id + this.makeid(5);
images: [ advert.tags = advert.tags.slice();
{ url: "nutella_v_1.jpeg", description: "image nutella 1" }, advert.isVisible = (Math.random() < 0.5);
{ url: "nutella_v_2.png", description: "image nutella 2" }, return advert;
{ url: "nutella_v_3.jpg", description: "image nutella 3" }
],
text: "Voici du bon nutella",
subjectTarget: [],
seen: 4,
date: new Date(),
} }
getTabAdvert(n: number): Advert[]
{
let tabAdvert = [];
for(let i=0 ; i<n ; i++) tabAdvert.push(this.getAdvert());
return tabAdvert;
} }
getTabWatchedVideo(n): WatchedVideo[] getWatchedVideo(): WatchedVideo
{ {
let tabWatchedVideo = []; const idx = Math.floor(Math.random() * TAB_VIDEO.length);
const l = TAB_VIDEO.length;
for(let i=0 ; i<n ; i++)
{
const idx = Math.floor(Math.random() * l);
const video: Video = TAB_VIDEO[idx]; const video: Video = TAB_VIDEO[idx];
const watchedVideo: WatchedVideo = { const watchedVideo: WatchedVideo = {
_id: video._id, _id: video._id,
@ -162,9 +208,57 @@ export class FictitiousDatasService
title: video.title, title: video.title,
date: new Date() date: new Date()
}; };
tabWatchedVideo.push(watchedVideo); return watchedVideo ;
} }
getTabWatchedVideo(n: number): WatchedVideo[]
{
let tabWatchedVideo = [];
for(let i=0 ; i<n ; i++) tabWatchedVideo.push(this.getWatchedVideo());
return tabWatchedVideo; return tabWatchedVideo;
} }
getUser(): User
{
return {
_id: "ririId",
login: "Riri",
hashPass: "agourgroou",
mail: "riri@gmail.com",
role: "user",
profilePictureUrl: "https://www.figurines-goodies.com/1185-thickbox_default/huey-duck-tales-disney-funko-pop.jpg"
}
}
getAdvertiser(): User
{
return {
_id: "fifiId",
login: "Fifi",
hashPass: "agourgroou",
mail: "fifi@gmail.com",
role: "advertiser",
profilePictureUrl: "https://www.figurines-goodies.com/1188-large_default/dewey-duck-tales-disney-funko-pop.jpg"
}
}
getAdmin(): User
{
return {
_id: "loulouId",
login: "Loulou",
hashPass: "agourgroou",
mail: "loulou@gmail.com",
role: "advertiser",
profilePictureUrl: "https://www.reference-gaming.com/assets/media/product/41195/figurine-pop-duck-tales-n-309-loulou.jpg?format=product-cover-large&k=1519639530"
}
}
getTags(): string[]
{
return [ "musique", "rap", "rock", "sport", "foot", "basket", "tennis", "film", "action", "aventure", "horreur", "romance", "comedie"];
}
} }

View file

@ -1,13 +1,13 @@
import { TestBed } from '@angular/core/testing'; import { TestBed } from '@angular/core/testing';
import { HistoriqueService } from './historique.service'; import { UserHistoryService } from './userHistory.service';
describe('HistoriqueService', () => { describe('HistoriqueService', () => {
let service: HistoriqueService; let service: UserHistoryService;
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({}); TestBed.configureTestingModule({});
service = TestBed.inject(HistoriqueService); service = TestBed.inject(UserHistoryService);
}); });
it('should be created', () => { it('should be created', () => {

View file

@ -6,7 +6,7 @@ import {MessageService} from "../message/message.service";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class HistoriqueService export class UserHistoryService
{ {
private tabVideoUrlClicked: string[] = []; private tabVideoUrlClicked: string[] = [];

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/assets/profil.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View file

@ -1,79 +0,0 @@
<div class="conteneur">
<!-- Navbar -->
<div style="margin-bottom: 50px">
<app-nav-bar pour="user"></app-nav-bar>
</div>
<!-- ---------------------------------------------------------------------------------------------------------- -->
<!-- bloc du milieu: niveau 1 -->
<div class="row blocMilieu1">
<!-- pub de gauche -->
<div class="col-2">
<div class="conteneurPubGauche">
<app-pub></app-pub>
</div>
</div>
<!-- ------------------------- -->
<!-- bloc du milieu: niveau 2 -->
<div class="col-8">
<!-- Search bar -->
<div class="row" style="margin-bottom: 10px">
<div>
<input type="search" placeholder="recherche..." class="inputSearchBar" [(ngModel)]="search"> &nbsp;
<button class="btnRechercher" (click)="onSearch()"> Rechercher </button>
</div>
</div>
<!-- Site de streaming -->
<div class="row" style="margin-bottom: 10px">
<div>
<span *ngFor="let plateforme of tabPlateform">
&nbsp;
<input type="checkbox" [id]="plateforme.name" [name]="plateforme.name" style="margin-left: 5px" [(ngModel)]="plateforme.isSelected">
<img [src]="'/assets/logo_plateforms/'+plateforme.name+'.png'" alt="image" width="25px" height="25px" style="margin-left: 5px">
<label [for]="plateforme.name" style="margin-left: 5px"> {{plateforme.name}}</label>
&nbsp;
</span>
</div>
</div>
<!-- Grille des videos -->
<div class="row">
<app-video-grid [tabVideo]="tabVideo"></app-video-grid>
</div>
</div>
<!-- ------------------------- -->
<!-- pub de droite -->
<div class="col-2">
<div class="conteneurPubDroite">
<app-pub></app-pub>
</div>
</div>
</div>
<!-- ---------------------------------------------------------------------------------------------------------- -->
<!-- pub du bas
<div class="row">
<div class="col-2"></div>
<div class="col-8">
<div class="conteneurPubBas">
<app-pub></app-pub>
</div>
</div>
<div class="col-2"></div>
</div>
-->
</div>

View file

@ -59,7 +59,7 @@
*/ */
import 'zone.js/dist/zone'; // Included with Angular CLI. import 'zone.js/dist/zone'; // Included with Angular CLI.
/*************************************************************************************************** /***************************************************************************************************
* APPLICATION IMPORTS * APPLICATION IMPORTS
*/ */
import '@angular/localize/init';

View file

@ -6,14 +6,24 @@
html, body { height: 100%; } html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
.lightTheme { .lightTheme {
background-color: white; background: url("assets/lightBackground.jpg") no-repeat center center fixed;
font-color: black; font-color: black;
border-color: black; border-color: black;
} }
.darkTheme { .darkTheme {
background-color: #323232; background: url("assets/darkBackground.webp") no-repeat center center fixed;
font-color: white; font-color: white;
border-color: white; border-color: white;
} }
.lightTheme, .darkTheme {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}