Skip to content

Commit a196339

Browse files
Marfuenclaude
andauthored
fix(onboarding): handle zero-item steps in tracker (#2785)
* 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> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bd43e8a commit a196339

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

apps/app/src/app/(app)/[orgId]/components/OnboardingTracker.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ export const OnboardingTracker = ({ onboarding }: { onboarding: Onboarding }) =>
197197
return {
198198
vendors: meta.vendors === true,
199199
risk: meta.risk === true,
200-
policies: pTotal > 0 && pCompleted >= pTotal,
200+
policies: pTotal === 0 || pCompleted >= pTotal,
201201
linkage: meta.linkage === true,
202-
vendorMitigations: vTotal > 0 && vCompleted >= vTotal,
203-
riskMitigations: rTotal > 0 && rCompleted >= rTotal,
202+
vendorMitigations: vTotal === 0 || vCompleted >= vTotal,
203+
riskMitigations: rTotal === 0 || rCompleted >= rTotal,
204204
currentStep: (meta.currentStep as string) || null,
205205
vendorsTotal: (meta.vendorsTotal as number) || 0,
206206
vendorsCompleted: (meta.vendorsCompleted as number) || 0,

0 commit comments

Comments
 (0)