@xeplr/ui-jobs 1.6.2 → 1.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeplr/ui-jobs",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "The screens for @xeplr/jobs — schedule, run, pause and watch jobs — as routes a host app registers, or a standalone app",
5
5
  "type": "module",
6
6
  "main": "src/index.jsx",
@@ -246,11 +246,13 @@ export function workflowToRules(workflow) {
246
246
  const arrows = Array.isArray(decide.transitions) ? decide.transitions : []
247
247
  const rules = []
248
248
  for (const a of arrows) {
249
- if (a.target === 'end_success' && !a.when) continue
249
+ // An arrow with no condition at all is "otherwise", however it was written.
250
+ const when = a.when !== undefined ? a.when : (a.condition == null ? null : undefined)
251
+ if (a.target === 'end_success' && !when) continue
250
252
  const step = byKey[a.target]
251
- if (!step || a.when === undefined) return { editedElsewhere: true, rules: [] }
253
+ if (!step || when === undefined) return { editedElsewhere: true, rules: [] }
252
254
  rules.push({
253
- when: mapWhen(a.when, fromTriggerField),
255
+ when: mapWhen(when, fromTriggerField),
254
256
  run: step.values.jobId,
255
257
  inputs: mapBindings(step.values.inputs || {}, fromTriggerBindings),
256
258
  carry: mapBindings(step.values.carry || {}, fromTriggerBindings)