From d783384c19178b8efa3e1fbc7c2c865b655847a4 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 30 May 2023 07:31:00 +0200 Subject: [PATCH 01/11] Clean up github actions (#24984) - Merge the file filters into `files-changed.yml` - Remove unused yaml anchors like `&backend` - Merge the `compliance-docs` workflow into `compliance` - Add actions linting - Misc cleanups for whitespace and step names --- .github/file-filters.yml | 15 -------- .github/workflows/files-changed.yml | 43 ++++++++++++++++------ .github/workflows/pull-compliance-docs.yml | 25 ------------- .github/workflows/pull-compliance.yml | 27 ++++++++++++++ 4 files changed, 59 insertions(+), 51 deletions(-) delete mode 100644 .github/file-filters.yml delete mode 100644 .github/workflows/pull-compliance-docs.yml diff --git a/.github/file-filters.yml b/.github/file-filters.yml deleted file mode 100644 index 26231c936423e..0000000000000 --- a/.github/file-filters.yml +++ /dev/null @@ -1,15 +0,0 @@ -docs: &docs - - "**/*.md" - - "docs/**" - -backend: &backend - - "**/*.go" - - "**/*.tmpl" - - "go.mod" - - "go.sum" - -frontend: &frontend - - "**/*.js" - - "web_src/**" - - "package.json" - - "package-lock.json" diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index 2efd6767197d1..9a9c54720b453 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -1,32 +1,53 @@ -name: files changed +name: files-changed on: workflow_call: outputs: - docs: - description: "whether docs files changed" - value: ${{ jobs.files-changed.outputs.docs }} backend: description: "whether backend files changed" - value: ${{ jobs.files-changed.outputs.backend }} + value: ${{ jobs.detect.outputs.backend }} frontend: description: "whether frontend files changed" - value: ${{ jobs.files-changed.outputs.frontend }} + value: ${{ jobs.detect.outputs.frontend }} + docs: + description: "whether docs files changed" + value: ${{ jobs.detect.outputs.docs }} + actions: + description: "whether actions files changed" + value: ${{ jobs.detect.outputs.actions }} jobs: - files-changed: + detect: name: detect which files changed runs-on: ubuntu-latest timeout-minutes: 3 # Map a step output to a job output outputs: - docs: ${{ steps.changes.outputs.docs }} backend: ${{ steps.changes.outputs.backend }} frontend: ${{ steps.changes.outputs.frontend }} + docs: ${{ steps.changes.outputs.docs }} + actions: ${{ steps.changes.outputs.actions }} steps: - uses: actions/checkout@v3 - - name: Check for backend file changes - uses: dorny/paths-filter@v2 + - uses: dorny/paths-filter@v2 id: changes with: - filters: .github/file-filters.yml + filters: | + backend: + - "**/*.go" + - "**/*.tmpl" + - "go.mod" + - "go.sum" + + frontend: + - "**/*.js" + - "web_src/**" + - "package.json" + - "package-lock.json" + + docs: + - "**/*.md" + - "docs/**" + + actions: + - ".github/workflows/*" diff --git a/.github/workflows/pull-compliance-docs.yml b/.github/workflows/pull-compliance-docs.yml deleted file mode 100644 index 0f6720a64dccf..0000000000000 --- a/.github/workflows/pull-compliance-docs.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: compliance-docs - -on: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - files-changed: - uses: ./.github/workflows/files-changed.yml - - compliance-docs: - if: needs.files-changed.outputs.docs == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 20 - - run: make deps-frontend - - run: make lint-md - - run: make docs # test if build could succeed diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index e108379b3096a..b7c1ab8a33c82 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -25,6 +25,7 @@ jobs: - run: make lint-backend env: TAGS: bindata sqlite sqlite_unlock_notify + lint-go-windows: if: needs.files-changed.outputs.backend == 'true' needs: files-changed @@ -41,6 +42,7 @@ jobs: TAGS: bindata sqlite sqlite_unlock_notify GOOS: windows GOARCH: amd64 + lint-go-gogit: if: needs.files-changed.outputs.backend == 'true' needs: files-changed @@ -55,6 +57,7 @@ jobs: - run: make lint-go env: TAGS: bindata gogit sqlite sqlite_unlock_notify + checks-backend: if: needs.files-changed.outputs.backend == 'true' needs: files-changed @@ -67,6 +70,7 @@ jobs: check-latest: true - run: make deps-backend deps-tools - run: make --always-make checks-backend # ensure the "go-licenses" make target runs + frontend: if: needs.files-changed.outputs.frontend == 'true' needs: files-changed @@ -79,6 +83,7 @@ jobs: - run: make deps-frontend - run: make lint-frontend - run: make checks-frontend + backend: if: needs.files-changed.outputs.backend == 'true' needs: files-changed @@ -113,3 +118,25 @@ jobs: env: GOOS: linux GOARCH: 386 + + docs: + if: needs.files-changed.outputs.docs == 'true' + needs: files-changed + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: make deps-frontend + - run: make lint-md + - run: make docs # test if build could succeed + + actions: + if: needs.files-changed.outputs.actions == 'true' + needs: files-changed + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + - run: make lint-actions From 32185efc1484c1d6ea3a5262a3c9779e8edb0b09 Mon Sep 17 00:00:00 2001 From: HesterG Date: Tue, 30 May 2023 18:08:09 +0800 Subject: [PATCH 02/11] Fix delete user account modal (#25004) Before: Screen Shot 2023-05-30 at 17 08 57 After: Screen Shot 2023-05-30 at 17 06 17 --- templates/admin/user/edit.tmpl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 00d21f24b0010..6130c38d98f1c 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -197,17 +197,17 @@ {{svg "octicon-trash"}} {{.locale.Tr "settings.delete_account_title"}} -
-

{{.locale.Tr "settings.delete_account_desc"}}

-
- {{$.CsrfTokenHtml}} -
-
- - +
+

{{.locale.Tr "settings.delete_account_desc"}}

+ {{$.CsrfTokenHtml}} +
+
+ + +
+

{{.locale.Tr "admin.users.purge_help"}}

-

{{.locale.Tr "admin.users.purge_help"}}

{{template "base/modal_actions_confirm" .}} From ee99cf6313ba565523b3c43f61ffda4b71e2c39b Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 30 May 2023 18:53:15 +0800 Subject: [PATCH 03/11] Refactor diffFileInfo / DiffTreeStore (#24998) Follow #21012, #22399 Replace #24983, fix #24938 Help #24956 Now, the `window.config.pageData.diffFileInfo` itself is a reactive store, so it's quite easy to sync values/states by it, no need to do "doLoadMoreFiles" or "callback". Screenshot: these two buttons both work. After complete loading, the UI is also right.
![image](https://github.com/go-gitea/gitea/assets/2114189/cc6310fd-7f27-45ea-ab4f-24952a87b421) ![image](https://github.com/go-gitea/gitea/assets/2114189/4c11dd67-ac03-4568-8541-91204d27a4e3) ![image](https://github.com/go-gitea/gitea/assets/2114189/38a22cec-41be-41e6-a209-f347b7a4c1de)
--- templates/repo/diff/box.tmpl | 52 +++++++++++----------- web_src/js/components/DiffFileList.vue | 28 +++++------- web_src/js/components/DiffFileTree.vue | 42 ++++++----------- web_src/js/components/DiffFileTreeItem.vue | 4 +- web_src/js/features/repo-diff.js | 39 +++++++--------- web_src/js/modules/stores.js | 11 +++-- 6 files changed, 76 insertions(+), 100 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 132f999808cc6..490465ea12fb1 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -45,33 +45,31 @@ {{end}}
- +
diff --git a/web_src/js/components/DiffFileList.vue b/web_src/js/components/DiffFileList.vue index 658357a887054..131be01811ce5 100644 --- a/web_src/js/components/DiffFileList.vue +++ b/web_src/js/components/DiffFileList.vue @@ -1,10 +1,10 @@