@team-codeme/crud-forge 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/agents/generator-engineer.md +31 -0
- package/.cursor/agents/keycloak-engineer.md +33 -0
- package/.cursor/agents/qa-engineer.md +32 -0
- package/.cursor/agents/security-reviewer.md +30 -0
- package/.cursor/mcp.json +13 -0
- package/.cursor/rules/crudforge-precautions.mdc +16 -0
- package/.cursor/rules/playwright-browser.mdc +30 -0
- package/.cursor/rules/readme-todo-sync.mdc +13 -0
- package/.env.qa.example +19 -0
- package/.github/workflows/qa-live.yml +32 -0
- package/.github/workflows/qa.yml +27 -0
- package/.vscode/settings.json +32 -0
- package/QA/IAM-PLAN.md +25 -0
- package/QA/IAM-RESULTS.md +39 -0
- package/QA/IAM-TESTCASES.md +36 -0
- package/QA/IAM-TODO.md +7 -0
- package/QA/KEYCLOAK-BOOTSTRAP.md +105 -0
- package/QA/PLAN.md +43 -0
- package/QA/RESULTS.md +59 -0
- package/QA/TESTCASES.md +65 -0
- package/QA/TODO.md +14 -0
- package/QA/pmb-dev/README.md +49 -0
- package/QA/pmb-dev/config/config.yml +152 -0
- package/QA/pmb-dev/gdl/i.gdl +17 -0
- package/README.md +851 -2
- package/Todo.md +207 -0
- package/assets/branding/crudforge-logo.png +0 -0
- package/assets/branding/crudforge-mark.png +0 -0
- package/branding/poster-crudforge.jpg +0 -0
- package/chat/last-chat/Investigating Mock Data Configuration.md +428 -0
- package/cli.js +167 -0
- package/config/default-config.yml +245 -0
- package/docs/performance/README.md +217 -0
- package/docs/performance/after.json +111 -0
- package/docs/performance/before.json +111 -0
- package/docs/quality/README.md +276 -0
- package/e2e/crudforge.e2e.yml +47 -0
- package/e2e/crudforge.field-profile.yml +33 -0
- package/e2e/crudforge.iam-live.yml +124 -0
- package/e2e/crudforge.iam.yml +62 -0
- package/e2e/tests/field-profile.spec.js +152 -0
- package/e2e/tests/generated-crud.spec.js +251 -0
- package/e2e/tests/iam-live.spec.js +149 -0
- package/e2e/tests/iam-pack.spec.js +151 -0
- package/e2e/tests/list-state.spec.js +73 -0
- package/features.csv +27 -0
- package/fuse-starter-pack/branding/crudforge-mark-source.jpg +0 -0
- package/fuse-starter-pack/branding/crudforge-mark-source.png +0 -0
- package/fuse-starter-pack/branding/crudforge-mark.png +0 -0
- package/fuse-starter-pack/branding/crudforge-wordmark-source.jpg +0 -0
- package/fuse-starter-pack/branding/crudforge-wordmark-source.png +0 -0
- package/fuse-starter-pack/branding/crudforge-wordmark.png +0 -0
- package/fuse-starter-pack/fuse-v21.1/Dockerfile +14 -0
- package/fuse-starter-pack/fuse-v21.1/LICENSE.md +6 -0
- package/fuse-starter-pack/fuse-v21.1/README.md +59 -0
- package/fuse-starter-pack/fuse-v21.1/angular.json +113 -0
- package/fuse-starter-pack/fuse-v21.1/eslint.config.ts +150 -0
- package/fuse-starter-pack/fuse-v21.1/nginx.conf +23 -0
- package/fuse-starter-pack/fuse-v21.1/nginx.dev.conf +18 -0
- package/fuse-starter-pack/fuse-v21.1/package-lock.json +11513 -0
- package/fuse-starter-pack/fuse-v21.1/package.json +69 -0
- package/fuse-starter-pack/fuse-v21.1/postcss.config.json +5 -0
- package/fuse-starter-pack/fuse-v21.1/prettier.config.ts +15 -0
- package/fuse-starter-pack/fuse-v21.1/proxy.conf.json +8 -0
- package/fuse-starter-pack/fuse-v21.1/proxy.dev.conf.json +8 -0
- package/fuse-starter-pack/fuse-v21.1/public/favicon.png +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/fonts/geist/Geist-Italic.woff2 +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/fonts/geist/Geist.woff2 +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/fonts/geist/GeistMono-Italic.woff2 +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/fonts/geist/GeistMono.woff2 +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/i18n/en.json +8 -0
- package/fuse-starter-pack/fuse-v21.1/public/i18n/es.json +8 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/flags/ES.svg +79 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/flags/US.svg +14 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/flags/where-to-find-other-flags.txt +5 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/logo/logo-mark.png +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/logo/logo.png +0 -0
- package/fuse-starter-pack/fuse-v21.1/push.sh +27 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.config.server.ts +10 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.config.ts +64 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.routes.server.ts +8 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.routes.ts +39 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.ts +22 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/icons/index.ts +1 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/icons/lucide.ts +1 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/icons/provider.ts +23 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/local-storage/index.ts +2 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/local-storage/local-storage.ts +109 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/local-storage/provider.ts +15 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/media/index.ts +2 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/media/media.ts +64 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/media/provider.ts +15 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/index.ts +3 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/models/theming.ts +13 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/palette.ts +209 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/provider.ts +24 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/theming.ts +129 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/transloco/transloco-http-loader.ts +12 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/data/navigation.ts +176 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/layout.ts +77 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/language-switcher.ts +91 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/navigation.ts +238 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/notifications.ts +252 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/scheme-switcher.ts +58 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/sidebar.ts +31 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/user.ts +132 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/data/academy.ts +753 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/data/model.ts +27 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/features/course.ts +318 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/features/courses.ts +228 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/routes.ts +14 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/data/contacts.ts +4372 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/data/model.ts +34 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/features/contact.ts +239 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/features/contacts.ts +185 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/routes.ts +16 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/data/file-manager.ts +261 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/data/model.ts +12 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/features/file-manager.ts +131 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/routes.ts +15 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/ui/list.ts +164 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/features/faq.ts +288 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/features/guide.ts +134 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/features/home.ts +219 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/features/support.ts +161 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/routes.ts +33 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/data/model.ts +18 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/data/notes.ts +324 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/features/note.ts +152 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/features/notes.ts +118 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/routes.ts +16 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/data/model.ts +17 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/data/tasks.ts +562 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/features/task.ts +195 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/features/tasks.ts +271 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/routes.ts +16 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/data/analytics.ts +1620 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/data/finance.ts +1065 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/data/project.ts +376 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/features/analytics/analytics.ts +1096 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/features/finance/finance.ts +658 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/features/project/budget-table.ts +188 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/features/project/project.ts +565 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/routes.ts +23 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/features/changelog/changelog.ts +932 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/features/getting-started/building.ts +33 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/features/getting-started/development.ts +42 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/features/getting-started/installation.ts +47 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/layout.ts +9 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/routes.ts +45 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/error/features/error-page.ts +70 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/error/routes.ts +21 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/notifications/features/notifications.ts +262 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/notifications/routes.ts +10 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/account.ts +238 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/notifications.ts +134 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/plan-and-billing.ts +238 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/security.ts +211 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/team.ts +188 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/layout.ts +109 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/routes.ts +37 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/welcome/welcome.component.ts +22 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/routes.ts +95 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/forgot-password/forgot-password.html +54 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/forgot-password/forgot-password.ts +51 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/reset-password/reset-password.html +82 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/reset-password/reset-password.ts +69 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/sign-in/sign-in.html +132 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/sign-in/sign-in.ts +54 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/sign-up/sign-up.html +183 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/sign-up/sign-up.ts +56 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/layout.ts +9 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/routes.ts +34 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/coming-soon/features/coming-soon.ts +156 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/coming-soon/layout.ts +9 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/coming-soon/routes.ts +16 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/website/layout/layout.ts +9 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/website/modules/home/features/home.ts +23 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/website/modules/home/routes.ts +10 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/website/routes.ts +30 -0
- package/fuse-starter-pack/fuse-v21.1/src/environments/environment.mock.ts +5 -0
- package/fuse-starter-pack/fuse-v21.1/src/environments/environment.prod.ts +5 -0
- package/fuse-starter-pack/fuse-v21.1/src/environments/environment.ts +5 -0
- package/fuse-starter-pack/fuse-v21.1/src/index.html +66 -0
- package/fuse-starter-pack/fuse-v21.1/src/main.server.ts +11 -0
- package/fuse-starter-pack/fuse-v21.1/src/main.ts +5 -0
- package/fuse-starter-pack/fuse-v21.1/src/server.ts +70 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/base/base.css +63 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/base/typography.css +54 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/components/a.css +18 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/components/input.css +22 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/components/kbd.css +55 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/components/material.css +1149 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/styles.css +31 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/tailwind/theme.css +147 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/tailwind/utilities.css +563 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/tailwind/variants.css +4 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/third-party/lucide-icons.css +12 -0
- package/fuse-starter-pack/fuse-v21.1/tsconfig.app.json +16 -0
- package/fuse-starter-pack/fuse-v21.1/tsconfig.json +37 -0
- package/fuse-starter-pack/fuse-v21.1/tsconfig.spec.json +10 -0
- package/generator/README.md +12 -0
- package/generator/issues/.gitkeep +0 -0
- package/package.json +56 -4
- package/playwright.config.js +29 -0
- package/playwright.field-profile.config.js +6 -0
- package/playwright.iam-live.config.js +31 -0
- package/playwright.iam.config.js +29 -0
- package/playwright.list-state.config.js +6 -0
- package/playwright.performance.config.js +1 -0
- package/run-config-tests.sh +5 -0
- package/scripts/e2e-paths.js +89 -0
- package/scripts/e2e-prepare-field-profile.js +17 -0
- package/scripts/e2e-prepare-iam-live.js +135 -0
- package/scripts/e2e-prepare-iam.js +65 -0
- package/scripts/e2e-prepare.js +72 -0
- package/scripts/e2e-serve-iam-live.js +28 -0
- package/scripts/e2e-serve-iam.js +28 -0
- package/scripts/e2e-serve.js +28 -0
- package/scripts/performance/generate.js +17 -0
- package/scripts/performance/measure.js +55 -0
- package/scripts/postinstall.js +9 -0
- package/scripts/prepare-quality-apps.js +34 -0
- package/scripts/run-config-tests.js +63 -0
- package/src/assets/logo-with-lable.jpeg +0 -0
- package/src/assets/logo.jpeg +0 -0
- package/src/commands/bootstrap.js +92 -0
- package/src/commands/doctor.js +403 -0
- package/src/commands/generate.js +301 -0
- package/src/commands/init-config.js +310 -0
- package/src/commands/keycloak-options.js +182 -0
- package/src/commands/validate.js +52 -0
- package/src/config/auth-config.js +183 -0
- package/src/config/default-values.js +235 -0
- package/src/config/env-refs.js +71 -0
- package/src/config/field-preferences.js +99 -0
- package/src/config/input-sources.js +104 -0
- package/src/config/load-config.js +166 -0
- package/src/config/proxy-routes.js +44 -0
- package/src/generator/access-control-tools.js +334 -0
- package/src/generator/ai-docs.js +691 -0
- package/src/generator/application-tests.js +252 -0
- package/src/generator/auth-pack.js +965 -0
- package/src/generator/embed-config.js +431 -0
- package/src/generator/entity-layout.js +30 -0
- package/src/generator/fuse-build.js +57 -0
- package/src/generator/fuse-runtime.js +344 -0
- package/src/generator/generated-banner.js +137 -0
- package/src/generator/index.js +874 -0
- package/src/generator/project-output.js +126 -0
- package/src/generator/team-pack.js +220 -0
- package/src/index.js +68 -0
- package/src/parser/gdl-parser.js +169 -0
- package/src/parser/jdl-parser.js +171 -0
- package/src/presets/pmb-test.js +139 -0
- package/src/presets/static-source.js +73 -0
- package/src/presets/store.js +96 -0
- package/src/provision/admin-service.js +148 -0
- package/src/provision/bootstrap.js +147 -0
- package/src/provision/http.js +123 -0
- package/src/provision/keycloak-admin-rest.js +335 -0
- package/src/provision/state.js +51 -0
- package/src/provision/token.js +52 -0
- package/src/templates/angular/auth/access-control.service.ts.ejs +179 -0
- package/src/templates/angular/auth/access-ctrl.pipe.ts.ejs +20 -0
- package/src/templates/angular/auth/auth.guard.ts.ejs +27 -0
- package/src/templates/angular/auth/auth.interceptor.ts.ejs +53 -0
- package/src/templates/angular/auth/auth.service.ts.ejs +594 -0
- package/src/templates/angular/auth/auth.utils.ts.ejs +28 -0
- package/src/templates/angular/auth/current-user.ts.ejs +24 -0
- package/src/templates/angular/auth/disabled-account-overlay.component.css.ejs +95 -0
- package/src/templates/angular/auth/disabled-account-overlay.component.html.ejs +33 -0
- package/src/templates/angular/auth/disabled-account-overlay.component.ts.ejs +23 -0
- package/src/templates/angular/auth/fuse-account.ts.ejs +234 -0
- package/src/templates/angular/auth/fuse-user.ts.ejs +264 -0
- package/src/templates/angular/auth/has-permission.directive.ts.ejs +51 -0
- package/src/templates/angular/auth/index.ts.ejs +24 -0
- package/src/templates/angular/auth/keycloak-admin.service.ts.ejs +670 -0
- package/src/templates/angular/auth/landing.guard.ts.ejs +61 -0
- package/src/templates/angular/auth/no-auth.guard.ts.ejs +19 -0
- package/src/templates/angular/auth/permission-attribute.util.ts.ejs +182 -0
- package/src/templates/angular/auth/sign-in.ts.ejs +60 -0
- package/src/templates/angular/entity/_entity_.model.ts.ejs +64 -0
- package/src/templates/angular/entity/_entity_.routes.ts.ejs +9 -0
- package/src/templates/angular/entity/components/forms/form/_entity_-form.component.html.ejs +168 -0
- package/src/templates/angular/entity/components/forms/form/_entity_-form.component.ts.ejs +175 -0
- package/src/templates/angular/entity/components/forms/form-page/_entity_-form-page.component.html.ejs +10 -0
- package/src/templates/angular/entity/components/forms/form-page/_entity_-form-page.component.ts.ejs +86 -0
- package/src/templates/angular/entity/components/forms/update/_entity_-form.service.ts.ejs +136 -0
- package/src/templates/angular/entity/components/interaction/actions/_entity_-actions.component.html.ejs +68 -0
- package/src/templates/angular/entity/components/interaction/actions/_entity_-actions.component.ts.ejs +69 -0
- package/src/templates/angular/entity/components/interaction/filter/_entity_-filter.component.html.ejs +111 -0
- package/src/templates/angular/entity/components/interaction/filter/_entity_-filter.component.ts.ejs +102 -0
- package/src/templates/angular/entity/components/presentation/card/_entity_-card.component.css.ejs +33 -0
- package/src/templates/angular/entity/components/presentation/card/_entity_-card.component.html.ejs +29 -0
- package/src/templates/angular/entity/components/presentation/card/_entity_-card.component.ts.ejs +93 -0
- package/src/templates/angular/entity/components/presentation/detail/_entity_-detail.component.css.ejs +54 -0
- package/src/templates/angular/entity/components/presentation/detail/_entity_-detail.component.html.ejs +58 -0
- package/src/templates/angular/entity/components/presentation/detail/_entity_-detail.component.ts.ejs +47 -0
- package/src/templates/angular/entity/components/presentation/list/_entity_-list.component.html.ejs +419 -0
- package/src/templates/angular/entity/components/presentation/list/_entity_-list.component.scss.ejs +48 -0
- package/src/templates/angular/entity/components/presentation/list/_entity_-list.component.ts.ejs +592 -0
- package/src/templates/angular/entity/service/_entity_.service.ts.ejs +153 -0
- package/src/templates/angular/entity/settings/_entity_.settings.ts.ejs +49 -0
- package/src/templates/angular/enums/_enum_.model.ts.ejs +11 -0
- package/src/templates/angular/iam/change-password.component.html.ejs +39 -0
- package/src/templates/angular/iam/change-password.component.ts.ejs +44 -0
- package/src/templates/angular/iam/no-access.component.ts.ejs +17 -0
- package/src/templates/angular/iam/role-list.component.html.ejs +331 -0
- package/src/templates/angular/iam/role-list.component.scss.ejs +107 -0
- package/src/templates/angular/iam/role-list.component.ts.ejs +597 -0
- package/src/templates/angular/iam/role-management/role-header.component.html.ejs +51 -0
- package/src/templates/angular/iam/role-management/role-header.component.ts.ejs +45 -0
- package/src/templates/angular/iam/role-management/role-inheritance.component.html.ejs +15 -0
- package/src/templates/angular/iam/role-management/role-inheritance.component.ts.ejs +19 -0
- package/src/templates/angular/iam/role-management/role-permissions-panel.component.css.ejs +24 -0
- package/src/templates/angular/iam/role-management/role-permissions-panel.component.html.ejs +108 -0
- package/src/templates/angular/iam/role-management/role-permissions-panel.component.ts.ejs +122 -0
- package/src/templates/angular/iam/role-management/role-users.component.html.ejs +104 -0
- package/src/templates/angular/iam/role-management/role-users.component.ts.ejs +53 -0
- package/src/templates/angular/iam/role-management/user-select-dialog.component.html.ejs +113 -0
- package/src/templates/angular/iam/role-management/user-select-dialog.component.ts.ejs +157 -0
- package/src/templates/angular/iam/role-permission-matrix.component.html.ejs +355 -0
- package/src/templates/angular/iam/role-permission-matrix.component.scss.ejs +217 -0
- package/src/templates/angular/iam/role-permission-matrix.component.ts.ejs +800 -0
- package/src/templates/angular/iam/screen-catalog.ts.ejs +147 -0
- package/src/templates/angular/iam/shared/confirm-dialog.component.ts.ejs +83 -0
- package/src/templates/angular/iam/shared/matrix-hierarchy.util.ts.ejs +196 -0
- package/src/templates/angular/iam/shared/permission-matrix-sound.ts.ejs +59 -0
- package/src/templates/angular/iam/shared/role-display.util.ts.ejs +43 -0
- package/src/templates/angular/iam/shared/role-permission-skeleton.component.ts.ejs +54 -0
- package/src/templates/angular/iam/shared/screen-matrix.util.ts.ejs +554 -0
- package/src/templates/angular/iam/shared/screen-navigation-map.ts.ejs +187 -0
- package/src/templates/angular/iam/shared/screen-navigation.registry.ts.ejs +64 -0
- package/src/templates/angular/iam/shared/text-highlight.pipe.ts.ejs +39 -0
- package/src/templates/angular/iam/user-access-matrix.component.html.ejs +212 -0
- package/src/templates/angular/iam/user-access-matrix.component.scss.ejs +34 -0
- package/src/templates/angular/iam/user-access-matrix.component.ts.ejs +239 -0
- package/src/templates/angular/iam/user-detail.component.html.ejs +143 -0
- package/src/templates/angular/iam/user-detail.component.ts.ejs +108 -0
- package/src/templates/angular/iam/user-form.component.html.ejs +63 -0
- package/src/templates/angular/iam/user-form.component.ts.ejs +100 -0
- package/src/templates/angular/iam/user-list.component.html.ejs +369 -0
- package/src/templates/angular/iam/user-list.component.scss.ejs +242 -0
- package/src/templates/angular/iam/user-list.component.ts.ejs +446 -0
- package/src/templates/angular/iam/user-management.routes.ts.ejs +47 -0
- package/src/templates/angular/iam/user-permission-matrix.component.html.ejs +231 -0
- package/src/templates/angular/iam/user-permission-matrix.component.scss.ejs +216 -0
- package/src/templates/angular/iam/user-permission-matrix.component.ts.ejs +516 -0
- package/src/templates/angular/shared/base/audit-user-name.pipe.ts.ejs +69 -0
- package/src/templates/angular/shared/base/base-filter.component.ts.ejs +245 -0
- package/src/templates/angular/shared/base/base-form.component.ts.ejs +109 -0
- package/src/templates/angular/shared/base/base-list.component.ts.ejs +507 -0
- package/src/templates/angular/shared/base/filter-types.ts.ejs +55 -0
- package/src/templates/angular/shared/base/input-format.directive.ts.ejs +47 -0
- package/src/templates/angular/shared/base/input-format.ts.ejs +15 -0
- package/src/templates/angular/shared/confirm-with-input-dialog.component.ts.ejs +91 -0
- package/src/templates/angular/shared/confirmation-dialog.component.ts.ejs +80 -0
- package/src/templates/angular/shared/list-styles.css.ejs +103 -0
- package/src/templates/angular/shared/loading-overlay.component.ts.ejs +24 -0
- package/src/templates/angular/shared/resizable.directive.ts.ejs +115 -0
- package/src/templates/angular/shared/snackbar-styles.css.ejs +11 -0
- package/src/templates/fuse-packs/access-control-tools/access-control-sync.js +819 -0
- package/src/templates/fuse-packs/access-control-tools/build-rename-map.js +67 -0
- package/src/templates/fuse-packs/access-control-tools/inject-qa-ids.js +14 -0
- package/src/templates/fuse-packs/access-control-tools/lib/hierarchy-scanner.js +628 -0
- package/src/templates/fuse-packs/access-control-tools/lib/hierarchy-scanner.test.js +323 -0
- package/src/templates/fuse-packs/access-control-tools/lib/html-scanner.js +362 -0
- package/src/templates/fuse-packs/access-control-tools/lib/id-rules.duplicate.test.js +136 -0
- package/src/templates/fuse-packs/access-control-tools/lib/id-rules.js +1095 -0
- package/src/templates/fuse-packs/access-control-tools/lib/ts-component-index.js +482 -0
- package/src/templates/fuse-packs/access-control-tools/output/.gitkeep +0 -0
- package/src/templates/fuse-packs/access-control-tools/run.sh +223 -0
- package/src/templates/fuse-packs/access-control-tools/scan-access-control.js +14 -0
- package/src/templates/fuse-packs/iam-assets/sound/apple-play.mp3 +0 -0
- package/src/templates/fuse-packs/iam-assets/sound/remove.mp3 +0 -0
- package/src/templates/generator/README.md +12 -0
- package/src/templates/testing/ci.cjs +45 -0
- package/src/templates/testing/mock.cjs +149 -0
- package/src/templates/testing/playwright.config.cjs +25 -0
- package/src/templates/testing/serve.cjs +22 -0
- package/src/templates/testing/smoke.spec.cjs +180 -0
- package/src/utils/branding.js +39 -0
- package/src/utils/colors.js +18 -0
- package/src/utils/diff.js +109 -0
- package/src/utils/merger.js +115 -0
- package/src/validator/backend-diagnostics.js +30 -0
- package/src/validator/blueprint-validator.js +276 -0
- package/src/validator/diagnostics.js +608 -0
- package/src/validator/pattern.js +28 -0
- package/test/auth-interceptor.js +84 -0
- package/test/auth-provision-checks.js +297 -0
- package/test/field-preferences.js +145 -0
- package/test/fixtures/field-profile.gdl +7 -0
- package/test/fixtures/mock.jdl +17 -0
- package/test/fixtures/mock.png +0 -0
- package/test/fixtures/performance/config.yml +33 -0
- package/test/fixtures/performance/large.gdl +199 -0
- package/test/fixtures/performance/small.gdl +7 -0
- package/test/fixtures/quality/custom.yml +22 -0
- package/test/fixtures/quality/go-duck.yml +22 -0
- package/test/fixtures/quality/jhipster.yml +30 -0
- package/test/fixtures/quality/representative.gdl +14 -0
- package/test/list-state.js +138 -0
- package/test/micro-functions-layout.js +95 -0
- package/test/performance-generation.js +32 -0
- package/test/pmb-preset.js +127 -0
- package/test/project-workflow.js +111 -0
- package/test/quality-features.js +250 -0
- package/test/verify-commands.js +83 -0
- package/test/verify.js +959 -0
- package/test-files/GDL/example.gdl +15 -0
- package/test-files/JDL/example.jdl +15 -0
- package/test-files/config/crudforge.config.yml +127 -0
- package/test-run.sh +272 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.cforge-disabled-backdrop {
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset: 0;
|
|
4
|
+
z-index: 10000;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
background: rgba(15, 23, 42, 0.72);
|
|
9
|
+
backdrop-filter: blur(2px);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.cforge-disabled-modal {
|
|
13
|
+
width: min(92vw, 26rem);
|
|
14
|
+
border-radius: 1rem;
|
|
15
|
+
background: #0f172a;
|
|
16
|
+
color: #e2e8f0;
|
|
17
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
|
|
18
|
+
padding: 1.5rem 1.75rem 1.75rem;
|
|
19
|
+
text-align: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.cforge-disabled-title {
|
|
23
|
+
font-size: 0.75rem;
|
|
24
|
+
letter-spacing: 0.12em;
|
|
25
|
+
text-transform: uppercase;
|
|
26
|
+
color: #94a3b8;
|
|
27
|
+
margin-bottom: 1rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.cforge-disabled-headline {
|
|
31
|
+
font-size: 1.5rem;
|
|
32
|
+
font-weight: 700;
|
|
33
|
+
margin-bottom: 0.5rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.cforge-disabled-message {
|
|
37
|
+
font-size: 0.95rem;
|
|
38
|
+
color: #cbd5e1;
|
|
39
|
+
margin-bottom: 1.5rem;
|
|
40
|
+
line-height: 1.45;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.cforge-disabled-timer {
|
|
44
|
+
position: relative;
|
|
45
|
+
width: 9rem;
|
|
46
|
+
height: 9rem;
|
|
47
|
+
margin: 0 auto 1rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.cforge-disabled-svg {
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
transform: rotate(-90deg);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.cforge-disabled-track {
|
|
57
|
+
fill: none;
|
|
58
|
+
stroke: #1e293b;
|
|
59
|
+
stroke-width: 10;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.cforge-disabled-progress {
|
|
63
|
+
fill: none;
|
|
64
|
+
stroke: #f97316;
|
|
65
|
+
stroke-width: 10;
|
|
66
|
+
stroke-linecap: round;
|
|
67
|
+
transition: stroke-dashoffset 0.35s linear;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.cforge-disabled-core {
|
|
71
|
+
position: absolute;
|
|
72
|
+
inset: 0;
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.cforge-disabled-value {
|
|
80
|
+
font-size: 2rem;
|
|
81
|
+
font-weight: 700;
|
|
82
|
+
line-height: 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.cforge-disabled-unit {
|
|
86
|
+
font-size: 0.75rem;
|
|
87
|
+
color: #94a3b8;
|
|
88
|
+
text-transform: uppercase;
|
|
89
|
+
letter-spacing: 0.08em;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cforge-disabled-countdown {
|
|
93
|
+
font-size: 0.875rem;
|
|
94
|
+
color: #94a3b8;
|
|
95
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<div
|
|
2
|
+
class="cforge-disabled-backdrop"
|
|
3
|
+
role="alertdialog"
|
|
4
|
+
aria-live="assertive"
|
|
5
|
+
aria-label="Account access blocked"
|
|
6
|
+
tabindex="0"
|
|
7
|
+
>
|
|
8
|
+
<div class="cforge-disabled-modal">
|
|
9
|
+
<div class="cforge-disabled-title">System Status</div>
|
|
10
|
+
<div class="cforge-disabled-headline">Please wait...</div>
|
|
11
|
+
<div class="cforge-disabled-message">{{ message }}</div>
|
|
12
|
+
|
|
13
|
+
<div class="cforge-disabled-timer">
|
|
14
|
+
<svg class="cforge-disabled-svg" viewBox="0 0 200 200" aria-hidden="true">
|
|
15
|
+
<circle class="cforge-disabled-track" cx="100" cy="100" [attr.r]="ringRadius"></circle>
|
|
16
|
+
<circle
|
|
17
|
+
class="cforge-disabled-progress"
|
|
18
|
+
cx="100"
|
|
19
|
+
cy="100"
|
|
20
|
+
[attr.r]="ringRadius"
|
|
21
|
+
[attr.stroke-dasharray]="ringCircumference"
|
|
22
|
+
[attr.stroke-dashoffset]="timerDashOffset"
|
|
23
|
+
></circle>
|
|
24
|
+
</svg>
|
|
25
|
+
<div class="cforge-disabled-core">
|
|
26
|
+
<div class="cforge-disabled-value">{{ countdown }}</div>
|
|
27
|
+
<div class="cforge-disabled-unit">sec</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="cforge-disabled-countdown">Signing out in {{ countdown }}s</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'cforge-disabled-account-overlay',
|
|
5
|
+
standalone: true,
|
|
6
|
+
templateUrl: './disabled-account-overlay.component.html',
|
|
7
|
+
styleUrl: './disabled-account-overlay.component.css',
|
|
8
|
+
})
|
|
9
|
+
export class DisabledAccountOverlayComponent {
|
|
10
|
+
@Input({ required: true }) countdown = 0;
|
|
11
|
+
@Input() totalCountdownSeconds = 20;
|
|
12
|
+
@Input() message = 'Your account has been disabled. Please contact your administrator.';
|
|
13
|
+
|
|
14
|
+
readonly ringRadius = 76;
|
|
15
|
+
readonly ringCircumference = 2 * Math.PI * this.ringRadius;
|
|
16
|
+
|
|
17
|
+
get timerDashOffset(): number {
|
|
18
|
+
const safeTotal = Math.max(this.totalCountdownSeconds, 1);
|
|
19
|
+
const clamped = Math.max(0, Math.min(this.countdown, safeTotal));
|
|
20
|
+
const progress = clamped / safeTotal;
|
|
21
|
+
return this.ringCircumference * (1 - progress);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { AuthService } from '@/app/core/auth';
|
|
2
|
+
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
|
3
|
+
import { Component, inject, linkedSignal } from '@angular/core';
|
|
4
|
+
import { email, form, FormField, required } from '@angular/forms/signals';
|
|
5
|
+
import { MatButton } from '@angular/material/button';
|
|
6
|
+
import { MatOption } from '@angular/material/core';
|
|
7
|
+
import { MatDivider } from '@angular/material/divider';
|
|
8
|
+
import { MatIcon } from '@angular/material/icon';
|
|
9
|
+
import {
|
|
10
|
+
MatError,
|
|
11
|
+
MatFormField,
|
|
12
|
+
MatHint,
|
|
13
|
+
MatInput,
|
|
14
|
+
MatLabel,
|
|
15
|
+
MatPrefix,
|
|
16
|
+
} from '@angular/material/input';
|
|
17
|
+
import { MatSelect } from '@angular/material/select';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'account-settings',
|
|
21
|
+
imports: [
|
|
22
|
+
CdkTextareaAutosize,
|
|
23
|
+
MatButton,
|
|
24
|
+
MatFormField,
|
|
25
|
+
MatIcon,
|
|
26
|
+
MatInput,
|
|
27
|
+
MatLabel,
|
|
28
|
+
MatOption,
|
|
29
|
+
MatPrefix,
|
|
30
|
+
MatSelect,
|
|
31
|
+
FormField,
|
|
32
|
+
MatDivider,
|
|
33
|
+
MatHint,
|
|
34
|
+
MatError,
|
|
35
|
+
],
|
|
36
|
+
template: `
|
|
37
|
+
<form
|
|
38
|
+
class="grid grid-cols-1 gap-6 md:grid-cols-4 md:gap-8"
|
|
39
|
+
(submit)="save($event)"
|
|
40
|
+
>
|
|
41
|
+
<!-- Profile section -->
|
|
42
|
+
<div class="col-span-full">
|
|
43
|
+
<div class="text-lg font-medium">Profile</div>
|
|
44
|
+
<div class="text-neutral-500">
|
|
45
|
+
Following information is publicly displayed, be careful!
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<!-- Name -->
|
|
50
|
+
<mat-form-field class="col-span-full md:col-span-2">
|
|
51
|
+
<mat-label>Name</mat-label>
|
|
52
|
+
<input
|
|
53
|
+
matInput
|
|
54
|
+
[formField]="accountSettingsForm.name"
|
|
55
|
+
/>
|
|
56
|
+
<mat-icon
|
|
57
|
+
svgIcon="user"
|
|
58
|
+
matPrefix
|
|
59
|
+
></mat-icon>
|
|
60
|
+
<mat-error>
|
|
61
|
+
@for (error of accountSettingsForm.name().errors(); track error) {
|
|
62
|
+
{{ error.message }}
|
|
63
|
+
}
|
|
64
|
+
</mat-error>
|
|
65
|
+
</mat-form-field>
|
|
66
|
+
|
|
67
|
+
<!-- Username -->
|
|
68
|
+
<mat-form-field class="col-span-full md:col-span-2 md:col-start-1">
|
|
69
|
+
<mat-label>Username</mat-label>
|
|
70
|
+
<input
|
|
71
|
+
matInput
|
|
72
|
+
[formField]="accountSettingsForm.username"
|
|
73
|
+
/>
|
|
74
|
+
<div
|
|
75
|
+
class="text-neutral-500"
|
|
76
|
+
matPrefix
|
|
77
|
+
>
|
|
78
|
+
fusetheme.com/
|
|
79
|
+
</div>
|
|
80
|
+
</mat-form-field>
|
|
81
|
+
|
|
82
|
+
<!-- Title -->
|
|
83
|
+
<mat-form-field class="col-span-full md:col-span-2 md:col-start-1">
|
|
84
|
+
<mat-label>Title</mat-label>
|
|
85
|
+
<input
|
|
86
|
+
matInput
|
|
87
|
+
[formField]="accountSettingsForm.title"
|
|
88
|
+
/>
|
|
89
|
+
<mat-icon
|
|
90
|
+
svgIcon="briefcase-business"
|
|
91
|
+
matPrefix
|
|
92
|
+
></mat-icon>
|
|
93
|
+
</mat-form-field>
|
|
94
|
+
|
|
95
|
+
<!-- Company -->
|
|
96
|
+
<mat-form-field class="col-span-full md:col-span-2">
|
|
97
|
+
<mat-label>Company</mat-label>
|
|
98
|
+
<input
|
|
99
|
+
matInput
|
|
100
|
+
[formField]="accountSettingsForm.company"
|
|
101
|
+
/>
|
|
102
|
+
<mat-icon
|
|
103
|
+
svgIcon="building-2"
|
|
104
|
+
matPrefix
|
|
105
|
+
></mat-icon>
|
|
106
|
+
</mat-form-field>
|
|
107
|
+
|
|
108
|
+
<!-- About -->
|
|
109
|
+
<mat-form-field class="col-span-full md:col-span-3">
|
|
110
|
+
<mat-label>About</mat-label>
|
|
111
|
+
<textarea
|
|
112
|
+
matInput
|
|
113
|
+
cdkTextareaAutosize
|
|
114
|
+
[formField]="accountSettingsForm.about"
|
|
115
|
+
[cdkAutosizeMinRows]="4"
|
|
116
|
+
[cdkAutosizeMaxRows]="6"
|
|
117
|
+
></textarea>
|
|
118
|
+
<mat-hint>
|
|
119
|
+
Brief description for your profile. Basic HTML and Emoji are allowed.
|
|
120
|
+
</mat-hint>
|
|
121
|
+
</mat-form-field>
|
|
122
|
+
|
|
123
|
+
<!-- Divider -->
|
|
124
|
+
<mat-divider class="col-span-full my-4" />
|
|
125
|
+
|
|
126
|
+
<!-- Personal information section -->
|
|
127
|
+
<div class="col-span-full">
|
|
128
|
+
<div class="text-lg font-medium">Personal Information</div>
|
|
129
|
+
<div class="text-neutral-500">
|
|
130
|
+
Communication details in case we want to connect with you. These will
|
|
131
|
+
be kept private.
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<!-- Email -->
|
|
136
|
+
<mat-form-field class="col-span-full md:col-span-2">
|
|
137
|
+
<mat-label>Email</mat-label>
|
|
138
|
+
<input
|
|
139
|
+
matInput
|
|
140
|
+
[formField]="accountSettingsForm.email"
|
|
141
|
+
/>
|
|
142
|
+
<mat-icon
|
|
143
|
+
svgIcon="mail"
|
|
144
|
+
matPrefix
|
|
145
|
+
></mat-icon>
|
|
146
|
+
<mat-error>
|
|
147
|
+
@for (error of accountSettingsForm.email().errors(); track error) {
|
|
148
|
+
{{ error.message }}
|
|
149
|
+
}
|
|
150
|
+
</mat-error>
|
|
151
|
+
</mat-form-field>
|
|
152
|
+
|
|
153
|
+
<!-- Phone -->
|
|
154
|
+
<mat-form-field class="col-span-full md:col-span-2">
|
|
155
|
+
<mat-label>Phone</mat-label>
|
|
156
|
+
<input
|
|
157
|
+
matInput
|
|
158
|
+
[formField]="accountSettingsForm.phone"
|
|
159
|
+
/>
|
|
160
|
+
<mat-icon
|
|
161
|
+
svgIcon="phone"
|
|
162
|
+
matPrefix
|
|
163
|
+
></mat-icon>
|
|
164
|
+
</mat-form-field>
|
|
165
|
+
|
|
166
|
+
<!-- Country -->
|
|
167
|
+
<mat-form-field class="col-span-full md:col-span-2">
|
|
168
|
+
<mat-label>Country</mat-label>
|
|
169
|
+
<mat-select [formField]="accountSettingsForm.country">
|
|
170
|
+
<mat-option [value]="'usa'">United States</mat-option>
|
|
171
|
+
<mat-option [value]="'canada'">Canada</mat-option>
|
|
172
|
+
<mat-option [value]="'mexico'">Mexico</mat-option>
|
|
173
|
+
<mat-option [value]="'france'">France</mat-option>
|
|
174
|
+
<mat-option [value]="'germany'">Germany</mat-option>
|
|
175
|
+
<mat-option [value]="'italy'">Italy</mat-option>
|
|
176
|
+
</mat-select>
|
|
177
|
+
<mat-icon
|
|
178
|
+
svgIcon="map-pin"
|
|
179
|
+
matPrefix
|
|
180
|
+
></mat-icon>
|
|
181
|
+
</mat-form-field>
|
|
182
|
+
|
|
183
|
+
<!-- Language -->
|
|
184
|
+
<mat-form-field class="col-span-full md:col-span-2">
|
|
185
|
+
<mat-label>Language</mat-label>
|
|
186
|
+
<mat-select [formField]="accountSettingsForm.language">
|
|
187
|
+
<mat-option [value]="'english'">English</mat-option>
|
|
188
|
+
<mat-option [value]="'french'">French</mat-option>
|
|
189
|
+
<mat-option [value]="'spanish'">Spanish</mat-option>
|
|
190
|
+
<mat-option [value]="'german'">German</mat-option>
|
|
191
|
+
<mat-option [value]="'italian'">Italian</mat-option>
|
|
192
|
+
</mat-select>
|
|
193
|
+
<mat-icon
|
|
194
|
+
svgIcon="globe"
|
|
195
|
+
matPrefix
|
|
196
|
+
></mat-icon>
|
|
197
|
+
</mat-form-field>
|
|
198
|
+
|
|
199
|
+
<!-- Divider -->
|
|
200
|
+
<mat-divider class="col-span-full my-4" />
|
|
201
|
+
|
|
202
|
+
<!-- Actions -->
|
|
203
|
+
<div class="col-span-full flex items-center justify-end gap-x-3">
|
|
204
|
+
<button
|
|
205
|
+
type="button"
|
|
206
|
+
matButton="outlined"
|
|
207
|
+
>
|
|
208
|
+
Cancel
|
|
209
|
+
</button>
|
|
210
|
+
<button matButton="filled">Save</button>
|
|
211
|
+
</div>
|
|
212
|
+
</form>
|
|
213
|
+
`,
|
|
214
|
+
})
|
|
215
|
+
export default class AccountSettings {
|
|
216
|
+
// State
|
|
217
|
+
private readonly authService = inject(AuthService);
|
|
218
|
+
protected accountSettingsModel = linkedSignal(() => ({
|
|
219
|
+
name: this.authService.profile()?.name || '',
|
|
220
|
+
username: this.authService.currentUser()?.preferred_username || '',
|
|
221
|
+
email: this.authService.profile()?.email || '',
|
|
222
|
+
title: '', company: '', about: '', phone: '', country: '', language: '',
|
|
223
|
+
}));
|
|
224
|
+
protected accountSettingsForm = form(this.accountSettingsModel, (schema) => {
|
|
225
|
+
required(schema.name, { message: 'Name is required' });
|
|
226
|
+
|
|
227
|
+
required(schema.email, { message: 'Email is required' });
|
|
228
|
+
email(schema.email, { message: 'Invalid email address' });
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
save(event: Event) {
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { Component, OnDestroy, computed, inject, signal } from '@angular/core';
|
|
2
|
+
import { MatIcon } from '@angular/material/icon';
|
|
3
|
+
import { AccessControlService, AuthService } from '@/app/core/auth';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'user',
|
|
7
|
+
standalone: true,
|
|
8
|
+
imports: [MatIcon],
|
|
9
|
+
host: {
|
|
10
|
+
class: 'block w-full',
|
|
11
|
+
},
|
|
12
|
+
styles: [`
|
|
13
|
+
.power-btn-container {
|
|
14
|
+
width: 36px;
|
|
15
|
+
height: 36px;
|
|
16
|
+
position: relative;
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
user-select: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.power-btn-container input {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.power-btn-container .power-button {
|
|
29
|
+
position: absolute;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: 100%;
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
border: 2px solid rgba(16, 185, 129, 0.4);
|
|
34
|
+
background-color: transparent;
|
|
35
|
+
background-image: linear-gradient(145deg, #171717, #262626);
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
box-shadow: inset 1px 1px 0 #7d7c7e, inset -1px -1px 0px #1c1c1c;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
transition: all 0.25s ease;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.power-btn-container .power-button::before {
|
|
45
|
+
position: absolute;
|
|
46
|
+
content: "";
|
|
47
|
+
width: 106%;
|
|
48
|
+
height: 106%;
|
|
49
|
+
border-radius: inherit;
|
|
50
|
+
background-color: transparent;
|
|
51
|
+
background-image: linear-gradient(145deg, #262626, #444245);
|
|
52
|
+
z-index: -1;
|
|
53
|
+
box-shadow: 2px 2px 6px #141414, -2px -2px 6px #404040;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.power-btn-container .power-button .icon {
|
|
57
|
+
width: 17px;
|
|
58
|
+
height: 17px;
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.power-btn-container .power-button .icon svg {
|
|
65
|
+
height: 100%;
|
|
66
|
+
width: 100%;
|
|
67
|
+
fill: #10b981;
|
|
68
|
+
filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.6));
|
|
69
|
+
transition: all 0.25s ease;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.power-btn-container:hover .power-button {
|
|
73
|
+
border-color: rgba(16, 185, 129, 0.8);
|
|
74
|
+
box-shadow: 0 0 10px rgba(16, 185, 129, 0.35), inset 1px 1px 0 #7d7c7e, inset -1px -1px 0px #1c1c1c;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.power-btn-container:hover .power-button .icon svg {
|
|
78
|
+
fill: #34d399;
|
|
79
|
+
filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.8));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.power-btn-container input:checked + .power-button {
|
|
83
|
+
box-shadow: inset -1px -1px 0 #5e5e5e, inset 1px 1px 0 #1c1c1c, 0 0 12px rgba(239, 68, 68, 0.5);
|
|
84
|
+
border: 2px solid rgba(239, 68, 68, 0.8);
|
|
85
|
+
animation: animeBorderRed 0.4s linear alternate-reverse infinite;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.power-btn-container input:checked + .power-button .icon svg {
|
|
89
|
+
fill: rgb(239, 68, 68);
|
|
90
|
+
filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.9));
|
|
91
|
+
animation: animeFillRed 0.4s linear alternate-reverse infinite;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@keyframes animeFillRed {
|
|
95
|
+
to {
|
|
96
|
+
fill: rgba(248, 113, 113, 0.65);
|
|
97
|
+
filter: drop-shadow(0 0 4px rgba(248, 113, 113, 0.5));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@keyframes animeBorderRed {
|
|
102
|
+
to {
|
|
103
|
+
border-color: rgba(239, 68, 68, 0.3);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`],
|
|
107
|
+
template: `
|
|
108
|
+
<div
|
|
109
|
+
class="flex w-full items-center gap-x-2.5 pl-1 pr-2 py-1 text-left text-slate-900 overflow-visible dark:text-slate-100"
|
|
110
|
+
>
|
|
111
|
+
<!-- Avatar + Super Admin badge -->
|
|
112
|
+
<div class="flex flex-col items-center shrink-0">
|
|
113
|
+
@if (profile()?.avatar && failedAvatar() !== profile()?.id + ':' + profile()?.avatar) {
|
|
114
|
+
<img
|
|
115
|
+
class="size-8 rounded-xl object-cover"
|
|
116
|
+
[src]="profile()!.avatar"
|
|
117
|
+
[alt]="userName()"
|
|
118
|
+
(error)="failedAvatar.set(profile()!.id + ':' + profile()!.avatar)"
|
|
119
|
+
/>
|
|
120
|
+
} @else {
|
|
121
|
+
<span
|
|
122
|
+
class="flex size-8 shrink-0 items-center justify-center rounded-xl bg-slate-900 text-white dark:bg-slate-100 dark:text-slate-900"
|
|
123
|
+
aria-hidden="true"
|
|
124
|
+
>
|
|
125
|
+
<mat-icon class="!h-4 !w-4 text-current" svgIcon="user-round" />
|
|
126
|
+
</span>
|
|
127
|
+
}
|
|
128
|
+
@if (isSuperAdmin()) {
|
|
129
|
+
<span
|
|
130
|
+
class="mt-0.5 inline-flex items-center gap-0.5 rounded bg-amber-500 px-1 py-0.5 text-[7px] font-extrabold uppercase leading-none tracking-tight text-slate-950 shadow-xs"
|
|
131
|
+
title="Super Admin Privilege"
|
|
132
|
+
>
|
|
133
|
+
<mat-icon class="!h-2 !w-2 text-slate-950" svgIcon="shield-check" />
|
|
134
|
+
Super Admin
|
|
135
|
+
</span>
|
|
136
|
+
}
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<!-- Name + email -->
|
|
140
|
+
<div class="flex min-w-0 flex-auto flex-col justify-center select-none pl-0.5">
|
|
141
|
+
<div class="truncate text-xs font-bold leading-tight text-slate-900 dark:text-slate-100">{{ userName() }}</div>
|
|
142
|
+
<div class="truncate text-[10px] leading-tight text-slate-500 dark:text-slate-400">
|
|
143
|
+
{{ userEmail() }}
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<!-- Power logout -->
|
|
148
|
+
<div class="ml-auto flex items-center justify-center shrink-0">
|
|
149
|
+
<label class="power-btn-container" title="Logout">
|
|
150
|
+
<input
|
|
151
|
+
type="checkbox"
|
|
152
|
+
[checked]="confirmLogoutOpen()"
|
|
153
|
+
(change)="openLogoutConfirm()"
|
|
154
|
+
/>
|
|
155
|
+
<span class="power-button">
|
|
156
|
+
<span class="icon">
|
|
157
|
+
<svg
|
|
158
|
+
version="1.1"
|
|
159
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
160
|
+
viewBox="0 0 30.143 30.143"
|
|
161
|
+
aria-hidden="true"
|
|
162
|
+
>
|
|
163
|
+
<g>
|
|
164
|
+
<path
|
|
165
|
+
d="M20.034,2.357v3.824c3.482,1.798,5.869,5.427,5.869,9.619c0,5.98-4.848,10.83-10.828,10.83 c-5.982,0-10.832-4.85-10.832-10.83c0-3.844,2.012-7.215,5.029-9.136V2.689C4.245,4.918,0.731,9.945,0.731,15.801 c0,7.921,6.42,14.342,14.34,14.342c7.924,0,14.342-6.421,14.342-14.342C29.412,9.624,25.501,4.379,20.034,2.357z"
|
|
166
|
+
></path>
|
|
167
|
+
<path
|
|
168
|
+
d="M14.795,17.652c1.576,0,1.736-0.931,1.736-2.076V2.08c0-1.148-0.16-2.08-1.736-2.08 c-1.57,0-1.732,0.932-1.732,2.08v13.496C13.062,16.722,13.225,17.652,14.795,17.652z"
|
|
169
|
+
></path>
|
|
170
|
+
</g>
|
|
171
|
+
</svg>
|
|
172
|
+
</span>
|
|
173
|
+
</span>
|
|
174
|
+
</label>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
@if (confirmLogoutOpen()) {
|
|
179
|
+
<div class="fixed inset-0 z-[200] flex items-center justify-center bg-slate-950/45 p-4">
|
|
180
|
+
<div class="w-full max-w-sm rounded-2xl bg-white p-5 shadow-2xl dark:bg-slate-900">
|
|
181
|
+
<div class="flex items-start gap-3">
|
|
182
|
+
<div class="flex size-10 shrink-0 items-center justify-center rounded-full bg-rose-100 text-rose-600">
|
|
183
|
+
<mat-icon class="size-5" svgIcon="power" />
|
|
184
|
+
</div>
|
|
185
|
+
<div class="min-w-0 flex-1">
|
|
186
|
+
<div class="text-base font-semibold text-slate-900 dark:text-slate-100">Confirm logout</div>
|
|
187
|
+
<div class="mt-1 text-sm text-slate-600 dark:text-slate-300">
|
|
188
|
+
Are you sure you want to sign out?
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
<div class="mt-5 flex justify-end gap-2">
|
|
194
|
+
<button
|
|
195
|
+
type="button"
|
|
196
|
+
class="rounded-lg border border-slate-200 px-3 py-2 text-sm font-medium text-slate-700 transition hover:bg-slate-50 dark:border-slate-700 dark:text-slate-200 dark:hover:bg-slate-800"
|
|
197
|
+
(click)="closeLogoutConfirm()"
|
|
198
|
+
>
|
|
199
|
+
Cancel
|
|
200
|
+
</button>
|
|
201
|
+
<button
|
|
202
|
+
type="button"
|
|
203
|
+
class="rounded-lg bg-rose-600 px-3 py-2 text-sm font-semibold text-white transition hover:bg-rose-700"
|
|
204
|
+
(click)="confirmLogout()"
|
|
205
|
+
>
|
|
206
|
+
Confirm
|
|
207
|
+
</button>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
}
|
|
212
|
+
`,
|
|
213
|
+
})
|
|
214
|
+
export class User implements OnDestroy {
|
|
215
|
+
private readonly authService = inject(AuthService);
|
|
216
|
+
private readonly accessControlService = inject(AccessControlService);
|
|
217
|
+
|
|
218
|
+
protected readonly profile = this.authService.profile;
|
|
219
|
+
protected readonly failedAvatar = signal('');
|
|
220
|
+
protected readonly confirmLogoutOpen = signal(false);
|
|
221
|
+
protected readonly isSuperAdmin = computed(() => this.accessControlService.isUserAdmin());
|
|
222
|
+
|
|
223
|
+
protected readonly userName = computed(() => {
|
|
224
|
+
const profile = this.profile();
|
|
225
|
+
if (profile?.name?.trim()) {
|
|
226
|
+
return profile.name.trim();
|
|
227
|
+
}
|
|
228
|
+
const user = this.authService.currentUser();
|
|
229
|
+
if (!user) {
|
|
230
|
+
return 'User';
|
|
231
|
+
}
|
|
232
|
+
return (
|
|
233
|
+
user.name ||
|
|
234
|
+
`${user['given_name'] || ''} ${user['family_name'] || ''}`.trim() ||
|
|
235
|
+
user.preferred_username ||
|
|
236
|
+
'User'
|
|
237
|
+
);
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
protected readonly userEmail = computed(() => {
|
|
241
|
+
const profile = this.profile();
|
|
242
|
+
if (profile?.email?.trim()) {
|
|
243
|
+
return profile.email.trim();
|
|
244
|
+
}
|
|
245
|
+
return this.authService.currentUser()?.email || '';
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
ngOnDestroy(): void {
|
|
249
|
+
this.confirmLogoutOpen.set(false);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
openLogoutConfirm(): void {
|
|
253
|
+
this.confirmLogoutOpen.set(true);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
closeLogoutConfirm(): void {
|
|
257
|
+
this.confirmLogoutOpen.set(false);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
confirmLogout(): void {
|
|
261
|
+
this.confirmLogoutOpen.set(false);
|
|
262
|
+
this.authService.signOut('user');
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Directive, Input, TemplateRef, ViewContainerRef, effect, inject } from '@angular/core';
|
|
2
|
+
import { AccessControlService } from '../services/access-control.service';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hasPermission]',
|
|
6
|
+
standalone: true,
|
|
7
|
+
})
|
|
8
|
+
export class HasPermissionDirective {
|
|
9
|
+
private readonly templateRef = inject(TemplateRef<unknown>);
|
|
10
|
+
private readonly viewContainer = inject(ViewContainerRef);
|
|
11
|
+
private readonly accessControl = inject(AccessControlService);
|
|
12
|
+
private screenId = '';
|
|
13
|
+
private componentId = '';
|
|
14
|
+
private hasView = false;
|
|
15
|
+
|
|
16
|
+
@Input()
|
|
17
|
+
set hasPermission(screenId: string) {
|
|
18
|
+
this.screenId = screenId;
|
|
19
|
+
this.render();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@Input()
|
|
23
|
+
set hasPermissionComponent(componentId: string) {
|
|
24
|
+
this.componentId = componentId;
|
|
25
|
+
this.render();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
constructor() {
|
|
29
|
+
effect(() => {
|
|
30
|
+
this.accessControl.isLoaded();
|
|
31
|
+
this.accessControl.isUserAdmin();
|
|
32
|
+
this.render();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private render(): void {
|
|
37
|
+
const allowed = this.componentId
|
|
38
|
+
? this.accessControl.hasComponentAccess(this.screenId, this.componentId)
|
|
39
|
+
: this.accessControl.hasScreenAccess(this.screenId);
|
|
40
|
+
|
|
41
|
+
if (allowed && !this.hasView) {
|
|
42
|
+
this.viewContainer.createEmbeddedView(this.templateRef);
|
|
43
|
+
this.hasView = true;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (!allowed && this.hasView) {
|
|
47
|
+
this.viewContainer.clear();
|
|
48
|
+
this.hasView = false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|