Skip to content

refactor: remove child translation templates#9151

Merged
csiyang merged 13 commits into
mainfrom
26-00-MA-feat-remove-child-translation-templates
May 15, 2026
Merged

refactor: remove child translation templates#9151
csiyang merged 13 commits into
mainfrom
26-00-MA-feat-remove-child-translation-templates

Conversation

@mikeallisonJS
Copy link
Copy Markdown
Collaborator

@mikeallisonJS mikeallisonJS commented May 5, 2026

Deleted the generated files for GetChildJourneysFromTemplateId and GetParentJourneysFromTemplateId, along with their associated hooks and mocks. Updated JourneyCardMenuItem, CopyToTeamMenuItem, LanguageScreen, and CopyToTeamDialog components to remove references to the deleted queries. This cleanup improves code maintainability and reduces unnecessary dependencies.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Simplified template language selection and duplication workflows
    • Removed restrictions on copying and translating certain template scenarios
  • Chores

    • Enhanced TypeScript module declarations for image file imports across applications

Deleted the generated files for GetChildJourneysFromTemplateId and GetParentJourneysFromTemplateId, along with their associated hooks and mocks. Updated JourneyCardMenuItem, CopyToTeamMenuItem, LanguageScreen, and CopyToTeamDialog components to remove references to the deleted queries. This cleanup improves code maintainability and reduces unnecessary dependencies.
@mikeallisonJS mikeallisonJS requested a review from csiyang May 5, 2026 00:17
@mikeallisonJS mikeallisonJS self-assigned this May 5, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@mikeallisonJS has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 30 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 065fe8ca-5a20-4f26-a53e-d86867a34c80

📥 Commits

Reviewing files that changed from the base of the PR and between 0eb857d and 38128bc.

📒 Files selected for processing (3)
  • apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.spec.tsx
  • apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx
  • libs/journeys/ui/src/components/CopyToTeamDialog/CopyToTeamDialog.spec.tsx

Walkthrough

This PR adds ESLint disable directives to i18next config files, extends TypeScript image module declarations across multiple apps, removes template-hierarchy language-fetching hooks, simplifies the LanguageScreen to rely on direct journey language comparison instead of template mappings, and removes journeyIsTemplate and journeyFromTemplateId props from CopyToTeamDialog and its callers, eliminating the "disable publisher copy and translate" behavior.

Changes

Configuration & Type Declarations

Layer / File(s) Summary
ESLint Directives
apps/docs/i18next.config.js, apps/journeys-admin/i18next.config.js, apps/journeys/i18next.config.js, apps/resources/i18next.config.js, apps/watch/i18next.config.js, libs/journeys/ui/i18next.config.js
Added @nx/enforce-module-boundaries ESLint disable comments to each i18next config file.
Image Module Type Declarations
apps/journeys-admin/index.d.ts, apps/player/index.d.ts, apps/resources/index.d.ts, apps/videos-admin/index.d.ts, apps/watch/index.d.ts
Added or extended TypeScript declare module declarations for *.png and *.jpg imports, typing them as StaticImageData from next/image. Existing *.svg declarations remain; apps/journeys-admin/index.d.ts also moved DateTime type to ambient global scope.

Template Language Query Removal & Dialog Simplification

