From ee99cf6313ba565523b3c43f61ffda4b71e2c39b Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 30 May 2023 18:53:15 +0800 Subject: [PATCH] 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 132f999808..490465ea12 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 658357a887..131be01811 100644 --- a/web_src/js/components/DiffFileList.vue +++ b/web_src/js/components/DiffFileList.vue @@ -1,10 +1,10 @@