@vectoriox/iox-ui 4.14.0 → 4.14.1
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.
|
@@ -2434,21 +2434,27 @@ function referencedDataSources(nodes, all) {
|
|
|
2434
2434
|
const aliases = collectReferencedAliases(nodes);
|
|
2435
2435
|
return (all ?? []).filter(ds => aliases.has(ds?.alias));
|
|
2436
2436
|
}
|
|
2437
|
-
/** Like `referencedDataSources`, but also pulls in
|
|
2438
|
-
*
|
|
2439
|
-
*
|
|
2440
|
-
*
|
|
2437
|
+
/** Like `referencedDataSources`, but also pulls in a referenced source's DEPENDENCIES (transitively),
|
|
2438
|
+
* none of which the layout names directly:
|
|
2439
|
+
* - a `derived` alias needs its `request.derived.from` parent;
|
|
2440
|
+
* - a `relative` (route-context) alias needs its `request.relative.subjectFrom` (the current item)
|
|
2441
|
+
* and `request.relative.from` (the collection it navigates).
|
|
2442
|
+
* Use this when RESOLVING (the engine) so derived views and siblings/related don't resolve to nothing. */
|
|
2441
2443
|
function referencedDataSourcesDeep(nodes, all) {
|
|
2442
2444
|
const byAlias = new Map((all ?? []).map(d => [d?.alias, d]));
|
|
2443
2445
|
const wanted = collectReferencedAliases(nodes);
|
|
2444
2446
|
const queue = [...wanted];
|
|
2447
|
+
const enqueue = (alias) => {
|
|
2448
|
+
if (alias && !wanted.has(alias)) {
|
|
2449
|
+
wanted.add(alias);
|
|
2450
|
+
queue.push(alias);
|
|
2451
|
+
}
|
|
2452
|
+
};
|
|
2445
2453
|
while (queue.length) {
|
|
2446
2454
|
const ds = byAlias.get(queue.pop());
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
queue.push(from);
|
|
2451
|
-
}
|
|
2455
|
+
enqueue(ds?.request?.derived?.from);
|
|
2456
|
+
enqueue(ds?.request?.relative?.subjectFrom);
|
|
2457
|
+
enqueue(ds?.request?.relative?.from);
|
|
2452
2458
|
}
|
|
2453
2459
|
return (all ?? []).filter(d => wanted.has(d?.alias));
|
|
2454
2460
|
}
|