@open-mercato/core 0.6.6-develop.6524.1.a78cc4694e → 0.6.6-develop.6526.1.6df9b3dd84
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/modules/sales/commands/documents.js +44 -0
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/commands/returns.js +2 -27
- package/dist/modules/sales/commands/returns.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +1 -0
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +9 -0
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/lib/shipments/snapshots.js +27 -1
- package/dist/modules/sales/lib/shipments/snapshots.js.map +2 -2
- package/dist/modules/workflows/lib/graph-utils.js +3 -3
- package/dist/modules/workflows/lib/graph-utils.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/sales/commands/documents.ts +65 -0
- package/src/modules/sales/commands/returns.ts +2 -32
- package/src/modules/sales/components/documents/ItemsSection.tsx +5 -0
- package/src/modules/sales/components/documents/LineItemDialog.tsx +10 -0
- package/src/modules/sales/i18n/de.json +4 -0
- package/src/modules/sales/i18n/en.json +4 -0
- package/src/modules/sales/i18n/es.json +4 -0
- package/src/modules/sales/i18n/pl.json +4 -0
- package/src/modules/sales/lib/shipments/snapshots.ts +30 -0
- package/src/modules/workflows/lib/graph-utils.ts +9 -4
|
@@ -388,10 +388,15 @@ function calculateSmartLayout(
|
|
|
388
388
|
const { id, level } = queue.shift()!
|
|
389
389
|
const currentLevel = levels.get(id)
|
|
390
390
|
|
|
391
|
-
//
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
391
|
+
// Only propagate when this path improves the node's level (longest path).
|
|
392
|
+
// Without this guard a cyclic graph (renegotiation/revision loops) keeps
|
|
393
|
+
// re-enqueuing children forever and freezes the browser (script timeout).
|
|
394
|
+
if (currentLevel !== undefined && level <= currentLevel) continue
|
|
395
|
+
levels.set(id, level)
|
|
396
|
+
|
|
397
|
+
// Safety cap: in a DAG a node's level is bounded by the node count; a
|
|
398
|
+
// higher value means we are walking a cycle, so stop descending.
|
|
399
|
+
if (level > steps.length) continue
|
|
395
400
|
|
|
396
401
|
const children = outgoing.get(id) || []
|
|
397
402
|
for (const child of children) {
|