Commit 35e901a
fix(onboarding): prevent mitigation steps flashing complete (#2786)
* fix: address cubic review findings on onboarding PR
P1: Add metadata.set('policies', true) after policy fan-out so the
tracker boolean flag is set.
P1: Log batchTriggerAndWait failures in vendor/risk mitigation fan-outs
instead of silently ignoring them.
P2: Strip {{#if}}/{{/if}} markers from mixed-content nodes so template
syntax doesn't leak into rendered policies.
P2: Fix stale onboardingTriggerJobId locking publish button in
ToDoOverview.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: strip only first marker occurrence to preserve nested conditionals
The global regex flag in stripMarkerText would remove ALL matching
{{#if}}/{{/if}} markers in a subtree, corrupting boundaries of nested
conditional blocks. Removed the g flag so only the first occurrence
(the one that triggered the match) is stripped.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(onboarding): add comprehensive tests for policy template processor
Covers placeholder replacement, inline/multi-node/nested conditionals,
mixed content nodes, edge cases, buildVariables, buildFlags, processTemplate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(onboarding): treat zero-item steps as complete in tracker
When an org has no vendors or risks, `total > 0 && completed >= total`
evaluates to false, causing those steps to appear stuck forever.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(onboarding): prevent mitigation steps from flashing complete on load
Revert zero-item guard (total === 0 ||) back to (total > 0 &&) — before
totals metadata is set, the default of 0 caused steps to appear complete
then flip back to in-progress once actual totals arrived.
Also add missing risksTotal/risksInfo metadata alongside vendorsTotal
so risk mitigation progress tracks correctly in the UI.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(onboarding): show created/total format for vendor and risk creation steps
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a196339 commit 35e901a
2 files changed
Lines changed: 13 additions & 3 deletions
File tree
- apps/app/src
- app/(app)/[orgId]/components
- trigger/tasks/onboarding
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
669 | | - | |
| 669 | + | |
670 | 670 | | |
671 | 671 | | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
672 | 675 | | |
673 | 676 | | |
674 | 677 | | |
675 | 678 | | |
676 | | - | |
677 | | - | |
| 679 | + | |
| 680 | + | |
678 | 681 | | |
679 | 682 | | |
680 | 683 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
| |||
0 commit comments