Compare commits
67 Commits
19ca0c086c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6ecefb8d9 | ||
|
|
be029ee054 | ||
|
|
df35b8991d | ||
|
|
4349fa39b4 | ||
|
|
7ed3367ed8 | ||
|
|
90c192c881 | ||
|
|
e9943dae76 | ||
|
|
4e77578abf | ||
|
|
72c213eaea | ||
|
|
c26abee957 | ||
|
|
fe30561a40 | ||
|
|
056b9f6c80 | ||
|
|
e86b356baf | ||
|
|
57edf5b4a8 | ||
|
|
453d02612c | ||
|
|
93b1fb9610 | ||
|
|
fb31f0813a | ||
|
|
c53c00e13c | ||
|
|
122ddae575 | ||
|
|
2e2f37ab86 | ||
|
|
cacc04a217 | ||
|
|
f740c11685 | ||
|
|
fa098f4a1b | ||
|
|
a043d64229 | ||
|
|
9d6e5bb7a3 | ||
|
|
aec1fd5ad1 | ||
|
|
02442a162a | ||
|
|
364be9976a | ||
|
|
e1ae0a36d7 | ||
|
|
71a8e267dc | ||
|
|
2934e099b1 | ||
|
|
dad9f4fce1 | ||
|
|
9c1c2f6356 | ||
|
|
bc5b73e080 | ||
|
|
a575200368 | ||
|
|
35a591fcf7 | ||
|
|
6b975dadac | ||
|
|
008b644bb1 | ||
|
|
b047ecc589 | ||
|
|
dfc3afd4a9 | ||
|
|
02cad3dbcd | ||
|
|
085605f85c | ||
|
|
c28431e80c | ||
|
|
4699f16b71 | ||
|
|
86f62b0c4d | ||
|
|
cc483e6ed5 | ||
|
|
e050bf5def | ||
|
|
635975207f | ||
|
|
d635ba0986 | ||
|
|
b08663fb28 | ||
|
|
3e2bdaebc6 | ||
|
|
d7bb559f95 | ||
|
|
a8ef23845c | ||
|
|
ec44849b31 | ||
|
|
1bfa4dec47 | ||
|
|
8ccb75ee4e | ||
|
|
d5644b6044 | ||
|
|
5e5a4fc505 | ||
|
|
ce76bf75c9 | ||
|
|
e2211e2de7 | ||
|
|
f1f2fefdab | ||
|
|
d11b0c65e0 | ||
|
|
96af8e564b | ||
|
|
42158d1fd4 | ||
|
|
f4c0bb0b76 | ||
|
|
5ab072992b | ||
|
|
cbede30d65 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -54,3 +54,5 @@ pids
|
|||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
|
tmp
|
||||||
|
|||||||
9
.run/all_start_dev.run.xml
Normal file
9
.run/all_start_dev.run.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="all:start:dev" type="CompoundRunConfigurationType">
|
||||||
|
<toRun name="dev:gui" type="ShConfigurationType" />
|
||||||
|
<toRun name="dev:lib" type="ShConfigurationType" />
|
||||||
|
<toRun name="dev:server" type="ShConfigurationType" />
|
||||||
|
<toRun name="docker-env-dev" type="ShConfigurationType" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
17
.run/dev_gui.run.xml
Normal file
17
.run/dev_gui.run.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="dev:gui" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value="cd admin && npm run start" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||||
|
<option name="SCRIPT_PATH" value="" />
|
||||||
|
<option name="SCRIPT_OPTIONS" value="" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||||
|
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||||
|
<option name="INTERPRETER_PATH" value="/usr/bin/zsh" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||||
|
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||||
|
<envs />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
17
.run/dev_lib.run.xml
Normal file
17
.run/dev_lib.run.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="dev:lib" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value="cd admin && ng build @rschneider/ng-daisyui --watch " />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||||
|
<option name="SCRIPT_PATH" value="" />
|
||||||
|
<option name="SCRIPT_OPTIONS" value="" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||||
|
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||||
|
<option name="INTERPRETER_PATH" value="/usr/bin/zsh" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||||
|
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||||
|
<envs />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
17
.run/dev_server.run.xml
Normal file
17
.run/dev_server.run.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="dev:server" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value="cd server && npm run start:dev" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||||
|
<option name="SCRIPT_PATH" value="" />
|
||||||
|
<option name="SCRIPT_OPTIONS" value="" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||||
|
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||||
|
<option name="INTERPRETER_PATH" value="/usr/bin/zsh" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||||
|
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||||
|
<envs />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
17
.run/docker-env-dev.run.xml
Normal file
17
.run/docker-env-dev.run.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="docker-env-dev" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value="cd environment/dev && docker compose up -d" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||||
|
<option name="SCRIPT_PATH" value="" />
|
||||||
|
<option name="SCRIPT_OPTIONS" value="" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||||
|
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||||
|
<option name="INTERPRETER_PATH" value="/usr/bin/zsh" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="EXECUTE_IN_TERMINAL" value="true" />
|
||||||
|
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||||
|
<envs />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
66
.vscode/launch.json
vendored
Normal file
66
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch Program",
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
"program": "${file}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "NPM Start Admin",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/admin",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"start"
|
||||||
|
],
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "NPM Start LIB",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/admin",
|
||||||
|
"runtimeExecutable": "ng",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"build",
|
||||||
|
"@rschneider/ng-daisyui",
|
||||||
|
"--watch"
|
||||||
|
],
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "NPM Start REST",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"cwd": "${workspaceFolder}/server",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"start:dev"
|
||||||
|
],
|
||||||
|
"preLaunchTask": "Docker Up (Environment)",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"compounds": [
|
||||||
|
{
|
||||||
|
"name": "Full Stack: Docker + App + GUI",
|
||||||
|
"configurations": [
|
||||||
|
"NPM Start LIB",
|
||||||
|
"NPM Start Admin",
|
||||||
|
"NPM Start REST"
|
||||||
|
],
|
||||||
|
"stopAll": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
19
.vscode/settings.json
vendored
Normal file
19
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"editor.fontFamily": "'FiraCode Nerd Font Mono',Menlo, Monaco, 'Courier New', monospace",
|
||||||
|
"terminal.integrated.fontFamily": "'FiraCode Nerd Font Mono'",
|
||||||
|
"markdown.preview.fontFamily": "'FiraCode Nerd Font Mono',-apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif",
|
||||||
|
"sqltools.connections": [
|
||||||
|
{
|
||||||
|
"ssh": "Disabled",
|
||||||
|
"previewLimit": 50,
|
||||||
|
"server": "localhost",
|
||||||
|
"port": 4301,
|
||||||
|
"driver": "PostgreSQL",
|
||||||
|
"name": "dvbooking-dev",
|
||||||
|
"group": "dvbooking",
|
||||||
|
"database": "dvbooking",
|
||||||
|
"username": "postgres",
|
||||||
|
"password": "test"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
18
.vscode/tasks.json
vendored
Normal file
18
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Docker Up (Environment)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "docker compose up -d",
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}/environment/dev"
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "new"
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
5
admin/.postcssrc.json
Normal file
5
admin/.postcssrc.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"plugins": {
|
||||||
|
"@tailwindcss/postcss": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -39,12 +39,24 @@
|
|||||||
"maximumError": "8kB"
|
"maximumError": "8kB"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"outputHashing": "all"
|
"outputHashing": "all",
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.production.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"optimization": false,
|
"optimization": false,
|
||||||
"extractLicenses": false,
|
"extractLicenses": false,
|
||||||
"sourceMap": true
|
"sourceMap": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.development.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "production"
|
"defaultConfiguration": "production"
|
||||||
@@ -80,6 +92,32 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"@rschneider/ng-daisyui": {
|
||||||
|
"projectType": "library",
|
||||||
|
"root": "projects/rschneider/ng-daisyui",
|
||||||
|
"sourceRoot": "projects/rschneider/ng-daisyui/src",
|
||||||
|
"prefix": "rs-daisy",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular/build:ng-packagr",
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"tsConfig": "projects/rschneider/ng-daisyui/tsconfig.lib.prod.json"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"tsConfig": "projects/rschneider/ng-daisyui/tsconfig.lib.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "production"
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular/build:karma",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": "projects/rschneider/ng-daisyui/tsconfig.spec.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
admin/generate.openapi.client.sh
Normal file
5
admin/generate.openapi.client.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
echo "workdir ${pwd}"
|
||||||
|
wget -O ./openapi/api.json localhost:3000/api-json
|
||||||
|
npx ng-openapi -i ./openapi/api.json -o ./src/api
|
||||||
1
admin/openapi/api.json
Normal file
1
admin/openapi/api.json
Normal file
File diff suppressed because one or more lines are too long
1555
admin/package-lock.json
generated
1555
admin/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
|||||||
"start": "ng serve --proxy-config proxy.conf.json",
|
"start": "ng serve --proxy-config proxy.conf.json",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
|
"generate.openapi.client": "bash ./generate.openapi.client.sh",
|
||||||
"test": "ng test"
|
"test": "ng test"
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
@@ -28,7 +29,19 @@
|
|||||||
"@angular/forms": "^20.3.0",
|
"@angular/forms": "^20.3.0",
|
||||||
"@angular/platform-browser": "^20.3.0",
|
"@angular/platform-browser": "^20.3.0",
|
||||||
"@angular/router": "^20.3.0",
|
"@angular/router": "^20.3.0",
|
||||||
|
"@fullcalendar/angular": "^6.1.19",
|
||||||
|
"@fullcalendar/core": "^6.1.19",
|
||||||
|
"@fullcalendar/daygrid": "^6.1.19",
|
||||||
|
"@fullcalendar/interaction": "^6.1.19",
|
||||||
|
"@fullcalendar/list": "^6.1.19",
|
||||||
|
"@fullcalendar/timegrid": "^6.1.19",
|
||||||
|
"@tailwindcss/postcss": "^4.1.17",
|
||||||
|
"daisyui": "^5.4.5",
|
||||||
|
"date-fns": "^4.1.0",
|
||||||
|
"jwt-decode": "^4.0.0",
|
||||||
|
"postcss": "^8.5.6",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
|
"tailwindcss": "^4.1.17",
|
||||||
"tslib": "^2.3.0"
|
"tslib": "^2.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -42,6 +55,8 @@
|
|||||||
"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",
|
||||||
|
"ng-openapi": "^0.2.10",
|
||||||
|
"ng-packagr": "^20.3.0",
|
||||||
"typescript": "~5.9.2"
|
"typescript": "~5.9.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
63
admin/projects/rschneider/ng-daisyui/README.md
Normal file
63
admin/projects/rschneider/ng-daisyui/README.md
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# NgDaisyui
|
||||||
|
|
||||||
|
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
|
||||||
|
|
||||||
|
## Code scaffolding
|
||||||
|
|
||||||
|
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng generate component component-name
|
||||||
|
```
|
||||||
|
|
||||||
|
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng generate --help
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
To build the library, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng build ng-daisyui
|
||||||
|
```
|
||||||
|
|
||||||
|
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
||||||
|
|
||||||
|
### Publishing the Library
|
||||||
|
|
||||||
|
Once the project is built, you can publish your library by following these steps:
|
||||||
|
|
||||||
|
1. Navigate to the `dist` directory:
|
||||||
|
```bash
|
||||||
|
cd dist/ng-daisyui
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Run the `npm publish` command to publish your library to the npm registry:
|
||||||
|
```bash
|
||||||
|
npm publish
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running end-to-end tests
|
||||||
|
|
||||||
|
For end-to-end (e2e) testing, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng e2e
|
||||||
|
```
|
||||||
|
|
||||||
|
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
||||||
|
|
||||||
|
## 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.
|
||||||
7
admin/projects/rschneider/ng-daisyui/ng-package.json
Normal file
7
admin/projects/rschneider/ng-daisyui/ng-package.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||||
|
"dest": "../../../dist/rschneider/ng-daisyui",
|
||||||
|
"lib": {
|
||||||
|
"entryFile": "src/public-api.ts"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
admin/projects/rschneider/ng-daisyui/package.json
Normal file
12
admin/projects/rschneider/ng-daisyui/package.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "@rschneider/ng-daisyui",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/common": "^20.3.0",
|
||||||
|
"@angular/core": "^20.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.3.0"
|
||||||
|
},
|
||||||
|
"sideEffects": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
@if (breadcrumbs()?.length) {
|
||||||
|
<div class="breadcrumbs text-sm">
|
||||||
|
<ul>
|
||||||
|
@for (breadcrumb of breadcrumbs(); track breadcrumb; ) {
|
||||||
|
|
||||||
|
<li>
|
||||||
|
@if (breadcrumb.url) {
|
||||||
|
<a [routerLink]="breadcrumb.url">
|
||||||
|
@if (breadcrumb.showIcon !== false) {
|
||||||
|
<span [outerHTML]="(breadcrumb.svgIcon || defaultLinkIcon) | safeHtml"></span>
|
||||||
|
}
|
||||||
|
{{ breadcrumb.text }}
|
||||||
|
</a>
|
||||||
|
} @else {
|
||||||
|
<span class="inline-flex items-center gap-2">
|
||||||
|
@if (breadcrumb.showIcon !== false) {
|
||||||
|
<span [outerHTML]="(breadcrumb.svgIcon || defaultIcon) | safeHtml"></span>
|
||||||
|
}
|
||||||
|
{{ breadcrumb.text }}
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { Breadcrumbs } from './breadcrumbs';
|
||||||
|
|
||||||
|
describe('Breadcrumbs', () => {
|
||||||
|
let component: Breadcrumbs;
|
||||||
|
let fixture: ComponentFixture<Breadcrumbs>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [Breadcrumbs]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(Breadcrumbs);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import { Component, input } from '@angular/core';
|
||||||
|
import { Breadcrumb } from '../../daisy.types';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
import { SafeHtmlPipe } from '../../pipes/safe-html-pipe';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'rs-daisy-breadcrumbs',
|
||||||
|
imports: [
|
||||||
|
RouterLink,
|
||||||
|
SafeHtmlPipe,
|
||||||
|
],
|
||||||
|
templateUrl: './breadcrumbs.html',
|
||||||
|
styleUrl: './breadcrumbs.css',
|
||||||
|
})
|
||||||
|
export class Breadcrumbs {
|
||||||
|
|
||||||
|
breadcrumbs = input<Breadcrumb[]>([]);
|
||||||
|
|
||||||
|
defaultLinkIcon: string = `<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
class="h-4 w-4 stroke-current">
|
||||||
|
<path
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
|
||||||
|
defaultIcon: string = `
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
class="h-4 w-4 stroke-current">
|
||||||
|
<path
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
d="M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<button
|
||||||
|
[aria-disabled]="disabled()"
|
||||||
|
role="button"
|
||||||
|
[ngClass]="{
|
||||||
|
'btn': true,
|
||||||
|
'btn-primary': variant() === 'primary',
|
||||||
|
'btn-secondary': variant() === 'secondary',
|
||||||
|
'btn-accent': variant() === 'accent',
|
||||||
|
'btn-info': variant() === 'info',
|
||||||
|
'btn-success': variant() === 'success',
|
||||||
|
'btn-warning': variant() === 'warning',
|
||||||
|
'btn-error': variant() === 'error',
|
||||||
|
'btn-ghost': variant() === 'ghost',
|
||||||
|
'btn-link': variant() === 'link',
|
||||||
|
|
||||||
|
'btn-lg': size() === 'lg',
|
||||||
|
'btn-md': size() === 'md',
|
||||||
|
'btn-sm': size() === 'sm',
|
||||||
|
'btn-xs': size() === 'xs',
|
||||||
|
|
||||||
|
'btn-outline': outline(),
|
||||||
|
'btn-active': active(),
|
||||||
|
'btn-glass': glass(),
|
||||||
|
'btn-square': square(),
|
||||||
|
'btn-circle': circle(),
|
||||||
|
'btn-wide': wide(),
|
||||||
|
'btn-block': block(),
|
||||||
|
'no-animation': noAnimation(),
|
||||||
|
'loading': loading(),
|
||||||
|
'btn-responsive': responsive(),
|
||||||
|
|
||||||
|
'btn-disabled': disabled()
|
||||||
|
}"
|
||||||
|
[class]="customClass() || ''"
|
||||||
|
(click)="onClick($event)"
|
||||||
|
>
|
||||||
|
<ng-content />
|
||||||
|
</button>
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { MainMenu } from './main-menu';
|
import { Button } from './button';
|
||||||
|
|
||||||
describe('MainMenu', () => {
|
describe('Button', () => {
|
||||||
let component: MainMenu;
|
let component: Button;
|
||||||
let fixture: ComponentFixture<MainMenu>;
|
let fixture: ComponentFixture<Button>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [MainMenu]
|
imports: [Button]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(MainMenu);
|
fixture = TestBed.createComponent(Button);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
// rs-daisy-button.component.ts
|
||||||
|
import { Component, input, HostBinding, output } from '@angular/core';
|
||||||
|
import { NgClass } from '@angular/common';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'rs-daisy-button',
|
||||||
|
standalone: true,
|
||||||
|
templateUrl: 'button.html',
|
||||||
|
imports: [NgClass]
|
||||||
|
})
|
||||||
|
export class Button {
|
||||||
|
// Daisy UI Button Props as Angular Inputs
|
||||||
|
// Sizes: lg, md, sm, xs
|
||||||
|
size = input<'lg' | 'md' | 'sm' | 'xs' | null>(null);
|
||||||
|
// States: primary, secondary, accent, info, success, warning, error, ghost, link
|
||||||
|
variant = input<'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'ghost' | 'link' | null>(null);
|
||||||
|
// Outlined
|
||||||
|
outline = input<boolean>(false);
|
||||||
|
// Active
|
||||||
|
active = input<boolean>(false);
|
||||||
|
// Disabled
|
||||||
|
disabled = input<boolean>(false);
|
||||||
|
// Glass
|
||||||
|
glass = input<boolean>(false);
|
||||||
|
// Square
|
||||||
|
square = input<boolean>(false);
|
||||||
|
// Circle
|
||||||
|
circle = input<boolean>(false);
|
||||||
|
// Wide
|
||||||
|
wide = input<boolean>(false);
|
||||||
|
// Block
|
||||||
|
block = input<boolean>(false);
|
||||||
|
// No animation
|
||||||
|
noAnimation = input<boolean>(false);
|
||||||
|
// Loading
|
||||||
|
loading = input<boolean>(false);
|
||||||
|
// Responsive
|
||||||
|
responsive = input<boolean>(false);
|
||||||
|
|
||||||
|
// You can also add a custom class input if needed
|
||||||
|
customClass = input<string | null>(null);
|
||||||
|
|
||||||
|
@HostBinding('attr.disabled') get isDisabled() {
|
||||||
|
return this.disabled() ? true : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// New Output for the click event
|
||||||
|
// By default, it emits 'void' (no specific data), but you could specify a type if needed.
|
||||||
|
readonly clickEvent = output<MouseEvent>();
|
||||||
|
|
||||||
|
// Event handler method
|
||||||
|
onClick(event: MouseEvent): void {
|
||||||
|
// Prevent default browser behavior for buttons if needed (e.g., form submission)
|
||||||
|
// event.preventDefault();
|
||||||
|
|
||||||
|
// Emit the click event
|
||||||
|
this.clickEvent.emit(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<div class="card bg-base-100 w-96 shadow-sm" [class]="cardClass()">
|
||||||
|
@if (imageSrc()) {
|
||||||
|
<figure class="px-10 pt-10">
|
||||||
|
<img
|
||||||
|
[src]="imageSrc()"
|
||||||
|
[alt]="imageAlt()"
|
||||||
|
class="rounded-xl"
|
||||||
|
[class]="imageClass()"
|
||||||
|
/>
|
||||||
|
</figure>
|
||||||
|
}
|
||||||
|
<div class="card-body items-center text-center">
|
||||||
|
@if (cardTitle()) {
|
||||||
|
<h2 class="card-title">{{ cardTitle() }}</h2>
|
||||||
|
}
|
||||||
|
@if (cardText()) {
|
||||||
|
<p>A card component has a figure, a body part, and inside body there are title and actions parts</p>
|
||||||
|
}
|
||||||
|
<ng-content></ng-content>
|
||||||
|
@if (cardActionText()) {
|
||||||
|
<div class="card-actions">
|
||||||
|
<button class="btn btn-primary">{{ cardActionText() }}</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import { Component, input, output, signal } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'rs-daisy-card-with-centered-content-and-paddings',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './card-with-centered-content-and-paddings.html',
|
||||||
|
styleUrl: './card-with-centered-content-and-paddings.css',
|
||||||
|
})
|
||||||
|
export class CardWithCenteredContentAndPaddings {
|
||||||
|
imageSrc = input<string | null>(null);
|
||||||
|
imageAlt = input<string | null>(null);
|
||||||
|
imageClass = input<string | null>(null);
|
||||||
|
cardTitle = input<string | null>(null);
|
||||||
|
cardText = input<string | null>(null);
|
||||||
|
cardActionText = input<string | null>(null);
|
||||||
|
cardActionClick = output<void>();
|
||||||
|
cardClass = signal<string | null>(null);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<footer class="footer sm:footer-horizontal bg-neutral text-neutral-content p-10">
|
||||||
|
@if (config()) {
|
||||||
|
@for ( footerNav of config()?.navs; let i = $index; track i){
|
||||||
|
<nav>
|
||||||
|
<h6 class="footer-title">{{ footerNav.label }}</h6>
|
||||||
|
@for ( link of footerNav.links; let j = $index; track j){
|
||||||
|
<a class="link link-hover" [routerLink]="link.href" >{{link.text}}</a>
|
||||||
|
}
|
||||||
|
</nav>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<nav>
|
||||||
|
<h6 class="footer-title">Services</h6>
|
||||||
|
<a class="link link-hover">Branding</a>
|
||||||
|
<a class="link link-hover">Design</a>
|
||||||
|
<a class="link link-hover">Marketing</a>
|
||||||
|
<a class="link link-hover">Advertisement</a>
|
||||||
|
</nav>
|
||||||
|
<nav>
|
||||||
|
<h6 class="footer-title">Company</h6>
|
||||||
|
<a class="link link-hover">About us</a>
|
||||||
|
<a class="link link-hover">Contact</a>
|
||||||
|
<a class="link link-hover">Jobs</a>
|
||||||
|
<a class="link link-hover">Press kit</a>
|
||||||
|
</nav>
|
||||||
|
<nav>
|
||||||
|
<h6 class="footer-title">Legal</h6>
|
||||||
|
<a class="link link-hover">Terms of use</a>
|
||||||
|
<a class="link link-hover">Privacy policy</a>
|
||||||
|
<a class="link link-hover">Cookie policy</a>
|
||||||
|
</nav>
|
||||||
|
</footer>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { Footer } from './footer';
|
||||||
|
|
||||||
|
describe('Footer', () => {
|
||||||
|
let component: Footer;
|
||||||
|
let fixture: ComponentFixture<Footer>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [Footer]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(Footer);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { Component, input } from '@angular/core';
|
||||||
|
import { FooterConfig } from '../../daisy.types';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'rs-daisy-footer',
|
||||||
|
imports: [
|
||||||
|
RouterLink,
|
||||||
|
],
|
||||||
|
templateUrl: './footer.html',
|
||||||
|
styleUrl: './footer.css',
|
||||||
|
})
|
||||||
|
export class Footer {
|
||||||
|
|
||||||
|
config = input<FooterConfig>()
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{{ isOpen() }}
|
||||||
|
<dialog #modal class="modal" [class]="dialogStyleClass()">
|
||||||
|
<div class="modal-box" [class]="modalBoxStyleClass()">
|
||||||
|
<button (click)="closeClicked()" class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button>
|
||||||
|
@if (headerText()) {
|
||||||
|
<h3 class="text-lg font-bold">{{ headerText() }}</h3>
|
||||||
|
}
|
||||||
|
<ng-content></ng-content>
|
||||||
|
</div>
|
||||||
|
@if (backdrop()) {
|
||||||
|
<form (click)="closeClicked()" class="modal-backdrop">
|
||||||
|
<button>close</button>
|
||||||
|
</form>
|
||||||
|
}
|
||||||
|
</dialog>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { Modal } from './modal';
|
||||||
|
|
||||||
|
describe('Modal', () => {
|
||||||
|
let component: Modal;
|
||||||
|
let fixture: ComponentFixture<Modal>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [Modal]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(Modal);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
import {
|
||||||
|
AfterViewInit,
|
||||||
|
Component,
|
||||||
|
effect,
|
||||||
|
ElementRef,
|
||||||
|
input,
|
||||||
|
model, OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
output,
|
||||||
|
signal,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'rs-daisy-modal',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './modal.html',
|
||||||
|
styleUrl: './modal.css',
|
||||||
|
})
|
||||||
|
export class Modal implements OnInit , AfterViewInit, OnDestroy{
|
||||||
|
dialogStyleClass = input<string>();
|
||||||
|
backdrop = input<boolean>(false);
|
||||||
|
modalBoxStyleClass = input<string>();
|
||||||
|
closeButton = input<boolean>(true);
|
||||||
|
headerText = input<string>();
|
||||||
|
isOpen = model<boolean>(false);
|
||||||
|
|
||||||
|
onClose = output<boolean>();
|
||||||
|
closeClick = output<boolean>();
|
||||||
|
|
||||||
|
@ViewChild('modal') modalRef!: ElementRef<HTMLDialogElement>;
|
||||||
|
|
||||||
|
private initialized = signal<boolean>(false);
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
effect(() => {
|
||||||
|
if ( this.isOpen()){
|
||||||
|
this.doOpen();
|
||||||
|
}else{
|
||||||
|
this.doClose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
/* if (open()){
|
||||||
|
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
// console.info("dialog",this.dialog)
|
||||||
|
const modal = this.modalRef.nativeElement;
|
||||||
|
modal.addEventListener('close', () => this.onClose.emit(true) );
|
||||||
|
this.initialized.set(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
emitClose(){
|
||||||
|
console.info("emit close", this.onClose);
|
||||||
|
this.onClose?.emit(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
doOpen() {
|
||||||
|
if ( !this.initialized()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const modal = this.modalRef.nativeElement;
|
||||||
|
if ( !modal.open ){
|
||||||
|
modal.showModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
doClose() {
|
||||||
|
if ( !this.initialized()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const modal = this.modalRef.nativeElement;
|
||||||
|
if ( modal.open ){
|
||||||
|
modal.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ngOnDestroy() {
|
||||||
|
console.info("destroy");
|
||||||
|
// const modal = this.modalRef?.nativeElement;
|
||||||
|
// if ( modal ){
|
||||||
|
// modal.removeEventListener('close', this.emitClose);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
closeClicked() {
|
||||||
|
console.info("close clicked");
|
||||||
|
this.closeClick.emit(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<div class="join">
|
||||||
|
@if (pageCount() > 1) {
|
||||||
|
<button class="join-item btn" (click)="paginate(1)"><</button>
|
||||||
|
}
|
||||||
|
@for (page of pages(); track page){
|
||||||
|
<button class="join-item btn"
|
||||||
|
[class.btn-active]="activePage() === page"
|
||||||
|
(click)="paginate(page)"
|
||||||
|
>{{page}}</button>
|
||||||
|
}
|
||||||
|
@if (pageCount() > 1) {
|
||||||
|
<button class="join-item btn" (click)="paginate(pageCount())">></button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { Pagination } from './pagination';
|
||||||
|
|
||||||
|
describe('Pagination', () => {
|
||||||
|
let component: Pagination;
|
||||||
|
let fixture: ComponentFixture<Pagination>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [Pagination]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(Pagination);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { Component, computed, input, output } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'rs-daisy-pagination',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './pagination.html',
|
||||||
|
styleUrl: './pagination.css',
|
||||||
|
})
|
||||||
|
export class Pagination {
|
||||||
|
pageCount = input<number>(0);
|
||||||
|
activePage = input<number>(0);
|
||||||
|
pages = computed( () => {
|
||||||
|
console.info("pag.pagecount", this.pageCount())
|
||||||
|
return [...Array(this.pageCount() ?? 1)].map((_,i) => i+1)
|
||||||
|
})
|
||||||
|
|
||||||
|
onPaginate = output<number>();
|
||||||
|
|
||||||
|
|
||||||
|
paginate(page: number){
|
||||||
|
this.onPaginate.emit(page);
|
||||||
|
}
|
||||||
|
}
|
||||||
20
admin/projects/rschneider/ng-daisyui/src/lib/daisy.types.ts
Normal file
20
admin/projects/rschneider/ng-daisyui/src/lib/daisy.types.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
export interface Link{
|
||||||
|
href: string;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FooterNav{
|
||||||
|
label: string;
|
||||||
|
links: Link[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FooterConfig{
|
||||||
|
navs: FooterNav[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Breadcrumb{
|
||||||
|
text: string;
|
||||||
|
url?: string;
|
||||||
|
showIcon?: boolean;
|
||||||
|
svgIcon?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<div class="drawer lg:drawer-open">
|
||||||
|
<input id="my-drawer-2" type="checkbox" class="drawer-toggle" />
|
||||||
|
|
||||||
|
<!-- Page Content -->
|
||||||
|
<div class="drawer-content flex flex-col h-screen">
|
||||||
|
|
||||||
|
<div class="navbar bg-base-200 p-4 shadow-md z-10">
|
||||||
|
<div class="flex-1">
|
||||||
|
<label for="my-drawer-2" class="btn btn-square btn-ghost drawer-button lg:hidden">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||||
|
class="inline-block w-6 h-6 stroke-current">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
|
||||||
|
</svg>
|
||||||
|
</label>
|
||||||
|
<a class="btn btn-ghost text-xl">{{headerText()}}</a>
|
||||||
|
</div>
|
||||||
|
@if (loggedIn()) {
|
||||||
|
<div class="flex-none">
|
||||||
|
<div class="dropdown dropdown-end">
|
||||||
|
<div tabindex="0" role="button" class="btn btn-ghost btn-circle avatar">
|
||||||
|
<div class="w-10 rounded-full">
|
||||||
|
<img
|
||||||
|
alt="Tailwind CSS Navbar component"
|
||||||
|
src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul
|
||||||
|
tabindex="-1"
|
||||||
|
class="menu menu-sm dropdown-content bg-base-100 rounded-box z-1 mt-3 w-52 p-2 shadow">
|
||||||
|
<li>
|
||||||
|
<a class="justify-between">
|
||||||
|
Profile
|
||||||
|
<span class="badge">New</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li><a>Settings</a></li>
|
||||||
|
<li><a (click)="onClick($event,'logout')">Logout</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Main Content -->
|
||||||
|
<main class="flex-1 p-6 bg-base-100 overflow-y-auto">
|
||||||
|
<ng-content select="[main-content]"></ng-content>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<!-- Footer -->
|
||||||
|
<footer class="bg-base-200 p-4 text-center">
|
||||||
|
<p>Copyright © 2025 - All right reserved</p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Sidebar -->
|
||||||
|
<div class="drawer-side">
|
||||||
|
<label for="my-drawer-2" aria-label="close sidebar" class="drawer-overlay"></label>
|
||||||
|
<ng-content select="[menu-content]"></ng-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AdminLayoutRs1 } from './admin-layout-rs1';
|
||||||
|
|
||||||
|
describe('AdminLayoutRs1', () => {
|
||||||
|
let component: AdminLayoutRs1;
|
||||||
|
let fixture: ComponentFixture<AdminLayoutRs1>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [AdminLayoutRs1]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(AdminLayoutRs1);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { Component, input, output } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'rs-daisy-admin-layout-rs1',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './admin-layout-rs1.html',
|
||||||
|
styleUrl: './admin-layout-rs1.css',
|
||||||
|
})
|
||||||
|
export class AdminLayoutRs1 {
|
||||||
|
|
||||||
|
headerText = input<string>();
|
||||||
|
|
||||||
|
readonly loggedIn = input<boolean>(false)
|
||||||
|
|
||||||
|
// New Output for the click event
|
||||||
|
// By default, it emits 'void' (no specific data), but you could specify a type if needed.
|
||||||
|
readonly clickEvent = output<MouseEvent>();
|
||||||
|
|
||||||
|
// Event handler method
|
||||||
|
onClick(event: MouseEvent, command: string): void {
|
||||||
|
// Prevent default browser behavior for buttons if needed (e.g., form submission)
|
||||||
|
// event.preventDefault();
|
||||||
|
|
||||||
|
// Emit the click event
|
||||||
|
this.clickEvent.emit(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export * from './admin-layout-rs1/admin-layout-rs1';
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { NgDaisyui } from './ng-daisyui';
|
||||||
|
|
||||||
|
describe('NgDaisyui', () => {
|
||||||
|
let component: NgDaisyui;
|
||||||
|
let fixture: ComponentFixture<NgDaisyui>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [NgDaisyui]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(NgDaisyui);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
15
admin/projects/rschneider/ng-daisyui/src/lib/ng-daisyui.ts
Normal file
15
admin/projects/rschneider/ng-daisyui/src/lib/ng-daisyui.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'rs-daisy-ng-daisyui',
|
||||||
|
imports: [],
|
||||||
|
template: `
|
||||||
|
<p>
|
||||||
|
ng-daisyui works!
|
||||||
|
</p>
|
||||||
|
`,
|
||||||
|
styles: ``,
|
||||||
|
})
|
||||||
|
export class NgDaisyui {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { inject, Pipe, PipeTransform } from '@angular/core';
|
||||||
|
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
@Pipe({
|
||||||
|
name: 'safeHtml'
|
||||||
|
})
|
||||||
|
export class SafeHtmlPipe implements PipeTransform {
|
||||||
|
|
||||||
|
private sanitized = inject(DomSanitizer);
|
||||||
|
|
||||||
|
transform(value: string | undefined): SafeHtml {
|
||||||
|
if (!value) return '';
|
||||||
|
return this.sanitized.bypassSecurityTrustHtml(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
13
admin/projects/rschneider/ng-daisyui/src/public-api.ts
Normal file
13
admin/projects/rschneider/ng-daisyui/src/public-api.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Public API Surface of ng-daisyui
|
||||||
|
*/
|
||||||
|
|
||||||
|
export * from './lib/ng-daisyui';
|
||||||
|
export * from './lib/components/button/button';
|
||||||
|
export * from './lib/components/footer/footer';
|
||||||
|
export * from './lib/components/breadcrumbs/breadcrumbs';
|
||||||
|
export * from './lib/components/modal/modal';
|
||||||
|
export * from './lib/components/pagination/pagination';
|
||||||
|
export * from './lib/components/card/card-with-centered-content-and-paddings/card-with-centered-content-and-paddings';
|
||||||
|
export * from './lib/daisy.types';
|
||||||
|
export * from './lib/layout/';
|
||||||
18
admin/projects/rschneider/ng-daisyui/tsconfig.lib.json
Normal file
18
admin/projects/rschneider/ng-daisyui/tsconfig.lib.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/* 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. */
|
||||||
|
{
|
||||||
|
"extends": "../../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../../out-tsc/lib",
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"inlineSources": true,
|
||||||
|
"types": []
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/*.spec.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
11
admin/projects/rschneider/ng-daisyui/tsconfig.lib.prod.json
Normal file
11
admin/projects/rschneider/ng-daisyui/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/* 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. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.lib.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"declarationMap": false
|
||||||
|
},
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"compilationMode": "partial"
|
||||||
|
}
|
||||||
|
}
|
||||||
14
admin/projects/rschneider/ng-daisyui/tsconfig.spec.json
Normal file
14
admin/projects/rschneider/ng-daisyui/tsconfig.spec.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/* 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. */
|
||||||
|
{
|
||||||
|
"extends": "../../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../../out-tsc/spec",
|
||||||
|
"types": [
|
||||||
|
"jasmine"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
admin/public/sample-profile-photo.webp
Normal file
BIN
admin/public/sample-profile-photo.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
16
admin/src/api/index.ts
Normal file
16
admin/src/api/index.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Entrypoint for the client
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
export * from "./models";
|
||||||
|
export * from "./tokens";
|
||||||
|
export * from "./providers";
|
||||||
|
export * from "./services";
|
||||||
|
export * from "./utils/file-download";
|
||||||
|
export * from "./utils/http-params-builder";
|
||||||
|
export * from "./utils/date-transformer";
|
||||||
127
admin/src/api/models/index.ts
Normal file
127
admin/src/api/models/index.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated TypeScript interfaces from Swagger specification
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpContext, HttpHeaders } from "@angular/common/http";
|
||||||
|
export interface CreateUserDto {
|
||||||
|
username: string;
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateUserDto {
|
||||||
|
username: string;
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LoginRequestDto {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateEventTypeDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateEventTypeDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateProductDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateProductDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateEventDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateEventDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateUserGroupDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateUserGroupDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateUserRoleDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateUserRoleDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateRecurrenceRuleDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateRecurrenceRuleDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateEventExceptionDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateEventExceptionDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateExceptionDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CalendarCreateBookingDto {
|
||||||
|
occurrenceStartTime: Date;
|
||||||
|
userId: number;
|
||||||
|
reservedSeatsCount: number;
|
||||||
|
notes: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CancelBookingDto {
|
||||||
|
canceledReason: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserResponseDto {
|
||||||
|
id: number;
|
||||||
|
username: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BookingResponseDto {
|
||||||
|
id: number;
|
||||||
|
eventId: number;
|
||||||
|
occurrenceStartTime: Date;
|
||||||
|
notes?: string;
|
||||||
|
reservedSeatsCount: number;
|
||||||
|
canceledAt: string | null;
|
||||||
|
createdAt: string | null;
|
||||||
|
user: UserResponseDto;
|
||||||
|
status?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PaginationResponseMetaDto {
|
||||||
|
totalItems: number;
|
||||||
|
itemCount: number;
|
||||||
|
itemsPerPage: number;
|
||||||
|
totalPages: number;
|
||||||
|
currentPage: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CalenderControllerGetBookingResponse {
|
||||||
|
data: Array<BookingResponseDto>;
|
||||||
|
meta: PaginationResponseMetaDto;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateBookingDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateBookingDto {
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Request Options for Angular HttpClient requests */
|
||||||
|
export interface RequestOptions<TResponseType extends 'arraybuffer' | 'blob' | 'json' | 'text'> {
|
||||||
|
headers?: HttpHeaders;
|
||||||
|
reportProgress?: boolean;
|
||||||
|
responseType?: TResponseType;
|
||||||
|
withCredentials?: boolean;
|
||||||
|
context?: HttpContext;
|
||||||
|
}
|
||||||
93
admin/src/api/providers.ts
Normal file
93
admin/src/api/providers.ts
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated provider functions for easy setup
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { EnvironmentProviders, Provider, makeEnvironmentProviders } from "@angular/core";
|
||||||
|
import { HTTP_INTERCEPTORS, HttpInterceptor } from "@angular/common/http";
|
||||||
|
import { BASE_PATH_DEFAULT, HTTP_INTERCEPTORS_DEFAULT } from "./tokens";
|
||||||
|
import { DefaultBaseInterceptor } from "./utils/base-interceptor";
|
||||||
|
import { DateInterceptor } from "./utils/date-transformer";
|
||||||
|
|
||||||
|
/** Configuration options for default client */
|
||||||
|
export interface DefaultConfig {
|
||||||
|
/** Base API URL */
|
||||||
|
basePath: string;
|
||||||
|
/** Enable automatic date transformation (default: true) */
|
||||||
|
enableDateTransform?: boolean;
|
||||||
|
/** Array of HTTP interceptor classes to apply to this client */
|
||||||
|
interceptors?: (new (...args: HttpInterceptor[]) => HttpInterceptor)[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Provides configuration for default client */
|
||||||
|
/** */
|
||||||
|
/** @example */
|
||||||
|
/** ```typescript */
|
||||||
|
/** // In your app.config.ts */
|
||||||
|
/** import { provideDefaultClient } from './api/providers'; */
|
||||||
|
/** */
|
||||||
|
/** export const appConfig: ApplicationConfig = { */
|
||||||
|
/** providers: [ */
|
||||||
|
/** provideDefaultClient({ */
|
||||||
|
/** basePath: 'https://api.example.com', */
|
||||||
|
/** interceptors: [AuthInterceptor, LoggingInterceptor] // Classes, not instances */
|
||||||
|
/** }), */
|
||||||
|
/** // other providers... */
|
||||||
|
/** ] */
|
||||||
|
/** }; */
|
||||||
|
/** ``` */
|
||||||
|
export function provideDefaultClient(config: DefaultConfig): EnvironmentProviders {
|
||||||
|
|
||||||
|
const providers: Provider[] = [
|
||||||
|
// Base path token for this client
|
||||||
|
{
|
||||||
|
provide: BASE_PATH_DEFAULT,
|
||||||
|
useValue: config.basePath
|
||||||
|
},
|
||||||
|
// Base interceptor that handles client-specific interceptors
|
||||||
|
{
|
||||||
|
provide: HTTP_INTERCEPTORS,
|
||||||
|
useClass: DefaultBaseInterceptor,
|
||||||
|
multi: true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// Add client-specific interceptor instances
|
||||||
|
if (config.interceptors && config.interceptors.length > 0) {
|
||||||
|
const interceptorInstances = config.interceptors.map(InterceptorClass => new InterceptorClass());
|
||||||
|
|
||||||
|
// Add date interceptor if enabled (default: true)
|
||||||
|
if (config.enableDateTransform !== false) {
|
||||||
|
interceptorInstances.unshift(new DateInterceptor());
|
||||||
|
}
|
||||||
|
|
||||||
|
providers.push({
|
||||||
|
provide: HTTP_INTERCEPTORS_DEFAULT,
|
||||||
|
useValue: interceptorInstances
|
||||||
|
});
|
||||||
|
} else if (config.enableDateTransform !== false) {
|
||||||
|
// Only date interceptor enabled
|
||||||
|
providers.push({
|
||||||
|
provide: HTTP_INTERCEPTORS_DEFAULT,
|
||||||
|
useValue: [new DateInterceptor()]
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// No interceptors
|
||||||
|
providers.push({
|
||||||
|
provide: HTTP_INTERCEPTORS_DEFAULT,
|
||||||
|
useValue: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return makeEnvironmentProviders(providers);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @deprecated Use provideDefaultClient instead for better clarity */
|
||||||
|
/** Provides configuration for the default client */
|
||||||
|
export function provideNgOpenapi(config: DefaultConfig): EnvironmentProviders {
|
||||||
|
return provideDefaultClient(config);
|
||||||
|
}
|
||||||
43
admin/src/api/services/app.service.ts
Normal file
43
admin/src/api/services/app.service.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for App controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class AppService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
appControllerGetHello(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
appControllerGetHello(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
appControllerGetHello(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
appControllerGetHello(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
75
admin/src/api/services/auth.service.ts
Normal file
75
admin/src/api/services/auth.service.ts
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for Auth controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { LoginRequestDto, RequestOptions } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class AuthService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
authControllerLogin(loginRequestDto: LoginRequestDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
authControllerLogin(loginRequestDto: LoginRequestDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
authControllerLogin(loginRequestDto: LoginRequestDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
authControllerLogin(loginRequestDto: LoginRequestDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/auth/login`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, loginRequestDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
authControllerLogout(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
authControllerLogout(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
authControllerLogout(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
authControllerLogout(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/auth/logout`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, null, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
authControllerRefresh(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
authControllerRefresh(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
authControllerRefresh(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
authControllerRefresh(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/auth/refresh`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, null, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
135
admin/src/api/services/bookings.service.ts
Normal file
135
admin/src/api/services/bookings.service.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for Bookings controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateBookingDto, UpdateBookingDto } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class BookingsService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
bookingsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
bookingsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
bookingsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
bookingsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/bookings`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
bookingsControllerCreate(createBookingDto: CreateBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/bookings`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createBookingDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
bookingsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/bookings/search`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (q != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||||
|
}
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
bookingsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
bookingsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
bookingsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
bookingsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/bookings/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
bookingsControllerUpdate(id: number, updateBookingDto: UpdateBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/bookings/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, updateBookingDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
bookingsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
bookingsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
bookingsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
bookingsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/bookings/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
189
admin/src/api/services/calendar.service.ts
Normal file
189
admin/src/api/services/calendar.service.ts
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for Calendar controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateEventDto, CreateExceptionDto, CalendarCreateBookingDto, CancelBookingDto, CalenderControllerGetBookingResponse } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class CalendarService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarControllerGetCalendarEvents(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
calendarControllerGetCalendarEvents(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
calendarControllerGetCalendarEvents(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
calendarControllerGetCalendarEvents(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/calendar`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
calendarControllerCreateEvent(createEventDto: CreateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/calendar/events`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createEventDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarControllerGetEventById(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
calendarControllerGetEventById(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
calendarControllerGetEventById(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
calendarControllerGetEventById(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/calendar/events/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
calendarControllerUpdateEvent(id: number, createEventDto: CreateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/calendar/events/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, createEventDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarControllerDeleteEvent(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
calendarControllerDeleteEvent(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
calendarControllerDeleteEvent(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
calendarControllerDeleteEvent(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/calendar/events/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
calendarControllerCreateException(id: number, createExceptionDto: CreateExceptionDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/calendar/events/${id}/exceptions`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createExceptionDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
calendarControllerCreateBooking(id: number, calendarCreateBookingDto: CalendarCreateBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/calendar/events/${id}/bookings`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, calendarCreateBookingDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<CalenderControllerGetBookingResponse>;
|
||||||
|
calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<CalenderControllerGetBookingResponse>>;
|
||||||
|
calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<CalenderControllerGetBookingResponse>>;
|
||||||
|
calendarControllerCancelBooking(bookingId: number, cancelBookingDto: CancelBookingDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/calendar/bookings/${bookingId}/cancel`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, cancelBookingDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'body', options?: RequestOptions<'json'>): Observable<CalenderControllerGetBookingResponse>;
|
||||||
|
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<CalenderControllerGetBookingResponse>>;
|
||||||
|
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<CalenderControllerGetBookingResponse>>;
|
||||||
|
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/calendar/bookings/${eventId}`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
if (sortBy != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, sortBy, 'sortBy');
|
||||||
|
}
|
||||||
|
if (order != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, order, 'order');
|
||||||
|
}
|
||||||
|
if (startTime != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, startTime, 'startTime');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
135
admin/src/api/services/eventExceptions.service.ts
Normal file
135
admin/src/api/services/eventExceptions.service.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for EventExceptions controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateEventExceptionDto, UpdateEventExceptionDto } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class EventExceptionsService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
eventExceptionsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventExceptionsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventExceptionsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventExceptionsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-exceptions`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventExceptionsControllerCreate(createEventExceptionDto: CreateEventExceptionDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventExceptionsControllerCreate(createEventExceptionDto: CreateEventExceptionDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventExceptionsControllerCreate(createEventExceptionDto: CreateEventExceptionDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventExceptionsControllerCreate(createEventExceptionDto: CreateEventExceptionDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-exceptions`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createEventExceptionDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventExceptionsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventExceptionsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventExceptionsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventExceptionsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-exceptions/search`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (q != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||||
|
}
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventExceptionsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventExceptionsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventExceptionsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventExceptionsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-exceptions/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventExceptionsControllerUpdate(id: number, updateEventExceptionDto: UpdateEventExceptionDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventExceptionsControllerUpdate(id: number, updateEventExceptionDto: UpdateEventExceptionDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventExceptionsControllerUpdate(id: number, updateEventExceptionDto: UpdateEventExceptionDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventExceptionsControllerUpdate(id: number, updateEventExceptionDto: UpdateEventExceptionDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-exceptions/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, updateEventExceptionDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventExceptionsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventExceptionsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventExceptionsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventExceptionsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-exceptions/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
135
admin/src/api/services/eventTypes.service.ts
Normal file
135
admin/src/api/services/eventTypes.service.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for EventTypes controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateEventTypeDto, UpdateEventTypeDto } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class EventTypesService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
eventTypesControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventTypesControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventTypesControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventTypesControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-type`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventTypesControllerCreate(createEventTypeDto: CreateEventTypeDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventTypesControllerCreate(createEventTypeDto: CreateEventTypeDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventTypesControllerCreate(createEventTypeDto: CreateEventTypeDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventTypesControllerCreate(createEventTypeDto: CreateEventTypeDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-type`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createEventTypeDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventTypesControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventTypesControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventTypesControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventTypesControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-type/search`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (q != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||||
|
}
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventTypesControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventTypesControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventTypesControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventTypesControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-type/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventTypesControllerUpdate(id: number, updateEventTypeDto: UpdateEventTypeDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventTypesControllerUpdate(id: number, updateEventTypeDto: UpdateEventTypeDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventTypesControllerUpdate(id: number, updateEventTypeDto: UpdateEventTypeDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventTypesControllerUpdate(id: number, updateEventTypeDto: UpdateEventTypeDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-type/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, updateEventTypeDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventTypesControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventTypesControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventTypesControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventTypesControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/event-type/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
135
admin/src/api/services/events.service.ts
Normal file
135
admin/src/api/services/events.service.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for Events controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateEventDto, UpdateEventDto } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class EventsService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
eventsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/events`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventsControllerCreate(createEventDto: CreateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventsControllerCreate(createEventDto: CreateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventsControllerCreate(createEventDto: CreateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventsControllerCreate(createEventDto: CreateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/events`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createEventDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/events/search`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (q != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||||
|
}
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/events/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventsControllerUpdate(id: number, updateEventDto: UpdateEventDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventsControllerUpdate(id: number, updateEventDto: UpdateEventDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventsControllerUpdate(id: number, updateEventDto: UpdateEventDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventsControllerUpdate(id: number, updateEventDto: UpdateEventDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/events/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, updateEventDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
eventsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
eventsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
eventsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/events/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
22
admin/src/api/services/index.ts
Normal file
22
admin/src/api/services/index.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated service exports
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
export { AppService } from "./app.service";
|
||||||
|
export { AuthService } from "./auth.service";
|
||||||
|
export { BookingsService } from "./bookings.service";
|
||||||
|
export { CalendarService } from "./calendar.service";
|
||||||
|
export { EventExceptionsService } from "./eventExceptions.service";
|
||||||
|
export { EventTypesService } from "./eventTypes.service";
|
||||||
|
export { EventsService } from "./events.service";
|
||||||
|
export { PingService } from "./ping.service";
|
||||||
|
export { ProductsService } from "./products.service";
|
||||||
|
export { RecurrenceRulesService } from "./recurrenceRules.service";
|
||||||
|
export { UserService } from "./user.service";
|
||||||
|
export { UserGroupsService } from "./userGroups.service";
|
||||||
|
export { UserRolesService } from "./userRoles.service";
|
||||||
59
admin/src/api/services/ping.service.ts
Normal file
59
admin/src/api/services/ping.service.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for Ping controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class PingService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
pingControllerPing(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
pingControllerPing(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
pingControllerPing(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
pingControllerPing(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/ping`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
pingControllerPingAuth(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
pingControllerPingAuth(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
pingControllerPingAuth(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
pingControllerPingAuth(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/ping/auth`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
135
admin/src/api/services/products.service.ts
Normal file
135
admin/src/api/services/products.service.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for Products controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateProductDto, UpdateProductDto } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class ProductsService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
productsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
productsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
productsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
productsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/products`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
productsControllerCreate(createProductDto: CreateProductDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
productsControllerCreate(createProductDto: CreateProductDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
productsControllerCreate(createProductDto: CreateProductDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
productsControllerCreate(createProductDto: CreateProductDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/products`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createProductDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
productsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
productsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
productsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
productsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/products/search`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (q != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||||
|
}
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
productsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
productsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
productsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
productsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/products/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
productsControllerUpdate(id: number, updateProductDto: UpdateProductDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
productsControllerUpdate(id: number, updateProductDto: UpdateProductDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
productsControllerUpdate(id: number, updateProductDto: UpdateProductDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
productsControllerUpdate(id: number, updateProductDto: UpdateProductDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/products/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, updateProductDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
productsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
productsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
productsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
productsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/products/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
135
admin/src/api/services/recurrenceRules.service.ts
Normal file
135
admin/src/api/services/recurrenceRules.service.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for RecurrenceRules controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateRecurrenceRuleDto, UpdateRecurrenceRuleDto } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class RecurrenceRulesService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
recurrenceRulesControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
recurrenceRulesControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
recurrenceRulesControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
recurrenceRulesControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/recurrence-rules`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
recurrenceRulesControllerCreate(createRecurrenceRuleDto: CreateRecurrenceRuleDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
recurrenceRulesControllerCreate(createRecurrenceRuleDto: CreateRecurrenceRuleDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
recurrenceRulesControllerCreate(createRecurrenceRuleDto: CreateRecurrenceRuleDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
recurrenceRulesControllerCreate(createRecurrenceRuleDto: CreateRecurrenceRuleDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/recurrence-rules`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createRecurrenceRuleDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
recurrenceRulesControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
recurrenceRulesControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
recurrenceRulesControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
recurrenceRulesControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/recurrence-rules/search`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (q != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||||
|
}
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
recurrenceRulesControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
recurrenceRulesControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
recurrenceRulesControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
recurrenceRulesControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/recurrence-rules/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
recurrenceRulesControllerUpdate(id: number, updateRecurrenceRuleDto: UpdateRecurrenceRuleDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
recurrenceRulesControllerUpdate(id: number, updateRecurrenceRuleDto: UpdateRecurrenceRuleDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
recurrenceRulesControllerUpdate(id: number, updateRecurrenceRuleDto: UpdateRecurrenceRuleDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
recurrenceRulesControllerUpdate(id: number, updateRecurrenceRuleDto: UpdateRecurrenceRuleDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/recurrence-rules/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, updateRecurrenceRuleDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
recurrenceRulesControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
recurrenceRulesControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
recurrenceRulesControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
recurrenceRulesControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/recurrence-rules/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
135
admin/src/api/services/user.service.ts
Normal file
135
admin/src/api/services/user.service.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for User controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateUserDto, UpdateUserDto } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class UserService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
userControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userControllerCreate(createUserDto: CreateUserDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userControllerCreate(createUserDto: CreateUserDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userControllerCreate(createUserDto: CreateUserDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userControllerCreate(createUserDto: CreateUserDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createUserDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user/search`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (q != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||||
|
}
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userControllerFindOne(id: string, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userControllerFindOne(id: string, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userControllerFindOne(id: string, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userControllerFindOne(id: string, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userControllerUpdate(id: string, updateUserDto: UpdateUserDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, updateUserDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userControllerRemove(id: string, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userControllerRemove(id: string, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userControllerRemove(id: string, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userControllerRemove(id: string, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
135
admin/src/api/services/userGroups.service.ts
Normal file
135
admin/src/api/services/userGroups.service.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for UserGroups controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateUserGroupDto, UpdateUserGroupDto } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class UserGroupsService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
userGroupsControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userGroupsControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userGroupsControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userGroupsControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-group`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userGroupsControllerCreate(createUserGroupDto: CreateUserGroupDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userGroupsControllerCreate(createUserGroupDto: CreateUserGroupDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userGroupsControllerCreate(createUserGroupDto: CreateUserGroupDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userGroupsControllerCreate(createUserGroupDto: CreateUserGroupDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-group`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createUserGroupDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userGroupsControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userGroupsControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userGroupsControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userGroupsControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-group/search`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (q != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||||
|
}
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userGroupsControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userGroupsControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userGroupsControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userGroupsControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-group/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userGroupsControllerUpdate(id: number, updateUserGroupDto: UpdateUserGroupDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userGroupsControllerUpdate(id: number, updateUserGroupDto: UpdateUserGroupDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userGroupsControllerUpdate(id: number, updateUserGroupDto: UpdateUserGroupDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userGroupsControllerUpdate(id: number, updateUserGroupDto: UpdateUserGroupDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-group/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, updateUserGroupDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userGroupsControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userGroupsControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userGroupsControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userGroupsControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-group/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
135
admin/src/api/services/userRoles.service.ts
Normal file
135
admin/src/api/services/userRoles.service.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Angular service for UserRoles controller
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpClient, HttpContext, HttpContextToken, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||||
|
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||||
|
import { RequestOptions, CreateUserRoleDto, UpdateUserRoleDto } from "../models";
|
||||||
|
|
||||||
|
@Injectable({ providedIn: "root" })
|
||||||
|
export class UserRolesService {
|
||||||
|
private readonly httpClient: HttpClient = inject(HttpClient);
|
||||||
|
private readonly basePath: string = inject(BASE_PATH_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
private createContextWithClientId(existingContext?: HttpContext): HttpContext {
|
||||||
|
const context = existingContext || new HttpContext();
|
||||||
|
return context.set(this.clientContextToken, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
userRolesControllerFindAll(observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userRolesControllerFindAll(observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userRolesControllerFindAll(observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userRolesControllerFindAll(observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-role`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userRolesControllerCreate(createUserRoleDto: CreateUserRoleDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userRolesControllerCreate(createUserRoleDto: CreateUserRoleDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userRolesControllerCreate(createUserRoleDto: CreateUserRoleDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userRolesControllerCreate(createUserRoleDto: CreateUserRoleDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-role`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.post(url, createUserRoleDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userRolesControllerSearch(q: string, page: number, limit: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userRolesControllerSearch(q: string, page: number, limit: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userRolesControllerSearch(q: string, page: number, limit: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userRolesControllerSearch(q: string, page: number, limit: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-role/search`;
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
if (q != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, q, 'q');
|
||||||
|
}
|
||||||
|
if (page != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||||
|
}
|
||||||
|
if (limit != null) {
|
||||||
|
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
params,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userRolesControllerFindOne(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userRolesControllerFindOne(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userRolesControllerFindOne(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userRolesControllerFindOne(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-role/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.get(url, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userRolesControllerUpdate(id: number, updateUserRoleDto: UpdateUserRoleDto, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userRolesControllerUpdate(id: number, updateUserRoleDto: UpdateUserRoleDto, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userRolesControllerUpdate(id: number, updateUserRoleDto: UpdateUserRoleDto, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userRolesControllerUpdate(id: number, updateUserRoleDto: UpdateUserRoleDto, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-role/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.patch(url, updateUserRoleDto, requestOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
userRolesControllerRemove(id: number, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||||
|
userRolesControllerRemove(id: number, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||||
|
userRolesControllerRemove(id: number, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||||
|
userRolesControllerRemove(id: number, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||||
|
const url = `${this.basePath}/api/user-role/${id}`;
|
||||||
|
|
||||||
|
const requestOptions: any = {
|
||||||
|
observe: observe as any,
|
||||||
|
reportProgress: options?.reportProgress,
|
||||||
|
withCredentials: options?.withCredentials,
|
||||||
|
context: this.createContextWithClientId(options?.context)
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.httpClient.delete(url, requestOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
29
admin/src/api/tokens/index.ts
Normal file
29
admin/src/api/tokens/index.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { InjectionToken } from "@angular/core";
|
||||||
|
import { HttpInterceptor, HttpContextToken } from "@angular/common/http";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Injection token for the default client base API path
|
||||||
|
*/
|
||||||
|
export const BASE_PATH_DEFAULT = new InjectionToken<string>('BASE_PATH_DEFAULT', {
|
||||||
|
providedIn: 'root',
|
||||||
|
factory: () => '/api', // Default fallback
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* Injection token for the default client HTTP interceptor instances
|
||||||
|
*/
|
||||||
|
export const HTTP_INTERCEPTORS_DEFAULT = new InjectionToken<HttpInterceptor[]>('HTTP_INTERCEPTORS_DEFAULT', {
|
||||||
|
providedIn: 'root',
|
||||||
|
factory: () => [], // Default empty array
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* HttpContext token to identify requests belonging to the default client
|
||||||
|
*/
|
||||||
|
export const CLIENT_CONTEXT_TOKEN_DEFAULT = new HttpContextToken<string>(() => 'default');
|
||||||
|
/**
|
||||||
|
* @deprecated Use BASE_PATH_DEFAULT instead
|
||||||
|
*/
|
||||||
|
export const BASE_PATH = BASE_PATH_DEFAULT;
|
||||||
|
/**
|
||||||
|
* @deprecated Use CLIENT_CONTEXT_TOKEN_DEFAULT instead
|
||||||
|
*/
|
||||||
|
export const CLIENT_CONTEXT_TOKEN = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
40
admin/src/api/utils/base-interceptor.ts
Normal file
40
admin/src/api/utils/base-interceptor.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/* @ts-nocheck */
|
||||||
|
/* eslint-disable */
|
||||||
|
/* @noformat */
|
||||||
|
/* @formatter:off */
|
||||||
|
/**
|
||||||
|
* Generated by ng-openapi
|
||||||
|
* Generated Base Interceptor for client default
|
||||||
|
* Do not edit this file manually
|
||||||
|
*/
|
||||||
|
import { HttpContextToken, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from "@angular/common/http";
|
||||||
|
import { inject, Injectable } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
import { CLIENT_CONTEXT_TOKEN_DEFAULT, HTTP_INTERCEPTORS_DEFAULT } from "../tokens";
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class DefaultBaseInterceptor implements HttpInterceptor {
|
||||||
|
private readonly httpInterceptors: HttpInterceptor[] = inject(HTTP_INTERCEPTORS_DEFAULT);
|
||||||
|
private readonly clientContextToken: HttpContextToken<string> = CLIENT_CONTEXT_TOKEN_DEFAULT;
|
||||||
|
|
||||||
|
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||||
|
|
||||||
|
// Check if this request belongs to this client using HttpContext
|
||||||
|
if (!req.context.has(this.clientContextToken)) {
|
||||||
|
// This request doesn't belong to this client, pass it through
|
||||||
|
return next.handle(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply client-specific interceptors in reverse order
|
||||||
|
let handler = next;
|
||||||
|
|
||||||
|
handler = this.httpInterceptors.reduceRight(
|
||||||
|
(next, interceptor) => ({
|
||||||
|
handle: (request: HttpRequest<any>) => interceptor.intercept(request, next)
|
||||||
|
}),
|
||||||
|
handler
|
||||||
|
);
|
||||||
|
|
||||||
|
return handler.handle(req);
|
||||||
|
}
|
||||||
|
}
|
||||||
50
admin/src/api/utils/date-transformer.ts
Normal file
50
admin/src/api/utils/date-transformer.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from "@angular/common/http";
|
||||||
|
import { Injectable } from "@angular/core";
|
||||||
|
import { Observable, map } from "rxjs";
|
||||||
|
|
||||||
|
export const ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/;
|
||||||
|
|
||||||
|
export function transformDates(obj: any): any {
|
||||||
|
|
||||||
|
if (obj === null || obj === undefined || typeof obj !== 'object') {
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (obj instanceof Date) {
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(obj)) {
|
||||||
|
return obj.map(item => transformDates(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof obj === 'object') {
|
||||||
|
const transformed: any = {};
|
||||||
|
for (const key of Object.keys(obj)) {
|
||||||
|
const value = obj[key];
|
||||||
|
if (typeof value === 'string' && ISO_DATE_REGEX.test(value)) {
|
||||||
|
transformed[key] = new Date(value);
|
||||||
|
} else {
|
||||||
|
transformed[key] = transformDates(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return transformed;
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class DateInterceptor implements HttpInterceptor {
|
||||||
|
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||||
|
|
||||||
|
return next.handle(req).pipe(
|
||||||
|
map(event => {
|
||||||
|
if (event instanceof HttpResponse && event.body) {
|
||||||
|
return event.clone({ body: transformDates(event.body) });
|
||||||
|
}
|
||||||
|
return event;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
61
admin/src/api/utils/file-download.ts
Normal file
61
admin/src/api/utils/file-download.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import { Observable, tap } from "rxjs";
|
||||||
|
|
||||||
|
export function downloadFile(blob: Blob, filename: string, mimeType?: string): void {
|
||||||
|
|
||||||
|
// Create a temporary URL for the blob
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
// Create a temporary anchor element and trigger download
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
link.download = filename;
|
||||||
|
|
||||||
|
// Append to body, click, and remove
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
|
||||||
|
// Clean up the URL
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function downloadFileOperator<T extends Blob>(filename: string | ((blob: T) => string), mimeType?: string): (source: Observable<T>) => Observable<T> {
|
||||||
|
|
||||||
|
return (source: Observable<T>) => {
|
||||||
|
return source.pipe(
|
||||||
|
tap((blob: T) => {
|
||||||
|
const actualFilename = typeof filename === 'function' ? filename(blob) : filename;
|
||||||
|
downloadFile(blob, actualFilename, mimeType);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function extractFilenameFromContentDisposition(contentDisposition: string | null, fallbackFilename: string = "download"): string {
|
||||||
|
|
||||||
|
if (!contentDisposition) {
|
||||||
|
return fallbackFilename;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to extract filename from Content-Disposition header
|
||||||
|
// Supports both "filename=" and "filename*=" formats
|
||||||
|
const filenameMatch = contentDisposition.match(/filename\*?=['"]?([^'"\n;]+)['"]?/i);
|
||||||
|
|
||||||
|
if (filenameMatch && filenameMatch[1]) {
|
||||||
|
// Decode if it's RFC 5987 encoded (filename*=UTF-8''...)
|
||||||
|
const filename = filenameMatch[1];
|
||||||
|
if (filename.includes("''")) {
|
||||||
|
const parts = filename.split("''");
|
||||||
|
if (parts.length === 2) {
|
||||||
|
try {
|
||||||
|
return decodeURIComponent(parts[1]);
|
||||||
|
} catch {
|
||||||
|
return parts[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fallbackFilename;
|
||||||
|
}
|
||||||
65
admin/src/api/utils/http-params-builder.ts
Normal file
65
admin/src/api/utils/http-params-builder.ts
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import { HttpParams } from "@angular/common/http";
|
||||||
|
|
||||||
|
export class HttpParamsBuilder {
|
||||||
|
/** Adds a value to HttpParams. Delegates to recursive handler for objects/arrays. */
|
||||||
|
public static addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
|
||||||
|
const isDate = value instanceof Date;
|
||||||
|
const isArray = Array.isArray(value);
|
||||||
|
const isObject = typeof value === "object" && !isDate && !isArray;
|
||||||
|
|
||||||
|
if (isObject) {
|
||||||
|
return this.addToHttpParamsRecursive(httpParams, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.addToHttpParamsRecursive(httpParams, value, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
|
||||||
|
if (value == null) {
|
||||||
|
return httpParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return this.handleArray(httpParams, value, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value instanceof Date) {
|
||||||
|
return this.handleDate(httpParams, value, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof value === "object") {
|
||||||
|
return this.handleObject(httpParams, value, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.handlePrimitive(httpParams, value, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static handleArray(httpParams: HttpParams, arr: unknown[], key?: string): HttpParams {
|
||||||
|
arr.forEach((element) => {
|
||||||
|
httpParams = this.addToHttpParamsRecursive(httpParams, element, key);
|
||||||
|
});
|
||||||
|
return httpParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static handleDate(httpParams: HttpParams, date: Date, key?: string): HttpParams {
|
||||||
|
if (!key) {
|
||||||
|
throw new Error("key may not be null if value is Date");
|
||||||
|
}
|
||||||
|
return httpParams.append(key, date.toISOString().substring(0, 10));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static handleObject(httpParams: HttpParams, obj: Record<string, any>, key?: string): HttpParams {
|
||||||
|
Object.keys(obj).forEach((prop) => {
|
||||||
|
const nestedKey = key ? `${key}.${prop}` : prop;
|
||||||
|
httpParams = this.addToHttpParamsRecursive(httpParams, obj[prop], nestedKey);
|
||||||
|
});
|
||||||
|
return httpParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static handlePrimitive(httpParams: HttpParams, value: string | number | boolean, key?: string): HttpParams {
|
||||||
|
if (!key) {
|
||||||
|
throw new Error("key may not be null if value is primitive");
|
||||||
|
}
|
||||||
|
return httpParams.append(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,8 @@ import { routes } from './app.routes';
|
|||||||
import { JwtInterceptor } from './auth/jwt.interceptor';
|
import { JwtInterceptor } from './auth/jwt.interceptor';
|
||||||
import { AuthService } from './auth/auth.service';
|
import { AuthService } from './auth/auth.service';
|
||||||
import { AuthGuard } from './auth/auth.guard';
|
import { AuthGuard } from './auth/auth.guard';
|
||||||
|
import { provideNgOpenapi } from '../api';
|
||||||
|
import { environment } from '../environments/environment';
|
||||||
|
|
||||||
export const appConfig: ApplicationConfig = {
|
export const appConfig: ApplicationConfig = {
|
||||||
providers: [
|
providers: [
|
||||||
@@ -16,6 +18,9 @@ export const appConfig: ApplicationConfig = {
|
|||||||
provideZonelessChangeDetection(),
|
provideZonelessChangeDetection(),
|
||||||
provideRouter(routes),
|
provideRouter(routes),
|
||||||
provideHttpClient(withInterceptorsFromDi()),
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
|
provideNgOpenapi({
|
||||||
|
basePath: environment.apiBaseUrl
|
||||||
|
}),
|
||||||
AuthService,
|
AuthService,
|
||||||
AuthGuard,
|
AuthGuard,
|
||||||
{ provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true },
|
{ provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true },
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
<div>
|
<rs-daisy-admin-layout-rs1 [headerText]="'Foglalási rendszer'" (clickEvent)="logout()" [loggedIn]="loggedIn()">
|
||||||
<button (click)="logout()">Logout</button>
|
|
||||||
</div>
|
<app-menu
|
||||||
<app-main-menu></app-main-menu>
|
[title]="menuTitle"
|
||||||
<router-outlet />
|
[menuItems]="menuConfig"
|
||||||
|
[userRoles]="currentUserRoles"
|
||||||
|
menu-content>
|
||||||
|
</app-menu>
|
||||||
|
<router-outlet main-content />
|
||||||
|
</rs-daisy-admin-layout-rs1>
|
||||||
|
|||||||
@@ -1,10 +1,342 @@
|
|||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
import { LoginComponent } from './components/login/login.component';
|
import { LoginComponent } from './components/login/login.component';
|
||||||
import { AuthGuard } from './auth/auth.guard';
|
import { AuthGuard } from './auth/auth.guard';
|
||||||
import { HomeComponent } from './components/home/home.component'; // Assuming you have a HomeComponent
|
import { HomeComponent } from './components/home/home.component';
|
||||||
|
import { Welcome } from './page/welcome/welcome';
|
||||||
|
import { EventTypeFormComponent } from './features/event-type/components/event-type-form/event-type-form.component';
|
||||||
|
import {
|
||||||
|
EventTypeDetailsComponent,
|
||||||
|
} from './features/event-type/components/event-type-details/event-type-details.component';
|
||||||
|
import { EventTypeTableComponent } from './features/event-type/components/event-type-table/event-type-table.component';
|
||||||
|
import { EventTypeListComponent } from './features/event-type/components/event-type-list/event-type-list.component';
|
||||||
|
import { ProductFormComponent } from './features/products/components/product-form/product-form.component';
|
||||||
|
import { ProductDetailsComponent } from './features/products/components/product-details/product-details.component';
|
||||||
|
import { ProductTableComponent } from './features/products/components/product-table/product-table.component';
|
||||||
|
import { ProductListComponent } from './features/products/components/product-list/product-list.component';
|
||||||
|
import { EventFormComponent } from './features/events/components/event-form/event-form.component';
|
||||||
|
import { EventDetailsComponent } from './features/events/components/event-details/event-details.component';
|
||||||
|
import { EventTableComponent } from './features/events/components/event-table/event-table.component';
|
||||||
|
import { EventListComponent } from './features/events/components/event-list/event-list.component';
|
||||||
|
import { UserFormComponent } from './features/user/components/user-form/user-form.component';
|
||||||
|
import { UserDetailsComponent } from './features/user/components/user-details/user-details.component';
|
||||||
|
import { UserTableComponent } from './features/user/components/user-table/user-table.component';
|
||||||
|
import { UserListComponent } from './features/user/components/user-list/user-list.component';
|
||||||
|
import { UserGroupFormComponent } from './features/user-group/components/user-group-form/user-group-form.component';
|
||||||
|
import {
|
||||||
|
UserGroupDetailsComponent,
|
||||||
|
} from './features/user-group/components/user-group-details/user-group-details.component';
|
||||||
|
import { UserGroupTableComponent } from './features/user-group/components/user-group-table/user-group-table.component';
|
||||||
|
import { UserGroupListComponent } from './features/user-group/components/user-group-list/user-group-list.component';
|
||||||
|
import { UserRoleFormComponent } from './features/user-role/components/user-role-form/user-role-form.component';
|
||||||
|
import {
|
||||||
|
UserRoleDetailsComponent,
|
||||||
|
} from './features/user-role/components/user-role-details/user-role-details.component';
|
||||||
|
import { UserRoleTableComponent } from './features/user-role/components/user-role-table/user-role-table.component';
|
||||||
|
import { UserRoleListComponent } from './features/user-role/components/user-role-list/user-role-list.component';
|
||||||
|
import { BookingFormComponent } from "./features/bookings/components/booking-form/booking-form.component";
|
||||||
|
import { BookingDetailsComponent } from "./features/bookings/components/booking-details/booking-details.component";
|
||||||
|
import { BookingTableComponent } from "./features/bookings/components/booking-table/booking-table.component";
|
||||||
|
import { BookingListComponent } from "./features/bookings/components/booking-list/booking-list.component";
|
||||||
|
import { CalendarView } from './features/calendar/components/calendar-view/calendar-view';
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
|
|
||||||
|
{
|
||||||
|
path: 'calendar',
|
||||||
|
component: CalendarView,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: 'bookings/new',
|
||||||
|
component: BookingFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'bookings',
|
||||||
|
component: BookingListComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'bookings/table',
|
||||||
|
component: BookingTableComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'bookings/:id',
|
||||||
|
component: BookingDetailsComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'bookings/:id/edit',
|
||||||
|
component: BookingFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-role/new',
|
||||||
|
component: UserRoleFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-role',
|
||||||
|
component: UserRoleListComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-role/table',
|
||||||
|
component: UserRoleTableComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-role/:id',
|
||||||
|
component: UserRoleDetailsComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-role/:id/edit',
|
||||||
|
component: UserRoleFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-group/new',
|
||||||
|
component: UserGroupFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-group',
|
||||||
|
component: UserGroupListComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-group/table',
|
||||||
|
component: UserGroupTableComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-group/:id',
|
||||||
|
component: UserGroupDetailsComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user-group/:id/edit',
|
||||||
|
component: UserGroupFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: 'user/new',
|
||||||
|
component: UserFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user',
|
||||||
|
component: UserListComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user/table',
|
||||||
|
component: UserTableComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user/:id',
|
||||||
|
component: UserDetailsComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user/:id/edit',
|
||||||
|
component: UserFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: 'events/new',
|
||||||
|
component: EventFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'events',
|
||||||
|
component: EventListComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'events/table',
|
||||||
|
component: EventTableComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'events/:id',
|
||||||
|
component: EventDetailsComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'events/:id/edit',
|
||||||
|
component: EventFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: 'products',
|
||||||
|
component: ProductListComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'products/table',
|
||||||
|
component: ProductTableComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'products/:id',
|
||||||
|
component: ProductDetailsComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'products/:id/edit',
|
||||||
|
component: ProductFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'products/new',
|
||||||
|
component: ProductFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'event-type',
|
||||||
|
component: EventTypeListComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'event-type/table',
|
||||||
|
component: EventTypeTableComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'event-type/new',
|
||||||
|
component: EventTypeFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'event-type/:id',
|
||||||
|
component: EventTypeDetailsComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'event-type/:id/edit',
|
||||||
|
component: EventTypeFormComponent,
|
||||||
|
canActivate: [AuthGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['admin'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
{ path: 'login', component: LoginComponent },
|
{ path: 'login', component: LoginComponent },
|
||||||
{ path: '', component: HomeComponent, canActivate: [AuthGuard] },
|
{ path: 'welcome', component: Welcome },
|
||||||
{ path: '**', redirectTo: '' } // Redirect to home for any other route
|
{ path: 'home', component: HomeComponent, canActivate: [AuthGuard] },
|
||||||
|
{ path: '', component: Welcome },
|
||||||
|
{ path: '**', redirectTo: '' }, // Redirect to home for any other route
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,21 +1,94 @@
|
|||||||
import { Component, signal } from '@angular/core';
|
import { Component, inject, signal } from '@angular/core';
|
||||||
import { Router, RouterOutlet } from '@angular/router';
|
import { Router, RouterOutlet } from '@angular/router';
|
||||||
import { MainMenu } from './components/main-menu/main-menu';
|
|
||||||
import { AuthService } from './auth/auth.service';
|
import { AuthService } from './auth/auth.service';
|
||||||
|
import { AdminLayoutRs1 } from '../../projects/rschneider/ng-daisyui/src/lib/layout';
|
||||||
|
import { Menu, MenuItem } from './components/menu/menu';
|
||||||
|
import { SingleEventDashboardCard } from './features/calendar/components/calendar-view/single-event-dashboard-card/single-event-dashboard-card';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
imports: [RouterOutlet, MainMenu],
|
|
||||||
|
imports: [RouterOutlet, AdminLayoutRs1, Menu, SingleEventDashboardCard], // Import it here
|
||||||
templateUrl: './app.html',
|
templateUrl: './app.html',
|
||||||
styleUrl: './app.css'
|
styleUrl: './app.css',
|
||||||
})
|
})
|
||||||
export class App {
|
export class App {
|
||||||
protected readonly title = signal('admin');
|
protected readonly title = signal('admin');
|
||||||
|
protected menuConfig: MenuItem[] = [];
|
||||||
|
protected currentUserRoles: string[] = ['admin'];
|
||||||
|
protected menuTitle: string | undefined = 'Menü';
|
||||||
|
|
||||||
constructor(private authService: AuthService, private router: Router) {}
|
|
||||||
|
constructor(private authService: AuthService, private router: Router) {
|
||||||
|
this.menuConfig = [
|
||||||
|
{
|
||||||
|
menuText: 'Esemény típusok',
|
||||||
|
targetUrl: '/event-type/table',
|
||||||
|
svgIcon: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6.429 9.75 2.25 12l4.179 2.25m0-4.5 5.571 3 5.571-3m-11.142 0L2.25 7.5 12 2.25l9.75 5.25-4.179 2.25m0 0L21.75 12l-4.179 2.25m0 0 4.179 2.25L12 21.75 2.25 16.5l4.179-2.25m11.142 0-5.571 3-5.571-3" />
|
||||||
|
</svg>
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
menuText: 'Események',
|
||||||
|
targetUrl: '/events/table',
|
||||||
|
svgIcon: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5" />
|
||||||
|
</svg>
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
menuText: 'Naptár',
|
||||||
|
targetUrl: '/calendar',
|
||||||
|
svgIcon: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z" />
|
||||||
|
</svg>
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
menuText: 'Felhasználók',
|
||||||
|
targetUrl: '/user/table',
|
||||||
|
svgIcon: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z" />
|
||||||
|
</svg>
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
menuText: 'Felhasználó Csoport',
|
||||||
|
targetUrl: '/user-group/table',
|
||||||
|
svgIcon: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z" />
|
||||||
|
</svg>
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
menuText: 'Felhasználó Szerepek',
|
||||||
|
targetUrl: '/user-role/table',
|
||||||
|
svgIcon: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" />
|
||||||
|
</svg>
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
logout(): void {
|
logout(): void {
|
||||||
this.authService.logout();
|
this.authService.serverSideLogout().subscribe({
|
||||||
this.router.navigate(['/login']);
|
next: () => {
|
||||||
|
console.log('Server-side logout successful.');
|
||||||
|
this.authService.clientSideLogout();
|
||||||
|
},
|
||||||
|
error: (err) => {
|
||||||
|
console.error('Server-side logout failed, logging out client-side anyway.', err);
|
||||||
|
this.authService.clientSideLogout();
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loggedIn() {
|
||||||
|
return this.authService.isLoggedIn();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,32 @@ export class AuthGuard implements CanActivate {
|
|||||||
route: ActivatedRouteSnapshot,
|
route: ActivatedRouteSnapshot,
|
||||||
state: RouterStateSnapshot
|
state: RouterStateSnapshot
|
||||||
): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||||
if (this.authService.isLoggedIn()) {
|
const requiredRoles = route.data['roles'] as string[];
|
||||||
|
|
||||||
|
console.info("auth guard started", requiredRoles)
|
||||||
|
|
||||||
|
// 1. Check if the route requires any specific roles
|
||||||
|
if (!requiredRoles || requiredRoles.length === 0) {
|
||||||
|
// If no roles are required, only check if the user is logged in
|
||||||
|
return this.authService.isLoggedIn() ? true : this.router.parseUrl('/login');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 2. Check if the user is logged in
|
||||||
|
if (!this.authService.isLoggedIn()) {
|
||||||
|
// If not logged in, redirect to the login page
|
||||||
|
return this.router.parseUrl('/login');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Check if the user has the required role
|
||||||
|
if (this.authService.hasRole(requiredRoles)) {
|
||||||
|
// If the user has the role, allow access
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// Redirect to the login page
|
// If the user does not have the role, redirect to an unauthorized page
|
||||||
return this.router.createUrlTree(['/login']);
|
console.warn(`User does not have one of the required roles: ${requiredRoles}`);
|
||||||
|
return this.router.parseUrl('/welcome');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,142 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable, signal } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable, of, throwError } from 'rxjs';
|
||||||
import { tap } from 'rxjs/operators';
|
import { tap } from 'rxjs/operators';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { jwtDecode } from 'jwt-decode';
|
||||||
|
|
||||||
|
|
||||||
|
interface User {
|
||||||
|
name: string;
|
||||||
|
roles: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DecodedToken {
|
||||||
|
name: string; // Or 'username', 'given_name', etc.
|
||||||
|
roles: string[]; // The claim can be a single string or an array
|
||||||
|
exp: number; // Expiration time (Unix timestamp)
|
||||||
|
// Add other claims you need, like 'sub' for user ID
|
||||||
|
sub: string;
|
||||||
|
}
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class AuthService {
|
export class AuthService {
|
||||||
private readonly TOKEN_KEY = 'access_token';
|
private readonly ACCESS_TOKEN_KEY = 'accessToken';
|
||||||
|
private readonly REFRESH_TOKEN_KEY = 'refreshToken';
|
||||||
private apiUrl = 'http://localhost:4200/api/auth'; // Adjust if your server URL is different
|
private apiUrl = 'http://localhost:4200/api/auth'; // Adjust if your server URL is different
|
||||||
|
|
||||||
constructor(private http: HttpClient) {}
|
currentUser = signal<User | null>(null);
|
||||||
|
|
||||||
|
constructor(private http: HttpClient, private router: Router) {
|
||||||
|
const accessToken = this.getAccessToken();
|
||||||
|
if (accessToken) {
|
||||||
|
this.decodeAndSetUser(accessToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
login(credentials: { username: string; password: string }): Observable<any> {
|
login(credentials: { username: string; password: string }): Observable<any> {
|
||||||
return this.http.post<{ access_token: string }>(`${this.apiUrl}/login`, credentials).pipe(
|
return this.http.post<{ accessToken: string; refreshToken: string }>(`${this.apiUrl}/login`, credentials).pipe(
|
||||||
tap((response) => this.setToken(response.access_token))
|
tap((response) => {
|
||||||
|
this.setTokens(response.accessToken, response.refreshToken);
|
||||||
|
this.decodeAndSetUser(response.accessToken);
|
||||||
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
logout(): void {
|
/**
|
||||||
localStorage.removeItem(this.TOKEN_KEY);
|
* Makes a best-effort call to the server to invalidate the refresh token.
|
||||||
|
*/
|
||||||
|
serverSideLogout(): Observable<any> {
|
||||||
|
return this.http.post(`${this.apiUrl}/logout`, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
getToken(): string | null {
|
/**
|
||||||
return localStorage.getItem(this.TOKEN_KEY);
|
* Performs the client-side cleanup, removing tokens and redirecting to login.
|
||||||
|
* This is the definitive logout action from the user's perspective.
|
||||||
|
*/
|
||||||
|
clientSideLogout(): void {
|
||||||
|
console.info("clientSideLogout");
|
||||||
|
this.removeTokens();
|
||||||
|
this.currentUser.set(null);
|
||||||
|
this.router.navigate(['/login']);
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshToken(): Observable<any> {
|
||||||
|
console.info("getting refresh token");
|
||||||
|
const refreshToken = this.getRefreshToken();
|
||||||
|
|
||||||
|
if (!refreshToken) {
|
||||||
|
console.info("no refresh token found", refreshToken);
|
||||||
|
// If no refresh token is present, logout and return an error.
|
||||||
|
this.clientSideLogout();
|
||||||
|
return throwError(() => new Error('No refresh token available'));
|
||||||
|
}
|
||||||
|
console.info("refresh token found", refreshToken);
|
||||||
|
|
||||||
|
return this.http.post<{ accessToken: string; refreshToken: string }>(`${this.apiUrl}/refresh`, {}, {
|
||||||
|
headers: { Authorization: `Bearer ${refreshToken}` }
|
||||||
|
}).pipe(
|
||||||
|
tap((response) => {
|
||||||
|
this.setTokens(response.accessToken, response.refreshToken);
|
||||||
|
this.decodeAndSetUser(response.accessToken);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getAccessToken(): string | null {
|
||||||
|
return localStorage.getItem(this.ACCESS_TOKEN_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
getRefreshToken(): string | null {
|
||||||
|
return localStorage.getItem(this.REFRESH_TOKEN_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoggedIn(): boolean {
|
isLoggedIn(): boolean {
|
||||||
return this.getToken() !== null;
|
return this.getAccessToken() !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private setToken(token: string): void {
|
hasRole(requiredRoles: string[]): boolean {
|
||||||
localStorage.setItem(this.TOKEN_KEY, token);
|
const user = this.currentUser();
|
||||||
|
if (!user) {
|
||||||
|
return false; // Not logged in, so no roles
|
||||||
}
|
}
|
||||||
|
// Check if any of the user's roles match any of the required roles
|
||||||
|
return requiredRoles.some(requiredRole => user.roles.includes(requiredRole));
|
||||||
|
}
|
||||||
|
|
||||||
|
private setTokens(accessToken: string, refreshToken: string): void {
|
||||||
|
localStorage.setItem(this.ACCESS_TOKEN_KEY, accessToken);
|
||||||
|
localStorage.setItem(this.REFRESH_TOKEN_KEY, refreshToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
private removeTokens(): void {
|
||||||
|
localStorage.removeItem(this.ACCESS_TOKEN_KEY);
|
||||||
|
localStorage.removeItem(this.REFRESH_TOKEN_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
private decodeAndSetUser(token: string): void {
|
||||||
|
try {
|
||||||
|
const decodedToken: DecodedToken = jwtDecode(token);
|
||||||
|
|
||||||
|
// Check if the token is expired. exp is in seconds, Date.now() is in ms.
|
||||||
|
// if (decodedToken.exp * 1000 < Date.now()) {
|
||||||
|
// console.warn('Attempted to use an expired token.');
|
||||||
|
// this.logout(); // The token is expired, so log the user out
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
this.currentUser.set({
|
||||||
|
name: decodedToken.name,
|
||||||
|
roles: decodedToken.roles
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Failed to decode JWT:', error);
|
||||||
|
this.currentUser.set(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,26 +4,82 @@ import {
|
|||||||
HttpHandler,
|
HttpHandler,
|
||||||
HttpInterceptor,
|
HttpInterceptor,
|
||||||
HttpRequest,
|
HttpRequest,
|
||||||
|
HttpErrorResponse,
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable, throwError, BehaviorSubject } from 'rxjs';
|
||||||
|
import { catchError, switchMap, filter, take, finalize } from 'rxjs/operators'; // Import finalize
|
||||||
import { AuthService } from './auth.service';
|
import { AuthService } from './auth.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class JwtInterceptor implements HttpInterceptor {
|
export class JwtInterceptor implements HttpInterceptor {
|
||||||
|
private isRefreshing = false;
|
||||||
|
// Initialize refreshTokenSubject with null
|
||||||
|
private refreshTokenSubject: BehaviorSubject<any> = new BehaviorSubject<any>(null);
|
||||||
|
|
||||||
constructor(private authService: AuthService) {}
|
constructor(private authService: AuthService) {}
|
||||||
|
|
||||||
intercept(
|
intercept(
|
||||||
request: HttpRequest<any>,
|
request: HttpRequest<any>,
|
||||||
next: HttpHandler
|
next: HttpHandler
|
||||||
): Observable<HttpEvent<any>> {
|
): Observable<HttpEvent<any>> {
|
||||||
const token = this.authService.getToken();
|
if (request.url.includes('/auth/refresh')) {
|
||||||
if (token) {
|
return next.handle(request);
|
||||||
request = request.clone({
|
}
|
||||||
|
|
||||||
|
const accessToken = this.authService.getAccessToken();
|
||||||
|
if (accessToken) {
|
||||||
|
request = this.addToken(request, accessToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
return next.handle(request).pipe(
|
||||||
|
catchError((error) => {
|
||||||
|
if (error instanceof HttpErrorResponse && error.status === 401) {
|
||||||
|
return this.handle401Error(request, next);
|
||||||
|
}
|
||||||
|
return throwError(() => error);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private handle401Error(request: HttpRequest<any>, next: HttpHandler): Observable<any> {
|
||||||
|
if (!this.isRefreshing) {
|
||||||
|
this.isRefreshing = true;
|
||||||
|
// Reset the refreshTokenSubject to null so that subsequent requests will wait
|
||||||
|
// this.refreshTokenSubject.next(null);
|
||||||
|
this.refreshTokenSubject = new BehaviorSubject<any>(null);
|
||||||
|
|
||||||
|
console.info("Refreshing tokens");
|
||||||
|
return this.authService.refreshToken().pipe(
|
||||||
|
switchMap((token: any) => {
|
||||||
|
this.refreshTokenSubject.next(token.accessToken);
|
||||||
|
return next.handle(this.addToken(request, token.accessToken));
|
||||||
|
}),
|
||||||
|
catchError((err) => {
|
||||||
|
// If refresh fails, logout the user
|
||||||
|
this.authService.clientSideLogout();
|
||||||
|
return throwError(() => err);
|
||||||
|
}),
|
||||||
|
finalize(() => {
|
||||||
|
console.info("refreshing done")
|
||||||
|
// When the refresh attempt completes, set isRefreshing to false
|
||||||
|
this.isRefreshing = false;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// If a refresh is already in progress, wait for it to complete
|
||||||
|
return this.refreshTokenSubject.pipe(
|
||||||
|
filter(token => token != null),
|
||||||
|
take(1),
|
||||||
|
switchMap(jwt => next.handle(this.addToken(request, jwt)))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private addToken(request: HttpRequest<any>, token: string) {
|
||||||
|
return request.clone({
|
||||||
setHeaders: {
|
setHeaders: {
|
||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return next.handle(request);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
0
admin/src/app/components/color-view/color-view.css
Normal file
0
admin/src/app/components/color-view/color-view.css
Normal file
8
admin/src/app/components/color-view/color-view.html
Normal file
8
admin/src/app/components/color-view/color-view.html
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
@if (color()) {
|
||||||
|
<div class="flex flex-row gap-1 items-center">
|
||||||
|
<div class='min-w-3 min-h-3 w-3 h-3'
|
||||||
|
[style]="'background-color: ' + color()"
|
||||||
|
></div>
|
||||||
|
{{color()}}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
23
admin/src/app/components/color-view/color-view.spec.ts
Normal file
23
admin/src/app/components/color-view/color-view.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ColorView } from './color-view';
|
||||||
|
|
||||||
|
describe('ColorView', () => {
|
||||||
|
let component: ColorView;
|
||||||
|
let fixture: ComponentFixture<ColorView>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [ColorView]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(ColorView);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
11
admin/src/app/components/color-view/color-view.ts
Normal file
11
admin/src/app/components/color-view/color-view.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component, input } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-color-view',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './color-view.html',
|
||||||
|
styleUrl: './color-view.css',
|
||||||
|
})
|
||||||
|
export class ColorView {
|
||||||
|
color = input<string>();
|
||||||
|
}
|
||||||
27
admin/src/app/components/detail-view/detail-view.html
Normal file
27
admin/src/app/components/detail-view/detail-view.html
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
@if (config().data){
|
||||||
|
<div class="overflow-x-auto" [ngClass]="config().styleClass">
|
||||||
|
<table class="table w-full table-zebra">
|
||||||
|
<tbody>
|
||||||
|
@for (row of config().rows; track row.attribute) {
|
||||||
|
<tr [ngClass]="row.getDetailClass ? row.getDetailClass(config().data) : ''">
|
||||||
|
<th [ngClass]="row.getTitleStyleClass ? row.getTitleStyleClass(config().data) : ''">
|
||||||
|
@if (row.titleComponent) {
|
||||||
|
<ng-container *ngComponentOutlet="row.titleComponent; inputs: row.titleComponentInputs ? row.titleComponentInputs(config().data) : {}"></ng-container>
|
||||||
|
} @else {
|
||||||
|
{{ getTitle(row, config().data) }}
|
||||||
|
}
|
||||||
|
</th>
|
||||||
|
<td [ngClass]="row.getValueStyleClass ? row.getValueStyleClass(config().data) : ''">
|
||||||
|
@if (row.component) {
|
||||||
|
<ng-container *ngComponentOutlet="row.component; inputs: row.componentInputs ? row.componentInputs(config().data) : {}"></ng-container>
|
||||||
|
} @else {
|
||||||
|
{{ getFormattedValue(row, config().data) }}
|
||||||
|
}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
}
|
||||||
23
admin/src/app/components/detail-view/detail-view.spec.ts
Normal file
23
admin/src/app/components/detail-view/detail-view.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { DetailView } from './detail-view';
|
||||||
|
|
||||||
|
describe('DetailView', () => {
|
||||||
|
let component: DetailView;
|
||||||
|
let fixture: ComponentFixture<DetailView>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [DetailView]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DetailView);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
76
admin/src/app/components/detail-view/detail-view.ts
Normal file
76
admin/src/app/components/detail-view/detail-view.ts
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
import { Component, input, Type } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
export interface CellComponent<T> {
|
||||||
|
component?: Type<any>;
|
||||||
|
componentInputs?: (obj: T) => { [key: string]: any };
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DetailViewRow<T> extends CellComponent<T> {
|
||||||
|
attribute: keyof T;
|
||||||
|
getValue?: (obj: T) => any;
|
||||||
|
format?: 'date' | 'datetime' | 'number' | 'raw' | ((value: any) => string);
|
||||||
|
getTitle?: string | ((obj: T) => string);
|
||||||
|
getDetailClass?: (obj: T) => string;
|
||||||
|
getTitleStyleClass?: (obj: T) => string;
|
||||||
|
getValueStyleClass?: (obj: T) => string;
|
||||||
|
titleComponent?: Type<any>;
|
||||||
|
titleComponentInputs?: (obj: T) => { [key: string]: any };
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DetailViewConfig<T> {
|
||||||
|
data: T;
|
||||||
|
rows: DetailViewRow<T>[];
|
||||||
|
styleClass?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-detail-view',
|
||||||
|
imports: [CommonModule],
|
||||||
|
templateUrl: './detail-view.html',
|
||||||
|
styleUrl: './detail-view.css',
|
||||||
|
})
|
||||||
|
export class DetailView<T> {
|
||||||
|
config = input.required<DetailViewConfig<T>>();
|
||||||
|
|
||||||
|
getFormattedValue(row: DetailViewRow<T>, data: T): string {
|
||||||
|
let value : any;
|
||||||
|
try {
|
||||||
|
value = row.getValue ? row.getValue(data) : data[row.attribute];
|
||||||
|
}catch (e) {
|
||||||
|
value = '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (row.component) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof row.format === 'function') {
|
||||||
|
return row.format(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (row.format) {
|
||||||
|
case 'date':
|
||||||
|
return new Date(value).toLocaleDateString();
|
||||||
|
case 'datetime':
|
||||||
|
return new Date(value).toLocaleString();
|
||||||
|
case 'number':
|
||||||
|
return Number(value).toString();
|
||||||
|
case 'raw':
|
||||||
|
default:
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getTitle(row: DetailViewRow<T>, data: T): string {
|
||||||
|
if (row.titleComponent) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof row.getTitle === 'function') {
|
||||||
|
return row.getTitle(data);
|
||||||
|
}
|
||||||
|
return row.getTitle || String(row.attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
0
admin/src/app/components/footer/footer.css
Normal file
0
admin/src/app/components/footer/footer.css
Normal file
22
admin/src/app/components/footer/footer.html
Normal file
22
admin/src/app/components/footer/footer.html
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<footer class="footer sm:footer-horizontal bg-neutral text-neutral-content p-10">
|
||||||
|
<nav>
|
||||||
|
<h6 class="footer-title">Services</h6>
|
||||||
|
<a class="link link-hover">Branding</a>
|
||||||
|
<a class="link link-hover">Design</a>
|
||||||
|
<a class="link link-hover">Marketing</a>
|
||||||
|
<a class="link link-hover">Advertisement</a>
|
||||||
|
</nav>
|
||||||
|
<nav>
|
||||||
|
<h6 class="footer-title">Company</h6>
|
||||||
|
<a class="link link-hover">About us</a>
|
||||||
|
<a class="link link-hover">Contact</a>
|
||||||
|
<a class="link link-hover">Jobs</a>
|
||||||
|
<a class="link link-hover">Press kit</a>
|
||||||
|
</nav>
|
||||||
|
<nav>
|
||||||
|
<h6 class="footer-title">Legal</h6>
|
||||||
|
<a class="link link-hover">Terms of use</a>
|
||||||
|
<a class="link link-hover">Privacy policy</a>
|
||||||
|
<a class="link link-hover">Cookie policy</a>
|
||||||
|
</nav>
|
||||||
|
</footer>
|
||||||
23
admin/src/app/components/footer/footer.spec.ts
Normal file
23
admin/src/app/components/footer/footer.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { Footer } from './footer';
|
||||||
|
|
||||||
|
describe('Footer', () => {
|
||||||
|
let component: Footer;
|
||||||
|
let fixture: ComponentFixture<Footer>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [Footer]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(Footer);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
11
admin/src/app/components/footer/footer.ts
Normal file
11
admin/src/app/components/footer/footer.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-footer',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './footer.html',
|
||||||
|
styleUrl: './footer.css',
|
||||||
|
})
|
||||||
|
export class Footer {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<div class="flex flex-row gap-1 items-center">
|
||||||
|
|
||||||
|
@for (action of actions(); track action){
|
||||||
|
<a class="btn btn-primary" title="{{action.title ?? '' }}" (click)="onClick($event,action)">
|
||||||
|
@if(action.svgIcon){
|
||||||
|
<span [outerHTML]="action.svgIcon | safeHtml"></span>
|
||||||
|
}
|
||||||
|
@if ( action.text !== false){
|
||||||
|
{{action.text || action.action}}
|
||||||
|
}
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import { Component, inject, input, OnInit } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { SafeHtmlPipe } from '../../pipes/safe-html-pipe';
|
||||||
|
import { SvgIcons } from '../../svg-icons';
|
||||||
|
import { EventType } from '../../features/event-type/models/event-type.model';
|
||||||
|
import { CellDefinition, StyleClassContext } from '../generic-table/cell-definition.interface';
|
||||||
|
|
||||||
|
export interface ActionDefinition<T> {
|
||||||
|
action: string;
|
||||||
|
text?: string | false;
|
||||||
|
title?: string;
|
||||||
|
generate: (action: string, item?: T) => string;
|
||||||
|
handler?: (action: ActionDefinition<T>, item?: T) => void;
|
||||||
|
svgIcon?: string; //https://heroicons.com/
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-generic-action-column',
|
||||||
|
imports: [
|
||||||
|
SafeHtmlPipe,
|
||||||
|
],
|
||||||
|
templateUrl: './generic-action-column.html',
|
||||||
|
styleUrl: './generic-action-column.css',
|
||||||
|
standalone: true,
|
||||||
|
})
|
||||||
|
export class GenericActionColumn<T> implements OnInit {
|
||||||
|
|
||||||
|
private router = inject(Router);
|
||||||
|
|
||||||
|
actions = input([] as ActionDefinition<T>[]);
|
||||||
|
item = input(undefined as T);
|
||||||
|
payload = input(undefined as any);
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
onClick($event: any, actionDefinition: ActionDefinition<T>) {
|
||||||
|
if (actionDefinition?.handler) {
|
||||||
|
actionDefinition.handler(actionDefinition, this.item());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateActionColumnCellDefinitionContext<T> {
|
||||||
|
actionHandler?: (action: ActionDefinition<T>, item?: T) => void;
|
||||||
|
styleClass?: (definition: StyleClassContext<T>) => string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const createActionColumnCellDefinition = <T>(createCtx: CreateActionColumnCellDefinitionContext<T>): CellDefinition<T> => {
|
||||||
|
return {
|
||||||
|
styleClass: createCtx.styleClass ?? (ctx => 'w-[1%]'),
|
||||||
|
component: GenericActionColumn,
|
||||||
|
componentInputs: item => ({
|
||||||
|
item: item,
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
action: 'view',
|
||||||
|
title: 'Részletek',
|
||||||
|
text: false,
|
||||||
|
handler: createCtx.actionHandler,
|
||||||
|
svgIcon: SvgIcons.heroDocument,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: 'edit', title: 'Szerkesztés', text: false,
|
||||||
|
svgIcon: SvgIcons.heroCog6Tooth,
|
||||||
|
handler: createCtx.actionHandler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: 'delete',
|
||||||
|
title: 'Törlés',
|
||||||
|
text: false,
|
||||||
|
handler: createCtx.actionHandler,
|
||||||
|
svgIcon: SvgIcons.heroTrash,
|
||||||
|
},
|
||||||
|
] as ActionDefinition<EventType>[],
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import { Type } from '@angular/core';
|
||||||
|
import { ColumnDefinition } from './column-definition.interface';
|
||||||
|
|
||||||
|
export interface StyleClassContext<T>{
|
||||||
|
definition: ColumnDefinition<T> ;
|
||||||
|
cellDefinition: CellDefinition<T>;
|
||||||
|
item?: T;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CellDefinition<T> {
|
||||||
|
value?: ((item?: T) => any) | string;
|
||||||
|
component?: Type<any>;
|
||||||
|
componentInputs?: (item?: T|null) => { [key: string]: any };
|
||||||
|
styleClass?: (definition: StyleClassContext<T>) => string;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user