Repository navigation
refactor: rename MediaUpload to MediaUploadDialog and share content-type constants - #795
Conversation
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>
There was a problem hiding this comment.
🟢 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
MediaUploadcomponent/module toMediaUploadDialogand updated all importers and test mocks. - Moved content-type constants (
UriLinkType,MarkDownType,Mp3Type,FaithbridgeType) intoutils/contentType.ts, removing duplicate local copies inresourceArtifactName.ts/its test and an obsolete jest mock. - Clarified identifiers via renames:
MediaUploadContentpropsaveText→saveButtonText,ResourceDatapropallowProject→allowGeneralResourceOption, andpullPlanMedia'sgetPlanId→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>
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).UriLinkType,MarkDownType,Mp3Type,FaithbridgeType) move from the dialog toutils/contentType.ts. This also removes the duplicate copies inresourceArtifactName.tsand its test, and a no-longer-needed jest mock inPassageDetailArtifacts.test.tsx.MediaUploadContentpropsaveText→saveButtonText(callers:TitleUploader,PassageRecordDlg).ResourceDatapropallowProject→allowGeneralResourceOption.pullPlanMedia:getPlanId→getRemotePlanId(it returns the remote id).Test plan
npm run typecheck(web) clean.Uploader,PassageDetailArtifacts,resourceArtifactName,PassageRecordDlgsuites pass (21 tests).🤖 Generated with Claude Code