Refactor pull request view (4)#37451
Conversation
3c17ca1 to
d579092
Compare
There was a problem hiding this comment.
Pull request overview
Refactors the pull request merge box to stop relying on inline <script type="module"> for populating merge-form data, and instead passes the merge form’s initial state via a JSON-encoded HTML attribute into the Vue component.
Changes:
- Replace inline script-based merge-form data injection with a
data-merge-form-propsJSON attribute consumed byPullRequestMergeForm.vue. - Move merge-form props construction into a dedicated backend helper (
prepareMergeBoxFormProps) and store it inPullMergeBoxData. - Adjust templates to use the new merge-box data structure for conditional rendering of pull command instructions.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web_src/js/features/repo-issue-pull.ts | Parses merge-form props JSON from DOM and mounts Vue component; removes dynamic script execution on merge-box reload. |
| web_src/js/components/PullRequestMergeForm.vue | Switches merge-form data source from window.config.pageData to passed-in Vue props. |
| templates/repo/issue/view_content/pull_merge_instruction.tmpl | Reads ShowMergeInstructions via MergeBoxData instead of a direct template variable. |
| templates/repo/issue/view_content/pull_merge_box.tmpl | Replaces inline script with data-merge-form-props attribute and updates instruction template invocation. |
| routers/web/repo/pull_merge_form.go | New backend helper to build the merge form props payload and attach it to merge-box data. |
| routers/web/repo/pull.go | Refactors head-target display computation into pullRequestViewInfo while keeping template data intact. |
| routers/web/repo/issue_view.go | Moves merge-form related data preparation into PullMergeBoxData and invokes the new merge-form props builder. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d579092 to
e069df3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e069df3 to
fa2ff5f
Compare
|
#37451 (comment) seems like a real regression, recommend not merging until fixed. |
Typo, fixed in 0a5ee25 |
* main: Add DEFAULT_TITLE_SOURCE setting for pull request title default behavior (go-gitea#37465) Fix compare dropdown for branches without common history (go-gitea#37470) FIX: URL sanitization to handle schemeless credentials (go-gitea#37440) Refactor pull request view (4) (go-gitea#37451) Fix scheduled action panic with null event payload (go-gitea#37459) Fix attachment Content-Security-Policy (go-gitea#37455) [skip ci] Updated translations via Crowdin Rename CurrentRefPath to CurrentRefSubURL (go-gitea#37453) Clean up org pages layout (go-gitea#37445) Fix script error alert (go-gitea#37458) Fix inconsistent disabled styling on logged-out repo header buttons (go-gitea#37406) Add API endpoint to reply to pull request review comments (go-gitea#36683) Add CurrentURL template variable back (go-gitea#37444)
Use JSON attribute instead of inline script