Shared library
What it is
src/app/shared/ is the application-wide library: ~67 components, 18
directives, 12 pipes, plus services, interceptors, guards, resolvers, models and
utilities. It is imported by every feature module through SharedModule.
The rule for placement: application-wide code lives here; module-wide code lives in
that module’s own shared/; component-specific code lives with the component. See
the module map.
|
Several concerns exist in more than one generation. This page names the current one for each. Before adding a shared component, check whether one of the older generations already covers it — and if it does, extend the current one rather than adding a fifth option. |
SharedModule exports
Everything below is exported by SharedModule and available in any feature module
that imports it.
Tables and grids
| Component | Status | Use |
|---|---|---|
|
Current |
The AG Grid wrapper with the project’s defaults. Use this for new grids. |
|
Widely used |
AG Grid table with header-template rendering
( |
|
Transitional |
Includes |
|
Oldest |
Material-table based. Its |
|
Light |
Small non-AG-Grid grid. |
|
Light |
Fixed short lists. |
|
Shared |
AG Grid cell renderers used across all generations —
e.g. |
|
— |
Pagination for the non-AG-Grid tables. |
AG Grid enterprise features are in use; the licence key is set in main.ts with
an expired ExpiryDate, which produces a console warning but does not disable
functionality. See technology stack.
Dialogs
| Component | Use |
|---|---|
|
The dialog opener and shared |
|
Generic yes/no. |
|
Delete confirmation with the item name. |
|
Informational, single button. |
|
Confirmation that requires a free-text reason — used where the reason is
persisted (supplier lifecycle actions). Mode enum in
|
|
Shows a computed summary before committing. |
|
Inline document preview. |
|
Confirmation raised on behalf of an embedded EVA frame. |
Domain-specific modals live with their feature (the ~20 folders under
suppliers/supplier/), not here.
Forms and inputs
| Component | Use |
|---|---|
|
The editable-card pattern: titled panel with edit/save/cancel submitting one
|
|
Configuration-driven forms, where the field set comes from data (report configuration, onboarding templates). |
|
A full family of in-place editors. Pick the specific one; do not build another. |
|
File selection for uploads. |
|
Input primitives. |
|
TinyMCE wrapper for email bodies and rich notes. |
|
Ordering UI. |
|
Declarative validation messages. Legacy; used in older forms. |
Display primitives
| Component | Use |
|---|---|
|
Read-only label/value pair. |
|
Section header with an icon. |
|
Empty state. |
|
Button with an inline progress state. |
|
The global loading indicators, driven by |
|
The sidebar task counters. |
|
A toast variant. |
|
Renders an external report feed. See reports. |
Filtering and search
| Component | Use |
|---|---|
|
Composite filter panel coordinating multiple controls. |
|
The individual filter controls. |
|
The global search modal, mounted once in the shell and opened by the sidebar. |
|
|
SearchEngineService.pybEncode percent-escapes ?, =, &, + as
~F, ~3D, ~26, ~2B before sending the phrase — a backend-specific encoding, not
URL encoding. search() has its feature check short-circuited to if (1 === 1).
Layout and navigation
| Component/directive | Use |
|---|---|
|
The shell. See UI composition. |
|
The sidebar and its hand-maintained menu tree. |
|
Sidebar behaviour. |
|
Sticky positioning. |
|
Shows why a control is disabled — the tooltip pattern used across the supplier workspace where a field is read-only due to status or permission. |
|
Footer and 404. |
|
Shared animation triggers (panel slide, expand/collapse). |
Pipes
CapitalizePipe, CurrencyPipe, DatePipe, PercentPipe, EllipsisPipe,
FromUnixPipe, KeysPipe, SafeHtmlPipe, SafeValuePipe, FormatPreviewPipe,
plus the two data-grid pipes.
|
|
Documents
Three document backends, three wrappers:
| Folder | Backend |
|---|---|
|
|
|
|
|
|
A fourth path exists — s3FilesProviderApi — and deposit-account documents use
documentsApiUrl. Which store a given attachment is in is not always inferable from
the front end.
EVA and iframes
eva/ (EvaComponent, EvaService, EvaCommunicationService, selector and cookie
constants, EvaPermissions) and iframe/ (CommunicationService,
ResizeIframeService, IframeComponent, MESSAGE_TYPE). See
iframe messaging and EVA.
The error-page game
error-handling/tetris/ — TetrisComponent, BoardComponent,
PybtrisButtonsComponent, piece/, game.service.ts, constants.ts, with specs.
Shown on the error page. See error handling.
Services in shared/
| Service | Purpose |
|---|---|
|
The error pipeline. See error handling. |
|
Contract templates and supplier contracts (+ abstract + mock). See contracts. |
|
Wrapper over |
|
Toastr stub for specs. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Server-sent events. See real-time streams. |
|
The in-app publish/subscribe bus. |
|
Segment/GA bootstrap and the KYC guardrail trail. See observability. |
|
Front-end and back-end versions. |
|
The |
|
Canned message codes ( |
|
Dynamic component embedding. |
|
Static dev-only console logging. |
|
|
|
The |
Utilities, models and constants
| Folder | Contents |
|---|---|
|
|
|
|
|
Pure helpers, e.g. |
|
|
|
|
|
|
|
|
|
|
Choosing what to use
| Need | Reach for |
|---|---|
A data grid |
|
An editable panel on a supplier tab |
|
An inline field edit |
The specific |
A confirmation |
|
A user-facing error |
|
Subscription cleanup |
Extend |
Reference data (states, countries, timezones) |
Dispatch |
A CSV download |
|
Telling another component to refresh |
|
Adding to shared/
-
Confirm the need is genuinely application-wide. If only one module uses it, it belongs in that module’s
shared/. -
Check the older generations first — especially for tables and dialogs.
-
Create
shared/<name>/with the component, template, styles and spec. -
Declare and export it in
SharedModule. -
Avoid
ViewEncapsulation.Noneunless the styles genuinely must be global (AppStageInfoComponent,TaskCountBadgeComponent,SelectorFormComponentand the event-rule forms use it — the pattern is not a recommendation). -
Do not import from a feature module. The two existing violations (
EvaCommunicationServiceandLookupRepositoryreaching intosuppliers/model) are debt, not precedent — see architectural overview. -
Document it here.