forgejo/web_src/js/components
Jason Song 90982bffa5
Add force_merge to merge request and fix checking mergable (#23010) (#23032)
Backport #23010.

Fix #23000.

The bug was introduced in #22633, and it seems that it has been noticed:
https://github.com/go-gitea/gitea/pull/22633#discussion_r1095395359 .

However, #22633 did nothing wrong, the logic should be "check if they is
admin only when `force` is true".

So we should provide the `ForceMerge` when merging from UI.

After this, an admin can also send a normal merge request with
`ForceMerge` false. So it fixes a potential bug: if the admin doesn't
want to do a force merge, they just see the green "Merge" button and
click it. At the same time, the status of the PR changed, and it
shouldn't be merged now, so the admin could send an unexpected force
merge.

In addition, I updated `ForceMerge *bool` to `ForceMerge bool`, I don't
see the reason to use a pointer.

And fixed the logic of CheckPullMergable to handle auto merge and force
merge correctly.
2023-02-21 09:42:22 -06:00
..
.eslintrc.yaml Fix eslint parsing errors, remove eslint-plugin-html (#20323) 2022-07-15 17:38:18 +08:00
ActivityHeatmap.vue Fix heatmap first color being unused (#22158) 2022-12-18 15:18:07 +02:00
ContextPopup.vue Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
DashboardRepoList.js Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
DiffFileList.vue Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
DiffFileTree.vue Restore function to "Show more" buttons (#22399) (#22426) 2023-01-13 17:29:10 +08:00
DiffFileTreeItem.vue Fix PR file tree folders no longer collapsing (#22864) (#22872) 2023-02-12 13:14:19 +02:00
PullRequestMergeForm.vue Add force_merge to merge request and fix checking mergable (#23010) (#23032) 2023-02-21 09:42:22 -06:00
RepoActivityTopAuthors.vue Split index.js to separate files (#17315) 2021-10-17 01:28:04 +08:00
RepoBranchTagDropdown.js Refactor from Vue2 to Vue3 (#20044) 2022-10-01 22:26:38 +08:00
VueComponentLoader.js Update JS dependencies and eslint config (#21388) 2022-10-10 20:02:20 +08:00