Compare commits

53 Commits

Author SHA1 Message Date
Schneider Roland
7ed3367ed8 feat: Implement event dashboard with activation, cancellation, editing, and booking management functionalities. 2025-12-31 12:00:05 +01:00
Roland Schneider
90c192c881 cancel booking 2025-12-20 21:55:22 +01:00
Roland Schneider
e9943dae76 basic booking load behavior 2025-12-19 22:40:32 +01:00
Roland Schneider
4e77578abf basic booking load behavior 2025-12-19 16:23:53 +01:00
Schneider Roland
72c213eaea implement getbookings for calendar 2025-12-17 07:58:52 +01:00
Roland Schneider
c26abee957 basic booking load behavior 2025-12-16 15:31:45 +01:00
Schneider Roland
fe30561a40 list booking 2025-12-16 08:07:05 +01:00
Schneider Roland
056b9f6c80 create booking 2025-12-14 22:11:42 +01:00
Roland Schneider
e86b356baf server: BOOKING 2025-12-13 21:35:23 +01:00
Roland Schneider
57edf5b4a8 server: add user decorator, add ping module 2025-12-12 08:20:32 +01:00
Roland Schneider
453d02612c refactor admin to use eventbus 2025-12-11 22:49:08 +01:00
Schneider Roland
93b1fb9610 improve exception saving 2025-12-11 07:01:17 +01:00
Roland Schneider
fb31f0813a improve calendar event creation 2025-12-09 08:39:23 +01:00
Schneider Roland
c53c00e13c improve exception saving 2025-12-09 07:20:55 +01:00
Roland Schneider
122ddae575 improve calendar event creation 2025-12-08 18:05:47 +01:00
Schneider Roland
2e2f37ab86 add calendar dashboard edit 2025-12-08 16:40:19 +01:00
Schneider Roland
cacc04a217 add calendar dashboard edit 2025-12-04 07:07:43 +01:00
Schneider Roland
f740c11685 add calendar dashboard edit 2025-12-03 07:47:16 +01:00
Schneider Roland
fa098f4a1b add calendar dashboard edit 2025-12-01 22:39:39 +01:00
Schneider Roland
a043d64229 add event-cancel dialog 2025-11-29 20:10:28 +01:00
Schneider Roland
9d6e5bb7a3 basic single event dashboard 2025-11-28 23:02:00 +01:00
Schneider Roland
aec1fd5ad1 basic single event dashboard 2025-11-28 08:03:33 +01:00
Schneider Roland
02442a162a basic single event dashboard 2025-11-27 22:24:41 +01:00
Roland Schneider
364be9976a add single calendar dialog 2025-11-27 19:57:58 +01:00
Schneider Roland
e1ae0a36d7 implement edit event 2025-11-27 06:50:39 +01:00
Roland Schneider
71a8e267dc improve calendar event creation 2025-11-26 16:48:20 +01:00
Roland Schneider
2934e099b1 add intellij run configs 2025-11-26 08:23:43 +01:00
Schneider Roland
dad9f4fce1 add recurring rules to event create form 2025-11-26 08:05:26 +01:00
Schneider Roland
9c1c2f6356 add calendarview add frequency 2025-11-25 20:00:48 +01:00
Schneider Roland
bc5b73e080 add calendarview add frequency 2025-11-25 08:28:23 +01:00
Roland Schneider
a575200368 implement add event via fullcalendar 2025-11-24 21:23:25 +01:00
Roland Schneider
35a591fcf7 implement add event via fullcalendar 2025-11-24 21:19:11 +01:00
Schneider Roland
6b975dadac add calendarview event creation 2025-11-23 22:26:16 +01:00
Schneider Roland
008b644bb1 small improvements:
- add colorview component
 - improve generic action column
 - improve generic table
 - improve event-type-table.component.ts
 - add headerText to admin layout
2025-11-21 21:14:00 +01:00
Roland Schneider
b047ecc589 add breadcrumbs 2025-11-21 15:24:35 +01:00
Roland Schneider
dfc3afd4a9 add fullcalendar example 2025-11-21 08:10:49 +01:00
Roland Schneider
02cad3dbcd add booking 2025-11-20 22:55:31 +01:00
Roland Schneider
085605f85c add calendar module 2025-11-20 22:08:17 +01:00
Roland Schneider
c28431e80c add server components for event_exceptions 2025-11-20 16:01:22 +01:00
Roland Schneider
4699f16b71 add server components for recurrence_rules 2025-11-20 15:56:13 +01:00
Roland Schneider
86f62b0c4d add user role components 2025-11-20 15:51:21 +01:00
Roland Schneider
cc483e6ed5 add user group components 2025-11-20 15:40:24 +01:00
Roland Schneider
e050bf5def add user frontend components 2025-11-20 15:27:22 +01:00
Roland Schneider
635975207f add event object 2025-11-20 15:08:32 +01:00
Roland Schneider
d635ba0986 implement role support for angular authguard 2025-11-20 12:14:41 +01:00
Roland Schneider
b08663fb28 implement configurable menu 2025-11-20 09:30:35 +01:00
Roland Schneider
3e2bdaebc6 add product and entity type 2025-11-20 00:04:03 +01:00
Roland Schneider
d7bb559f95 add product and entity type 2025-11-20 00:03:08 +01:00
Roland Schneider
a8ef23845c cleanup app module in angular 2025-11-19 23:32:13 +01:00
Roland Schneider
ec44849b31 add generic table 2025-11-19 22:48:18 +01:00
Roland Schneider
1bfa4dec47 add generic table 2025-11-19 20:29:21 +01:00
Roland Schneider
8ccb75ee4e add environments and configuration.service.ts for admin 2025-11-19 09:12:27 +01:00
Roland Schneider
d5644b6044 prepare global validationpipe 2025-11-18 18:39:33 +01:00
331 changed files with 14849 additions and 99 deletions

