feat(NES-1601): default Copy To Team dialog to active team#9074
feat(NES-1601): default Copy To Team dialog to active team#9074
Conversation
When a user opens CopyToTeamDialog (from Use-this-Template on a team template or from a journey's Duplicate menu), pre-fill the team selector with the user's active team instead of leaving it empty. Falls back to the existing single-team/empty behaviour when no active team is resolved. Fully client-side — the JourneyDuplicate mutation already accepts teamId from the client, so no api-journeys changes are needed.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 54 minutes and 31 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run journeys-e2e:e2e |
❌ Failed | 36s | View ↗ |
nx run journeys-admin-e2e:e2e |
✅ Succeeded | 27s | View ↗ |
nx run watch-e2e:e2e |
✅ Succeeded | 21s | View ↗ |
nx run resources-e2e:e2e |
✅ Succeeded | 16s | View ↗ |
nx run videos-admin-e2e:e2e |
✅ Succeeded | 4s | View ↗ |
nx run-many --target=vercel-alias --projects=jo... |
✅ Succeeded | 2s | View ↗ |
nx run-many --target=upload-sourcemaps --projec... |
✅ Succeeded | 9s | View ↗ |
nx run-many --target=deploy --projects=journeys... |
✅ Succeeded | 2m 42s | View ↗ |
Additional runs (12) |
✅ Succeeded | ... | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-04-24 01:13:31 UTC
Collapses the two default-team-selection tests to a single render helper so they differ only in the one input they vary — the lastActiveTeamId — plus their assertion. Saves ~40 lines of copy-paste scaffolding.
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
Found 1 test failure on Blacksmith runners: Failure
|

Summary
JourneyDuplicatemutation already acceptsteamIdfrom the client, so noapi-journeyschanges are needed.What changed
libs/journeys/ui/src/components/CopyToTeamDialog/CopyToTeamDialog.tsxactiveTeamfromuseTeam().initialValues.teamSelectnow defaults toactiveTeam?.id ?? (teams.length === 1 ? teams[0].id : '').enableReinitialize: trueis already on, so the form re-initializes cleanly onceactiveTeamresolves from the asyncGetLastActiveTeamIdAndTeamsquery.Scope note
CopyToTeamDialogis also reused byDuplicateJourneyMenuItem. The default naturally improves that flow too — there was no benefit to conditionally gating only for team templates (and doing so would have required a new prop). All usage sites share the better default.Testing
CopyToTeamDialog.spec.tsx:CopyToTeamDialog.spec.tsxstill pass.CopyToTeamMenuItem.spec.tsx(9 tests) andDuplicateJourneyMenuItem.spec.tsx(6 tests) pass unchanged.TemplateViewsuite (19 files, 156 tests) passes.nx lint journeys-uiclean (no new warnings).nx type-check journeys-uiclean.Post-Deploy Monitoring & Validation
No additional operational monitoring required: this is a client-only default-value change on a form field. The mutation shape and payloads are unchanged, there are no new error paths, and the fallback preserves prior behaviour when
activeTeamis not resolved.