@zealicsolutions/web-ui 1.0.140-beta.221 → 1.0.140-beta.223
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/dist/cjs/helpers/rwoContext.d.ts +9 -5
- package/dist/cjs/helpers/useRwoContext.d.ts +6 -3
- package/dist/cjs/helpers/utils.d.ts +11 -7
- package/dist/cjs/index.js +87 -87
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/containers/FormStepContainer.js.map +1 -1
- package/dist/esm/contexts/OrganismContext/OrganismContext.js.map +1 -1
- package/dist/esm/contexts/OrganismContext/OrganismContextProvider.js.map +1 -1
- package/dist/esm/helpers/rwoContext.d.ts +9 -5
- package/dist/esm/helpers/useRwoContext.d.ts +6 -3
- package/dist/esm/helpers/useRwoContext.js +1 -1
- package/dist/esm/helpers/useRwoContext.js.map +1 -1
- package/dist/esm/helpers/utils.d.ts +11 -7
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +1 -1
- package/dist/esm/molecules/Avatar/Avatar.js.map +1 -1
- package/dist/esm/molecules/BasicTextField/BasicTextField.js.map +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js.map +1 -1
- package/dist/esm/molecules/MoleculeSkeletons/MoleculeSkeletons.js +1 -1
- package/dist/esm/molecules/MoleculeSkeletons/MoleculeSkeletons.js.map +1 -1
- package/dist/esm/molecules/Select/Select.js.map +1 -1
- package/package.json +1 -1
|
@@ -82,10 +82,14 @@ export declare const composeRwoParamsV2: ({ selectedWebpageId, includeRwoRecordI
|
|
|
82
82
|
* return; // No context for this webpage
|
|
83
83
|
* }
|
|
84
84
|
*
|
|
85
|
-
* // Get
|
|
86
|
-
* //
|
|
87
|
-
* // 2. Webpage-level: webpageContext.rwoRecordId
|
|
85
|
+
* // Get organism context - ONLY use organism-specific context
|
|
86
|
+
* // DO NOT fallback to webpage-level rwoRecordId
|
|
88
87
|
* const organismContext = webpageContext[organismId] as Record<string, string> | undefined;
|
|
89
|
-
*
|
|
90
|
-
*
|
|
88
|
+
*
|
|
89
|
+
* // Use organism context for data fetching (includes rwoRecordId + other fields)
|
|
90
|
+
* // Form fetching payload: { [sourceFieldId]: value, rwoRecordId: value }
|
|
91
|
+
* const fetchPayload = organismContext || {};
|
|
92
|
+
*
|
|
93
|
+
* // Use ONLY organism-specific rwoRecordId for form submission
|
|
94
|
+
* const rwoRecordIdForSubmission = organismContext?.rwoRecordId;
|
|
91
95
|
*/
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* Hook for organisms to easily access their RWO context from URL parameters.
|
|
3
3
|
* Uses webpage-scoped structure to prevent cross-page context pollution.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Structure: { [webpageId]: { [organismId]: { rwoRecordId, [fieldId]: value } } }
|
|
6
|
+
*
|
|
7
|
+
* CRITICAL: Forms ONLY use rwoRecordId from their organism-specific context.
|
|
8
|
+
* DO NOT fallback to webpage-level or top-level rwoRecordId.
|
|
6
9
|
*
|
|
7
10
|
* Organisms look up context by:
|
|
8
11
|
* 1. Get their current webpage ID from prop or URL
|
|
9
|
-
* 2. Look up rwoContext[webpageId] to get
|
|
10
|
-
* 3. Read rwoRecordId
|
|
12
|
+
* 2. Look up rwoContext[webpageId][organismId] to get organism's context
|
|
13
|
+
* 3. Read rwoRecordId ONLY from organism-specific context
|
|
11
14
|
*
|
|
12
15
|
* @param organismId - The ID of the organism consuming the context
|
|
13
16
|
* @param currentWebpageId - The webpage ID this organism belongs to (REQUIRED for proper scoping)
|
|
@@ -13,20 +13,24 @@ export declare const getRwoTargets: (url?: string) => Array<{
|
|
|
13
13
|
recordId: string;
|
|
14
14
|
}>;
|
|
15
15
|
/**
|
|
16
|
-
* Gets the
|
|
16
|
+
* Gets the RWO record ID for a specific organism using webpage-scoped RWO context.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* Structure: { [webpageId]: { [organismId]: { rwoRecordId, [fieldId]: value } } }
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* 2. Webpage-level: rwoContext[webpageId].rwoRecordId
|
|
20
|
+
* CRITICAL: Forms ONLY use rwoRecordId from their organism-specific context.
|
|
21
|
+
* DO NOT fallback to webpage-level rwoRecordId - this prevents unintended data fetching.
|
|
23
22
|
*
|
|
24
|
-
*
|
|
23
|
+
* Organisms read context by:
|
|
24
|
+
* 1. Get their current webpage ID
|
|
25
|
+
* 2. Look up rwoContext[webpageId][organismId] to get organism's context
|
|
26
|
+
* 3. Read rwoRecordId ONLY from organism-specific context
|
|
27
|
+
*
|
|
28
|
+
* This ensures forms only fetch/edit data when explicitly navigated to with their own context.
|
|
25
29
|
*
|
|
26
30
|
* @param organismId - The ID of the organism
|
|
27
31
|
* @param url - The URL to parse (defaults to current location)
|
|
28
32
|
* @param currentWebpageId - The current webpage ID (REQUIRED for proper scoping)
|
|
29
|
-
* @returns The record ID to use, or undefined if not found or no context for this
|
|
33
|
+
* @returns The record ID to use, or undefined if not found or no context for this organism
|
|
30
34
|
*/
|
|
31
35
|
export declare const getRwoRecordIdForOrganism: (organismId: string, url?: string, currentWebpageId?: string) => string | undefined;
|
|
32
36
|
export declare const updateSearchParams: (currentParams: URLSearchParams, internalLink?: Nullable<string>, isPreview?: boolean) => URLSearchParams;
|