View 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
View File

@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="dev:gui" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="cd admin &amp;&amp; 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
View File

@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="dev:lib" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="cd admin &amp;&amp; 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
View File

@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="dev:server" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="cd server &amp;&amp; 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>

View 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 &amp;&amp; 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
View 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
}
]
}

5
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"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"
}

18
.vscode/tasks.json vendored Normal file
View 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": []
}
]
}

View File

@@ -39,12 +39,24 @@
"maximumError": "8kB"
}
],
"outputHashing": "all"
"outputHashing": "all",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.production.ts"
}
]
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration": "production"

View 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

File diff suppressed because one or more lines are too long

521
admin/package-lock.json generated
View File

@@ -14,8 +14,16 @@
"@angular/forms": "^20.3.0",
"@angular/platform-browser": "^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",
"tailwindcss": "^4.1.17",
@@ -32,6 +40,7 @@
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"ng-openapi": "^0.2.10",
"ng-packagr": "^20.3.0",
"typescript": "~5.9.2"
}
@@ -915,6 +924,30 @@
"node": ">=0.1.90"
}
},
"node_modules/@cspotcode/source-map-support": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
"integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/trace-mapping": "0.3.9"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
"integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/resolve-uri": "^3.0.3",
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.25.9",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz",
@@ -1357,6 +1390,68 @@
"node": ">=18"
}
},
"node_modules/@fullcalendar/angular": {
"version": "6.1.19",
"resolved": "https://registry.npmjs.org/@fullcalendar/angular/-/angular-6.1.19.tgz",
"integrity": "sha512-a3TmjKnF8xprH1aNgFn9zYehEhM4GBAyh+91SJymno2j1cE8D8z0+W1HNwtDekKWwJt/5YoinCvDTHydmF/kKw==",
"license": "MIT",
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": "12 - 20",
"@angular/core": "12 - 20",
"@fullcalendar/core": "~6.1.19"
}
},
"node_modules/@fullcalendar/core": {
"version": "6.1.19",
"resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.19.tgz",
"integrity": "sha512-z0aVlO5e4Wah6p6mouM0UEqtRf1MZZPt4mwzEyU6kusaNL+dlWQgAasF2cK23hwT4cmxkEmr4inULXgpyeExdQ==",
"license": "MIT",
"dependencies": {
"preact": "~10.12.1"
}
},
"node_modules/@fullcalendar/daygrid": {
"version": "6.1.19",
"resolved": "https://registry.npmjs.org/@fullcalendar/daygrid/-/daygrid-6.1.19.tgz",
"integrity": "sha512-IAAfnMICnVWPjpT4zi87i3FEw0xxSza0avqY/HedKEz+l5MTBYvCDPOWDATpzXoLut3aACsjktIyw9thvIcRYQ==",
"license": "MIT",
"peerDependencies": {
"@fullcalendar/core": "~6.1.19"
}
},
"node_modules/@fullcalendar/interaction": {
"version": "6.1.19",
"resolved": "https://registry.npmjs.org/@fullcalendar/interaction/-/interaction-6.1.19.tgz",
"integrity": "sha512-GOciy79xe8JMVp+1evAU3ytdwN/7tv35t5i1vFkifiuWcQMLC/JnLg/RA2s4sYmQwoYhTw/p4GLcP0gO5B3X5w==",
"license": "MIT",
"peerDependencies": {
"@fullcalendar/core": "~6.1.19"
}
},
"node_modules/@fullcalendar/list": {
"version": "6.1.19",
"resolved": "https://registry.npmjs.org/@fullcalendar/list/-/list-6.1.19.tgz",
"integrity": "sha512-knZHpAVF0LbzZpSJSUmLUUzF0XlU/MRGK+Py2s0/mP93bCtno1k2L3XPs/kzh528hSjehwLm89RgKTSfW1P6cA==",
"license": "MIT",
"peerDependencies": {
"@fullcalendar/core": "~6.1.19"
}
},
"node_modules/@fullcalendar/timegrid": {
"version": "6.1.19",
"resolved": "https://registry.npmjs.org/@fullcalendar/timegrid/-/timegrid-6.1.19.tgz",
"integrity": "sha512-OuzpUueyO9wB5OZ8rs7TWIoqvu4v3yEqdDxZ2VcsMldCpYJRiOe7yHWKr4ap5Tb0fs7Rjbserc/b6Nt7ol6BRg==",
"license": "MIT",
"dependencies": {
"@fullcalendar/daygrid": "~6.1.19"
},
"peerDependencies": {
"@fullcalendar/core": "~6.1.19"
}
},
"node_modules/@inquirer/ansi": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-1.0.1.tgz",
@@ -2429,6 +2524,44 @@
"node": ">= 10"
}
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
"integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "2.0.5",
"run-parallel": "^1.1.9"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.stat": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
"integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/@nodelib/fs.walk": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
"integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@nodelib/fs.scandir": "2.1.5",
"fastq": "^1.6.0"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@npmcli/agent": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz",
@@ -3809,6 +3942,62 @@
"tailwindcss": "4.1.17"
}
},
"node_modules/@ts-morph/common": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.27.0.tgz",
"integrity": "sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"fast-glob": "^3.3.3",
"minimatch": "^10.0.1",
"path-browserify": "^1.0.1"
}
},
"node_modules/@ts-morph/common/node_modules/minimatch": {
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
"integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"@isaacs/brace-expansion": "^5.0.0"
},
"engines": {
"node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/@tsconfig/node10": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz",
"integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==",
"dev": true,
"license": "MIT"
},
"node_modules/@tsconfig/node12": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
"integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
"dev": true,
"license": "MIT"
},
"node_modules/@tsconfig/node14": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
"integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
"dev": true,
"license": "MIT"
},
"node_modules/@tsconfig/node16": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
"dev": true,
"license": "MIT"
},
"node_modules/@tufjs/canonical-json": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz",
@@ -3893,6 +4082,13 @@
"undici-types": "~7.16.0"
}
},
"node_modules/@types/swagger-schema-official": {
"version": "2.0.25",
"resolved": "https://registry.npmjs.org/@types/swagger-schema-official/-/swagger-schema-official-2.0.25.tgz",
"integrity": "sha512-T92Xav+Gf/Ik1uPW581nA+JftmjWPgskw/WBf4TJzxRG/SJ+DfNnNE+WuZ4mrXuzflQMqMkm1LSYjzYW7MB1Cg==",
"dev": true,
"license": "MIT"
},
"node_modules/@vitejs/plugin-basic-ssl": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-2.1.0.tgz",
@@ -3937,6 +4133,32 @@
"node": ">= 0.6"
}
},
"node_modules/acorn": {
"version": "8.15.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"dev": true,
"license": "MIT",
"bin": {
"acorn": "bin/acorn"
},
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/acorn-walk": {
"version": "8.3.4",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz",
"integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==",
"dev": true,
"license": "MIT",
"dependencies": {
"acorn": "^8.11.0"
},
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/agent-base": {
"version": "7.1.4",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
@@ -4087,6 +4309,20 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/arg": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true,
"license": "MIT"
},
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true,
"license": "Python-2.0"
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -4565,6 +4801,13 @@
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/code-block-writer": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
"integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==",
"dev": true,
"license": "MIT"
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@@ -4778,6 +5021,13 @@
"node": ">= 0.10"
}
},
"node_modules/create-require": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
"dev": true,
"license": "MIT"
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -4839,6 +5089,16 @@
"url": "https://github.com/saadeghi/daisyui?sponsor=1"
}
},
"node_modules/date-fns": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz",
"integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==",
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/kossnocorp"
}
},
"node_modules/date-format": {
"version": "4.0.14",
"resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz",
@@ -4914,6 +5174,16 @@
"dev": true,
"license": "MIT"
},
"node_modules/diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.3.1"
}
},
"node_modules/dom-serialize": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz",
@@ -5465,6 +5735,23 @@
"dev": true,
"license": "MIT"
},
"node_modules/fast-glob": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.2",
"merge2": "^1.3.0",
"micromatch": "^4.0.8"
},
"engines": {
"node": ">=8.6.0"
}
},
"node_modules/fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
@@ -5489,6 +5776,16 @@
],
"license": "BSD-3-Clause"
},
"node_modules/fastq": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
"integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==",
"dev": true,
"license": "ISC",
"dependencies": {
"reusify": "^1.0.4"
}
},
"node_modules/fdir": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
@@ -6428,6 +6725,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/js-yaml": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"dev": true,
"license": "MIT",
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/jsesc": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
@@ -6498,6 +6808,15 @@
],
"license": "MIT"
},
"node_modules/jwt-decode": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz",
"integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==",
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"node_modules/karma": {
"version": "6.4.4",
"resolved": "https://registry.npmjs.org/karma/-/karma-6.4.4.tgz",
@@ -7524,6 +7843,13 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/make-error": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
"dev": true,
"license": "ISC"
},
"node_modules/make-fetch-happen": {
"version": "14.0.3",
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz",
@@ -7580,13 +7906,22 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/micromatch": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"braces": "^3.0.3",
"picomatch": "^2.3.1"
@@ -7601,7 +7936,6 @@
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"license": "MIT",
"optional": true,
"engines": {
"node": ">=8.6"
},
@@ -7968,6 +8302,44 @@
"node": ">= 0.6"
}
},
"node_modules/ng-openapi": {
"version": "0.2.10",
"resolved": "https://registry.npmjs.org/ng-openapi/-/ng-openapi-0.2.10.tgz",
"integrity": "sha512-QddaPUVh69Tb6pfBx/2odT3rA6/gBUYpUD0sLr4QaTkvazUGEzytqGcbX3hRkU9eaHuKjbq2yU7c+UOdbWYLjA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/swagger-schema-official": "^2.0.25",
"commander": "^14.0.0",
"js-yaml": "^4.1.0",
"ts-morph": "^26.0.0",
"ts-node": "^10.9.2",
"typescript": "^5.8.3"
},
"bin": {
"ng-openapi": "cli.cjs"
},
"engines": {
"node": ">=18.0.0",
"npm": ">=8.0.0"
},
"funding": {
"type": "buymeacoffee",
"url": "https://buymeacoffee.com/ngopenapi"
},
"peerDependencies": {
"@angular/common": ">=15",
"@angular/core": ">=15"
},
"peerDependenciesMeta": {
"@angular/common": {
"optional": false
},
"@angular/core": {
"optional": false
}
}
},
"node_modules/ng-packagr": {
"version": "20.3.2",
"resolved": "https://registry.npmjs.org/ng-packagr/-/ng-packagr-20.3.2.tgz",
@@ -8629,6 +9001,13 @@
"node": ">= 0.8"
}
},
"node_modules/path-browserify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
"dev": true,
"license": "MIT"
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
@@ -8795,6 +9174,16 @@
"dev": true,
"license": "MIT"
},
"node_modules/preact": {
"version": "10.12.1",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.12.1.tgz",
"integrity": "sha512-l8386ixSsBdbreOAkqtrwqHwdvR35ID8c3rKPa8lCWuO86dBi32QWHV4vfsZK1utLLFMvw+Z5Ad4XLkZzchscg==",
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/preact"
}
},
"node_modules/proc-log": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz",
@@ -8874,6 +9263,27 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
@@ -8996,6 +9406,17 @@
"node": ">= 4"
}
},
"node_modules/reusify": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
"integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
"dev": true,
"license": "MIT",
"engines": {
"iojs": ">=1.0.0",
"node": ">=0.10.0"
}
},
"node_modules/rfdc": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz",
@@ -9102,6 +9523,30 @@
"node": ">= 18"
}
},
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT",
"dependencies": {
"queue-microtask": "^1.2.2"
}
},
"node_modules/rxjs": {
"version": "7.8.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
@@ -10015,6 +10460,61 @@
"node": ">=0.6"
}
},
"node_modules/ts-morph": {
"version": "26.0.0",
"resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-26.0.0.tgz",
"integrity": "sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug==",
"dev": true,
"license": "MIT",
"dependencies": {
"@ts-morph/common": "~0.27.0",
"code-block-writer": "^13.0.3"
}
},
"node_modules/ts-node": {
"version": "10.9.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@cspotcode/source-map-support": "^0.8.0",
"@tsconfig/node10": "^1.0.7",
"@tsconfig/node12": "^1.0.7",
"@tsconfig/node14": "^1.0.0",
"@tsconfig/node16": "^1.0.2",
"acorn": "^8.4.1",
"acorn-walk": "^8.1.1",
"arg": "^4.1.0",
"create-require": "^1.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"v8-compile-cache-lib": "^3.0.1",
"yn": "3.1.1"
},
"bin": {
"ts-node": "dist/bin.js",
"ts-node-cwd": "dist/bin-cwd.js",
"ts-node-esm": "dist/bin-esm.js",
"ts-node-script": "dist/bin-script.js",
"ts-node-transpile-only": "dist/bin-transpile.js",
"ts-script": "dist/bin-script-deprecated.js"
},
"peerDependencies": {
"@swc/core": ">=1.2.50",
"@swc/wasm": ">=1.2.50",
"@types/node": "*",
"typescript": ">=2.7"
},
"peerDependenciesMeta": {
"@swc/core": {
"optional": true
},
"@swc/wasm": {
"optional": true
}
}
},
"node_modules/tslib": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
@@ -10206,6 +10706,13 @@
"node": ">= 0.4.0"
}
},
"node_modules/v8-compile-cache-lib": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
"dev": true,
"license": "MIT"
},
"node_modules/validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
@@ -10627,6 +11134,16 @@
"node": "^20.19.0 || ^22.12.0 || >=23"
}
},
"node_modules/yn": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/yoctocolors-cjs": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz",