Layer / File(s) Summary
Query & Hook Removal
apps/journeys-admin/src/libs/useGetChildTemplateJourneyLanguages/*, apps/journeys-admin/src/libs/useGetParentTemplateJourneyLanguages/*
Entirely removed useGetChildTemplateJourneyLanguages and useGetParentTemplateJourneyLanguages hooks, their GraphQL queries (GET_CHILD_JOURNEYS_FROM_TEMPLATE_ID, GET_PARENT_JOURNEYS_FROM_TEMPLATE_ID), mock fixtures, and test suites. These hooks previously fetched and mapped languages across template hierarchies.
Language Screen Simplification
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx, apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.spec.tsx
Removed parent/child template language-fetching logic and languagesJourneyMap construction. Updated handleSubmit to compare selected language directly against journey.language.id. Test suite simplified by removing all parent/child template query mocks and adjusting assertions accordingly; one test replaced to verify AI translation dialog is triggered for language changes.
Dialog Props Removal
libs/journeys/ui/src/components/CopyToTeamDialog/CopyToTeamDialog.tsx, libs/journeys/ui/src/components/CopyToTeamDialog/CopyToTeamDialog.spec.tsx
Removed journeyIsTemplate and journeyFromTemplateId props from CopyToTeamDialog definition and usage. Deleted the derived disablePublisherCopyAndTranslate logic and conditional disabling/warning UI. Updated test suite to remove parameterized template context coverage.
Component Integration
apps/journeys-admin/src/components/JourneyList/JourneyCard/JourneyCardMenu/DuplicateJourneyMenuItem/DuplicateJourneyMenuItem.tsx, apps/journeys-admin/src/components/Team/CopyToTeamMenuItem/CopyToTeamMenuItem.tsx, libs/journeys/ui/src/components/TemplateView/CreateJourneyButton/CreateJourneyButton.tsx
Removed journeyIsTemplate and journeyFromTemplateId prop passing from all CopyToTeamDialog and DynamicCopyToTeamDialog invocations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • JesusFilm/core#8586: Touches the same journey card/menu/copy dialog codepaths and modifies how journey context/props are passed through CopyToTeamDialog and related components.
  • JesusFilm/core#6543: Modifies the same translation/copy UX flows in CopyToTeamDialog, CopyToTeamMenuItem, DuplicateJourneyMenuItem, and related template-aware behavior.

Suggested reviewers

  • csiyang
  • edmonday
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: remove child translation templates' directly and specifically describes the main objective of the PR—removing the unused child and parent translation template query hooks and dependencies.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 26-00-MA-feat-remove-child-translation-templates

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Warnings
⚠️ ❗ Big PR (1176 changes)

(change count - 1176): Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.

Generated by 🚫 dangerJS against 9ae8c65

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 5, 2026

View your CI Pipeline Execution ↗ for commit 9ae8c65

Command Status Duration Result
nx run journeys-admin-e2e:e2e ✅ Succeeded 28s View ↗
nx run journeys-e2e:e2e ✅ Succeeded 19s View ↗
nx run watch-e2e:e2e ✅ Succeeded 18s View ↗
nx run resources-e2e:e2e ✅ Succeeded 14s 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 20s View ↗
nx run-many --target=vercel-alias --projects=re... ✅ Succeeded 2s View ↗
Additional runs (12) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-05-15 03:17:14 UTC

@github-actions github-actions Bot temporarily deployed to Preview - videos-admin May 5, 2026 00:19 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin May 5, 2026 00:19 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys May 5, 2026 00:19 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch May 5, 2026 00:19 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources May 5, 2026 00:19 Inactive
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Fri May 15 15:12:58 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Fri May 15 15:12:51 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Fri May 15 15:13:26 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Fri May 15 15:13:14 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Fri May 15 15:13:33 NZST 2026

@mikeallisonJS
Copy link
Copy Markdown
Collaborator Author

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions github-actions Bot temporarily deployed to Preview - videos-admin May 5, 2026 01:06 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources May 5, 2026 01:06 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - docs May 5, 2026 01:06 Inactive
@github-actions github-actions Bot requested a deployment to Preview - journeys-admin May 5, 2026 01:06 Pending
@github-actions github-actions Bot temporarily deployed to Preview - player May 5, 2026 01:06 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys May 5, 2026 01:06 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player May 5, 2026 01:46 Inactive
csiyang
csiyang previously approved these changes May 5, 2026
@stage-branch-merger
Copy link
Copy Markdown
Contributor

I see you added the "on stage" label, I'll get this merged to the stage branch!

@stage-branch-merger
Copy link
Copy Markdown
Contributor

Merge conflict attempting to merge this into stage. Please fix manually.

@linear
Copy link
Copy Markdown

linear Bot commented May 13, 2026

NES-1658

@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin May 13, 2026 19:07 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys May 13, 2026 19:07 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources May 13, 2026 19:07 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch May 13, 2026 19:07 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin May 13, 2026 19:07 Inactive
@csiyang csiyang enabled auto-merge May 15, 2026 02:38
@github-actions github-actions Bot temporarily deployed to Preview - watch May 15, 2026 03:10 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys May 15, 2026 03:10 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin May 15, 2026 03:10 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources May 15, 2026 03:10 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin May 15, 2026 03:10 Inactive
@csiyang csiyang added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit 98b895e May 15, 2026
32 checks passed
@csiyang csiyang deleted the 26-00-MA-feat-remove-child-translation-templates branch May 15, 2026 03:20
csiyang added a commit that referenced this pull request May 18, 2026
…ateId on CopyToTeamDialog

PR #9151 (refactor: remove child translation templates, 2026-05-14) landed
on main after this branch was cut and removed `journeyIsTemplate` +
`journeyFromTemplateId` from `CopyToTeamDialog` (along with the
publisher-side "disable copy-and-translate for non-original templates"
guard that consumed them).

`UseTemplateDeepLink` was authored against the pre-removal interface and
still passed those props, so the PR merge preview (pull/9173/merge) fails
journeys-admin type-check even though the branch tip alone is clean. CI
failure was reproducible across two lint-work runs but not locally —
local doesn't have main merged in.

Dropping the two props from the JSX is the correct resolution: the
"disable for non-original templates" logic was the only consumer and
it's gone. The deep-link receiver is consumed by anyone with the URL,
not just publishers, so the publisher-specific gate didn't apply here
anyway.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tanflem pushed a commit that referenced this pull request May 19, 2026
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Siyang Cao <67619008+csiyang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants