@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,147 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable, catchError, map, of } from 'rxjs';
|
|
3
|
+
import { NAVIGATION, NavigationItem } from '@/app/domains/admin/layout/data/navigation';
|
|
4
|
+
|
|
5
|
+
export type ManagedScreen = {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type ScreenComponentRow = {
|
|
11
|
+
screenName: string;
|
|
12
|
+
screenId: string;
|
|
13
|
+
componentName: string;
|
|
14
|
+
componentId: string;
|
|
15
|
+
componentType: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** Generated at build time from entities + IAM screens (also written to public/assets/screen-components.csv). */
|
|
20
|
+
export const GENERATED_MANAGED_SCREENS: ManagedScreen[] = <%- JSON.stringify(typeof managedScreens !== 'undefined' ? managedScreens : [], null, 2) %>;
|
|
21
|
+
|
|
22
|
+
const configuredScreens: string[] = <%- JSON.stringify(iam.screens || []) %>;
|
|
23
|
+
|
|
24
|
+
function collectRouteIds(items: NavigationItem[]): string[] {
|
|
25
|
+
const ids: string[] = [];
|
|
26
|
+
items.forEach((item) => {
|
|
27
|
+
if (item.route && item.id) {
|
|
28
|
+
ids.push(item.id);
|
|
29
|
+
}
|
|
30
|
+
if (item.children?.length) {
|
|
31
|
+
ids.push(...collectRouteIds(item.children));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return ids;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Sync fallback used before CSV loads (nav + generated entity/IAM screen ids). */
|
|
38
|
+
export function listManagedScreens(): ManagedScreen[] {
|
|
39
|
+
if (GENERATED_MANAGED_SCREENS.length) {
|
|
40
|
+
return GENERATED_MANAGED_SCREENS.slice();
|
|
41
|
+
}
|
|
42
|
+
const fromNav = collectRouteIds(NAVIGATION);
|
|
43
|
+
const extra = configuredScreens.filter(Boolean);
|
|
44
|
+
const unique = Array.from(new Set([...fromNav, ...extra, 'user-management', 'role-management', 'role-permissions']));
|
|
45
|
+
return unique.map((id) => ({
|
|
46
|
+
id,
|
|
47
|
+
label: id.split('/').pop()?.replace(/-/g, ' ') || id,
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function parseCsvLine(line: string): string[] {
|
|
52
|
+
const cells: string[] = [];
|
|
53
|
+
let current = '';
|
|
54
|
+
let inQuotes = false;
|
|
55
|
+
for (let i = 0; i < line.length; i += 1) {
|
|
56
|
+
const ch = line[i];
|
|
57
|
+
if (inQuotes) {
|
|
58
|
+
if (ch === '"' && line[i + 1] === '"') {
|
|
59
|
+
current += '"';
|
|
60
|
+
i += 1;
|
|
61
|
+
} else if (ch === '"') {
|
|
62
|
+
inQuotes = false;
|
|
63
|
+
} else {
|
|
64
|
+
current += ch;
|
|
65
|
+
}
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (ch === '"') {
|
|
69
|
+
inQuotes = true;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (ch === ',') {
|
|
73
|
+
cells.push(current);
|
|
74
|
+
current = '';
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
current += ch;
|
|
78
|
+
}
|
|
79
|
+
cells.push(current);
|
|
80
|
+
return cells;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function parseScreenComponentsCsv(text: string): ScreenComponentRow[] {
|
|
84
|
+
const lines = String(text || '')
|
|
85
|
+
.split(/\r?\n/)
|
|
86
|
+
.map((line) => line.trim())
|
|
87
|
+
.filter(Boolean);
|
|
88
|
+
if (lines.length < 2) {
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
const rows: ScreenComponentRow[] = [];
|
|
92
|
+
for (let i = 1; i < lines.length; i += 1) {
|
|
93
|
+
const cells = parseCsvLine(lines[i]);
|
|
94
|
+
if (cells.length < 5) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
rows.push({
|
|
98
|
+
screenName: cells[0] || '',
|
|
99
|
+
screenId: cells[1] || '',
|
|
100
|
+
componentName: cells[2] || '',
|
|
101
|
+
componentId: cells[3] || '',
|
|
102
|
+
componentType: cells[4] || '',
|
|
103
|
+
description: cells[5] || '',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return rows;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Unique SCREEN rows from the CSV registry (for permission matrices). */
|
|
110
|
+
export function screensFromCsvRows(rows: ScreenComponentRow[]): ManagedScreen[] {
|
|
111
|
+
const seen = new Set<string>();
|
|
112
|
+
const screens: ManagedScreen[] = [];
|
|
113
|
+
for (const row of rows) {
|
|
114
|
+
const type = String(row.componentType || '').toUpperCase();
|
|
115
|
+
const isScreen = type === 'SCREEN' || row.componentId === row.screenId;
|
|
116
|
+
if (!isScreen || !row.screenId || seen.has(row.screenId)) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
seen.add(row.screenId);
|
|
120
|
+
screens.push({
|
|
121
|
+
id: row.screenId,
|
|
122
|
+
label: row.screenName || row.screenId.split('/').pop()?.replace(/-/g, ' ') || row.screenId,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return screens;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Load generated ACL catalog from public/assets/screen-components.csv (PMB-compatible path).
|
|
130
|
+
* Falls back to listManagedScreens() when the file is missing.
|
|
131
|
+
*/
|
|
132
|
+
export function loadManagedScreens(http: HttpClient): Observable<ManagedScreen[]> {
|
|
133
|
+
return http.get('assets/screen-components.csv', { responseType: 'text' }).pipe(
|
|
134
|
+
map((text) => {
|
|
135
|
+
const fromCsv = screensFromCsvRows(parseScreenComponentsCsv(text));
|
|
136
|
+
return fromCsv.length ? fromCsv : listManagedScreens();
|
|
137
|
+
}),
|
|
138
|
+
catchError(() => of(listManagedScreens()))
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function loadScreenComponentRows(http: HttpClient): Observable<ScreenComponentRow[]> {
|
|
143
|
+
return http.get('assets/screen-components.csv', { responseType: 'text' }).pipe(
|
|
144
|
+
map((text) => parseScreenComponentsCsv(text)),
|
|
145
|
+
catchError(() => of([]))
|
|
146
|
+
);
|
|
147
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Component, Inject, inject } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
import { FormsModule } from '@angular/forms';
|
|
7
|
+
|
|
8
|
+
export interface ConfirmDialogData {
|
|
9
|
+
title: string;
|
|
10
|
+
message: string;
|
|
11
|
+
confirmLabel?: string;
|
|
12
|
+
cancelLabel?: string;
|
|
13
|
+
showInput?: boolean;
|
|
14
|
+
inputValue?: string;
|
|
15
|
+
inputPlaceholder?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'app-confirm-dialog',
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [CommonModule, MatDialogModule, MatButtonModule, MatIconModule, FormsModule],
|
|
22
|
+
template: `
|
|
23
|
+
<div class="flex max-w-sm flex-col p-6">
|
|
24
|
+
<div class="mb-3 flex items-center gap-x-3 text-primary-700 dark:text-primary-400">
|
|
25
|
+
<mat-icon svgIcon="shield-alert" class="size-6 text-primary-600 dark:text-primary-400"></mat-icon>
|
|
26
|
+
<h3 class="text-lg font-bold leading-6 text-slate-900 dark:text-white">{{ data.title }}</h3>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<p class="mb-4 text-sm leading-relaxed text-slate-600 dark:text-slate-400">
|
|
30
|
+
{{ data.message }}
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<div *ngIf="data.showInput" class="mb-6">
|
|
34
|
+
<input
|
|
35
|
+
type="text"
|
|
36
|
+
[(ngModel)]="inputValue"
|
|
37
|
+
[placeholder]="data.inputPlaceholder || ''"
|
|
38
|
+
class="w-full rounded-xl border bg-white px-4 py-2 text-sm uppercase shadow-sm outline-none transition focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 dark:border-slate-700 dark:bg-slate-800"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="flex items-center justify-end gap-x-3">
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
(click)="onCancel()"
|
|
46
|
+
class="rounded-xl px-4 py-2 text-sm font-semibold text-slate-700 transition hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
47
|
+
>
|
|
48
|
+
{{ data.cancelLabel || 'Cancel' }}
|
|
49
|
+
</button>
|
|
50
|
+
<button
|
|
51
|
+
type="button"
|
|
52
|
+
(click)="onConfirm()"
|
|
53
|
+
class="rounded-xl bg-primary-600 px-4 py-2 text-sm font-semibold text-white shadow-sm transition hover:bg-primary-700"
|
|
54
|
+
[disabled]="data.showInput && !inputValue.trim()"
|
|
55
|
+
>
|
|
56
|
+
{{ data.confirmLabel || 'Confirm' }}
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
`,
|
|
61
|
+
})
|
|
62
|
+
export class ConfirmDialogComponent {
|
|
63
|
+
private dialogRef = inject(MatDialogRef<ConfirmDialogComponent>);
|
|
64
|
+
inputValue = '';
|
|
65
|
+
|
|
66
|
+
constructor(@Inject(MAT_DIALOG_DATA) public data: ConfirmDialogData) {
|
|
67
|
+
if (data.showInput) {
|
|
68
|
+
this.inputValue = data.inputValue || '';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
onCancel(): void {
|
|
73
|
+
this.dialogRef.close(false);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
onConfirm(): void {
|
|
77
|
+
if (this.data.showInput) {
|
|
78
|
+
this.dialogRef.close(this.inputValue.trim());
|
|
79
|
+
} else {
|
|
80
|
+
this.dialogRef.close(true);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { getScreenBaseId, screenIdsMatch } from '@/app/core/auth';
|
|
2
|
+
import { GroupedScreenCluster } from './screen-matrix.util';
|
|
3
|
+
import {
|
|
4
|
+
EMPTY_SCREEN_NAVIGATION_MAP,
|
|
5
|
+
PageNavigationEntry,
|
|
6
|
+
getMappedScreenIds,
|
|
7
|
+
} from './screen-navigation-map';
|
|
8
|
+
|
|
9
|
+
export interface MatrixPageGroup {
|
|
10
|
+
kind: 'page';
|
|
11
|
+
page: PageNavigationEntry;
|
|
12
|
+
host: GroupedScreenCluster;
|
|
13
|
+
embeds: GroupedScreenCluster[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface MatrixFlatGroup {
|
|
17
|
+
kind: 'flat';
|
|
18
|
+
group: GroupedScreenCluster;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type MatrixHierarchyItem = MatrixPageGroup | MatrixFlatGroup;
|
|
22
|
+
|
|
23
|
+
function clusterMatchesScreenId(cluster: GroupedScreenCluster, screenId: string): boolean {
|
|
24
|
+
const target = String(screenId || '').trim().toLowerCase();
|
|
25
|
+
if (!target) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (String(cluster.cleanScreenId || '').toLowerCase() === target) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (getScreenBaseId(target) === String(cluster.cleanScreenId || '').toLowerCase()) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return (cluster.screenIds || []).some(
|
|
35
|
+
(id) => String(id).toLowerCase() === target || screenIdsMatch(id, target)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function findClusterForScreenId(
|
|
40
|
+
clusters: GroupedScreenCluster[],
|
|
41
|
+
screenId: string
|
|
42
|
+
): GroupedScreenCluster | undefined {
|
|
43
|
+
return clusters.find((cluster) => clusterMatchesScreenId(cluster, screenId));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function syntheticCluster(screenId: string, title: string): GroupedScreenCluster {
|
|
47
|
+
return {
|
|
48
|
+
cleanScreenId: getScreenBaseId(screenId) || screenId,
|
|
49
|
+
screen: {
|
|
50
|
+
screenId,
|
|
51
|
+
screenName: title,
|
|
52
|
+
description: null,
|
|
53
|
+
},
|
|
54
|
+
screenIds: [screenId],
|
|
55
|
+
screenNames: [title],
|
|
56
|
+
components: [],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Build page-grouped matrix rows from flat clusters + navigation map.
|
|
62
|
+
* Clusters claimed as hosts/embeds appear under pages; remaining stay flat A–Z.
|
|
63
|
+
*/
|
|
64
|
+
export function buildMatrixHierarchy(
|
|
65
|
+
clusters: GroupedScreenCluster[],
|
|
66
|
+
map: readonly PageNavigationEntry[] = EMPTY_SCREEN_NAVIGATION_MAP
|
|
67
|
+
): MatrixHierarchyItem[] {
|
|
68
|
+
const claimed = getMappedScreenIds(map);
|
|
69
|
+
const usedClusterKeys = new Set<string>();
|
|
70
|
+
|
|
71
|
+
const markUsed = (cluster: GroupedScreenCluster | undefined) => {
|
|
72
|
+
if (!cluster) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
usedClusterKeys.add(cluster.cleanScreenId);
|
|
76
|
+
(cluster.screenIds || []).forEach((id) => usedClusterKeys.add(String(id).toLowerCase()));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const pages: MatrixPageGroup[] = [];
|
|
80
|
+
|
|
81
|
+
map.forEach((page) => {
|
|
82
|
+
const hostIds = [page.hostScreenId, ...(page.hostScreenAliases || [])];
|
|
83
|
+
let host = hostIds.map((id) => findClusterForScreenId(clusters, id)).find(Boolean);
|
|
84
|
+
if (!host) {
|
|
85
|
+
host = syntheticCluster(page.hostScreenId, page.navTitle);
|
|
86
|
+
}
|
|
87
|
+
markUsed(host);
|
|
88
|
+
|
|
89
|
+
const embeds: GroupedScreenCluster[] = [];
|
|
90
|
+
page.embeddedScreens.forEach((embedded) => {
|
|
91
|
+
let child = findClusterForScreenId(clusters, embedded.screenId);
|
|
92
|
+
if (!child) {
|
|
93
|
+
child = syntheticCluster(embedded.screenId, embedded.title);
|
|
94
|
+
}
|
|
95
|
+
// Same physical cluster (e.g. sampling-details-form) can nest under multiple pages.
|
|
96
|
+
embeds.push(child);
|
|
97
|
+
markUsed(child);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
pages.push({ kind: 'page', page, host, embeds });
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const flat: MatrixFlatGroup[] = clusters
|
|
104
|
+
.filter((cluster) => {
|
|
105
|
+
if (usedClusterKeys.has(cluster.cleanScreenId)) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
const ids = (cluster.screenIds || []).map((id) => String(id).toLowerCase());
|
|
109
|
+
if (ids.some((id) => claimed.has(id) || usedClusterKeys.has(id))) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
})
|
|
114
|
+
.map((group) => ({ kind: 'flat' as const, group }));
|
|
115
|
+
|
|
116
|
+
pages.sort((a, b) => {
|
|
117
|
+
const domain = a.page.domain.localeCompare(b.page.domain);
|
|
118
|
+
if (domain !== 0) {
|
|
119
|
+
return domain;
|
|
120
|
+
}
|
|
121
|
+
return a.page.navTitle.localeCompare(b.page.navTitle);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
flat.sort((a, b) =>
|
|
125
|
+
String(a.group.cleanScreenId || '').localeCompare(String(b.group.cleanScreenId || ''))
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
return [...pages, ...flat];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function filterMatrixHierarchy(
|
|
132
|
+
items: MatrixHierarchyItem[],
|
|
133
|
+
searchTerm: string,
|
|
134
|
+
scope: 'ALL' | 'SCREEN',
|
|
135
|
+
clusterMatches: (group: GroupedScreenCluster, search: string, scope: 'ALL' | 'SCREEN') => GroupedScreenCluster | null
|
|
136
|
+
): MatrixHierarchyItem[] {
|
|
137
|
+
const search = searchTerm.trim();
|
|
138
|
+
if (!search) {
|
|
139
|
+
return items;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const result: MatrixHierarchyItem[] = [];
|
|
143
|
+
|
|
144
|
+
items.forEach((item) => {
|
|
145
|
+
if (item.kind === 'flat') {
|
|
146
|
+
const matched = clusterMatches(item.group, search, scope);
|
|
147
|
+
if (matched) {
|
|
148
|
+
result.push({ kind: 'flat', group: matched });
|
|
149
|
+
}
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const pageHaystack = [
|
|
154
|
+
item.page.domain,
|
|
155
|
+
item.page.navTitle,
|
|
156
|
+
item.page.route,
|
|
157
|
+
item.page.hostScreenId,
|
|
158
|
+
...(item.page.hostScreenAliases || []),
|
|
159
|
+
...item.page.embeddedScreens.map((e) => `${e.screenId} ${e.title}`),
|
|
160
|
+
]
|
|
161
|
+
.join(' ')
|
|
162
|
+
.toLowerCase();
|
|
163
|
+
const pageMatches = pageHaystack.includes(search.toLowerCase());
|
|
164
|
+
|
|
165
|
+
const hostMatched = clusterMatches(item.host, search, scope);
|
|
166
|
+
const embedMatched = item.embeds
|
|
167
|
+
.map((embed) => clusterMatches(embed, search, scope))
|
|
168
|
+
.filter((g): g is GroupedScreenCluster => g !== null);
|
|
169
|
+
|
|
170
|
+
if (pageMatches || hostMatched || embedMatched.length > 0) {
|
|
171
|
+
result.push({
|
|
172
|
+
kind: 'page',
|
|
173
|
+
page: item.page,
|
|
174
|
+
host: hostMatched || item.host,
|
|
175
|
+
embeds: pageMatches || hostMatched ? item.embeds : embedMatched,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** Adapt filterMatrixClusters-style matching for a single cluster. */
|
|
184
|
+
export function matchClusterForHierarchySearch(
|
|
185
|
+
group: GroupedScreenCluster,
|
|
186
|
+
search: string,
|
|
187
|
+
scope: 'ALL' | 'SCREEN',
|
|
188
|
+
filterFn: (
|
|
189
|
+
data: GroupedScreenCluster[],
|
|
190
|
+
searchTerm: string,
|
|
191
|
+
scope: 'ALL' | 'SCREEN'
|
|
192
|
+
) => GroupedScreenCluster[]
|
|
193
|
+
): GroupedScreenCluster | null {
|
|
194
|
+
const filtered = filterFn([group], search, scope);
|
|
195
|
+
return filtered[0] || null;
|
|
196
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Grant / revoke cue sounds for IAM permission matrices (PMB-style). */
|
|
2
|
+
|
|
3
|
+
export function playPermissionGrantSound(): void {
|
|
4
|
+
playSoundFile('assets/sound/apple-play.mp3', () => playSynthGrantBeep());
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function playPermissionRevokeSound(): void {
|
|
8
|
+
playSoundFile('assets/sound/remove.mp3', () => playSynthRevokeBeep());
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function playSoundFile(src: string, fallback: () => void): void {
|
|
12
|
+
try {
|
|
13
|
+
const audio = new Audio(`${src}?t=${Date.now()}`);
|
|
14
|
+
audio.play().catch(() => fallback());
|
|
15
|
+
} catch {
|
|
16
|
+
fallback();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function playSynthGrantBeep(): void {
|
|
21
|
+
playSynthChime([
|
|
22
|
+
{ frequency: 880, offset: 0, duration: 0.15 },
|
|
23
|
+
{ frequency: 1108.73, offset: 0.08, duration: 0.25 },
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function playSynthRevokeBeep(): void {
|
|
28
|
+
playSynthChime([
|
|
29
|
+
{ frequency: 1108.73, offset: 0, duration: 0.15 },
|
|
30
|
+
{ frequency: 830.61, offset: 0.08, duration: 0.25 },
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function playSynthChime(notes: Array<{ frequency: number; offset: number; duration: number }>): void {
|
|
35
|
+
try {
|
|
36
|
+
const AudioContextClass = window.AudioContext || (window as unknown as { webkitAudioContext?: typeof AudioContext }).webkitAudioContext;
|
|
37
|
+
if (!AudioContextClass) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const ctx = new AudioContextClass();
|
|
41
|
+
const now = ctx.currentTime;
|
|
42
|
+
for (const note of notes) {
|
|
43
|
+
const osc = ctx.createOscillator();
|
|
44
|
+
const gain = ctx.createGain();
|
|
45
|
+
const start = now + note.offset;
|
|
46
|
+
osc.type = 'sine';
|
|
47
|
+
osc.frequency.setValueAtTime(note.frequency, start);
|
|
48
|
+
gain.gain.setValueAtTime(0, start);
|
|
49
|
+
gain.gain.linearRampToValueAtTime(0.15, start + 0.02);
|
|
50
|
+
gain.gain.exponentialRampToValueAtTime(0.001, start + note.duration);
|
|
51
|
+
osc.connect(gain);
|
|
52
|
+
gain.connect(ctx.destination);
|
|
53
|
+
osc.start(start);
|
|
54
|
+
osc.stop(start + note.duration);
|
|
55
|
+
}
|
|
56
|
+
} catch {
|
|
57
|
+
// Audio optional — never block permission writes.
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export function formatRoleDisplayName(roleName: unknown): string {
|
|
2
|
+
const normalized = String(roleName ?? '').trim();
|
|
3
|
+
if (!normalized) {
|
|
4
|
+
return '';
|
|
5
|
+
}
|
|
6
|
+
const lowerRoleName = normalized.toLowerCase();
|
|
7
|
+
|
|
8
|
+
if (lowerRoleName === 'role_super_admin' || lowerRoleName === 'role_super_admin_pmb') {
|
|
9
|
+
return 'ROLE SUPER ADMIN';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Keep full stakeholder labels — generic ROLE_*_ strip would turn this into just "STAFF".
|
|
13
|
+
if (lowerRoleName === 'role_stakeholder_staff') {
|
|
14
|
+
return 'Stakeholder Staff';
|
|
15
|
+
}
|
|
16
|
+
if (lowerRoleName === 'role_stakeholder' || lowerRoleName === 'stakeholder') {
|
|
17
|
+
return 'Stakeholder';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const regionRoleMatch = /^REG_([^_]+)__(.+?)__(MGR|STAFF)$/i.exec(normalized);
|
|
21
|
+
if (regionRoleMatch) {
|
|
22
|
+
const regionCode = regionRoleMatch[1].toUpperCase();
|
|
23
|
+
const regionName = regionRoleMatch[2].replace(/_/g, ' ').trim();
|
|
24
|
+
const roleLabel = regionRoleMatch[3].toUpperCase() === 'MGR' ? 'Regional Manager' : 'Regional Officer';
|
|
25
|
+
return `${roleLabel} - ${regionName} (${regionCode})`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const regionParentMatch = /^REG_([^_]+)__(.+)$/i.exec(normalized);
|
|
29
|
+
if (regionParentMatch) {
|
|
30
|
+
const regionCode = regionParentMatch[1].toUpperCase();
|
|
31
|
+
const regionName = regionParentMatch[2].replace(/_/g, ' ').trim();
|
|
32
|
+
return `Region Access - ${regionName} (${regionCode})`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const legacyRegionRoleMatch = /^REG_([^_]+)_(MGR|STAFF)$/i.exec(normalized);
|
|
36
|
+
if (legacyRegionRoleMatch) {
|
|
37
|
+
const regionCode = legacyRegionRoleMatch[1].toUpperCase();
|
|
38
|
+
const roleLabel = legacyRegionRoleMatch[2].toUpperCase() === 'MGR' ? 'Regional Manager' : 'Regional Officer';
|
|
39
|
+
return `${roleLabel} (${regionCode})`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return normalized.replace(/^ROLE_[A-Z0-9]+_/i, '').replace(/_/g, ' ');
|
|
43
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'tbody[app-role-permission-skeleton]',
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
template: `
|
|
9
|
+
@for (sIdx of [1, 2, 3, 4, 5]; track sIdx) {
|
|
10
|
+
<!-- Mock Screen Header Row -->
|
|
11
|
+
<tr class="bg-slate-100/50 dark:bg-slate-800/50 select-none">
|
|
12
|
+
<td [attr.colspan]="colspan" class="sticky left-0 px-6 py-3 border-b border-slate-200 dark:border-slate-800 text-slate-800 dark:text-slate-100 text-sm">
|
|
13
|
+
<div class="flex items-center gap-x-2 animate-pulse">
|
|
14
|
+
<div class="h-4 w-4 rounded bg-slate-200 dark:bg-slate-700"></div>
|
|
15
|
+
<div class="h-4 w-4 rounded-full bg-slate-200 dark:bg-slate-700"></div>
|
|
16
|
+
<div class="h-4 w-40 rounded bg-slate-200 dark:bg-slate-700"></div>
|
|
17
|
+
<div class="h-4 w-24 rounded bg-slate-200 dark:bg-slate-700"></div>
|
|
18
|
+
</div>
|
|
19
|
+
</td>
|
|
20
|
+
</tr>
|
|
21
|
+
<!-- Mock Component Rows (2 per screen) -->
|
|
22
|
+
@for (cIdx of [1, 2]; track cIdx) {
|
|
23
|
+
<tr class="hover:bg-slate-50/30 dark:hover:bg-slate-800/10">
|
|
24
|
+
<!-- Mock Component details -->
|
|
25
|
+
<td class="sticky left-0 z-10 px-8 py-3.5 border-r border-b border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900">
|
|
26
|
+
<div class="flex items-center gap-x-2 animate-pulse">
|
|
27
|
+
<div class="h-5 w-14 rounded bg-slate-200 dark:bg-slate-700"></div>
|
|
28
|
+
<div class="h-4 w-48 rounded bg-slate-200 dark:bg-slate-700"></div>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="h-3 w-32 rounded bg-slate-200 dark:bg-slate-700 mt-2 pl-2 animate-pulse"></div>
|
|
31
|
+
</td>
|
|
32
|
+
<!-- Mock Checkboxes -->
|
|
33
|
+
@for (rIdx of rolesArray; track rIdx) {
|
|
34
|
+
<td class="px-6 py-3.5 text-center border-b border-slate-200 dark:border-slate-800">
|
|
35
|
+
<div class="inline-flex justify-center items-center h-5 w-5 rounded bg-slate-200 dark:bg-slate-700 animate-pulse"></div>
|
|
36
|
+
</td>
|
|
37
|
+
}
|
|
38
|
+
</tr>
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`
|
|
42
|
+
})
|
|
43
|
+
export class RolePermissionSkeletonComponent {
|
|
44
|
+
readonly SCREEN = 'role-permission-skeleton';
|
|
45
|
+
@Input() rolesCount: number = 6;
|
|
46
|
+
|
|
47
|
+
get colspan(): number {
|
|
48
|
+
return this.rolesCount + 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
get rolesArray(): number[] {
|
|
52
|
+
return Array.from({ length: this.rolesCount }, (_, i) => i);
|
|
53
|
+
}
|
|
54
|
+
}
|