View File

@@ -6,6 +6,7 @@
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"generate.openapi.client": "bash ./generate.openapi.client.sh",
"test": "ng test"
},
"prettier": {
@@ -28,8 +29,16 @@
"@angular/forms": "^20.3.0",
"@angular/platform-browser": "^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",
"tailwindcss": "^4.1.17",
@@ -46,7 +55,8 @@
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"ng-openapi": "^0.2.10",
"ng-packagr": "^20.3.0",
"typescript": "~5.9.2"
}
}
}

View File

@@ -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>
}

View File

@@ -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();
});
});

View File

@@ -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>
`;
}

View File

@@ -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>

View File

@@ -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);
}

View File

@@ -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>

View File

@@ -1,18 +1,18 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MainMenu } from './main-menu';
import { Modal } from './modal';
describe('MainMenu', () => {
let component: MainMenu;
let fixture: ComponentFixture<MainMenu>;
describe('Modal', () => {
let component: Modal;
let fixture: ComponentFixture<Modal>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [MainMenu]
imports: [Modal]
})
.compileComponents();
fixture = TestBed.createComponent(MainMenu);
fixture = TestBed.createComponent(Modal);
component = fixture.componentInstance;
fixture.detectChanges();
});

View File

@@ -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);
}
}

View File

@@ -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>

View File

@@ -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();
});
});

View File

@@ -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);
}
}

View File

@@ -11,3 +11,10 @@ export interface FooterNav{
export interface FooterConfig{
navs: FooterNav[]
}
export interface Breadcrumb{
text: string;
url?: string;
showIcon?: boolean;
svgIcon?: string;
}

View File

@@ -12,7 +12,7 @@
<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">daisyUI</a>
<a class="btn btn-ghost text-xl">{{headerText()}}</a>
</div>
@if (loggedIn()) {
<div class="flex-none">
@@ -44,7 +44,7 @@
<!-- Main Content -->
<main class="flex-1 p-6 bg-base-100 overflow-y-auto">
<ng-content></ng-content>
<ng-content select="[main-content]"></ng-content>
</main>
<!-- Footer -->
@@ -57,27 +57,7 @@
<!-- Sidebar -->
<div class="drawer-side">
<label for="my-drawer-2" aria-label="close sidebar" class="drawer-overlay"></label>
<ul class="menu p-4 w-80 min-h-full bg-base-300 text-base-content">
<!-- Sidebar content here -->
<li class="text-lg font-bold p-4">My App</li>
<li><a>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
</svg>
Dashboard</a></li>
<li><a>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
Analytics</a></li>
<li><a>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
</svg>
Reports</a></li>
</ul>
<ng-content select="[menu-content]"></ng-content>
</div>
</div>

View File

@@ -8,6 +8,7 @@ import { Component, input, output } from '@angular/core';
})
export class AdminLayoutRs1 {
headerText = input<string>();
readonly loggedIn = input<boolean>(false)

View File

@@ -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);
}
}

View File

@@ -5,5 +5,9 @@
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/';

16
admin/src/api/index.ts Normal file
View 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";

View 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;
}

View 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);
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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";

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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;

View 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);
}
}

View 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;
})
);
}
}

View 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;
}

View 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);
}
}

View File

@@ -9,6 +9,8 @@ import { routes } from './app.routes';
import { JwtInterceptor } from './auth/jwt.interceptor';
import { AuthService } from './auth/auth.service';
import { AuthGuard } from './auth/auth.guard';
import { provideNgOpenapi } from '../api';
import { environment } from '../environments/environment';
export const appConfig: ApplicationConfig = {
providers: [
@@ -16,6 +18,9 @@ export const appConfig: ApplicationConfig = {
provideZonelessChangeDetection(),
provideRouter(routes),
provideHttpClient(withInterceptorsFromDi()),
provideNgOpenapi({
basePath: environment.apiBaseUrl
}),
AuthService,
AuthGuard,
{ provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true },

View File

@@ -1,3 +1,10 @@
<rs-daisy-admin-layout-rs1 (clickEvent)="logout()" [loggedIn]="loggedIn()">
<router-outlet />
<rs-daisy-admin-layout-rs1 [headerText]="'Foglalási rendszer'" (clickEvent)="logout()" [loggedIn]="loggedIn()">
<app-menu
[title]="menuTitle"
[menuItems]="menuConfig"
[userRoles]="currentUserRoles"
menu-content>
</app-menu>
<router-outlet main-content />
</rs-daisy-admin-layout-rs1>

View File

@@ -1,10 +1,342 @@
import { Routes } from '@angular/router';
import { LoginComponent } from './components/login/login.component';
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 = [
{
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: '', component: HomeComponent, canActivate: [AuthGuard] },
{ path: '**', redirectTo: '' } // Redirect to home for any other route
{ path: 'welcome', component: Welcome },
{ path: 'home', component: HomeComponent, canActivate: [AuthGuard] },
{ path: '', component: Welcome },
{ path: '**', redirectTo: '' }, // Redirect to home for any other route
];

View File

@@ -1,27 +1,80 @@
import { Component, inject, signal } from '@angular/core';
import { Router, RouterOutlet } from '@angular/router';
import { MainMenu } from './components/main-menu/main-menu';
import { AuthService } from './auth/auth.service';
import { AdminLayout } from './layout/admin-layout/admin-layout';
import { finalize } from 'rxjs/operators';
import {Button} from '@rschneider/ng-daisyui';
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({
selector: 'app-root',
imports: [RouterOutlet, MainMenu, Button, AdminLayoutRs1],
imports: [RouterOutlet, AdminLayoutRs1, Menu, SingleEventDashboardCard], // Import it here
templateUrl: './app.html',
styleUrl: './app.css',
})
export class App {
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 {
// With the interceptor fixed, this is now the correct and robust way.
// The error from a failed server logout will propagate here.
this.authService.serverSideLogout().subscribe({
next: () => {
console.log('Server-side logout successful.');
@@ -34,8 +87,8 @@ export class App {
});
}
loggedIn(){
return this.authService.isLoggedIn()
loggedIn() {
return this.authService.isLoggedIn();
}
}

View File

@@ -13,11 +13,32 @@ export class AuthGuard implements CanActivate {
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): 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;
} else {
// Redirect to the login page
return this.router.createUrlTree(['/login']);
// If the user does not have the role, redirect to an unauthorized page
console.warn(`User does not have one of the required roles: ${requiredRoles}`);
return this.router.parseUrl('/welcome');
}
}
}

View File

@@ -1,8 +1,23 @@
import { Injectable } from '@angular/core';
import { Injectable, signal } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of, throwError } from 'rxjs';
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({
providedIn: 'root',
@@ -12,11 +27,21 @@ export class AuthService {
private readonly REFRESH_TOKEN_KEY = 'refreshToken';
private apiUrl = 'http://localhost:4200/api/auth'; // Adjust if your server URL is different
constructor(private http: HttpClient, private router: Router) {}
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> {
return this.http.post<{ accessToken: string; refreshToken: string }>(`${this.apiUrl}/login`, credentials).pipe(
tap((response) => this.setTokens(response.accessToken, response.refreshToken))
tap((response) => {
this.setTokens(response.accessToken, response.refreshToken);
this.decodeAndSetUser(response.accessToken);
})
);
}
@@ -32,23 +57,31 @@ export class AuthService {
* This is the definitive logout action from the user's perspective.
*/
clientSideLogout(): void {
console.info("clientSideLogout")
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))
tap((response) => {
this.setTokens(response.accessToken, response.refreshToken);
this.decodeAndSetUser(response.accessToken);
})
);
}
@@ -64,6 +97,15 @@ export class AuthService {
return this.getAccessToken() !== null;
}
hasRole(requiredRoles: string[]): boolean {
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);
@@ -73,4 +115,28 @@ export class AuthService {
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);
}
}
}

View File

@@ -48,7 +48,7 @@ export class JwtInterceptor implements HttpInterceptor {
// 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);
@@ -60,6 +60,7 @@ export class JwtInterceptor implements HttpInterceptor {
return throwError(() => err);
}),
finalize(() => {
console.info("refreshing done")
// When the refresh attempt completes, set isRefreshing to false
this.isRefreshing = false;
})

View 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>
}

View 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();
});
});

View 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>();
}

View 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>
}

View 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();
});
});

View 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);
}
}

View File

@@ -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>

View File

@@ -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>[],
}),
};
};

View File

@@ -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;
}

View File

@@ -0,0 +1,13 @@
import { CellDefinition } from './cell-definition.interface';
export interface TypeDefinition{
type: 'boolean' | 'number' | 'string' | 'date' | 'time' | 'datetime';
params?: Record<string, any>;
}
export interface ColumnDefinition<T> {
attribute: keyof T;
type: TypeDefinition;
valueCell?: CellDefinition<T> | boolean
headerCell?: CellDefinition<T> | boolean
}

View File

@@ -0,0 +1,23 @@
import { Observable } from 'rxjs';
import { PaginatedResponse } from '../../features/products/models/product.model';
export interface QueryParams extends Record<string, any>{
sortBy?: string;
sortDirection?: 'asc' | 'desc',
page?: number,
limit?: number,
q?: string,
}
export interface GetDataOptions extends Record<string, any>{
params?: QueryParams
}
export interface GetDataResponse<T> extends Record<string, any>{
data: PaginatedResponse<T>;
}
export interface DataProvider<T> {
getData( options?: GetDataOptions): Observable<GetDataResponse<T>>;
}

View File

@@ -0,0 +1,6 @@
<form [formGroup]="filterForm" class="p-4 bg-base-200 rounded-lg shadow">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 items-end">
<div class="form-control"><label class="label"><span class="label-text">SearchTerm</span></label>
<input type="text" formControlName="term" class="input input-bordered w-full" placeholder="Search term" /></div>
</div>
</form>

View File

@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { GenericTableSearchForm } from './generic-table-search-form';
describe('GenericTableSearchForm', () => {
let component: GenericTableSearchForm;
let fixture: ComponentFixture<GenericTableSearchForm>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [GenericTableSearchForm]
})
.compileComponents();
fixture = TestBed.createComponent(GenericTableSearchForm);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,37 @@
import { Component, EventEmitter, Output } from '@angular/core';
import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { debounceTime, distinctUntilChanged, filter } from 'rxjs/operators';
@Component({
selector: 'app-generic-table-search-form',
imports: [
FormsModule,
ReactiveFormsModule,
],
templateUrl: './generic-table-search-form.html',
styleUrl: './generic-table-search-form.css',
})
export class GenericTableSearchForm {
@Output() searchTermChanged = new EventEmitter<any>();
filterForm: FormGroup;
constructor(private fb: FormBuilder) {
this.filterForm = this.fb.group({
term: ['']
});
this.filterForm.valueChanges.pipe(
debounceTime(300),
distinctUntilChanged()
).subscribe(values => {
const cleanFilter = Object.fromEntries(
Object.entries(values).filter(([_, v]) => v != null && v !== '')
);
this.searchTermChanged.emit(cleanFilter);
});
}
reset() {
this.filterForm.reset();
}
}

View File

@@ -0,0 +1,14 @@
import { DataProvider } from './data-provider.interface';
import { ColumnDefinition } from './column-definition.interface';
import { Subject } from 'rxjs';
export interface GenericTableConfig<T> {
dataProvider: DataProvider<T>;
columns: ColumnDefinition<T>[];
tableCssClass?: string;
rowCssClass?: (item: T) => string;
refresh$: Subject<void>;
filter$: Subject<any>;
page$: Subject<number>;
limit$: Subject<number>;
}

View File

@@ -0,0 +1,92 @@
<div [ngClass]="config.tableCssClass" [class]="'overflow-x-auto'">
<app-generic-table-search-form (searchTermChanged)="searchTermChanged($event)" ></app-generic-table-search-form>
<div>
</div>
@if (data$ | async; as getDataResponse) {
<table class="table w-full table-zebra" [class]="config.tableCssClass ?? ''">
<thead>
<tr>
@for (column of config.columns; track column) {
<th [class]="column.attribute">
@if (column.headerCell) {
@if (typeof column.headerCell === 'boolean') {
{{ column.attribute }}
} @else {
@if (!column?.headerCell?.component) {
@if (typeof column.headerCell.value === 'string') {
<div [innerHTML]="getAsHtml(column.headerCell.value)"></div>
}
} @else {
<ng-container
*ngComponentOutlet="column.headerCell.component!"></ng-container>
}
}
}
</th>
}
</tr>
</thead>
<tbody>
@for (item of getDataResponse?.data?.data; track item) {
<tr [ngClass]="config.rowCssClass ? config.rowCssClass(item) : ''">
@for (column of config.columns; track column) {
<td [class]="getValueStyleClass(column!,column.valueCell!,item) ">
@if (column.valueCell) {
@if (typeof column.valueCell === 'boolean') {
<div [outerHTML]=" resolveValue(item, column) | safeHtml "></div>
} @else {
@if (!column.valueCell.component) {
<div [outerHTML]=" resolveValue(item, column, column.valueCell) | safeHtml "></div>
} @else {
<ng-container
*ngComponentOutlet="column.valueCell.component; inputs: getComponentInputs(item, column,column.valueCell)"></ng-container>
}
}
}
</td>
}
</tr>
}
</tbody>
</table>
@if ((getDataResponse?.data?.meta?.totalPages ?? 1) > 0) {
<div class="flex justify-end mt-4 items-center me-3 ">
Items: {{getDataResponse.data.data.length}}/{{getDataResponse.data.meta.totalItems}}
Page: {{getDataResponse.data.meta.currentPage}}/{{getDataResponse.data.meta.totalPages}}
PageSize:
<select class="select w-auto" #pageSize (change)="onPageSizeChange(pageSize.value)">
<option>10</option>
<option>20</option>
<option>50</option>
</select>
</div>
}
@if ((getDataResponse?.data?.meta?.totalPages ?? 1) > 1) {
<div class="flex justify-center mt-4">
<div class="join">
<button
class="join-item btn"
(click)="changePage(getDataResponse.data.meta.currentPage- 1)"
[disabled]="getDataResponse.data.meta.currentPage === 1">«
</button>
<button class="join-item btn">Page {{ getDataResponse.data.meta.currentPage }} of {{ getDataResponse.data.meta.totalPages }}</button>
<button
class="join-item btn"
(click)="changePage(getDataResponse.data.meta.currentPage + 1)"
[disabled]="getDataResponse.data.meta.currentPage === getDataResponse.data.meta.totalPages">»
</button>
</div>
</div>
}
} @else {
<div class="text-center p-8">
<span class="loading loading-spinner loading-lg"></span>
</div>
}
</div>

View File

@@ -0,0 +1,108 @@
import { Component, inject, Input, OnInit } from '@angular/core';
import { BehaviorSubject, combineLatest, Observable, of } from 'rxjs';
import { ColumnDefinition } from './column-definition.interface';
import { AsyncPipe, NgClass, NgComponentOutlet } from '@angular/common';
import { CellDefinition } from './cell-definition.interface';
import { GetDataResponse } from './data-provider.interface';
import { DomSanitizer } from '@angular/platform-browser';
import { GenericTableConfig } from './generic-table.config';
import { startWith, switchMap } from 'rxjs/operators';
import { GenericTableSearchForm } from './generic-table-search-form/generic-table-search-form';
import { SafeHtmlPipe } from '../../pipes/safe-html-pipe';
@Component({
selector: 'app-generic-table',
templateUrl: './generic-table.html',
imports: [NgClass, AsyncPipe, NgComponentOutlet, GenericTableSearchForm, SafeHtmlPipe],
standalone: true,
})
export class GenericTable<T> implements OnInit {
@Input() config!: GenericTableConfig<T>;
public data$!: Observable<GetDataResponse<T>>;
sanitizer = inject(DomSanitizer);
parser = new DOMParser();
ngOnInit(): void {
this.data$ = combineLatest([
this.config.refresh$,
this.config.filter$.pipe(startWith({})),
this.config.page$.pipe(startWith(1)),
this.config.limit$.pipe(startWith(10)),
]).pipe(
switchMap(([_, filter, page, limit]) => {
const query = { ...filter, page, limit: 10 };
console.info('filter is', filter);
return this.config.dataProvider.getData({
params: {
q: filter.term ?? '',
page,
limit,
},
});
}),
);
}
resolveValue(item: T, column: ColumnDefinition<T>, cell?: CellDefinition<T>): any {
if (cell) {
if (cell.value) {
if (typeof cell.value === 'string') {
return cell.value;
}
if (typeof cell.value === 'function') {
return cell.value(item);
}
}
}
if (column.attribute) {
return item[column.attribute];
}
return '';
}
getComponentInputs(item: T | null, column: ColumnDefinition<T>, cell: CellDefinition<T>): { [key: string]: any } {
if (cell.componentInputs) {
return cell.componentInputs(item);
}
return { item }; // Default input
}
getAsHtml(str: string) {
// return this.sanitizer.bypassSecurityTrustHtml(str);
return this.sanitizer.bypassSecurityTrustHtml(this.parser.parseFromString(str, 'text/html').body.innerHTML);
}
changePage(newPage: number): void {
if (newPage > 0) {
this.config.page$.next(newPage);
}
}
protected searchTermChanged(searchTerm: any) {
console.info('searchterm', searchTerm);
this.config.page$.next(1);
this.config.filter$.next(searchTerm);
}
protected onPageSizeChange(value: any) {
this.config.page$.next(1);
this.config.limit$.next(+value);
}
protected getValueStyleClass(columnDefinition: ColumnDefinition<T>, cellDefinition: CellDefinition<T> | boolean, item: T) {
console.info("co")
if ( (cellDefinition as any).hasOwnProperty("styleClass") ){
const def = (cellDefinition as CellDefinition<T>);
if (def && def.styleClass) {
return (columnDefinition.attribute as string) +" "+def.styleClass({definition: columnDefinition, cellDefinition: def, item});
}
}
return columnDefinition.attribute;
}
}

View File

@@ -0,0 +1,10 @@
<!-- We use a generic container but tell the browser it is a heading -->
<div
role="heading"
[attr.aria-level]="level()"
class="text-3xl font-bold"
[class]="'h' + level()"
>
<ng-content></ng-content>
</div>

View File

@@ -0,0 +1,14 @@
import { Component, input } from '@angular/core';
export type HeadingLevel = 1|2|3|4|5|6;
@Component({
selector: 'app-heading',
imports: [],
templateUrl: './heading.html',
styleUrl: './heading.css',
})
export class Heading {
level = input.required<HeadingLevel>()
}

View File

@@ -0,0 +1 @@
<p>list-view works!</p>

View File

@@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-list-view',
imports: [],
templateUrl: './list-view.html',
styleUrl: './list-view.css',
})
export class ListView {
}

View File

@@ -1 +0,0 @@
<p>main-menu works!</p>

View File

@@ -1,11 +0,0 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-main-menu',
imports: [],
templateUrl: './main-menu.html',
styleUrl: './main-menu.css',
})
export class MainMenu {
}

View File

View File

@@ -0,0 +1,52 @@
<!--
<ul class="menu p-4 w-80 min-h-full bg-base-300 text-base-content">
<li class="text-lg font-bold p-4">My App</li>
<li><a>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
</svg>
Dashboard</a></li>
<li><a>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
Analytics</a></li>
<li><a>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
</svg>
Reports</a></li>
</ul>
-->
<ul class="menu p-4 w-80 min-h-full bg-base-300 text-base-content">
@if(title()){
<li class="text-lg font-bold p-4">{{ title() }}</li>
}
@for (item of menuItems(); track item.menuText) {
@if (isItemVisible(item)) {
<li [ngClass]="getItemStyleClass(item)">
@if (item.children && item.children.length > 0) {
<details [open]="isSubMenuActive(item)">
<summary>
<!-- Using [innerHTML] for SVG. Be cautious with non-trusted sources. -->
<span [innerHTML]="item.svgIcon | safeHtml"></span>
{{ item.menuText }}
</summary>
<!-- Recursive call to the menu component for nested items -->
<app-menu [menuItems]="item.children" [userRoles]="userRoles()"></app-menu>
</details>
} @else {
<a (click)="handleItemClick($event, item)" [class.menu-active]="isItemActive(item)">
<span [innerHTML]="item.svgIcon | safeHtml"></span>
{{ item.menuText }}
</a>
}
</li>
}
}
</ul>

View File

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

View File

@@ -0,0 +1,82 @@
import { Component, inject, input } from '@angular/core';
import { Router, RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { SafeHtmlPipe } from '../../pipes/safe-html-pipe';
export interface MenuItem {
id?: string;
menuText: string;
targetUrl?: string;
onClick?: (event: MouseEvent, item: MenuItem) => void;
roles?: string[];
children?: MenuItem[];
getStyleClass?: (item: MenuItem) => string;
isActive?: (item: MenuItem, router: Router) => boolean;
svgIcon?: string;
}
@Component({
selector: 'app-menu',
imports: [CommonModule, RouterModule, SafeHtmlPipe],
templateUrl: './menu.html',
styleUrl: './menu.css',
})
export class Menu {
title = input<string>();
// Use the input() function instead of the @Input() decorator.
// input.required makes sure that the menuItems array is always passed.
menuItems = input.required<MenuItem[]>();
// You can also provide a default value with input().
// In a real app, this would likely come from an authentication service.
userRoles = input<string[]>(['admin', 'user']);
// Use inject() for dependency injection instead of the constructor.
private router = inject(Router);
isItemVisible(item: MenuItem): boolean {
if (!item.roles || item.roles.length === 0) {
return true;
}
// Access the value of the signal by calling it as a function: this.userRoles()
return item.roles.some(role => this.userRoles().includes(role));
}
handleItemClick(event: MouseEvent, item: MenuItem): void {
if (item.onClick) {
item.onClick(event, item);
} else if (item.targetUrl) {
this.router.navigate([item.targetUrl]);
}
}
getItemStyleClass(item: MenuItem): string {
return item.getStyleClass ? item.getStyleClass(item) : '';
}
isItemActive(item: MenuItem): boolean {
if (item.isActive) {
return item.isActive(item, this.router);
}
if (item.targetUrl) {
// router.isActive is a boolean check, perfect for this use case.
return this.router.isActive(item.targetUrl, {
paths: 'exact',
queryParams: 'exact',
fragment: 'ignored',
matrixParams: 'ignored'
});
}
return false;
}
// Helper function to determine if a dropdown should be open by default
isSubMenuActive(item: MenuItem): boolean {
if (!item.children) {
return false;
}
// Recursively check if any child or grandchild is active
return item.children.some(child => this.isItemActive(child) || this.isSubMenuActive(child));
}
}

View File

@@ -0,0 +1 @@
<app-generic-table [config]="listConfig"></app-generic-table>

View File

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

View File

@@ -0,0 +1,107 @@
import { Component, inject, OnInit } from '@angular/core';
import { Product } from '../../features/products/models/product.model';
import { ColumnDefinition } from '../../components/generic-table/column-definition.interface';
import { ProductDataProvider } from '../product-data-provider.service';
import { GenericTable } from '../../components/generic-table/generic-table';
import { GenericTableConfig } from '../../components/generic-table/generic-table.config';
import { ActionDefinition, GenericActionColumn } from '../../components/generic-action-column/generic-action-column';
import { Router } from '@angular/router';
import { BehaviorSubject } from 'rxjs';
@Component({
selector: 'app-generic-list-example',
imports: [
GenericTable,
],
templateUrl: './generic-list-example.html',
styleUrl: './generic-list-example.css',
})
export class GenericListExample implements OnInit {
router = inject(Router);
listConfig!: GenericTableConfig<Product>;
productDataProvider = inject(ProductDataProvider);
private refresh$ = new BehaviorSubject<void>(undefined);
private filter$ = new BehaviorSubject<any>({});
private page$ = new BehaviorSubject<number>(1);
private limit$ = new BehaviorSubject<number>(10);
ngOnInit(): void {
const actionHandler = (action: ActionDefinition<Product>, item: Product) => {
switch (action.action) {
case 'view':
this.router.navigate(['/products/' + item?.id + '']);
break;
case 'edit':
this.router.navigate(['/products/' + item?.id + '/edit']);
break;
case 'delete':
alert('delete');
break;
}
};
this.listConfig = {
refresh$: this.refresh$,
filter$: this.filter$,
page$: this.page$,
limit$: this.limit$,
dataProvider: this.productDataProvider,
columns: [
{
headerCell: true,
attribute: 'name',
valueCell: true,
},
{
attribute: 'price',
headerCell: {
value: '<h1>MyPrice</h1>',
},
valueCell: {
value: item => {
return item?.price ? Math.floor(item.price) : '-';
},
},
},
{
attribute: 'available',
headerCell: true ,
valueCell: {
value: item => {
return item?.is_available ? 'yes' : 'no';
},
},
},
{
attribute: 'actions',
headerCell: { value: 'Actions' },
valueCell: {
component: GenericActionColumn,
componentInputs: item => {
return {
item: item,
actions: [
{
action: 'view',
handler: actionHandler,
},
{
action: 'edit',
handler: actionHandler,
},
{
action: 'delete',
handler: actionHandler,
},
] as ActionDefinition<Product>[],
};
},
},
},
] as ColumnDefinition<Product>[],
tableCssClass: 'product-list-container',
rowCssClass: undefined,
};
}
}

View File

@@ -0,0 +1,18 @@
import { inject, Injectable } from '@angular/core';
import { DataProvider, GetDataOptions, GetDataResponse } from '../components/generic-table/data-provider.interface';
import { Product } from '../features/products/models/product.model';
import { map, Observable } from 'rxjs';
import { ProductService } from '../features/products/services/product.service';
@Injectable({
providedIn: 'root',
})
export class ProductDataProvider implements DataProvider<Product> {
private productService = inject(ProductService);
getData(options?: GetDataOptions): Observable<GetDataResponse<Product>> {
return this.productService.find({
...(options?.params ?? {})
}).pipe(map((res) => {return {'data': res}}));
}
}

Some files were not shown because too many files have changed in this diff Show More