gitea/web_src/js/features
Brecht Van Lommel a46b16f10f
Edit file workflow for creating a fork and proposing changes (#34240)
When viewing a file that the user can't edit because they can't write to
the branch, the new, upload, patch, edit and delete functionality is no
longer disabled.

If no user fork of the repository exists, there is now a page to create one.
It will automatically create a fork with a single branch matching the one
being viewed, and a unique repository name will be automatically picked.

When a fork exists, but it's archived, a mirror or the user can't write
code to it, there will instead be a message explaining the situation.

If the usable fork exists, a message will appear at the top of the edit page
explaining that the changes will be applied to a branch in the fork. The
base repository branch will be pushed to a new branch to the fork, and
then the edits will be applied on top.

The suggestion to fork happens when accessing /_edit/, so that for
example online documentation can have an "edit this page" link to
the base repository that does the right thing.

Also includes changes to properly report errors when trying to commit
to a new branch that is protected, and when trying to commit to an
existing branch when choosing the new branch option.

Resolves #9017, #20882

---------

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-22 12:43:43 +00:00
..
admin Optimize the calling code of queryElems (#34235) 2025-04-19 08:17:07 +08:00
comp Fix readme path and markdown link paste (#34755) 2025-06-18 04:19:54 +00:00
captcha.ts Fix mCaptcha bug (#33659) 2025-02-20 22:53:38 +08:00
citation.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
clipboard.ts Enable Typescript strictFunctionTypes (#32911) 2024-12-22 02:59:25 +08:00
code-frequency.ts Convert frontend code to typescript (#31559) 2024-07-07 15:32:30 +00:00
codeeditor.ts Improve JSX/TSX support in code editor (#32833) 2024-12-14 03:10:20 +00:00
colorpicker.ts Enable Typescript strictFunctionTypes (#32911) 2024-12-22 02:59:25 +08:00
common-button.test.ts Add a button editing action secret (#34348) 2025-05-08 17:11:43 +00:00
common-button.ts Fix autofocus behavior (#34397) 2025-05-08 18:26:18 +00:00
common-fetch-action.ts Edit file workflow for creating a fork and proposing changes (#34240) 2025-06-22 12:43:43 +00:00
common-form.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
common-issue-list.test.ts Convert frontend code to typescript (#31559) 2024-07-07 15:32:30 +00:00
common-issue-list.ts Fix autofocus behavior (#34397) 2025-05-08 18:26:18 +00:00
common-organization.ts Optimize the calling code of queryElems (#34235) 2025-04-19 08:17:07 +08:00
common-page.ts Optimize the calling code of queryElems (#34235) 2025-04-19 08:17:07 +08:00
contextpopup.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
contributors.ts Add "n commits" link to contributors in contributors graph page (#32799) 2024-12-12 19:02:54 +00:00
copycontent.ts Update TypeScript types (#33799) 2025-03-05 08:03:44 -08:00
dashboard.ts Enable Typescript noImplicitThis (#33250) 2025-01-16 04:26:17 +08:00
dropzone.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
emoji.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
eventsource.sharedworker.ts Enable Typescript strictFunctionTypes (#32911) 2024-12-22 02:59:25 +08:00
file-fold.ts Mark parent directory as viewed when all files are viewed (#33958) 2025-04-15 22:35:22 +08:00
heatmap.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
imagediff.ts Drop fomantic build (#33845) 2025-03-11 12:44:52 +08:00
install.ts Add post-installation redirect based on admin account status (#34493) 2025-06-21 18:48:06 +00:00
issue.ts Trivial fixes (#33304) 2025-01-17 08:55:02 +00:00
notification.ts Refactor legacy JS (#33115) 2025-01-06 17:38:42 +08:00
oauth2-settings.ts Enable Typescript strictFunctionTypes (#32911) 2024-12-22 02:59:25 +08:00
org-team.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
pull-view-file.ts Mark parent directory as viewed when all files are viewed (#33958) 2025-04-15 22:35:22 +08:00
recent-commits.ts Convert frontend code to typescript (#31559) 2024-07-07 15:32:30 +00:00
repo-actions.ts Grey out expired artifact on Artifacts list (#34314) 2025-05-05 21:53:17 -07:00
repo-branch.ts Fix a number of typescript errors (#32773) 2024-12-11 09:29:04 +01:00
repo-code.ts Fix line-button issue after file selection in file tree (#34574) 2025-06-02 09:52:12 +08:00
repo-commit.ts [Fix] Resolve the problem of commit_statuses not being loaded at the top - right when switching files from the file tree (#34079) 2025-03-31 18:39:08 +00:00
repo-common.test.ts Fix some migration and repo name problems (#33986) 2025-03-24 20:26:58 -07:00
repo-common.ts Fix some migration and repo name problems (#33986) 2025-03-24 20:26:58 -07:00
repo-diff-commit.ts Fix a number of typescript errors (#32773) 2024-12-11 09:29:04 +01:00
repo-diff-commitselect.ts Convert frontend code to typescript (#31559) 2024-07-07 15:32:30 +00:00
repo-diff-filetree.ts Use git diff-tree for DiffFileTree on diff pages (#33514) 2025-02-28 00:58:25 +00:00
repo-diff.ts Fix various Fomantic UI and htmx problems (#33851) 2025-03-11 11:35:05 -07:00
repo-editor.ts Refactor editor (#34780) 2025-06-21 19:20:51 +08:00
repo-findfile.test.ts Convert frontend code to typescript (#31559) 2024-07-07 15:32:30 +00:00
repo-findfile.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
repo-graph.ts Fix dynamic content loading init problem (#33748) 2025-03-01 02:02:10 +00:00
repo-home.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
repo-issue-content.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
repo-issue-edit.ts Fix: quoted replies incorrectly render user input as part of the quote (#34216) 2025-04-16 14:32:58 +08:00
repo-issue-list.ts Fix autofocus behavior (#34397) 2025-05-08 18:26:18 +00:00
repo-issue-pull.ts Option to delay conflict checking of old pull requests until page view (#27779) 2025-04-24 19:26:57 +00:00
repo-issue-sidebar-combolist.ts Fix some dropdown problems on the issue sidebar (#34308) 2025-04-30 02:00:36 +00:00
repo-issue-sidebar.md Fix issue sidebar dropdown keyboard support (#33447) 2025-01-30 22:54:50 +00:00
repo-issue-sidebar.ts Fix some dropdown problems on the issue sidebar (#34308) 2025-04-30 02:00:36 +00:00
repo-issue.ts Option to delay conflict checking of old pull requests until page view (#27779) 2025-04-24 19:26:57 +00:00
repo-legacy.ts Option to delay conflict checking of old pull requests until page view (#27779) 2025-04-24 19:26:57 +00:00
repo-migrate.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
repo-migration.ts Fix some migration and repo name problems (#33986) 2025-03-24 20:26:58 -07:00
repo-milestone.ts Fix milestone deadline and date related problems (#32339) 2024-11-05 07:46:40 +00:00
repo-new.ts fix org repo creation being limited by user limits (#34030) 2025-03-27 13:16:17 +00:00
repo-projects.ts Add fullscreen mode as a more efficient operation way to view projects (#34081) 2025-04-23 13:42:22 +08:00
repo-release.ts Enable Typescript strictFunctionTypes (#32911) 2024-12-22 02:59:25 +08:00
repo-search.ts Enable Typescript strictFunctionTypes (#32911) 2024-12-22 02:59:25 +08:00
repo-settings-branches.test.ts Refactor repo-projects.ts (#32892) 2024-12-19 08:37:12 +00:00
repo-settings-branches.ts Allow cropping an avatar before setting it (#32565) 2024-11-28 02:15:59 +00:00
repo-settings.ts Optimize the calling code of queryElems (#34235) 2025-04-19 08:17:07 +08:00
repo-unicode-escape.ts Fix "unicode escape" JS error (#32806) 2024-12-12 18:37:44 +00:00
repo-view-file-tree.ts Add file tree to file view page (#32721) 2025-03-15 16:26:49 +08:00
repo-wiki.ts Refactor markup and pdf-viewer to use new init framework (#33772) 2025-03-03 11:49:15 -08:00
sshkey-helper.ts Enable Typescript noImplicitThis (#33250) 2025-01-16 04:26:17 +08:00
stopwatch.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
tablesort.ts Enable Typescript noImplicitAny (#33322) 2025-01-22 15:11:51 +08:00
tribute.ts Fix various trivial frontend problems (#34263) 2025-04-24 09:11:54 +08:00
user-auth-webauthn.ts Simplify secure context check (#33906) 2025-03-16 19:05:26 +08:00
user-auth.ts Warn users when they try to use a non-root-url to sign in/up (#32272) 2024-10-17 10:28:51 +08:00
user-settings.ts Optimize the calling code of queryElems (#34235) 2025-04-19 08:17:07 +08:00