@easygov/react-components 0.10.0 → 0.11.0
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 +10 -11
- package/dist/easygov.d.mts +10 -10
- package/dist/easygov.mjs +1 -1
- package/dist/easygov.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,8 +76,8 @@ that runs it.
|
|
|
76
76
|
|
|
77
77
|
### Reading the header context
|
|
78
78
|
|
|
79
|
-
The header resolves the signed-in user, the selected customer account, the running process
|
|
80
|
-
|
|
79
|
+
The header resolves the signed-in user, the selected customer account, and the running process
|
|
80
|
+
or the parent process a sub-process is being created under, from core-backend and publishes them to
|
|
81
81
|
consumers:
|
|
82
82
|
|
|
83
83
|
```tsx
|
|
@@ -86,7 +86,7 @@ import { useEasygovHeaderContext } from '@easygov/react-components';
|
|
|
86
86
|
function ContactForm() {
|
|
87
87
|
const { claims } = useEasygovHeaderContext();
|
|
88
88
|
const account = claims?.customerAccount;
|
|
89
|
-
const parentProcess = claims?.
|
|
89
|
+
const parentProcess = claims?.parentProcess;
|
|
90
90
|
|
|
91
91
|
return (
|
|
92
92
|
<form>
|
|
@@ -99,14 +99,13 @@ function ContactForm() {
|
|
|
99
99
|
}
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
`claims.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
without relying solely on the array's ordering.
|
|
102
|
+
`claims.process` and `claims.parentProcess` are mutually exclusive. `process` is the Behördengang
|
|
103
|
+
the URL selects (`/process/{id}`). `parentProcess` is the Behördengang a sub-process is about to be
|
|
104
|
+
created under (`/parentprocess/{id}`) — not a selected Behördengang. Neither is present when the
|
|
105
|
+
URL addresses no process. Each `SelectedProcess` carries its own `parentProcessId`, the global
|
|
106
|
+
identifier of its parent, absent for a top-level Behördengang. That reference is the only
|
|
107
|
+
representation of a selected process's parent: the context carries no ancestor chain, because it
|
|
108
|
+
is forwarded as an HTTP header where 4/8 KB size limits apply.
|
|
110
109
|
|
|
111
110
|
`claims` is `null` until the first response lands and again after logout — render a fallback,
|
|
112
111
|
don't assume it is present on first paint. The hook reflects the last context an `EasygovHeader`
|
package/dist/easygov.d.mts
CHANGED
|
@@ -390,9 +390,9 @@ interface SelectedProcess {
|
|
|
390
390
|
individualServicePermissionModel: boolean;
|
|
391
391
|
};
|
|
392
392
|
/**
|
|
393
|
-
* Global identifier of this process's own parent. Absent for a top-level Behördengang.
|
|
394
|
-
*
|
|
395
|
-
*
|
|
393
|
+
* Global identifier of this process's own parent. Absent for a top-level Behördengang. This
|
|
394
|
+
* reference is the only representation of a selected process's parent: the context carries no
|
|
395
|
+
* ancestor chain.
|
|
396
396
|
*/
|
|
397
397
|
parentProcessId?: string;
|
|
398
398
|
}
|
|
@@ -419,16 +419,16 @@ interface UserProfile {
|
|
|
419
419
|
interface HeaderContextClaims {
|
|
420
420
|
currentUser: UserProfile;
|
|
421
421
|
customerAccount?: SelectedCustomerAccount;
|
|
422
|
+
/**
|
|
423
|
+
* The Behördengang the URL selects (`/process/{id}`). Mutually exclusive with `parentProcess`.
|
|
424
|
+
*/
|
|
422
425
|
process?: SelectedProcess;
|
|
423
426
|
/**
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
* Present while `process` is absent means a sub-process is about to be created under
|
|
428
|
-
* `parentProcesses[0]`, which is then the addressed Process itself and NOT a selected
|
|
429
|
-
* Behördengang. That is the `/parentprocess/{id}` URL form.
|
|
427
|
+
* The Behördengang a sub-process is about to be created under (`/parentprocess/{id}`).
|
|
428
|
+
* Mutually exclusive with `process`, and NOT a selected Behördengang. A selected process's own
|
|
429
|
+
* parent is never included as an object — only as `process.parentProcessId`.
|
|
430
430
|
*/
|
|
431
|
-
|
|
431
|
+
parentProcess?: SelectedProcess;
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
interface EasygovHeaderContext {
|