Feature Pages Overview
Feature pages live under src/app/views/pages/ (plus src/app/views/onboarding/
for the onboarding flow) and are lazy-loaded from
src/app/app-routing.module.ts.
Page index
| Route | Module | Gating | Detail |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
|
|
|
— |
|
|
|
— |
|
|
|
— |
|
|
— (guard-only) |
|
The shell
Every authenticated route renders inside BaseComponent
(src/app/views/theme/base/), which provides:
|
Top navigation, built from |
|
Side navigation and |
|
Page title and breadcrumbs, fed by |
|
Footer with build version. |
|
Logo and white-label branding. |
|
Bootstrap loading screen. |
Global banners are rendered by the shell and managed by BannerService.
Common page anatomy
pages/<feature>/
├── <feature>.module.ts declarations + RouterModule.forChild(routes)
├── <feature>.component.ts the page component (or <feature>.page.ts)
├── <feature>.component.html
├── <feature>.component.scss
├── <feature>.service.ts feature-scoped service (provided by the module)
├── <feature>.config.ts route table / column config / constants
├── <feature>.enums.ts
├── <feature>.types.ts
└── <sub-feature>/ nested lazy modules
Page components typically:
-
extend
Subscriberand pipe throughtakeUntil(this.ngUnsubscribe$), -
use
ChangeDetectionStrategy.OnPush, -
set the page title through
SubheaderService, -
select from the store rather than calling services directly,
-
dispatch a load action in
ngOnInit.
Shared building blocks
|
Store-connected cards, mostly for the dashboard. |
|
Dialogs opened by |
|
Presentational primitives. |
|
CTA strategies, export dialogs, the TabaPay iframe. |
|
Reusable form templates such as |
|
AG Grid cell renderers. |
Full inventory: Shared Components.
Environment redirection
DashboardPageHelperService handles a supplier landing on the wrong environment
host. It compares the environment segment of the current host with the supplier’s
own site and, if they differ, rebuilds the URL and redirects:
redirectToSupplierSite(supplierSite: string, currentHost: string, token = ''): void {
const hostPart = this.generateHostPart(currentHost, supplierSite);
const loginPart = token ? `/#/login/auth?token=${token}` : '';
const protocol = this.windowRef.nativeWindow.location.protocol;
this.windowRef.nativeWindow.location.href = `${protocol}//${hostPart}${loginPart}`;
}
The host is split on . to take the environment segment, then on - to take the
dashboard segment, so dev1-sd.payability.com and dev1-crm.payability.com are
recognised as the same environment with different dashboards. When a token is
supplied the supplier is dropped straight into an authenticated session on the
correct host.