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
code-frequency.ts
codeeditor.ts
colorpicker.ts
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
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
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
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
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
repo-actions.ts Grey out expired artifact on Artifacts list (#34314) 2025-05-05 21:53:17 -07:00
repo-branch.ts
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
repo-diff-commitselect.ts
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
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
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
repo-search.ts
repo-settings-branches.test.ts
repo-settings-branches.ts
repo-settings.ts Optimize the calling code of queryElems (#34235) 2025-04-19 08:17:07 +08:00
repo-unicode-escape.ts
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
user-settings.ts Optimize the calling code of queryElems (#34235) 2025-04-19 08:17:07 +08:00