fix(studies): allow editing external resources on a module - #15
Merged
Merged
Conversation
ResourceDialog already supported edit mode (resource prop, isEdit flag, calls updateResource), but no caller ever rendered it that way — the module page only added a create trigger and a delete button per resource, with no edit entry point at all. Add an edit icon trigger to ResourceDialog when a resource is passed uncontrolled, and render it per row on the module page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ResourceDialog(src/components/studies/resource-dialog.tsx) already fully supported an edit mode —resourceprop,isEditflag, and callingupdateResourceon submit — but no caller anywhere ever rendered it in that mode. The module page (src/app/[locale]/(app)/studies/[programId]/[moduleId]/page.tsx) only wired up the "add" create trigger and a delete button per resource row, with no edit entry point at all, so external resources attached to a module could not be edited.ResourceDialog: when it's rendered uncontrolled with aresourceprop, it now shows a small pencil icon button (instead of the "add" button) that opens the same dialog pre-filled for editing.Test plan
npx tsc --noEmitnpx eslinton changed filesnpx next buildGenerated by Claude Code