common-header-lib 0.20.10 → 0.20.12
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/README.md +119 -2
- package/fesm2022/common-header-lib.mjs +332 -28
- package/fesm2022/common-header-lib.mjs.map +1 -1
- package/index.d.ts +62 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,12 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
Angular 20 shared header library for the Arcon platform. Provides the application header bar, LOB selector, user sidebar, notification panel, mailbox panel, waffle (9-dots) app panel, general configuration drawer, and all supporting services.
|
|
4
4
|
|
|
5
|
-
Current published version: **0.20.
|
|
5
|
+
Current published version: **0.20.12**
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## What's New
|
|
10
10
|
|
|
11
|
+
### 0.20.12
|
|
12
|
+
|
|
13
|
+
- **Proxy Access Token — Download button** — outlined in the library's primary colour at rest (white background; primary text, border and icon), filled primary with white text and icon on hover (was always filled). New `lib-download-btn` class; the icon is a mask that follows the text colour.
|
|
14
|
+
- **Oracle proxy certificate (CI-23566)** — Oracle added to the SSL/TLS certificate list. The component keeps its own "failed to download" toast: unlike the Workspace UI, the library has no app-wide error handler that would show the API's message instead.
|
|
15
|
+
- **General Configuration — sticky left menu** — the menu (`.left-card`) stays in view while a long screen such as the certificate list scrolls the dialog.
|
|
16
|
+
- **No "Required field" tooltip** — the native tooltip on the red `*` of required fields is removed in every General Configuration screen (Preference Path, Change Password, Preferred Timezone, Landing Page). The `*` keeps its `aria-label`, so screen readers still announce "required".
|
|
17
|
+
- **LOB dropdown focus** — the selected LOB text no longer shifts 1px when the dropdown gets the keyboard focus ring (the ring is drawn as an inset shadow, not a border). The dropdown's size now comes from SCSS (`height: 30px`, width 140px) instead of an inline `[style]`.
|
|
18
|
+
|
|
19
|
+
### 0.20.11
|
|
20
|
+
|
|
21
|
+
- **Session-end routing (`SessionEndService`, CI-26608)** — new exported service that decides where the user goes when a session ends, so the header and every host app follow one rule.
|
|
22
|
+
- The header's Logout button calls the logout API, then `SessionEndService.redirect(result)`. This replaces the old `identity` check, which sent default-identity-provider users to the login page (signing them straight back in) and Windows users to a `/logout` router path most host apps do not have.
|
|
23
|
+
- Host apps should call `SessionEndService.endSession()` from their HTTP interceptor (302 / 401 / 419 or a missing token) and from their 403 page. It calls `xaccess/api/SecureAccess/cookiesUpdation` once (parallel failures are deduplicated), clears local and session storage, and redirects.
|
|
24
|
+
- Destination: `loginMethod` 1 → login page (`origin/#/login`), 2 → `origin/#/logout?mode=windowsAuth`, 3 → `origin/#/logout?mode=defaultIdp`. Without a valid `loginMethod` — the logout API does not send it, only `cookiesUpdation` does — `identity`, then `ssoDefaultLogin` decide; otherwise the login page.
|
|
25
|
+
- Also exported: `readSessionEndAction`, `loginPageUrl`, `logoutScreenUrl` and the `SessionEndAction` type.
|
|
26
|
+
- Host-app usage and examples: see [Session end in host applications](#session-end-in-host-applications-sessionendservice).
|
|
27
|
+
- **SSO / MFA logout via `spRoute` (CI-15352, CSP-safe per CI-25594)** — when the logout response carries `spRoute` (the identity provider's auto-submit logout page), the header replays its form in the same window without executing the response HTML (new internal `ExternalFormPostService`; `javascript:`/`data:` form actions are refused), so it also works under `script-src 'self'`. The session-end redirect is skipped in that case: from a host app it navigates to another page, which would cancel the form submission. Without `spRoute`, logout is unchanged.
|
|
28
|
+
- **Mail table header stays pinned, with its borders** — PrimeNG 20 puts an inline `overflow: auto` on the table container, which made the sticky header scroll away with the rows; `.mail-table` sets it back to `overflow: visible`. The table also moved from `border-collapse: collapse` to `separate`, with the frame and row lines drawn on the cells: collapsed borders do not move with a sticky header, so its top border scrolled away and row text showed above it. Mail table only.
|
|
29
|
+
- **Notification panel spacing matches the Workspace UI** — header height (48px), title, close-button and content padding, and the hint position now match the Workspace notification sidebar; the close icon is the same `close.svg`. The ticket icon keeps its 40px circle when an event name wraps to two lines. Notification panel only.
|
|
30
|
+
- **Class rename: `changingContent` → `lib-changing-content`** — the mailbox overlay wrapper now follows the library's `lib-` class prefix. Host apps that styled `.changingContent` must switch to `.lib-changing-content`.
|
|
31
|
+
- **Focus ring corners** — the `.lib-ui :focus-visible` ring now has `border-radius: 4px` on every focusable element inside the header.
|
|
32
|
+
|
|
11
33
|
### 0.20.10
|
|
12
34
|
|
|
13
35
|
- **Subject filter "Contains" dropdown padding fixed** — in the mail table's Subject column-filter popover, the match-mode dropdown's label lost its `0 10px` padding and `13px` font size to competing PrimeNG/host styles, so the text sat against the control's edge. Both values are now `!important`. The rule stays scoped to `.lib-ui.mail-filter-overlay`, so no host-app dropdown is affected.
|
|
@@ -126,7 +148,7 @@ These are provided directly on `CommonHeaderLibComponent` (`providers: [HeaderDa
|
|
|
126
148
|
|
|
127
149
|
### Other services (singleton, provided in root or module)
|
|
128
150
|
|
|
129
|
-
`HttpCommonService`, `HttpGeneralConfigService`, `RestLoginFormService`, `RestSignalrService`, `EventService`, `ToastMsgService`, `StorageService`, `CookieStorageManagerService`, `EncrpDataService`, `EncryptDecryptRsaService`, `AsyncPasswordcheckService`, `VaptValidationService`
|
|
151
|
+
`HttpCommonService`, `HttpGeneralConfigService`, `RestLoginFormService`, `RestSignalrService`, `EventService`, `ToastMsgService`, `StorageService`, `CookieStorageManagerService`, `EncrpDataService`, `EncryptDecryptRsaService`, `AsyncPasswordcheckService`, `VaptValidationService`, `SessionEndService` (exported for host apps — see 0.20.11), `ExternalFormPostService` (internal, `spRoute` logout)
|
|
130
152
|
|
|
131
153
|
---
|
|
132
154
|
|
|
@@ -145,6 +167,101 @@ These are provided directly on `CommonHeaderLibComponent` (`providers: [HeaderDa
|
|
|
145
167
|
|
|
146
168
|
---
|
|
147
169
|
|
|
170
|
+
## Session end in host applications (`SessionEndService`)
|
|
171
|
+
|
|
172
|
+
The header handles its own **Logout** button. When the session **expires**, though, it is the host application that notices: its API calls fail in its own HTTP interceptor and never reach the header. In those places call `SessionEndService.endSession()` instead of redirecting yourself, so every module sends the user to the same place.
|
|
173
|
+
|
|
174
|
+
### When to call it
|
|
175
|
+
|
|
176
|
+
| Where in the host app | When |
|
|
177
|
+
|---|---|
|
|
178
|
+
| HTTP interceptor | A response means the session has ended: 302, 401 or 419 (or the token is missing) |
|
|
179
|
+
| 403 error page | After its countdown, instead of going to the login page |
|
|
180
|
+
|
|
181
|
+
Do **not** call it for the header's Logout button — the header already does that through the same service.
|
|
182
|
+
|
|
183
|
+
### What it does
|
|
184
|
+
|
|
185
|
+
1. `POST {page origin}/xaccess/api/SecureAccess/cookiesUpdation` with `{ actiontype: 'd', keys: ['-100'] }` (delete all server-side cookies) — the same call host apps made before.
|
|
186
|
+
2. On a `success` response it clears `localStorage` and `sessionStorage`, then sends the user where `result` says:
|
|
187
|
+
|
|
188
|
+
| `result` | Destination |
|
|
189
|
+
|---|---|
|
|
190
|
+
| `loginMethod: 1` | Login page — `{origin}/#/login` |
|
|
191
|
+
| `loginMethod: 2` | Logout screen — `{origin}/#/logout?mode=windowsAuth` |
|
|
192
|
+
| `loginMethod: 3` | Logout screen — `{origin}/#/logout?mode=defaultIdp` |
|
|
193
|
+
| no valid `loginMethod` | `identity: true` → Windows logout screen; else `ssoDefaultLogin: true` → default-IDP logout screen; else the login page |
|
|
194
|
+
|
|
195
|
+
3. A response that is not `success` → storage cleared, login page. If the call itself fails → login page, storage left as is.
|
|
196
|
+
|
|
197
|
+
The navigation is a full page load to the site root (the Workspace UI's login / logout pages), not a router navigation inside the host app.
|
|
198
|
+
|
|
199
|
+
It runs **once per page**: several requests failing together (e.g. five parallel calls getting 401) cause one `cookiesUpdation` call and one redirect. Later calls do nothing — including the one your interceptor makes if `cookiesUpdation` itself gets a 401, so there is no loop.
|
|
200
|
+
|
|
201
|
+
### Requirements
|
|
202
|
+
|
|
203
|
+
- `HttpClient` provided in the host app (`provideHttpClient(...)`). The `cookiesUpdation` call goes through the host's own interceptors.
|
|
204
|
+
- The call uses the **page's origin**, not the `_WAU` Web API URL.
|
|
205
|
+
|
|
206
|
+
### Example — HTTP interceptor (Angular 20, functional)
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
import { HttpErrorResponse, HttpInterceptorFn } from '@angular/common/http';
|
|
210
|
+
import { inject } from '@angular/core';
|
|
211
|
+
import { catchError, throwError } from 'rxjs';
|
|
212
|
+
import { SessionEndService } from 'common-header-lib';
|
|
213
|
+
|
|
214
|
+
/** Responses that mean the session has ended. */
|
|
215
|
+
const SESSION_ENDED_STATUSES = [302, 401, 419];
|
|
216
|
+
|
|
217
|
+
export const sessionEndInterceptor: HttpInterceptorFn = (req, next) => {
|
|
218
|
+
const sessionEnd = inject(SessionEndService);
|
|
219
|
+
return next(req).pipe(
|
|
220
|
+
catchError((error: HttpErrorResponse) => {
|
|
221
|
+
if (SESSION_ENDED_STATUSES.includes(error.status)) {
|
|
222
|
+
sessionEnd.endSession();
|
|
223
|
+
}
|
|
224
|
+
return throwError(() => error);
|
|
225
|
+
}),
|
|
226
|
+
);
|
|
227
|
+
};
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
// app.config.ts (standalone) — next to the library's own interceptor
|
|
232
|
+
provideHttpClient(withInterceptors([httpErrorInterceptor, sessionEndInterceptor])),
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
If the host already has an interceptor with this check, keep its status check and replace its own redirect (the old `if (identity) … else …` block) with `sessionEnd.endSession()`. In an NgModule host with a class-based interceptor (`HTTP_INTERCEPTORS`), inject `SessionEndService` the same way and call the same method.
|
|
236
|
+
|
|
237
|
+
### Example — 403 page
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
import { inject } from '@angular/core';
|
|
241
|
+
import { SessionEndService } from 'common-header-lib';
|
|
242
|
+
|
|
243
|
+
export class ForbiddenPageComponent {
|
|
244
|
+
private readonly sessionEnd = inject(SessionEndService);
|
|
245
|
+
|
|
246
|
+
// When the countdown reaches zero (instead of navigating to the login page):
|
|
247
|
+
private onCountdownFinished(): void {
|
|
248
|
+
this.sessionEnd.endSession();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Lower-level exports
|
|
254
|
+
|
|
255
|
+
For a host that needs the decision without the navigation:
|
|
256
|
+
|
|
257
|
+
| Export | Purpose |
|
|
258
|
+
|---|---|
|
|
259
|
+
| `readSessionEndAction(result)` | Returns `'login'`, `'windowsAuth'` or `'defaultIdp'` for a `cookiesUpdation` / logout `result` |
|
|
260
|
+
| `loginPageUrl(origin)` / `logoutScreenUrl(origin, mode)` | The destination URLs above |
|
|
261
|
+
| `SessionEndService.redirect(result)` | Navigates for a `result` you already have (what the header's Logout uses) |
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
148
265
|
## Angular patterns used
|
|
149
266
|
|
|
150
267
|
- `input()` / `output()` / `model()` signal-based bindings (Angular 17+)
|