From 35054f670867a517bfa6296e34822febc8e6d278 Mon Sep 17 00:00:00 2001 From: sillyguodong Date: Mon, 29 May 2023 18:19:20 +0800 Subject: [PATCH 1/4] hide show more btn in file list if no more data --- web_src/js/components/DiffFileTree.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/js/components/DiffFileTree.vue b/web_src/js/components/DiffFileTree.vue index 6ac16def995a6..9792b51f3182b 100644 --- a/web_src/js/components/DiffFileTree.vue +++ b/web_src/js/components/DiffFileTree.vue @@ -147,6 +147,7 @@ export default { this.isLoadingNewData = false; const {pageData} = window.config; this.diffEnd = pageData.diffFileInfo.diffEnd; + this.isIncomplete = pageData.diffFileInfo.isIncomplete; }); }, }, From e2706e87d457e3a8074f36a1df78e149c346c984 Mon Sep 17 00:00:00 2001 From: sillyguodong Date: Mon, 29 May 2023 18:55:01 +0800 Subject: [PATCH 2/4] hide btn in tree when click btn in file list --- web_src/js/components/DiffFileTree.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/js/components/DiffFileTree.vue b/web_src/js/components/DiffFileTree.vue index 9792b51f3182b..77532f85dba75 100644 --- a/web_src/js/components/DiffFileTree.vue +++ b/web_src/js/components/DiffFileTree.vue @@ -94,6 +94,7 @@ export default { // Merge folders with just a folder as children in order to // reduce the depth of our tree. mergeChildIfOnlyOneDir(result); + this.isIncomplete = pageData.diffFileInfo.isIncomplete; return result; } }, From 35422cab9693ff79bf8e2a1bd72f1e4029cb117b Mon Sep 17 00:00:00 2001 From: sillyguodong Date: Mon, 29 May 2023 22:07:07 +0800 Subject: [PATCH 3/4] use computed --- web_src/js/components/DiffFileTree.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web_src/js/components/DiffFileTree.vue b/web_src/js/components/DiffFileTree.vue index 77532f85dba75..812c8d12aac5f 100644 --- a/web_src/js/components/DiffFileTree.vue +++ b/web_src/js/components/DiffFileTree.vue @@ -7,7 +7,7 @@
-
+
{{ tooManyFilesMessage }}{{ showMoreMessage }}
@@ -34,6 +34,14 @@ export default { }; }, computed: { + hasMore: { + get() { + return this.isIncomplete; + }, + set(newValue) { + this.isIncomplete = newValue; + } + }, fileTree() { const result = []; for (const file of this.files) { @@ -148,7 +156,6 @@ export default { this.isLoadingNewData = false; const {pageData} = window.config; this.diffEnd = pageData.diffFileInfo.diffEnd; - this.isIncomplete = pageData.diffFileInfo.isIncomplete; }); }, }, From 6f4f52c59f0c0594f6f37e1ccc8447f81e8974b4 Mon Sep 17 00:00:00 2001 From: sillyguodong Date: Mon, 29 May 2023 23:23:18 +0800 Subject: [PATCH 4/4] Revert "use computed" This reverts commit 35422cab9693ff79bf8e2a1bd72f1e4029cb117b. --- web_src/js/components/DiffFileTree.vue | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/web_src/js/components/DiffFileTree.vue b/web_src/js/components/DiffFileTree.vue index 812c8d12aac5f..77532f85dba75 100644 --- a/web_src/js/components/DiffFileTree.vue +++ b/web_src/js/components/DiffFileTree.vue @@ -7,7 +7,7 @@
-
+
{{ tooManyFilesMessage }}{{ showMoreMessage }}
@@ -34,14 +34,6 @@ export default { }; }, computed: { - hasMore: { - get() { - return this.isIncomplete; - }, - set(newValue) { - this.isIncomplete = newValue; - } - }, fileTree() { const result = []; for (const file of this.files) { @@ -156,6 +148,7 @@ export default { this.isLoadingNewData = false; const {pageData} = window.config; this.diffEnd = pageData.diffFileInfo.diffEnd; + this.isIncomplete = pageData.diffFileInfo.isIncomplete; }); }, },