You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/web_src/js
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.
2 years ago
..
components Add force_merge to merge request and fix checking mergable (#23010) (#23032) 2 years ago
features Escape path for the file list (#22741) (#22757) 2 years ago
markup Fix environments for KaTeX and error reporting (#22453) (#22473) 2 years ago
modules Improve commit status icons (#21124) 3 years ago
standalone Add new JS linter rules (#17699) 3 years ago
test Switch from jest to vitest (#21444) 2 years ago
bootstrap.js Quick fixes monaco-editor error: "vs.editor.nullLanguage" (#21734) (#21738) 2 years ago
index.js Add system setting table with cache and also add cache supports for user setting (#18058) 2 years ago
jquery.js Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055) 5 years ago
serviceworker.js Fix serviceworker output file and misc improvements (#11562) 5 years ago
svg.js Multiple improvements for comment edit diff (#21990) (#22007) 2 years ago
svg.test.js Remove vitest globals (#21505) 2 years ago
utils.js Use weighted algorithm for string matching when finding files in repo (#21370) 2 years ago
utils.test.js Remove vitest globals (#21505) 2 years ago