Skip to content

refactor: rename MediaUpload to MediaUploadDialog and share content-type constants - #795

Merged
sarahentzel merged 2 commits into
developfrom
add-resource-renames
Oct 30, 2026
Merged

sarahentzel merged 2 commits into
developfrom
add-resource-renames

Conversation

@nabalone

Copy link
Copy Markdown
Collaborator

Pure renames split out of #741 (add-resource wizard refactor) so that PR is easier to review. No behavior change.

What changed

  • MediaUpload.tsx → MediaUploadDialog.tsx (component name and all importers updated).
  • Content-type constants (UriLinkType, MarkDownType, Mp3Type, FaithbridgeType) move from the dialog to utils/contentType.ts. This also removes the duplicate copies in resourceArtifactName.ts and its test, and a no-longer-needed jest mock in PassageDetailArtifacts.test.tsx.
  • MediaUploadContent prop saveText → saveButtonText (callers: TitleUploader, PassageRecordDlg).
  • ResourceData prop allowProject → allowGeneralResourceOption.
  • pullPlanMedia: getPlanId → getRemotePlanId (it returns the remote id).

Test plan

  • npm run typecheck (web) clean.
  • Jest: Uploader, PassageDetailArtifacts, resourceArtifactName, PassageRecordDlg suites pass (21 tests).

🤖 Generated with Claude Code

Pure renames split out of the add-resource wizard refactor (#741), no
behavior change:
- MediaUpload.tsx -> MediaUploadDialog.tsx (component + importers)
- UriLinkType/MarkDownType/Mp3Type/FaithbridgeType move to utils/contentType
  (drops the duplicate copies in resourceArtifactName and its test)
- MediaUploadContent prop saveText -> saveButtonText
- ResourceData prop allowProject -> allowGeneralResourceOption
- pullPlanMedia getPlanId -> getRemotePlanId

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is a set of pure renames and a constant relocation with no behavior change, and all references were consistently updated with no outstanding issues.

No open issues 🎉

What changed in this PR

This PR performs a set of pure renames split out of the larger add-resource wizard refactor (#741) to make that work easier to review, with no behavior change. It clarifies naming and centralizes shared content-type constants into an import-light utility leaf so consumers (hooks, dialogs, and Internalization components) can share them without pulling in the dialog's heavy import graph.

Changes:

  • Renamed the MediaUpload component/module to MediaUploadDialog and updated all importers and test mocks.
  • Moved content-type constants (UriLinkType, MarkDownType, Mp3Type, FaithbridgeType) into utils/contentType.ts, removing duplicate local copies in resourceArtifactName.ts/its test and an obsolete jest mock.
  • Clarified identifiers via renames: MediaUploadContent prop saveText → saveButtonText, ResourceData prop allowProject → allowGeneralResourceOption, and pullPlanMedia's getPlanId → getRemotePlanId.

I verified all references are consistently updated: no stale ./MediaUpload imports or JSX usages remain, all content-type constant consumers now import from utils/contentType.ts, and both prop renames are applied at every call site. No issues were found.

File Description
web/​src/​utils/​contentType.ts Adds the shared content-type constants to the import-light leaf.
web/​src/​crud/​pullPlanMedia.ts Renames internal getPlanId → getRemotePlanId and adds a clarifying comment.
web/​src/​components/​MediaUploadDialog.tsx Renames the component (from MediaUpload) and drops the constants now moved to contentType.ts.
web/​src/​components/​MediaUploadContent.tsx Imports constants from contentType.ts; renames saveText prop → saveButtonText.
web/​src/​components/​Uploader.tsx Uses MediaUploadDialog and imports FaithbridgeType from contentType.ts.
web/​src/​components/​Uploader.test.tsx Updates jest mock to ./MediaUploadDialog; drops the now-unneeded constant.
web/​src/​components/​ImportTab.tsx Switches import/JSX to MediaUploadDialog.
web/​src/​components/​GraphicUploader.tsx Switches import/JSX to MediaUploadDialog.
web/​src/​components/​ProjectDownloadAlert.tsx Imports MarkDownType/UriLinkType from contentType.ts.
web/​src/​components/​TitleUploader.tsx Updates prop saveText → saveButtonText.
web/​src/​components/​PassageRecordDlg.tsx Updates prop saveText → saveButtonText.
web/​src/​components/​PassageDetail/​Internalization/​SortableItem.tsx Imports content-type constants from contentType.ts.
web/​src/​components/​PassageDetail/​Internalization/​ResourceData.tsx Renames prop allowProject → allowGeneralResourceOption; imports from contentType.ts.
web/​src/​components/​PassageDetail/​Internalization/​resourceArtifactName.ts Replaces local constant copies with imports from contentType.ts.
web/​src/​components/​PassageDetail/​Internalization/​resourceArtifactName.test.ts Imports constants from contentType.ts instead of local copies.
web/​src/​components/​PassageDetail/​Internalization/​PassageDetailArtifacts.tsx Imports from contentType.ts; updates allowGeneralResourceOption at call sites.
web/​src/​components/​PassageDetail/​Internalization/​PassageDetailArtifacts.test.tsx Removes the obsolete MediaUpload jest mock.
web/​src/​components/​PassageDetail/​Internalization/​PassageDetailsArtifactsMobile.tsx Imports from contentType.ts; updates allowGeneralResourceOption at call sites.

Review effort: Balanced

Follow-up to the MediaUpload -> MediaUploadDialog rename: the 30
mediaUpload.* trans-units still named MediaUpload.tsx as their source file
for translators (flagged by Devin review).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@nabalone
nabalone marked this pull request as ready for review October 29, 2026 22:18
@sarahentzel
sarahentzel merged commit 947d874 into develop Oct 30, 2026
2 checks passed
@sarahentzel
sarahentzel deleted the add-resource-renames branch October 30, 2026 13:46
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.

3 participants