From 2a3d852e461b4c8f0766cc8be390b569a50c2625 Mon Sep 17 00:00:00 2001 From: Gusted Date: Thu, 30 Oct 2025 21:06:14 +0100 Subject: [PATCH] feat: convert create/rename branch and create tag to native dialog (#9760) Followup to https://codeberg.org/forgejo/forgejo/pulls/8859, https://codeberg.org/forgejo/forgejo/pulls/9636. Convert the create branch and rename branch modals in the branch list to native dialogs and convert the create branch and create tag in the commit view to native dialogs. The dialogs in the commit view have been simplified and no longer uses javascript to construct the data in the dialog (thus would be eligible for nojs modals). The dialogs have footer styled actions. The rename branch modal now has a 'branch name' label to indicate the field is required. E2E testing is added. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9760 Reviewed-by: 0ko <0ko@noreply.codeberg.org> Co-authored-by: Gusted Co-committed-by: Gusted --- options/locale/locale_en-US.ini | 2 +- templates/repo/branch/list.tmpl | 86 +++++++++++----------- templates/repo/commit_header.tmpl | 86 +++++++++------------- tests/e2e/branch-operations.test.e2e.ts | 95 +++++++++++++++++++++++++ tests/e2e/commit-operations.test.e2e.ts | 68 ++++++++++++++++++ web_src/css/modules/dialog.css | 4 ++ web_src/js/features/repo-branch.js | 42 ----------- web_src/js/features/repo-branch.ts | 35 +++++++++ web_src/js/index.js | 2 +- 9 files changed, 279 insertions(+), 141 deletions(-) create mode 100644 tests/e2e/branch-operations.test.e2e.ts create mode 100644 tests/e2e/commit-operations.test.e2e.ts delete mode 100644 web_src/js/features/repo-branch.js create mode 100644 web_src/js/features/repo-branch.ts diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 118a0ee540..7d71282e40 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2754,7 +2754,7 @@ branch.included = Included branch.create_new_branch = Create branch from branch: branch.confirm_create_branch = Create branch branch.warning_rename_default_branch = You are renaming the default branch. -branch.rename_branch_to = Rename "%s" to: +branch.rename_branch_to = Renaming branch "%s". branch.create_branch_operation = Create branch branch.new_branch = Create new branch branch.new_branch_from = Create new branch from "%s" diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 164ecbf62c..55a7bbcf07 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -32,9 +32,7 @@ {{if and $.IsWriter (not $.Repository.IsArchived) (not $.Repository.IsMirror) (not .IsDeleted)}} @@ -178,10 +173,9 @@ {{end}} {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted) (not $.IsMirror)}} - +
+
- - -