bla
This commit is contained in:
parent
630c777022
commit
dee8d9cc6b
|
|
@ -1,17 +1,17 @@
|
||||||
# Editor configuration, see https://editorconfig.org
|
# Editor configuration, see https://editorconfig.org
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[*.ts]
|
[*.ts]
|
||||||
quote_type = single
|
quote_type = single
|
||||||
ij_typescript_use_double_quotes = false
|
ij_typescript_use_double_quotes = false
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
max_line_length = off
|
max_line_length = off
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,42 @@
|
||||||
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
|
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
|
||||||
|
|
||||||
# Compiled output
|
# Compiled output
|
||||||
/dist
|
/dist
|
||||||
/tmp
|
/tmp
|
||||||
/out-tsc
|
/out-tsc
|
||||||
/bazel-out
|
/bazel-out
|
||||||
|
|
||||||
# Node
|
# Node
|
||||||
/node_modules
|
/node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
|
||||||
# IDEs and editors
|
# IDEs and editors
|
||||||
.idea/
|
.idea/
|
||||||
.project
|
.project
|
||||||
.classpath
|
.classpath
|
||||||
.c9/
|
.c9/
|
||||||
*.launch
|
*.launch
|
||||||
.settings/
|
.settings/
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
|
|
||||||
# Visual Studio Code
|
# Visual Studio Code
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/settings.json
|
!.vscode/settings.json
|
||||||
!.vscode/tasks.json
|
!.vscode/tasks.json
|
||||||
!.vscode/launch.json
|
!.vscode/launch.json
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
.history/*
|
.history/*
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
/.angular/cache
|
/.angular/cache
|
||||||
.sass-cache/
|
.sass-cache/
|
||||||
/connect.lock
|
/connect.lock
|
||||||
/coverage
|
/coverage
|
||||||
/libpeerconnection.log
|
/libpeerconnection.log
|
||||||
testem.log
|
testem.log
|
||||||
/typings
|
/typings
|
||||||
|
|
||||||
# System files
|
# System files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"@tailwindcss/postcss": {}
|
"@tailwindcss/postcss": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
|
||||||
"recommendations": ["angular.ng-template"]
|
"recommendations": ["angular.ng-template"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
{
|
{
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "ng serve",
|
"name": "ng serve",
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "npm: start",
|
"preLaunchTask": "npm: start",
|
||||||
"url": "http://localhost:4200/"
|
"url": "http://localhost:4200/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ng test",
|
"name": "ng test",
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "npm: test",
|
"preLaunchTask": "npm: test",
|
||||||
"url": "http://localhost:9876/debug.html"
|
"url": "http://localhost:9876/debug.html"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,42 @@
|
||||||
{
|
{
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
|
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
"script": "start",
|
"script": "start",
|
||||||
"isBackground": true,
|
"isBackground": true,
|
||||||
"problemMatcher": {
|
"problemMatcher": {
|
||||||
"owner": "typescript",
|
"owner": "typescript",
|
||||||
"pattern": "$tsc",
|
"pattern": "$tsc",
|
||||||
"background": {
|
"background": {
|
||||||
"activeOnStart": true,
|
"activeOnStart": true,
|
||||||
"beginsPattern": {
|
"beginsPattern": {
|
||||||
"regexp": "(.*?)"
|
"regexp": "(.*?)"
|
||||||
},
|
},
|
||||||
"endsPattern": {
|
"endsPattern": {
|
||||||
"regexp": "bundle generation complete"
|
"regexp": "bundle generation complete"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
"script": "test",
|
"script": "test",
|
||||||
"isBackground": true,
|
"isBackground": true,
|
||||||
"problemMatcher": {
|
"problemMatcher": {
|
||||||
"owner": "typescript",
|
"owner": "typescript",
|
||||||
"pattern": "$tsc",
|
"pattern": "$tsc",
|
||||||
"background": {
|
"background": {
|
||||||
"activeOnStart": true,
|
"activeOnStart": true,
|
||||||
"beginsPattern": {
|
"beginsPattern": {
|
||||||
"regexp": "(.*?)"
|
"regexp": "(.*?)"
|
||||||
},
|
},
|
||||||
"endsPattern": {
|
"endsPattern": {
|
||||||
"regexp": "bundle generation complete"
|
"regexp": "bundle generation complete"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
118
README.md
118
README.md
|
|
@ -1,59 +1,59 @@
|
||||||
# TpAngularFinal
|
# TpAngularFinal
|
||||||
|
|
||||||
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.1.3.
|
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.1.3.
|
||||||
|
|
||||||
## Development server
|
## Development server
|
||||||
|
|
||||||
To start a local development server, run:
|
To start a local development server, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ng serve
|
ng serve
|
||||||
```
|
```
|
||||||
|
|
||||||
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
||||||
|
|
||||||
## Code scaffolding
|
## Code scaffolding
|
||||||
|
|
||||||
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ng generate component component-name
|
ng generate component component-name
|
||||||
```
|
```
|
||||||
|
|
||||||
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ng generate --help
|
ng generate --help
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
To build the project run:
|
To build the project run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ng build
|
ng build
|
||||||
```
|
```
|
||||||
|
|
||||||
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
||||||
|
|
||||||
## Running unit tests
|
## Running unit tests
|
||||||
|
|
||||||
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ng test
|
ng test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running end-to-end tests
|
## Running end-to-end tests
|
||||||
|
|
||||||
For end-to-end (e2e) testing, run:
|
For end-to-end (e2e) testing, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ng e2e
|
ng e2e
|
||||||
```
|
```
|
||||||
|
|
||||||
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
||||||
|
|
||||||
## Additional Resources
|
## Additional Resources
|
||||||
|
|
||||||
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
||||||
|
|
|
||||||
188
angular.json
188
angular.json
|
|
@ -1,94 +1,94 @@
|
||||||
{
|
{
|
||||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"newProjectRoot": "projects",
|
"newProjectRoot": "projects",
|
||||||
"projects": {
|
"projects": {
|
||||||
"tpAngularFinal": {
|
"tpAngularFinal": {
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"schematics": {},
|
"schematics": {},
|
||||||
"root": "",
|
"root": "",
|
||||||
"sourceRoot": "src",
|
"sourceRoot": "src",
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"architect": {
|
"architect": {
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular/build:application",
|
"builder": "@angular/build:application",
|
||||||
"options": {
|
"options": {
|
||||||
"browser": "src/main.ts",
|
"browser": "src/main.ts",
|
||||||
"tsConfig": "tsconfig.app.json",
|
"tsConfig": "tsconfig.app.json",
|
||||||
"assets": [
|
"assets": [
|
||||||
{
|
{
|
||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "public"
|
"input": "public"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"src/styles.css"
|
"src/styles.css"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"budgets": [
|
"budgets": [
|
||||||
{
|
{
|
||||||
"type": "initial",
|
"type": "initial",
|
||||||
"maximumWarning": "500kB",
|
"maximumWarning": "500kB",
|
||||||
"maximumError": "1MB"
|
"maximumError": "1MB"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "anyComponentStyle",
|
"type": "anyComponentStyle",
|
||||||
"maximumWarning": "4kB",
|
"maximumWarning": "4kB",
|
||||||
"maximumError": "8kB"
|
"maximumError": "8kB"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"outputHashing": "all"
|
"outputHashing": "all"
|
||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"optimization": false,
|
"optimization": false,
|
||||||
"extractLicenses": false,
|
"extractLicenses": false,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"fileReplacements": [
|
"fileReplacements": [
|
||||||
{
|
{
|
||||||
"replace": "src/environments/environment.ts",
|
"replace": "src/environments/environment.ts",
|
||||||
"with": "src/environments/environment.development.ts"
|
"with": "src/environments/environment.development.ts"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "production"
|
"defaultConfiguration": "production"
|
||||||
},
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular/build:dev-server",
|
"builder": "@angular/build:dev-server",
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"buildTarget": "tpAngularFinal:build:production"
|
"buildTarget": "tpAngularFinal:build:production"
|
||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"buildTarget": "tpAngularFinal:build:development"
|
"buildTarget": "tpAngularFinal:build:development"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "development"
|
"defaultConfiguration": "development"
|
||||||
},
|
},
|
||||||
"extract-i18n": {
|
"extract-i18n": {
|
||||||
"builder": "@angular/build:extract-i18n"
|
"builder": "@angular/build:extract-i18n"
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"builder": "@angular/build:karma",
|
"builder": "@angular/build:karma",
|
||||||
"options": {
|
"options": {
|
||||||
"tsConfig": "tsconfig.spec.json",
|
"tsConfig": "tsconfig.spec.json",
|
||||||
"assets": [
|
"assets": [
|
||||||
{
|
{
|
||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "public"
|
"input": "public"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"src/styles.css"
|
"src/styles.css"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cli": {
|
"cli": {
|
||||||
"analytics": false
|
"analytics": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
98
package.json
98
package.json
|
|
@ -1,49 +1,49 @@
|
||||||
{
|
{
|
||||||
"name": "tp-angular-final",
|
"name": "tp-angular-final",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
"test": "ng test"
|
"test": "ng test"
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": "*.html",
|
"files": "*.html",
|
||||||
"options": {
|
"options": {
|
||||||
"parser": "angular"
|
"parser": "angular"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "^20.1.0",
|
"@angular/common": "^20.1.0",
|
||||||
"@angular/compiler": "^20.1.0",
|
"@angular/compiler": "^20.1.0",
|
||||||
"@angular/core": "^20.1.0",
|
"@angular/core": "^20.1.0",
|
||||||
"@angular/forms": "^20.1.0",
|
"@angular/forms": "^20.1.0",
|
||||||
"@angular/platform-browser": "^20.1.0",
|
"@angular/platform-browser": "^20.1.0",
|
||||||
"@angular/router": "^20.1.0",
|
"@angular/router": "^20.1.0",
|
||||||
"@tailwindcss/postcss": "^4.1.13",
|
"@tailwindcss/postcss": "^4.1.13",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "^8.5.6",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
"tailwindcss": "^4.1.13",
|
"tailwindcss": "^4.1.13",
|
||||||
"tslib": "^2.3.0"
|
"tslib": "^2.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/build": "^20.1.3",
|
"@angular/build": "^20.1.3",
|
||||||
"@angular/cli": "^20.1.3",
|
"@angular/cli": "^21.1.0",
|
||||||
"@angular/compiler-cli": "^20.1.0",
|
"@angular/compiler-cli": "^20.1.0",
|
||||||
"@types/jasmine": "~5.1.0",
|
"@types/jasmine": "~5.1.0",
|
||||||
"daisyui": "^5.1.22",
|
"daisyui": "^5.1.22",
|
||||||
"jasmine-core": "~5.8.0",
|
"jasmine-core": "~5.8.0",
|
||||||
"karma": "~6.4.0",
|
"karma": "~6.4.0",
|
||||||
"karma-chrome-launcher": "~3.2.0",
|
"karma-chrome-launcher": "~3.2.0",
|
||||||
"karma-coverage": "~2.2.0",
|
"karma-coverage": "~2.2.0",
|
||||||
"karma-jasmine": "~5.1.0",
|
"karma-jasmine": "~5.1.0",
|
||||||
"karma-jasmine-html-reporter": "~2.1.0",
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
"typescript": "~5.8.2"
|
"typescript": "~5.8.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZonelessChangeDetection } from '@angular/core';
|
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZonelessChangeDetection } from '@angular/core';
|
||||||
import { provideRouter } from '@angular/router';
|
import { provideRouter } from '@angular/router';
|
||||||
|
|
||||||
import { routes } from './app.routes';
|
import { routes } from './app.routes';
|
||||||
import { provideHttpClient } from '@angular/common/http';
|
import { provideHttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
export const appConfig: ApplicationConfig = {
|
export const appConfig: ApplicationConfig = {
|
||||||
providers: [
|
providers: [
|
||||||
provideBrowserGlobalErrorListeners(),
|
provideBrowserGlobalErrorListeners(),
|
||||||
provideZonelessChangeDetection(),
|
provideZonelessChangeDetection(),
|
||||||
provideRouter(routes),
|
provideRouter(routes),
|
||||||
provideHttpClient()
|
provideHttpClient()
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
main {
|
main {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 2rem;
|
margin: 2rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<html><app-header [userEmail]="connectedUserEmail()" />
|
<html><app-header [userEmail]="connectedUserEmail()" />
|
||||||
<main>
|
<main>
|
||||||
<router-outlet />
|
<router-outlet />
|
||||||
</main>
|
</main>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
import { adminGuard } from './guards/admin-guard';
|
import { adminGuard } from './guards/admin-guard';
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{path: '', redirectTo: "/home", pathMatch:"full"},
|
{path: '', redirectTo: "/home", pathMatch:"full"},
|
||||||
{path: 'home', loadComponent: ()=> import("./pages/home/home").then(m =>m.Home)},
|
{path: 'home', loadComponent: ()=> import("./pages/home/home").then(m =>m.Home)},
|
||||||
{path: 'login', loadComponent: ()=> import("./pages/login/login").then(m =>m.Login)},
|
{path: 'login', loadComponent: ()=> import("./pages/login/login").then(m =>m.Login)},
|
||||||
{path: 'register', loadComponent: ()=> import("./pages/register/register").then(m =>m.Register)},
|
{path: 'register', loadComponent: ()=> import("./pages/register/register").then(m =>m.Register)},
|
||||||
{path: 'login', loadComponent: ()=> import("./pages/login/login").then(m =>m.Login)},
|
{path: 'login', loadComponent: ()=> import("./pages/login/login").then(m =>m.Login)},
|
||||||
{path: 'potd', loadComponent: ()=> import("./pages/potd/potd").then(m =>m.POTD)},
|
{path: 'potd', loadComponent: ()=> import("./pages/potd/potd").then(m =>m.POTD)},
|
||||||
{path: 'search', loadComponent: ()=> import("./pages/search/search").then(m =>m.Search)},
|
{path: 'search', loadComponent: ()=> import("./pages/search/search").then(m =>m.Search)},
|
||||||
{path: 'video/:id', loadComponent: ()=> import("./pages/video/video").then(m =>m.Video)},
|
{path: 'video/:id', loadComponent: ()=> import("./pages/video/video").then(m =>m.Video)},
|
||||||
{path: 'admin',canActivate: [adminGuard], loadChildren: () => import('./pages/admin/admin').then(m => m.Admin), data: { role: 'ADMIN' } },
|
{path: 'admin',canActivate: [adminGuard], loadChildren: () => import('./pages/admin/admin').then(m => m.Admin), data: { role: 'ADMIN' } },
|
||||||
//version si besoin de multiplier les routes admin
|
//version si besoin de multiplier les routes admin
|
||||||
// {path: 'admin',canActivate: [adminGuard], loadChildren: () => import('./pages/admin/admin.routes').then(m => m.ADMIN_ROUTES), data: { role: 'ADMIN' } },
|
// {path: 'admin',canActivate: [adminGuard], loadChildren: () => import('./pages/admin/admin.routes').then(m => m.ADMIN_ROUTES), data: { role: 'ADMIN' } },
|
||||||
{path: '**',loadComponent: ()=> import("./pages/not-found/not-found").then(m =>m.NotFound) }
|
{path: '**',loadComponent: ()=> import("./pages/not-found/not-found").then(m =>m.NotFound) }
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
import { provideZonelessChangeDetection } from '@angular/core';
|
import { provideZonelessChangeDetection } from '@angular/core';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { App } from './app';
|
import { App } from './app';
|
||||||
|
|
||||||
describe('App', () => {
|
describe('App', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [App],
|
imports: [App],
|
||||||
providers: [provideZonelessChangeDetection()]
|
providers: [provideZonelessChangeDetection()]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create the app', () => {
|
it('should create the app', () => {
|
||||||
const fixture = TestBed.createComponent(App);
|
const fixture = TestBed.createComponent(App);
|
||||||
const app = fixture.componentInstance;
|
const app = fixture.componentInstance;
|
||||||
expect(app).toBeTruthy();
|
expect(app).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render title', () => {
|
it('should render title', () => {
|
||||||
const fixture = TestBed.createComponent(App);
|
const fixture = TestBed.createComponent(App);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const compiled = fixture.nativeElement as HTMLElement;
|
const compiled = fixture.nativeElement as HTMLElement;
|
||||||
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, tpAngularFinal');
|
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, tpAngularFinal');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,26 @@
|
||||||
import { Component, computed, Signal, signal } from '@angular/core';
|
import { Component, computed, Signal, signal } from '@angular/core';
|
||||||
import { RouterOutlet } from '@angular/router';
|
import { RouterOutlet } from '@angular/router';
|
||||||
import { Auth } from './services/auth';
|
import { Auth } from './services/auth';
|
||||||
import { Header } from './shared/header/header';
|
import { Header } from './shared/header/header';
|
||||||
import { Sidebar } from "./shared/sidebar/sidebar";
|
import { Sidebar } from "./shared/sidebar/sidebar";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
imports: [RouterOutlet, Header, Sidebar],
|
imports: [RouterOutlet, Header, Sidebar],
|
||||||
templateUrl: './app.html',
|
templateUrl: './app.html',
|
||||||
styleUrl: './app.css'
|
styleUrl: './app.css'
|
||||||
})
|
})
|
||||||
export class App {
|
export class App {
|
||||||
protected readonly title = signal('tpAngularFinal');
|
protected readonly title = signal('tpAngularFinal');
|
||||||
isLoggedIn: Signal<Boolean> = signal(false);
|
isLoggedIn: Signal<Boolean> = signal(false);
|
||||||
|
|
||||||
connectedUserEmail = computed(()=>{
|
connectedUserEmail = computed(()=>{
|
||||||
const user=this.userService.connectedUser();
|
const user=this.userService.connectedUser();
|
||||||
return user ? user.email : null;
|
return user ? user.email : null;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
constructor(private readonly userService: Auth){
|
constructor(private readonly userService: Auth){
|
||||||
console.log(this.isLoggedIn());
|
console.log(this.isLoggedIn());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { CanActivateFn } from '@angular/router';
|
import { CanActivateFn } from '@angular/router';
|
||||||
|
|
||||||
import { adminGuard } from './admin-guard';
|
import { adminGuard } from './admin-guard';
|
||||||
|
|
||||||
describe('adminGuard', () => {
|
describe('adminGuard', () => {
|
||||||
const executeGuard: CanActivateFn = (...guardParameters) =>
|
const executeGuard: CanActivateFn = (...guardParameters) =>
|
||||||
TestBed.runInInjectionContext(() => adminGuard(...guardParameters));
|
TestBed.runInInjectionContext(() => adminGuard(...guardParameters));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
||||||
expect(executeGuard).toBeTruthy();
|
expect(executeGuard).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { CanActivateFn } from '@angular/router';
|
import { CanActivateFn } from '@angular/router';
|
||||||
|
|
||||||
export const adminGuard: CanActivateFn = (route, state) => {
|
export const adminGuard: CanActivateFn = (route, state) => {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
export type ColorApi = Color[]
|
|
||||||
|
|
||||||
export interface Color {
|
|
||||||
id: number
|
|
||||||
title: string
|
|
||||||
userName: string
|
|
||||||
numViews: number
|
|
||||||
numVotes: number
|
|
||||||
numComments: number
|
|
||||||
numHearts: number
|
|
||||||
rank: number
|
|
||||||
dateCreated: string
|
|
||||||
hex: string
|
|
||||||
rgb: Rgb
|
|
||||||
hsv: Hsv
|
|
||||||
description: string
|
|
||||||
url: string
|
|
||||||
imageUrl: string
|
|
||||||
badgeUrl: string
|
|
||||||
apiUrl: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Rgb {
|
|
||||||
red: number
|
|
||||||
green: number
|
|
||||||
blue: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Hsv {
|
|
||||||
hue: number
|
|
||||||
saturation: number
|
|
||||||
value: number
|
|
||||||
}
|
|
||||||
|
|
@ -1,52 +1,52 @@
|
||||||
export interface NasaApi {
|
export interface NasaApi {
|
||||||
collection: Collection
|
collection: Collection
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Collection {
|
export interface Collection {
|
||||||
version: string
|
version: string
|
||||||
href: string
|
href: string
|
||||||
items: Item[]
|
items: Item[]
|
||||||
metadata: Metadata
|
metadata: Metadata
|
||||||
links: Link2[]
|
links: Link2[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Item {
|
export interface Item {
|
||||||
href: string
|
href: string
|
||||||
data: Daum[]
|
data: Daum[]
|
||||||
links: Link[]
|
links: Link[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Daum {
|
export interface Daum {
|
||||||
center: string
|
center: string
|
||||||
date_created: string
|
date_created: string
|
||||||
description?: string
|
description?: string
|
||||||
keywords?: string[]
|
keywords?: string[]
|
||||||
media_type: string
|
media_type: string
|
||||||
nasa_id: string
|
nasa_id: string
|
||||||
title: string
|
title: string
|
||||||
description_508?: string
|
description_508?: string
|
||||||
album?: string[]
|
album?: string[]
|
||||||
location?: string
|
location?: string
|
||||||
secondary_creator?: string
|
secondary_creator?: string
|
||||||
photographer?: string
|
photographer?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Link {
|
export interface Link {
|
||||||
href: string
|
href: string
|
||||||
rel: string
|
rel: string
|
||||||
render?: string
|
render?: string
|
||||||
width?: number
|
width?: number
|
||||||
size?: number
|
size?: number
|
||||||
height?: number
|
height?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Metadata {
|
export interface Metadata {
|
||||||
total_hits: number
|
total_hits: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Link2 {
|
export interface Link2 {
|
||||||
rel: string
|
rel: string
|
||||||
prompt: string
|
prompt: string
|
||||||
href: string
|
href: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
export interface Picture {
|
export interface Picture {
|
||||||
copyright: string
|
copyright: string
|
||||||
date: string
|
date: string
|
||||||
explanation: string
|
explanation: string
|
||||||
hdurl: string
|
hdurl: string
|
||||||
media_type: string
|
media_type: string
|
||||||
service_version: string
|
service_version: string
|
||||||
title: string
|
title: string
|
||||||
url: string
|
url: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<p>admin works!</p>
|
<p>admin works!</p>
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Admin } from './admin';
|
import { Admin } from './admin';
|
||||||
|
|
||||||
describe('Admin', () => {
|
describe('Admin', () => {
|
||||||
let component: Admin;
|
let component: Admin;
|
||||||
let fixture: ComponentFixture<Admin>;
|
let fixture: ComponentFixture<Admin>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Admin]
|
imports: [Admin]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Admin);
|
fixture = TestBed.createComponent(Admin);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-admin',
|
selector: 'app-admin',
|
||||||
imports: [],
|
imports: [],
|
||||||
templateUrl: './admin.html',
|
templateUrl: './admin.html',
|
||||||
styleUrl: './admin.css'
|
styleUrl: './admin.css'
|
||||||
})
|
})
|
||||||
export class Admin {
|
export class Admin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<p>home works!</p>
|
<p>home works!</p>
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Home } from './home';
|
import { Home } from './home';
|
||||||
|
|
||||||
describe('Home', () => {
|
describe('Home', () => {
|
||||||
let component: Home;
|
let component: Home;
|
||||||
let fixture: ComponentFixture<Home>;
|
let fixture: ComponentFixture<Home>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Home]
|
imports: [Home]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Home);
|
fixture = TestBed.createComponent(Home);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-home',
|
selector: 'app-home',
|
||||||
imports: [],
|
imports: [],
|
||||||
templateUrl: './home.html',
|
templateUrl: './home.html',
|
||||||
styleUrl: './home.css'
|
styleUrl: './home.css'
|
||||||
})
|
})
|
||||||
export class Home {
|
export class Home {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<!-- TODO: utiliser des formgroup -->
|
<!-- TODO: utiliser des formgroup -->
|
||||||
<div class = "form-container">
|
<div class = "form-container">
|
||||||
<form (ngSubmit)="login()">
|
<form (ngSubmit)="login()">
|
||||||
<fieldset >
|
<fieldset >
|
||||||
<legend >Login</legend>
|
<legend >Login</legend>
|
||||||
<div >
|
<div >
|
||||||
<input class="input" type="text" [value]="email()" (input)="updateEmail($event)" placeholder="Mail" aria-label="email">
|
<input class="input" type="text" [value]="email()" (input)="updateEmail($event)" placeholder="Mail" aria-label="email">
|
||||||
</div>
|
</div>
|
||||||
<input class="input" type="text" [value]="password()" (input)="updatePassword($event)" placeholder="Password" aria-label="password">
|
<input class="input" type="text" [value]="password()" (input)="updatePassword($event)" placeholder="Password" aria-label="password">
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<button class="btn" type="submit">Login</button>
|
<button class="btn" type="submit">Login</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Login } from './login';
|
import { Login } from './login';
|
||||||
|
|
||||||
describe('Login', () => {
|
describe('Login', () => {
|
||||||
let component: Login;
|
let component: Login;
|
||||||
let fixture: ComponentFixture<Login>;
|
let fixture: ComponentFixture<Login>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Login]
|
imports: [Login]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Login);
|
fixture = TestBed.createComponent(Login);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<p>not-found works!</p>
|
<p>not-found works!</p>
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { NotFound } from './not-found';
|
import { NotFound } from './not-found';
|
||||||
|
|
||||||
describe('NotFound', () => {
|
describe('NotFound', () => {
|
||||||
let component: NotFound;
|
let component: NotFound;
|
||||||
let fixture: ComponentFixture<NotFound>;
|
let fixture: ComponentFixture<NotFound>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [NotFound]
|
imports: [NotFound]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(NotFound);
|
fixture = TestBed.createComponent(NotFound);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-not-found',
|
selector: 'app-not-found',
|
||||||
imports: [],
|
imports: [],
|
||||||
templateUrl: './not-found.html',
|
templateUrl: './not-found.html',
|
||||||
styleUrl: './not-found.css'
|
styleUrl: './not-found.css'
|
||||||
})
|
})
|
||||||
export class NotFound {
|
export class NotFound {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,17 @@
|
||||||
<!-- <div class="card bg-base-100 w-96 shadow-sm">
|
<div class="hero bg-base-200 min-h-screen">
|
||||||
<div class="card-body">
|
<div class="hero-content flex-col lg:flex-col">
|
||||||
<h2 class="card-title">{{nasaPOTD()?.title}}</h2>
|
<img
|
||||||
<p>{{nasaPOTD()?.explanation}}</p>
|
src={{nasaPOTD()?.url}}
|
||||||
</div>
|
class="max-w-mid rounded-lg shadow-2xl"
|
||||||
<figure>
|
/>
|
||||||
<img
|
<div>
|
||||||
src={{nasaPOTD()?.url}}
|
<h1 class="text-5xl font-bold">{{nasaPOTD()?.title}}</h1>
|
||||||
alt="Nasa picture of the day" />
|
<p class="text-2x2 font-semibold">Copyright: {{nasaPOTD()?.copyright}}</p>
|
||||||
</figure>
|
<p class="py-6">
|
||||||
</div> -->
|
{{nasaPOTD()?.explanation}}
|
||||||
|
</p>
|
||||||
<div class="hero bg-base-200 min-h-screen">
|
<!-- TODO: button to erase or find a usage -->
|
||||||
<div class="hero-content flex-col lg:flex-col">
|
<!-- <button class="btn btn-primary">Get Started</button> -->
|
||||||
<img
|
</div>
|
||||||
src={{nasaPOTD()?.url}}
|
</div>
|
||||||
class="max-w-mid rounded-lg shadow-2xl"
|
</div>
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<h1 class="text-5xl font-bold">{{nasaPOTD()?.title}}</h1>
|
|
||||||
<p class="text-2x2 font-semibold">Copyright: {{nasaPOTD()?.copyright}}</p>
|
|
||||||
<p class="py-6">
|
|
||||||
{{nasaPOTD()?.explanation}}
|
|
||||||
</p>
|
|
||||||
<!-- TODO: button to erase or find a usage -->
|
|
||||||
<!-- <button class="btn btn-primary">Get Started</button> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { POTD } from './potd';
|
import { POTD } from './potd';
|
||||||
|
|
||||||
describe('POTD', () => {
|
describe('POTD', () => {
|
||||||
let component: POTD;
|
let component: POTD;
|
||||||
let fixture: ComponentFixture<POTD>;
|
let fixture: ComponentFixture<POTD>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [POTD]
|
imports: [POTD]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(POTD);
|
fixture = TestBed.createComponent(POTD);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,29 @@
|
||||||
import { Component, inject, signal } from '@angular/core';
|
import { Component, inject, signal } from '@angular/core';
|
||||||
import { NAPOD } from '../../services/napod';
|
import { NAPOD } from '../../services/napod';
|
||||||
import { Picture } from '../../interfaces/picture';
|
import { Picture } from '../../interfaces/picture';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-potd',
|
selector: 'app-potd',
|
||||||
imports: [],
|
imports: [],
|
||||||
templateUrl: './potd.html',
|
templateUrl: './potd.html',
|
||||||
styleUrl: './potd.css'
|
styleUrl: './potd.css'
|
||||||
})
|
})
|
||||||
export class POTD {
|
export class POTD {
|
||||||
|
|
||||||
private nasaApi = inject(NAPOD)
|
private readonly nasaApi = inject(NAPOD)
|
||||||
nasaPOTD = signal< Picture | null >(null)
|
nasaPOTD = signal< Picture | null >(null)
|
||||||
|
|
||||||
constructor(){
|
constructor(){
|
||||||
this.nasaApi.getPicOfToday().subscribe({
|
this.nasaApi.getPicOfToday().subscribe({
|
||||||
next: (data)=>{
|
next: (data)=>{
|
||||||
console.log(data)
|
console.log(data)
|
||||||
this.nasaPOTD.set(data)
|
this.nasaPOTD.set(data)
|
||||||
},
|
},
|
||||||
error: error =>{
|
error: error =>{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Register } from './register';
|
import { Register } from './register';
|
||||||
|
|
||||||
describe('Register', () => {
|
describe('Register', () => {
|
||||||
let component: Register;
|
let component: Register;
|
||||||
let fixture: ComponentFixture<Register>;
|
let fixture: ComponentFixture<Register>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Register]
|
imports: [Register]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Register);
|
fixture = TestBed.createComponent(Register);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
.searchcontainer {
|
.searchcontainer {
|
||||||
width:80vw;
|
width:80vw;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputSearch {
|
.inputSearch {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
@ -1,63 +1,58 @@
|
||||||
<div class="searchcontainer">
|
<div class="searchcontainer">
|
||||||
<form class="inputSearch" (ngSubmit)="onSubmit()">
|
<form class="inputSearch" (ngSubmit)="onSubmit()">
|
||||||
<label class="input">
|
<label class="input">
|
||||||
<svg
|
<svg
|
||||||
class="h-[1em] opacity-50"
|
class="h-[1em] opacity-50"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
>
|
>
|
||||||
<g
|
<g
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-width="2.5"
|
stroke-width="2.5"
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
>
|
>
|
||||||
<circle cx="11" cy="11" r="8"></circle>
|
<circle cx="11" cy="11" r="8"></circle>
|
||||||
<path d="m21 21-4.3-4.3"></path>
|
<path d="m21 21-4.3-4.3"></path>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
<input type="search" [value]="searchString()" (input)="updateSearch($event)" class="grow" placeholder="Search" />
|
<input type="search" [value]="searchString()" (input)="updateSearch($event)" class="grow" placeholder="Search" />
|
||||||
<kbd class="kbd kbd-sm">⌘</kbd>
|
<kbd class="kbd kbd-sm">⌘</kbd>
|
||||||
<kbd class="kbd kbd-sm">K</kbd>
|
<kbd class="kbd kbd-sm">K</kbd>
|
||||||
</label>
|
</label>
|
||||||
<button class="btn">Submit</button>
|
<button class="btn">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@if(searchResults()!==null && searchResults()!.collection.items.length==0){
|
@if(searchResults()!==null && searchResults()!.collection.items.length==0){
|
||||||
<div class="resultsContainer">
|
<div class="resultsContainer">
|
||||||
<p>No results for this search</p>
|
<p>No results for this search</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if(searchResults()!==null && searchResults()!.collection.items.length!==0){
|
@if(searchResults()!==null && searchResults()!.collection.items.length!==0){
|
||||||
<div class="resultsContainer">
|
<div class="resultsContainer">
|
||||||
<ul class="list bg-base-100 rounded-box shadow-md">
|
<ul class="list bg-base-100 rounded-box shadow-md">
|
||||||
|
|
||||||
<li class="p-4 pb-2 text-xs opacity-60 tracking-wide">Results</li>
|
<li class="p-4 pb-2 text-xs opacity-60 tracking-wide">Results</li>
|
||||||
<!-- TODO why the fuck is nasaData an array?-->
|
@for(el of searchResults()!.collection.items; track el.data[0].nasa_id){
|
||||||
|
<li class="list-row">
|
||||||
@for(el of searchResults()!.collection.items; track el.data[0].nasa_id){
|
<!-- 2 for small image -->
|
||||||
<li class="list-row">
|
<div><a><img class="size-25 rounded-box" src="{{el.links[1].href}}"/></a></div>
|
||||||
<!-- 2 for small image -->
|
<div>
|
||||||
<div><a><img class="size-25 rounded-box" src="{{el.links[1].href}}"/></a></div>
|
<div>{{el.data[0].title}}</div>
|
||||||
<div>
|
<div class="text-xs uppercase font-semibold opacity-60">Photographer: {{el.data[0].photographer}}</div>
|
||||||
<div>{{el.data[0].title}}</div>
|
<p class="list-col-wrap text-xs">
|
||||||
<div class="text-xs uppercase font-semibold opacity-60">Photographer: {{el.data[0].photographer}}</div>
|
{{el.data[0].description}}
|
||||||
<p class="list-col-wrap text-xs">
|
</p>
|
||||||
{{el.data[0].description}}
|
</div>
|
||||||
</p>
|
<button class="btn btn-square btn-ghost" (click)="onClick(el.data[0].nasa_id)">
|
||||||
</div>
|
<svg class="size-[1.2em]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="currentColor"><path d="M6 3L20 12 6 21 6 3z"></path></g></svg>
|
||||||
<button class="btn btn-square btn-ghost" (click)="onClick(el.data[0].nasa_id)">
|
</button>
|
||||||
<svg class="size-[1.2em]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="currentColor"><path d="M6 3L20 12 6 21 6 3z"></path></g></svg>
|
</li>
|
||||||
</button>
|
}
|
||||||
<!-- <button class="btn btn-square btn-ghost">
|
|
||||||
<svg class="size-[1.2em]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="currentColor"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"></path></g></svg>
|
</ul>
|
||||||
</button> -->
|
</div>
|
||||||
</li>
|
}
|
||||||
}
|
</div>
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Search } from './search';
|
import { Search } from './search';
|
||||||
|
|
||||||
describe('Search', () => {
|
describe('Search', () => {
|
||||||
let component: Search;
|
let component: Search;
|
||||||
let fixture: ComponentFixture<Search>;
|
let fixture: ComponentFixture<Search>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Search]
|
imports: [Search]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Search);
|
fixture = TestBed.createComponent(Search);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
@if(isLoading()){
|
@if(isLoading()){
|
||||||
<div class="spinner">
|
<div class="spinner">
|
||||||
<span class="loading loading-spinner loading-xl"></span>
|
<span class="loading loading-spinner loading-xl"></span>
|
||||||
<p>Chargement de la vidéo...</p>
|
<p>Chargement de la vidéo...</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@if(!isLoading() && asset()){
|
@if(!isLoading() && asset()){
|
||||||
<div class="videocontainer">
|
<div class="videocontainer">
|
||||||
<video width="320" height="240" controls>
|
<video width="320" height="240" controls>
|
||||||
<source src="{{asset()!.items[3].href}}" type="video/mp4">
|
<source src="{{asset()!.items[3].href}}" type="video/mp4">
|
||||||
Your browser does not support the video tag.
|
Your browser does not support the video tag.
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if(!isLoading() && !asset()){
|
@if(!isLoading() && !asset()){
|
||||||
<p>Impossible de charger la vidéo.</p>
|
<p>Impossible de charger la vidéo.</p>
|
||||||
}
|
}
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Video } from './video';
|
import { Video } from './video';
|
||||||
|
|
||||||
describe('Video', () => {
|
describe('Video', () => {
|
||||||
let component: Video;
|
let component: Video;
|
||||||
let fixture: ComponentFixture<Video>;
|
let fixture: ComponentFixture<Video>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Video]
|
imports: [Video]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Video);
|
fixture = TestBed.createComponent(Video);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Auth } from './auth';
|
import { Auth } from './auth';
|
||||||
|
|
||||||
describe('Auth', () => {
|
describe('Auth', () => {
|
||||||
let service: Auth;
|
let service: Auth;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({});
|
||||||
service = TestBed.inject(Auth);
|
service = TestBed.inject(Auth);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
||||||
expect(service).toBeTruthy();
|
expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -119,9 +119,5 @@ export class Auth {
|
||||||
else{
|
else{
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { NAPOD } from './napod';
|
import { NAPOD } from './napod';
|
||||||
|
|
||||||
describe('NAPOD', () => {
|
describe('NAPOD', () => {
|
||||||
let service: NAPOD;
|
let service: NAPOD;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({});
|
||||||
service = TestBed.inject(NAPOD);
|
service = TestBed.inject(NAPOD);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
||||||
expect(service).toBeTruthy();
|
expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,28 @@
|
||||||
import { inject, Injectable } from '@angular/core';
|
import { inject, Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Picture } from '../interfaces/picture';
|
import { Picture } from '../interfaces/picture';
|
||||||
import { environment } from '../../environments/environment.development';
|
import { environment } from '../../environments/environment.development';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { NasaApi } from '../interfaces/nasa-api';
|
import { NasaApi } from '../interfaces/nasa-api';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class NAPOD {
|
export class NAPOD {
|
||||||
|
|
||||||
private readonly http = inject(HttpClient);
|
private readonly http = inject(HttpClient);
|
||||||
|
|
||||||
getPicOfToday(): Observable<Picture> {
|
getPicOfToday(): Observable<Picture> {
|
||||||
return this.http.get<Picture>(`${environment.NASA_API_BASE_URL}/planetary/apod?api_key=${environment.NASA_API_KEY}`)
|
return this.http.get<Picture>(`${environment.NASA_API_BASE_URL}/planetary/apod?api_key=${environment.NASA_API_KEY}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
searchForVideos(query: string){
|
searchForVideos(query: string){
|
||||||
// TODO: Si vide?
|
return this.http.get<NasaApi>(`${environment.NASA_API_IMAGE_BASE_URL}/search?q=${query}&media_type=video&page_size=5`)
|
||||||
return this.http.get<NasaApi>(`${environment.NASA_API_IMAGE_BASE_URL}/search?q=${query}&media_type=video&page_size=5`)
|
}
|
||||||
}
|
|
||||||
|
getAssetDetail(nasaId: string){
|
||||||
getAssetDetail(nasaId: string){
|
return this.http.get<NasaApi>(`${environment.NASA_API_IMAGE_BASE_URL}/asset/${nasaId}`)
|
||||||
return this.http.get<NasaApi>(`${environment.NASA_API_IMAGE_BASE_URL}/asset/${nasaId}`)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
<div class="navbar bg-base-100 shadow-sm" >
|
<div class="navbar bg-base-100 shadow-sm" >
|
||||||
<div><a class="btn btn-ghost text-xl" routerLink="/home">Home</a></div>
|
<div><a class="btn btn-ghost text-xl" routerLink="/home">Home</a></div>
|
||||||
<div><a class="btn btn-ghost text-xl" routerLink="/potd">Picture of the day</a></div>
|
<div><a class="btn btn-ghost text-xl" routerLink="/potd">Picture of the day</a></div>
|
||||||
<div><a class="btn btn-ghost text-xl" routerLink="/search">Search</a></div>
|
<div><a class="btn btn-ghost text-xl" routerLink="/search">Search</a></div>
|
||||||
@if(isLoggedIn()){
|
@if(isLoggedIn()){
|
||||||
<div><a class="btn btn-ghost text-xl" (click)="logout()">Logout</a></div>
|
<div><a class="btn btn-ghost text-xl" (click)="logout()">Logout</a></div>
|
||||||
}
|
}
|
||||||
@if(!isLoggedIn()){
|
@if(!isLoggedIn()){
|
||||||
<div ><a class="btn btn-ghost text-xl" routerLink="/login">Login</a></div>
|
<div ><a class="btn btn-ghost text-xl" routerLink="/login">Login</a></div>
|
||||||
<div ><a class="btn btn-ghost text-xl" routerLink="/register">Register</a></div>
|
<div ><a class="btn btn-ghost text-xl" routerLink="/register">Register</a></div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Header } from './header';
|
import { Header } from './header';
|
||||||
|
|
||||||
describe('Header', () => {
|
describe('Header', () => {
|
||||||
let component: Header;
|
let component: Header;
|
||||||
let fixture: ComponentFixture<Header>;
|
let fixture: ComponentFixture<Header>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Header]
|
imports: [Header]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Header);
|
fixture = TestBed.createComponent(Header);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,29 @@
|
||||||
import { Component, computed, input, signal, Signal } from '@angular/core';
|
import { Component, computed, input, signal, Signal } from '@angular/core';
|
||||||
import { Router, RouterLink } from '@angular/router';
|
import { Router, RouterLink } from '@angular/router';
|
||||||
import { Auth } from '../../services/auth';
|
import { Auth } from '../../services/auth';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
imports: [RouterLink],
|
imports: [RouterLink],
|
||||||
templateUrl: './header.html',
|
templateUrl: './header.html',
|
||||||
styleUrl: './header.css'
|
styleUrl: './header.css'
|
||||||
})
|
})
|
||||||
export class Header {
|
export class Header {
|
||||||
userEmail=input<string | null>(null);
|
userEmail=input<string | null>(null);
|
||||||
isLoggedIn = computed(()=>this.userEmail() !== null)
|
isLoggedIn = computed(()=>this.userEmail() !== null)
|
||||||
currentUserEmail = computed(()=> this.userEmail());
|
currentUserEmail = computed(()=> this.userEmail());
|
||||||
|
|
||||||
|
|
||||||
constructor(private readonly loginservice: Auth, private readonly router: Router){
|
constructor(private readonly loginservice: Auth, private readonly router: Router){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logout(){
|
logout(){
|
||||||
this.loginservice.logout();
|
this.loginservice.logout();
|
||||||
this.router.navigate(["/login"])
|
this.router.navigate(["/login"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<p>sidebar works!</p>
|
<p>sidebar works!</p>
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Sidebar } from './sidebar';
|
import { Sidebar } from './sidebar';
|
||||||
|
|
||||||
describe('Sidebar', () => {
|
describe('Sidebar', () => {
|
||||||
let component: Sidebar;
|
let component: Sidebar;
|
||||||
let fixture: ComponentFixture<Sidebar>;
|
let fixture: ComponentFixture<Sidebar>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [Sidebar]
|
imports: [Sidebar]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Sidebar);
|
fixture = TestBed.createComponent(Sidebar);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-sidebar',
|
selector: 'app-sidebar',
|
||||||
imports: [],
|
imports: [],
|
||||||
templateUrl: './sidebar.html',
|
templateUrl: './sidebar.html',
|
||||||
styleUrl: './sidebar.css'
|
styleUrl: './sidebar.css'
|
||||||
})
|
})
|
||||||
export class Sidebar {
|
export class Sidebar {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: true
|
production: true
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>TpAngularFinal</title>
|
<title>TpAngularFinal</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<app-root></app-root>
|
<app-root></app-root>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
12
src/main.ts
12
src/main.ts
|
|
@ -1,6 +1,6 @@
|
||||||
import { bootstrapApplication } from '@angular/platform-browser';
|
import { bootstrapApplication } from '@angular/platform-browser';
|
||||||
import { appConfig } from './app/app.config';
|
import { appConfig } from './app/app.config';
|
||||||
import { App } from './app/app';
|
import { App } from './app/app';
|
||||||
|
|
||||||
bootstrapApplication(App, appConfig)
|
bootstrapApplication(App, appConfig)
|
||||||
.catch((err) => console.error(err));
|
.catch((err) => console.error(err));
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
@plugin "daisyui";
|
@plugin "daisyui";
|
||||||
|
|
||||||
html {
|
html {
|
||||||
background: #000000;
|
background: #000000;
|
||||||
/* background: linear-gradient(90deg,rgba(0, 0, 0, 1) 0%, rgba(130, 21, 21, 1) 66%, rgb(223, 47, 38) 100%); */
|
/* background: linear-gradient(90deg,rgba(0, 0, 0, 1) 0%, rgba(130, 21, 21, 1) 66%, rgb(223, 47, 38) 100%); */
|
||||||
}
|
}
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./out-tsc/app",
|
"outDir": "./out-tsc/app",
|
||||||
"types": []
|
"types": []
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts"
|
"src/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"src/**/*.spec.ts"
|
"src/**/*.spec.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,34 @@
|
||||||
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
{
|
{
|
||||||
"compileOnSave": false,
|
"compileOnSave": false,
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noImplicitOverride": true,
|
"noImplicitOverride": true,
|
||||||
"noPropertyAccessFromIndexSignature": true,
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "preserve"
|
"module": "preserve"
|
||||||
},
|
},
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"enableI18nLegacyMessageIdFormat": false,
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
"strictInjectionParameters": true,
|
"strictInjectionParameters": true,
|
||||||
"strictInputAccessModifiers": true,
|
"strictInputAccessModifiers": true,
|
||||||
"typeCheckHostBindings": true,
|
"typeCheckHostBindings": true,
|
||||||
"strictTemplates": true
|
"strictTemplates": true
|
||||||
},
|
},
|
||||||
"files": [],
|
"files": [],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "./tsconfig.app.json"
|
"path": "./tsconfig.app.json"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "./tsconfig.spec.json"
|
"path": "./tsconfig.spec.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./out-tsc/spec",
|
"outDir": "./out-tsc/spec",
|
||||||
"types": [
|
"types": [
|
||||||
"jasmine"
|
"jasmine"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts"
|
"src/**/*.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue