@salesforce/ui-bundle-template-feature-angular-authentication 12.5.4
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/LICENSE.txt +82 -0
- package/README.md +130 -0
- package/dist/.forceignore +15 -0
- package/dist/.husky/pre-commit +4 -0
- package/dist/.prettierignore +11 -0
- package/dist/.prettierrc +17 -0
- package/dist/CHANGELOG.md +5238 -0
- package/dist/README.md +77 -0
- package/dist/config/project-scratch-def.json +13 -0
- package/dist/eslint.config.js +7 -0
- package/dist/force-app/main/default/classes/UIBundleAuthUtils.cls +68 -0
- package/dist/force-app/main/default/classes/UIBundleAuthUtils.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleChangePassword.cls +77 -0
- package/dist/force-app/main/default/classes/UIBundleChangePassword.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls +71 -0
- package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleLogin.cls +105 -0
- package/dist/force-app/main/default/classes/UIBundleLogin.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleRegistration.cls +162 -0
- package/dist/force-app/main/default/classes/UIBundleRegistration.cls-meta.xml +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.postcssrc.json +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.prettierignore +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/.prettierrc +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/CHANGELOG.md +4 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/README.md +85 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/angular.json +98 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/components.json +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/e2e/app.spec.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/esbuild/api-version.mjs +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/esbuild/graphql-codegen.mjs +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/eslint-plugin-angular-graphql.js +148 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/eslint.config.js +76 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/feature-angular-authentication.uibundle-meta.xml +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/middleware/html.mjs +3 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/middleware/proxy.mjs +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/package.json +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/playwright.config.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/public/favicon.ico +0 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/scripts/get-graphql-schema.mjs +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/scripts/rewrite-e2e-assets.mjs +30 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/api/data-client.service.spec.ts +184 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/api/data-client.service.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/api/user-profile.service.ts +126 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.config.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.html +1 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.routes.ts +66 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.spec.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/app.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/layout/app-layout/app-layout.html +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/layout/app-layout/app-layout.spec.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/layout/app-layout/app-layout.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/alert/alert.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/alert/alert.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/button/button.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/button/button.ts +66 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/card/card.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/collapsible/collapsible.html +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/collapsible/collapsible.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/date-picker/date-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/date-picker/date-picker.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/date-range-picker/date-range-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/date-range-picker/date-range-picker.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/dialog/dialog.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/dialog/dialog.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/dropdown-menu/dropdown-menu.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/dropdown-menu/dropdown-menu.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/field/field.html +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/field/field.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/field-appearance.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/field-size.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/icon/icon.ts +68 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/input/input.html +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/input/input.ts +79 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/label/label.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/paginator/paginator.html +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/paginator/paginator.ts +93 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/paginator/types.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/popover/popover.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/popover/popover.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/select/select.html +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/select/select.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/separator/separator.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/skeleton/skeleton.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/components/ui/spinner/spinner.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth/auth.guard.ts +50 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth/auth.service.ts +158 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth-form/auth-form.html +33 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth-form/auth-form.ts +94 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth-layout/auth-layout.html +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/auth-layout/auth-layout.ts +30 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/card-layout/card-layout.html +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/card-layout/card-layout.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/config/authentication.config.ts +75 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/footer-link/footer-link.html +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/footer-link/footer-link.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/menu/auth-menu/auth-menu.html +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/menu/auth-menu/auth-menu.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/reactive-form-page.base.ts +50 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/session/session.html +55 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/session/session.ts +205 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/status-alert/status-alert.html +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/status-alert/status-alert.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/submit-button/submit-button.html +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/submit-button/submit-button.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/auth-helpers.ts +68 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/auth-validators.ts +72 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/helpers.ts +85 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/session-time-servlet.ts +130 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/session-timeout.config.ts +83 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/features/authentication/utils/session-timeout.service.ts +201 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/change-password/change-password-page.html +68 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/change-password/change-password-page.ts +82 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/forgot-password/forgot-password-page.html +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/forgot-password/forgot-password-page.ts +87 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/home/home.html +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/home/home.spec.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/home/home.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/login/login-page.html +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/login/login-page.ts +89 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/not-found/not-found.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/not-found/not-found.spec.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/not-found/not-found.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/profile/profile-page.html +116 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/profile/profile-page.ts +194 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/register/register-page.html +80 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/register/register-page.ts +93 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/reset-password/reset-password-page.html +60 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/pages/reset-password/reset-password-page.ts +96 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/hlm-alert-action.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/hlm-alert-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/hlm-alert-title.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/hlm-alert.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/alert/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/button/hlm-button.token.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/button/hlm-button.ts +72 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/button/index.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/hlm-calendar-multi.ts +195 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/hlm-calendar-range.ts +194 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/hlm-calendar.ts +189 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/hlm-month-year-calendar.ts +119 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/calendar/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-action.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-avatar.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-footer.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-header.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card.token.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/hlm-card.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/card/index.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/collapsible/hlm-collapsible-content.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/collapsible/hlm-collapsible-trigger.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/collapsible/hlm-collapsible.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/collapsible/index.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-multi-input.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-anchor.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-input.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-multi.token.ts +109 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-multi.ts +220 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker-trigger.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker.token.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-picker.ts +203 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-range-input.ts +120 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-range-picker.token.ts +86 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-date-range-picker.ts +252 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-month-year-input.ts +105 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-month-year-picker.token.ts +89 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/hlm-month-year-picker.ts +196 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/date-picker/index.ts +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-close.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-content.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-footer.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-overlay.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-title.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog.service.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/hlm-dialog.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dialog/index.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox.ts +54 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-focus-on-hover.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-item-sub-indicator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-item.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-label.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-separator.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-shortcut.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub-trigger.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-token.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu-trigger.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/hlm-dropdown-menu.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/dropdown-menu/index.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-description.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-error.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-group.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-legend.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-separator.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-set.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field-title.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/hlm-field.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/field/index.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input/hlm-input.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group-addon.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group-button.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group-input.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group-text.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/hlm-input-group.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/input-group/index.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/label/hlm-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/label/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/label/label.html +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-numbered-pagination-query-params.ts +191 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-numbered-pagination.ts +290 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-ellipsis.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-item.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-link.ts +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-next.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination-previous.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/hlm-pagination.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/pagination/index.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-content.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/hlm-popover.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/popover/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-content.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-item.ts +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-label.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-multiple.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-placeholder.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-scroll-down.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-scroll-up.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-separator.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-trigger.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-value-template.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-value.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-values-content.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select-values.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/hlm-select.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/select/index.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/separator/hlm-separator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/separator/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/skeleton/hlm-skeleton.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/skeleton/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/spinner/hlm-spinner.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/spinner/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/utils/hlm.ts +313 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/utils/index.ts +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/shared/utils/provide-spartan-hlm.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/app/utils/async-data.ts +99 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/index.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/main.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/styles.css +139 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/src/types/sf-globals.d.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/tsconfig.app.json +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/tsconfig.json +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/tsconfig.spec.json +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-authentication/ui-bundle.json +7 -0
- package/dist/jest.config.js +6 -0
- package/dist/package-lock.json +12554 -0
- package/dist/package.json +46 -0
- package/dist/scripts/apex/hello.apex +10 -0
- package/dist/scripts/gitignore-templates.json +4 -0
- package/dist/scripts/graphql-search.sh +191 -0
- package/dist/scripts/org-setup-config-schema.mjs +132 -0
- package/dist/scripts/org-setup-dev.mjs +114 -0
- package/dist/scripts/org-setup-url.mjs +108 -0
- package/dist/scripts/org-setup-utils.mjs +569 -0
- package/dist/scripts/org-setup-xml.mjs +278 -0
- package/dist/scripts/org-setup.config.json +5 -0
- package/dist/scripts/org-setup.mjs +2537 -0
- package/dist/scripts/sf-project-setup.mjs +103 -0
- package/dist/scripts/soql/account.soql +6 -0
- package/dist/scripts/validate-org-setup-config.mjs +38 -0
- package/dist/sfdx-project.json +12 -0
- package/package.json +45 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import {
|
|
7
|
+
ChangeDetectionStrategy,
|
|
8
|
+
Component,
|
|
9
|
+
booleanAttribute,
|
|
10
|
+
computed,
|
|
11
|
+
input,
|
|
12
|
+
model,
|
|
13
|
+
} from '@angular/core';
|
|
14
|
+
import { HlmSelectImports } from '@spartan-ng/styles/select';
|
|
15
|
+
import { HlmLabelImports } from '@spartan-ng/styles/label';
|
|
16
|
+
import type { AppFieldSize } from '../field-size';
|
|
17
|
+
import type { AppFieldAppearance } from '../field-appearance';
|
|
18
|
+
|
|
19
|
+
export interface AppSelectOption {
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-select',
|
|
26
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
imports: [HlmSelectImports, HlmLabelImports],
|
|
28
|
+
host: { class: 'block min-w-0' },
|
|
29
|
+
templateUrl: './select.html',
|
|
30
|
+
})
|
|
31
|
+
export class SelectComponent {
|
|
32
|
+
readonly value = model<string>('');
|
|
33
|
+
readonly values = model<readonly string[]>([]);
|
|
34
|
+
readonly multiple = input(false, { transform: booleanAttribute });
|
|
35
|
+
readonly options = input<readonly AppSelectOption[]>([]);
|
|
36
|
+
readonly placeholder = input<string>('');
|
|
37
|
+
readonly label = input<string>('');
|
|
38
|
+
readonly disabled = input(false, { transform: booleanAttribute });
|
|
39
|
+
readonly appearance = input<AppFieldAppearance>('outline');
|
|
40
|
+
readonly size = input<AppFieldSize>('default');
|
|
41
|
+
|
|
42
|
+
private static _uid = 0;
|
|
43
|
+
protected readonly labelId = `app-select-${SelectComponent._uid++}`;
|
|
44
|
+
|
|
45
|
+
protected readonly itemToString = (value: string): string => {
|
|
46
|
+
return this.options().find((o) => o.value === value)?.label ?? value;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
protected readonly triggerClasses = computed(() => {
|
|
50
|
+
if (this.appearance() === 'fill') return 'border-transparent bg-muted';
|
|
51
|
+
return '';
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
protected onSingleChange(event: string | null | undefined): void {
|
|
55
|
+
this.value.set(event ?? '');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
protected onMultiChange(event: string[] | readonly string[] | null | undefined): void {
|
|
59
|
+
this.values.set(event ?? []);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const SelectImports = [SelectComponent] as const;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
7
|
+
import { BrnSeparator } from '@spartan-ng/brain/separator';
|
|
8
|
+
import { hlmSeparatorClass } from '@spartan-ng/styles/separator';
|
|
9
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
10
|
+
|
|
11
|
+
export type AppSeparatorOrientation = 'horizontal' | 'vertical';
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'app-separator',
|
|
15
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
+
hostDirectives: [{ directive: BrnSeparator, inputs: ['orientation', 'decorative'] }],
|
|
17
|
+
host: {
|
|
18
|
+
'data-slot': 'separator',
|
|
19
|
+
},
|
|
20
|
+
template: '',
|
|
21
|
+
})
|
|
22
|
+
export class SeparatorComponent {
|
|
23
|
+
readonly orientation = input<AppSeparatorOrientation>('horizontal');
|
|
24
|
+
readonly decorative = input(true, { transform: booleanAttribute });
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
classes(() => hlmSeparatorClass);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const SeparatorImports = [SeparatorComponent] as const;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
7
|
+
import { HlmSkeleton } from '@spartan-ng/styles/skeleton';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-skeleton',
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
hostDirectives: [HlmSkeleton],
|
|
13
|
+
host: {
|
|
14
|
+
'aria-hidden': 'true',
|
|
15
|
+
},
|
|
16
|
+
template: '<ng-content />',
|
|
17
|
+
})
|
|
18
|
+
export class SkeletonComponent {}
|
|
19
|
+
|
|
20
|
+
export const SkeletonImports = [SkeletonComponent] as const;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
7
|
+
import { HlmSpinnerImports } from '@spartan-ng/styles/spinner';
|
|
8
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'app-spinner',
|
|
12
|
+
imports: [HlmSpinnerImports],
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
host: {
|
|
15
|
+
role: 'status',
|
|
16
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
17
|
+
},
|
|
18
|
+
template: `<hlm-spinner />`,
|
|
19
|
+
})
|
|
20
|
+
export class SpinnerComponent {
|
|
21
|
+
public readonly ariaLabel = input<string>('Loading', { alias: 'aria-label' });
|
|
22
|
+
|
|
23
|
+
constructor() {
|
|
24
|
+
classes(() => 'text-[length:--spacing(4)]');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const SpinnerImports = [SpinnerComponent] as const;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { inject } from "@angular/core";
|
|
7
|
+
import { CanActivateFn, Router, UrlTree } from "@angular/router";
|
|
8
|
+
import { AuthService } from "./auth.service";
|
|
9
|
+
import { AUTH_REDIRECT_PARAM, ROUTES } from "../config/authentication.config";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Route guard — the Angular analogue of the React `PrivateRoute` layout.
|
|
13
|
+
*
|
|
14
|
+
* Allows activation when the user is authenticated. Otherwise redirects to the
|
|
15
|
+
* login page with a `startUrl` query param capturing the requested destination,
|
|
16
|
+
* so the user is returned there after a successful login.
|
|
17
|
+
*
|
|
18
|
+
* Because `AuthService` runs its initial check on construction, the guard first
|
|
19
|
+
* awaits any in-flight `loading` state (equivalent to the React guard returning
|
|
20
|
+
* `null` while loading, then re-rendering once auth resolves). It resolves to a
|
|
21
|
+
* boolean `true` or a `UrlTree` redirect — never leaves the user on a blank
|
|
22
|
+
* screen.
|
|
23
|
+
*/
|
|
24
|
+
export const authGuard: CanActivateFn = async (route, state): Promise<boolean | UrlTree> => {
|
|
25
|
+
const authService = inject(AuthService);
|
|
26
|
+
const router = inject(Router);
|
|
27
|
+
|
|
28
|
+
// Wait for the initial auth check to settle before deciding. If a check is
|
|
29
|
+
// already resolved this returns immediately.
|
|
30
|
+
if (authService.loading()) {
|
|
31
|
+
await authService.checkAuth();
|
|
32
|
+
} else if (authService.user() === null && authService.error() !== null) {
|
|
33
|
+
// The prior check finished unauthenticated *because of an error* (e.g. a
|
|
34
|
+
// transient network failure), not a confirmed guest. Without this, a single
|
|
35
|
+
// failed initial check would poison protected-route access until a full page
|
|
36
|
+
// reload. Re-run the check on guard entry so recovery doesn't require reload.
|
|
37
|
+
await authService.checkAuth();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (authService.isAuthenticated()) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Capture the current destination (path + query) to return to after login.
|
|
45
|
+
// `state.url` is already the resolved absolute URL for the attempted route.
|
|
46
|
+
const destination = state.url;
|
|
47
|
+
return router.createUrlTree([ROUTES.LOGIN.PATH], {
|
|
48
|
+
queryParams: { [AUTH_REDIRECT_PARAM]: destination },
|
|
49
|
+
});
|
|
50
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { computed, inject, Injectable, signal } from "@angular/core";
|
|
7
|
+
import { gql } from "@salesforce/platform-sdk";
|
|
8
|
+
import { DataClient } from "../../../api/data-client.service";
|
|
9
|
+
import { API_ROUTES } from "../config/authentication.config";
|
|
10
|
+
|
|
11
|
+
/** The authenticated user shape (mirrors the React `AuthContext` `User`). */
|
|
12
|
+
export interface AuthUser {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const CURRENT_USER_QUERY = gql`
|
|
18
|
+
query GetCurrentUser {
|
|
19
|
+
uiapi {
|
|
20
|
+
currentUser {
|
|
21
|
+
Id
|
|
22
|
+
Name @optional {
|
|
23
|
+
value
|
|
24
|
+
}
|
|
25
|
+
UserType {
|
|
26
|
+
value
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
interface CurrentUserGraphQLResult {
|
|
34
|
+
uiapi?: {
|
|
35
|
+
currentUser?: {
|
|
36
|
+
Id?: string;
|
|
37
|
+
Name?: { value?: string };
|
|
38
|
+
UserType?: { value?: string | null } | null;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Angular signal-based replacement for the React `AuthProvider` / `useAuth`.
|
|
45
|
+
*
|
|
46
|
+
* `providedIn: 'root'` makes the service a single app-wide singleton, so it
|
|
47
|
+
* replaces the React context+provider wrapper without any `<AuthProvider>` in
|
|
48
|
+
* the tree (the coordinator-approved design). State is exposed as readonly
|
|
49
|
+
* signals; `isAuthenticated` is a computed mirror of `user !== null`.
|
|
50
|
+
*
|
|
51
|
+
* Authentication is checked on construction (equivalent to the React mount
|
|
52
|
+
* `useEffect`). `checkAuth()` re-runs the lookup on demand.
|
|
53
|
+
*
|
|
54
|
+
* The current-user lookup goes through the base app's `DataClient.execute` to
|
|
55
|
+
* UI API GraphQL (`uiapi.currentUser`) — the same call `@salesforce/ui-bundle`'s
|
|
56
|
+
* `getCurrentUser` makes — so the feature reuses the base app's existing
|
|
57
|
+
* `@salesforce/platform-sdk` dependency and adds no new package.
|
|
58
|
+
*/
|
|
59
|
+
@Injectable({ providedIn: "root" })
|
|
60
|
+
export class AuthService {
|
|
61
|
+
// DataClient is provided by the base-angular-app; consumed via the
|
|
62
|
+
// `__inherit__` stub under app/api/ (patches-cli strips the prefix at compose
|
|
63
|
+
// so it resolves to the seeded base data-client.service.ts).
|
|
64
|
+
private readonly dataClient = inject(DataClient);
|
|
65
|
+
|
|
66
|
+
private readonly _user = signal<AuthUser | null>(null);
|
|
67
|
+
private readonly _loading = signal<boolean>(true);
|
|
68
|
+
private readonly _error = signal<string | null>(null);
|
|
69
|
+
|
|
70
|
+
/** The current authenticated user, or null when unauthenticated. */
|
|
71
|
+
readonly user = this._user.asReadonly();
|
|
72
|
+
/** True while the initial (or a manual) auth check is in flight. */
|
|
73
|
+
readonly loading = this._loading.asReadonly();
|
|
74
|
+
/** Error message from the most recent failed auth check, else null. */
|
|
75
|
+
readonly error = this._error.asReadonly();
|
|
76
|
+
/** Mirrors React `isAuthenticated = user !== null`. */
|
|
77
|
+
readonly isAuthenticated = computed(() => this._user() !== null);
|
|
78
|
+
|
|
79
|
+
constructor() {
|
|
80
|
+
// Kick off the initial check on construction (React mount `useEffect`).
|
|
81
|
+
void this.checkAuth();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Fetches the current user and updates state. Mirrors the React `checkAuth`.
|
|
86
|
+
*/
|
|
87
|
+
async checkAuth(): Promise<void> {
|
|
88
|
+
this._loading.set(true);
|
|
89
|
+
this._error.set(null);
|
|
90
|
+
try {
|
|
91
|
+
const userData = await this.getCurrentUser();
|
|
92
|
+
this._user.set(userData);
|
|
93
|
+
} catch (err) {
|
|
94
|
+
console.error("Authentication failed", err);
|
|
95
|
+
this._error.set("Authentication failed");
|
|
96
|
+
this._user.set(null);
|
|
97
|
+
} finally {
|
|
98
|
+
this._loading.set(false);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Returns the current user, throwing when unauthenticated. The Angular
|
|
104
|
+
* analogue of the React `useUser()` hook — used by the Profile page which
|
|
105
|
+
* only renders behind the auth guard.
|
|
106
|
+
*/
|
|
107
|
+
requireUser(): AuthUser {
|
|
108
|
+
const user = this._user();
|
|
109
|
+
if (!user) {
|
|
110
|
+
throw new Error("Authenticated context not established");
|
|
111
|
+
}
|
|
112
|
+
return user;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Navigate to the server-side logout endpoint. Uses `replace` to prevent the
|
|
117
|
+
* back button from returning to an authenticated session. Direct port of the
|
|
118
|
+
* React `logout`.
|
|
119
|
+
*/
|
|
120
|
+
logout(startURL?: string): void {
|
|
121
|
+
const finalLogoutUrl = startURL
|
|
122
|
+
? `${API_ROUTES.LOGOUT}?startURL=${encodeURIComponent(startURL)}`
|
|
123
|
+
: API_ROUTES.LOGOUT;
|
|
124
|
+
window.location.replace(finalLogoutUrl);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Fetches the current user via UI API GraphQL. Reproduces
|
|
129
|
+
* `@salesforce/ui-bundle`'s `getCurrentUser` so we don't add ui-bundle as a
|
|
130
|
+
* dependency (base app only ships @salesforce/platform-sdk). Guest sessions
|
|
131
|
+
* also resolve to a running user record, so they're filtered out via
|
|
132
|
+
* `UserType` rather than relying on a fetch failure — a confirmed guest
|
|
133
|
+
* resolves to `null` rather than throwing, so `checkAuth` doesn't record it
|
|
134
|
+
* as an error the guard would retry on the next navigation. A missing/null/
|
|
135
|
+
* empty UserType is treated as an error rather than assumed non-guest, since
|
|
136
|
+
* that's an unexpected shape we can't safely authenticate against.
|
|
137
|
+
*/
|
|
138
|
+
private async getCurrentUser(): Promise<AuthUser | null> {
|
|
139
|
+
const data = await this.dataClient.execute<CurrentUserGraphQLResult>(CURRENT_USER_QUERY);
|
|
140
|
+
const currentUser = data.uiapi?.currentUser;
|
|
141
|
+
|
|
142
|
+
if (!currentUser?.Id) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const userType = currentUser.UserType?.value;
|
|
147
|
+
|
|
148
|
+
if (!userType) {
|
|
149
|
+
throw new Error("Current user response missing UserType");
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (userType === "Guest") {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return { id: currentUser.Id, name: currentUser.Name?.value || "User" };
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<app-card-layout [title]="title()" [subtitle]="description()">
|
|
2
|
+
<div class="space-y-6">
|
|
3
|
+
@if (showAuthAlert()) {
|
|
4
|
+
<app-status-alert variant="info" message="You are already logged in." />
|
|
5
|
+
} @if (errorMessages().length > 0) { @if (errorMessages().length === 1) {
|
|
6
|
+
<app-status-alert variant="error" [message]="errorMessages()[0]" />
|
|
7
|
+
} @else {
|
|
8
|
+
<app-status-alert variant="error">
|
|
9
|
+
<ul>
|
|
10
|
+
@for (msg of errorMessages(); track msg) {
|
|
11
|
+
<li>{{ msg }}</li>
|
|
12
|
+
}
|
|
13
|
+
</ul>
|
|
14
|
+
</app-status-alert>
|
|
15
|
+
} } @if (success()) {
|
|
16
|
+
<app-status-alert variant="success" [message]="success()!" />
|
|
17
|
+
} @if (!showAuthAlert()) {
|
|
18
|
+
<form (ngSubmit)="onSubmit()">
|
|
19
|
+
<ng-content />
|
|
20
|
+
<app-submit-button
|
|
21
|
+
class="mt-6 block"
|
|
22
|
+
[label]="submitText()"
|
|
23
|
+
[loadingLabel]="submitLoadingText()"
|
|
24
|
+
[submitting]="submitting()"
|
|
25
|
+
[disabled]="isSubmitDisabled()"
|
|
26
|
+
/>
|
|
27
|
+
</form>
|
|
28
|
+
|
|
29
|
+
@if (footer(); as f) {
|
|
30
|
+
<app-footer-link [text]="f.text ?? ''" [to]="f.link" [linkText]="f.linkText" />
|
|
31
|
+
} }
|
|
32
|
+
</div>
|
|
33
|
+
</app-card-layout>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input, output } from "@angular/core";
|
|
7
|
+
import { FormsModule } from "@angular/forms";
|
|
8
|
+
import { CardLayoutComponent } from "../card-layout/card-layout";
|
|
9
|
+
import { StatusAlertComponent } from "../status-alert/status-alert";
|
|
10
|
+
import { SubmitButtonComponent } from "../submit-button/submit-button";
|
|
11
|
+
import { FooterLinkComponent } from "../footer-link/footer-link";
|
|
12
|
+
import { AuthService } from "../auth/auth.service";
|
|
13
|
+
|
|
14
|
+
/** Footer link descriptor for the auth form frame. */
|
|
15
|
+
export interface AuthFormFooter {
|
|
16
|
+
text?: string;
|
|
17
|
+
link: string;
|
|
18
|
+
linkText: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Wrapper enforcing a consistent layout (card) and error/success alert
|
|
23
|
+
* positioning for all authentication forms — the Angular port of the React
|
|
24
|
+
* `AuthForm`.
|
|
25
|
+
*
|
|
26
|
+
* Auth-aware behavior (identical to React):
|
|
27
|
+
* - While auth state is loading, the submit button is disabled.
|
|
28
|
+
* - If the user is already authenticated and `showAlreadyLoggedIn` is true, an
|
|
29
|
+
* info alert is shown and submit is disabled.
|
|
30
|
+
*
|
|
31
|
+
* The owning page holds the FormGroup and binds `[formGroup]` on the projected
|
|
32
|
+
* `<form>`; this component renders the frame, alerts, submit button, and footer.
|
|
33
|
+
* It emits `(submitted)` when the submit button is pressed so the page runs its
|
|
34
|
+
* submit handler. The page passes its submitting flag via `[submitting]` and any
|
|
35
|
+
* extra disabled condition via `[submitDisabled]`.
|
|
36
|
+
*/
|
|
37
|
+
@Component({
|
|
38
|
+
selector: "app-auth-form",
|
|
39
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
40
|
+
imports: [
|
|
41
|
+
FormsModule,
|
|
42
|
+
CardLayoutComponent,
|
|
43
|
+
StatusAlertComponent,
|
|
44
|
+
SubmitButtonComponent,
|
|
45
|
+
FooterLinkComponent,
|
|
46
|
+
],
|
|
47
|
+
templateUrl: "./auth-form.html",
|
|
48
|
+
})
|
|
49
|
+
export class AuthFormComponent {
|
|
50
|
+
private readonly authService = inject(AuthService);
|
|
51
|
+
|
|
52
|
+
readonly title = input.required<string>();
|
|
53
|
+
readonly description = input<string>("");
|
|
54
|
+
/** Error message(s) to surface; empty/null hides the error alert. */
|
|
55
|
+
readonly error = input<string | string[] | null>(null);
|
|
56
|
+
/** Success message to surface; empty/null hides the success alert. */
|
|
57
|
+
readonly success = input<string | null>(null);
|
|
58
|
+
/** Whether to show the "already logged in" alert and disable submit. @default true */
|
|
59
|
+
readonly showAlreadyLoggedIn = input<boolean>(true);
|
|
60
|
+
readonly submitText = input.required<string>();
|
|
61
|
+
readonly submitLoadingText = input<string>("Submitting…");
|
|
62
|
+
/** True while the page's async submit is in flight. */
|
|
63
|
+
readonly submitting = input<boolean>(false);
|
|
64
|
+
/** Extra disabled condition from the page (e.g. success state). */
|
|
65
|
+
readonly submitDisabled = input<boolean>(false);
|
|
66
|
+
readonly footer = input<AuthFormFooter | null>(null);
|
|
67
|
+
|
|
68
|
+
/** Emitted when the submit button is pressed (page runs its handler). */
|
|
69
|
+
readonly submitted = output<void>();
|
|
70
|
+
|
|
71
|
+
protected readonly isAuthenticated = this.authService.isAuthenticated;
|
|
72
|
+
protected readonly loading = this.authService.loading;
|
|
73
|
+
|
|
74
|
+
/** Info alert shown when already authenticated on a public page. */
|
|
75
|
+
protected readonly showAuthAlert = computed(
|
|
76
|
+
() => this.showAlreadyLoggedIn() && this.isAuthenticated(),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
/** Submit disabled when: caller says so, already-logged-in, or auth loading. */
|
|
80
|
+
protected readonly isSubmitDisabled = computed(
|
|
81
|
+
() => this.submitDisabled() || this.showAuthAlert() || this.loading(),
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
/** Normalizes the error input to an array for the template's list rendering. */
|
|
85
|
+
protected readonly errorMessages = computed<string[]>(() => {
|
|
86
|
+
const err = this.error();
|
|
87
|
+
if (!err) return [];
|
|
88
|
+
return Array.isArray(err) ? err : [err];
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
protected onSubmit(): void {
|
|
92
|
+
this.submitted.emit();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
|
7
|
+
import { AppLayoutComponent } from "../../../components/layout/app-layout/app-layout";
|
|
8
|
+
import { SessionTimeoutValidatorComponent } from "../session/session";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Top-level app wrapper — the faithful Angular port of the React `AuthAppLayout`
|
|
12
|
+
* (`<AuthProvider><SessionTimeoutValidator/><AppLayout/></AuthProvider>`).
|
|
13
|
+
*
|
|
14
|
+
* There is no AuthProvider equivalent: `AuthService` is `providedIn: 'root'`, so
|
|
15
|
+
* auth state is app-wide automatically. This component renders the
|
|
16
|
+
* session-timeout validator (whose warning modal is thus available on every
|
|
17
|
+
* child route, exactly like React) followed by the base `app-layout`. Child
|
|
18
|
+
* routes render inside the base layout's own `<router-outlet />` post-compose.
|
|
19
|
+
*
|
|
20
|
+
* Wired as the top route node's `component` in `app.routes.ts`; the route-merger
|
|
21
|
+
* swaps the base layout node for this wrapper (the same element-swap object-search
|
|
22
|
+
* performs by repeating `component: AppLayoutComponent`).
|
|
23
|
+
*/
|
|
24
|
+
@Component({
|
|
25
|
+
selector: "app-auth-app-layout",
|
|
26
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
imports: [SessionTimeoutValidatorComponent, AppLayoutComponent],
|
|
28
|
+
templateUrl: "./auth-layout.html",
|
|
29
|
+
})
|
|
30
|
+
export class AuthAppLayoutComponent {}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div class="p-4">
|
|
2
|
+
<app-card class="w-full">
|
|
3
|
+
@if (title() || subtitle()) {
|
|
4
|
+
<app-card-header>
|
|
5
|
+
@if (title()) {
|
|
6
|
+
<app-card-title>{{ title() }}</app-card-title>
|
|
7
|
+
} @if (subtitle()) {
|
|
8
|
+
<app-card-description>{{ subtitle() }}</app-card-description>
|
|
9
|
+
}
|
|
10
|
+
</app-card-header>
|
|
11
|
+
}
|
|
12
|
+
<app-card-content>
|
|
13
|
+
<ng-content />
|
|
14
|
+
</app-card-content>
|
|
15
|
+
</app-card>
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
7
|
+
import {
|
|
8
|
+
CardComponent,
|
|
9
|
+
CardContentComponent,
|
|
10
|
+
CardDescriptionComponent,
|
|
11
|
+
CardHeaderComponent,
|
|
12
|
+
CardTitleComponent,
|
|
13
|
+
} from "../../../components/ui/card/card";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Centered page shell for auth pages — a feature-owned composition over the base
|
|
17
|
+
* `app-card` ui primitives (not a base-template component). Renders a single
|
|
18
|
+
* `app-card` centered in the viewport with an optional title / subtitle header,
|
|
19
|
+
* and content-projects the page body.
|
|
20
|
+
*
|
|
21
|
+
* Consumed by the authentication login / register / reset pages as the
|
|
22
|
+
* `CenteredPageLayout` analogue's card frame. Tailwind utilities pass through
|
|
23
|
+
* via the host `class`.
|
|
24
|
+
*/
|
|
25
|
+
@Component({
|
|
26
|
+
selector: "app-card-layout",
|
|
27
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
28
|
+
imports: [
|
|
29
|
+
CardComponent,
|
|
30
|
+
CardHeaderComponent,
|
|
31
|
+
CardTitleComponent,
|
|
32
|
+
CardDescriptionComponent,
|
|
33
|
+
CardContentComponent,
|
|
34
|
+
],
|
|
35
|
+
templateUrl: "./card-layout.html",
|
|
36
|
+
})
|
|
37
|
+
export class CardLayoutComponent {
|
|
38
|
+
readonly title = input<string>("");
|
|
39
|
+
readonly subtitle = input<string | null>(null);
|
|
40
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Centralized configuration for Auth routes. Each route contains both the path
|
|
9
|
+
* and page title. Using constants prevents typos in route paths across the app.
|
|
10
|
+
*
|
|
11
|
+
* Direct port of the React `authenticationConfig.ts`. NOTE: Angular route
|
|
12
|
+
* `path` values are relative (no leading slash) in `app.routes.ts`; these
|
|
13
|
+
* PATH constants keep the leading slash so `routerLink` / `navigate` calls and
|
|
14
|
+
* the open-redirect validation behave exactly as the React version.
|
|
15
|
+
*/
|
|
16
|
+
export const ROUTES = {
|
|
17
|
+
LOGIN: {
|
|
18
|
+
PATH: "/login",
|
|
19
|
+
TITLE: "Login | MyApp",
|
|
20
|
+
},
|
|
21
|
+
REGISTER: {
|
|
22
|
+
PATH: "/register",
|
|
23
|
+
TITLE: "Create Account | MyApp",
|
|
24
|
+
},
|
|
25
|
+
FORGOT_PASSWORD: {
|
|
26
|
+
PATH: "/forgot-password",
|
|
27
|
+
TITLE: "Recover Password | MyApp",
|
|
28
|
+
},
|
|
29
|
+
RESET_PASSWORD: {
|
|
30
|
+
PATH: "/reset-password",
|
|
31
|
+
TITLE: "Reset Password | MyApp",
|
|
32
|
+
},
|
|
33
|
+
PROFILE: {
|
|
34
|
+
PATH: "/profile",
|
|
35
|
+
TITLE: "My Profile | MyApp",
|
|
36
|
+
},
|
|
37
|
+
CHANGE_PASSWORD: {
|
|
38
|
+
PATH: "/change-password",
|
|
39
|
+
TITLE: "Change Password | MyApp",
|
|
40
|
+
},
|
|
41
|
+
} as const;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Centralized configuration for API endpoints. These are server-side endpoints,
|
|
45
|
+
* not client-side routes.
|
|
46
|
+
*/
|
|
47
|
+
export const API_ROUTES = {
|
|
48
|
+
// W-21253864: Logout URL integration is not currently supported
|
|
49
|
+
LOGOUT: "/secur/logout.jsp",
|
|
50
|
+
// Custom Apex REST resources handling the auth flows.
|
|
51
|
+
LOGIN: "/services/apexrest/auth/login",
|
|
52
|
+
REGISTER: "/services/apexrest/auth/register",
|
|
53
|
+
FORGOT_PASSWORD: "/services/apexrest/auth/forgot-password",
|
|
54
|
+
RESET_PASSWORD: "/services/apexrest/auth/reset-password",
|
|
55
|
+
CHANGE_PASSWORD: "/services/apexrest/auth/change-password",
|
|
56
|
+
} as const;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Query parameter key used to store the return URL.
|
|
60
|
+
* e.g. /login?startUrl=/profile
|
|
61
|
+
*/
|
|
62
|
+
export const AUTH_REDIRECT_PARAM = "startUrl";
|
|
63
|
+
|
|
64
|
+
/** Placeholder text constants for authentication form inputs. */
|
|
65
|
+
export const AUTH_PLACEHOLDERS = {
|
|
66
|
+
EMAIL: "e.g. name@example.com",
|
|
67
|
+
PASSWORD: "Enter your password",
|
|
68
|
+
PASSWORD_CREATE: "Create a password",
|
|
69
|
+
PASSWORD_CONFIRM: "Re-enter your password",
|
|
70
|
+
PASSWORD_NEW: "Enter new password",
|
|
71
|
+
PASSWORD_NEW_CONFIRM: "Re-enter new password",
|
|
72
|
+
FIRST_NAME: "e.g. Alex",
|
|
73
|
+
LAST_NAME: "e.g. Smith",
|
|
74
|
+
USERNAME: "e.g. asmith",
|
|
75
|
+
} as const;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<p class="w-full text-center text-sm text-muted-foreground">
|
|
2
|
+
@if (text()) { {{ text() }} }
|
|
3
|
+
<a
|
|
4
|
+
[routerLink]="to()"
|
|
5
|
+
class="font-medium underline hover:text-primary transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
6
|
+
>
|
|
7
|
+
{{ linkText() }}
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|