From 8ebbdbc2ce19a1629baef78824492252e6c41d8c Mon Sep 17 00:00:00 2001 From: Leane Schlundt Date: Tue, 4 Jun 2024 09:33:47 +0200 Subject: [PATCH 1/8] Add button to ensure filtering is finished --- resources/assets/js/volumes/cloneForm.vue | 10 +++++++++- resources/views/volumes/clone.blade.php | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/volumes/cloneForm.vue b/resources/assets/js/volumes/cloneForm.vue index 44698c35d..0863becf5 100644 --- a/resources/assets/js/volumes/cloneForm.vue +++ b/resources/assets/js/volumes/cloneForm.vue @@ -38,7 +38,8 @@ export default { fileLabelIds: [], annotationLabelIds: [], cloneUrlTemplate: "", - noFilesFoundByPattern: false + noFilesFoundByPattern: false, + showCloneButton: true, }; }, computed: { @@ -107,6 +108,7 @@ export default { if (this.selectedFiles.length === 0) { this.noFilesFoundByPattern = true; } + this.showCloneButton = true; }); }, @@ -176,6 +178,12 @@ export default { this.filterFileLabels = false; } }, + filePattern() { + // Show clone button only after filter process is finished. + if (this.showCloneButton) { + this.showCloneButton = false; + } + }, }, created() { this.volume = biigle.$require('volume'); diff --git a/resources/views/volumes/clone.blade.php b/resources/views/volumes/clone.blade.php index efb146dd8..b829bd898 100644 --- a/resources/views/volumes/clone.blade.php +++ b/resources/views/volumes/clone.blade.php @@ -150,7 +150,11 @@ class="request-labels-well well well-sm" v-cloak> Cancel - + + + + + Date: Wed, 19 Jun 2024 08:08:48 +0200 Subject: [PATCH 2/8] Revert "Add button to ensure filtering is finished" This reverts commit 8ebbdbc2ce19a1629baef78824492252e6c41d8c. --- resources/assets/js/volumes/cloneForm.vue | 10 +--------- resources/views/volumes/clone.blade.php | 6 +----- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/resources/assets/js/volumes/cloneForm.vue b/resources/assets/js/volumes/cloneForm.vue index 0863becf5..44698c35d 100644 --- a/resources/assets/js/volumes/cloneForm.vue +++ b/resources/assets/js/volumes/cloneForm.vue @@ -38,8 +38,7 @@ export default { fileLabelIds: [], annotationLabelIds: [], cloneUrlTemplate: "", - noFilesFoundByPattern: false, - showCloneButton: true, + noFilesFoundByPattern: false }; }, computed: { @@ -108,7 +107,6 @@ export default { if (this.selectedFiles.length === 0) { this.noFilesFoundByPattern = true; } - this.showCloneButton = true; }); }, @@ -178,12 +176,6 @@ export default { this.filterFileLabels = false; } }, - filePattern() { - // Show clone button only after filter process is finished. - if (this.showCloneButton) { - this.showCloneButton = false; - } - }, }, created() { this.volume = biigle.$require('volume'); diff --git a/resources/views/volumes/clone.blade.php b/resources/views/volumes/clone.blade.php index b829bd898..efb146dd8 100644 --- a/resources/views/volumes/clone.blade.php +++ b/resources/views/volumes/clone.blade.php @@ -150,11 +150,7 @@ class="request-labels-well well well-sm" v-cloak> Cancel - - - - - + Date: Wed, 19 Jun 2024 09:10:19 +0200 Subject: [PATCH 3/8] Add test query button Enable volume cloning if file name query was checked. --- resources/assets/js/volumes/cloneForm.vue | 25 +++++++++++++++++++++-- resources/views/volumes/clone.blade.php | 5 ++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/volumes/cloneForm.vue b/resources/assets/js/volumes/cloneForm.vue index 44698c35d..8e43cb74b 100644 --- a/resources/assets/js/volumes/cloneForm.vue +++ b/resources/assets/js/volumes/cloneForm.vue @@ -38,7 +38,9 @@ export default { fileLabelIds: [], annotationLabelIds: [], cloneUrlTemplate: "", - noFilesFoundByPattern: false + noFilesFoundByPattern: false, + showTestQueryBtn: false, + cloneBtnTitle: "", }; }, computed: { @@ -65,7 +67,7 @@ export default { return this.selectedAnnotationLabelIds.length; }, cannotSubmit() { - return this.name === '' || this.selectedProjectId < 0 || this.loading; + return this.name === '' || this.selectedProjectId < 0 || this.loading || this.showTestQueryBtn; }, getCloneUrl() { return this.cloneUrlTemplate.replace(':pid', this.selectedProjectId); @@ -107,6 +109,7 @@ export default { if (this.selectedFiles.length === 0) { this.noFilesFoundByPattern = true; } + this.showTestQueryBtn = false; }); }, @@ -170,12 +173,30 @@ export default { if (!newState) { this.noFilesFoundByPattern = false; } + if (!this.fileFiles) { + this.showTestQueryBtn = false; + } }, cloneFileLabels(newState) { if (!newState) { this.filterFileLabels = false; } }, + filePattern(newPattern, oldPattern) { + if (newPattern.length === 0) { + this.showTestQueryBtn = false; + return; + } + + this.showTestQueryBtn = this.filterFiles && (oldPattern !== newPattern); + }, + cannotSubmit() { + if (this.cannotSubmit) { + this.cloneBtnTitle = "The query has to be checked first before the volume can be cloned."; + } else { + this.cloneBtnTitle = ""; + } + } }, created() { this.volume = biigle.$require('volume'); diff --git a/resources/views/volumes/clone.blade.php b/resources/views/volumes/clone.blade.php index efb146dd8..f7b8b0ffe 100644 --- a/resources/views/volumes/clone.blade.php +++ b/resources/views/volumes/clone.blade.php @@ -82,6 +82,9 @@ class="text-muted">#
  • No files found
  • +
    + +
    @@ -150,7 +153,7 @@ class="request-labels-well well well-sm" v-cloak> Cancel - + Date: Fri, 21 Jun 2024 07:46:14 +0200 Subject: [PATCH 4/8] Change info message --- resources/assets/js/volumes/cloneForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/volumes/cloneForm.vue b/resources/assets/js/volumes/cloneForm.vue index 8e43cb74b..a0070474d 100644 --- a/resources/assets/js/volumes/cloneForm.vue +++ b/resources/assets/js/volumes/cloneForm.vue @@ -192,7 +192,7 @@ export default { }, cannotSubmit() { if (this.cannotSubmit) { - this.cloneBtnTitle = "The query has to be checked first before the volume can be cloned."; + this.cloneBtnTitle = "The query has to be tested first before the volume can be cloned."; } else { this.cloneBtnTitle = ""; } From 6184f29d4a42c11b8f6f6f883a177f7791bcc0e8 Mon Sep 17 00:00:00 2001 From: Leane Schlundt Date: Fri, 21 Jun 2024 07:46:31 +0200 Subject: [PATCH 5/8] Change button position --- resources/views/volumes/clone.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/volumes/clone.blade.php b/resources/views/volumes/clone.blade.php index f7b8b0ffe..f3962c8f3 100644 --- a/resources/views/volumes/clone.blade.php +++ b/resources/views/volumes/clone.blade.php @@ -61,6 +61,9 @@ @endif
    +
    + +
    @if ($volume->isImageVolume()) #
  • No files found
  • -
    - -
    From 980b6839dcbfca8bdd48c7a199190195a25e7a75 Mon Sep 17 00:00:00 2001 From: Leane Schlundt Date: Fri, 21 Jun 2024 08:22:36 +0200 Subject: [PATCH 6/8] Reset filter file results after unchecking box --- resources/assets/js/volumes/cloneForm.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/assets/js/volumes/cloneForm.vue b/resources/assets/js/volumes/cloneForm.vue index a0070474d..fc6379e51 100644 --- a/resources/assets/js/volumes/cloneForm.vue +++ b/resources/assets/js/volumes/cloneForm.vue @@ -175,6 +175,8 @@ export default { } if (!this.fileFiles) { this.showTestQueryBtn = false; + this.filePattern = ""; + this.selectedFiles = []; } }, cloneFileLabels(newState) { From 3b46e6a294dc3f35075bb668c04c5d7cc9b68ebf Mon Sep 17 00:00:00 2001 From: Leane Schlundt Date: Fri, 21 Jun 2024 08:40:36 +0200 Subject: [PATCH 7/8] Disable clone button on checked filter file option --- resources/assets/js/volumes/cloneForm.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/volumes/cloneForm.vue b/resources/assets/js/volumes/cloneForm.vue index fc6379e51..bca6811bc 100644 --- a/resources/assets/js/volumes/cloneForm.vue +++ b/resources/assets/js/volumes/cloneForm.vue @@ -41,6 +41,7 @@ export default { noFilesFoundByPattern: false, showTestQueryBtn: false, cloneBtnTitle: "", + disableCloneBtn: false, }; }, computed: { @@ -67,7 +68,7 @@ export default { return this.selectedAnnotationLabelIds.length; }, cannotSubmit() { - return this.name === '' || this.selectedProjectId < 0 || this.loading || this.showTestQueryBtn; + return this.name === '' || this.selectedProjectId < 0 || this.loading || this.showTestQueryBtn || this.disableCloneBtn; }, getCloneUrl() { return this.cloneUrlTemplate.replace(':pid', this.selectedProjectId); @@ -110,6 +111,7 @@ export default { this.noFilesFoundByPattern = true; } this.showTestQueryBtn = false; + this.disableCloneBtn = this.noFilesFoundByPattern; }); }, @@ -178,6 +180,7 @@ export default { this.filePattern = ""; this.selectedFiles = []; } + this.disableCloneBtn = this.filterFiles; }, cloneFileLabels(newState) { if (!newState) { @@ -198,6 +201,11 @@ export default { } else { this.cloneBtnTitle = ""; } + }, + noFilesFoundByPattern() { + if (this.cannotSubmit && this.noFilesFoundByPattern) { + this.cloneBtnTitle = "For cloning file list must not be empty or filter file option needs to be unchecked."; + } } }, created() { From 183fbd5c928ea59d9035dfd3a89b3c830015d083 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Fri, 21 Jun 2024 12:02:51 +0200 Subject: [PATCH 8/8] Move test query button and update clone volume title attributes --- resources/assets/js/volumes/cloneForm.vue | 4 ++-- resources/views/volumes/clone.blade.php | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/assets/js/volumes/cloneForm.vue b/resources/assets/js/volumes/cloneForm.vue index bca6811bc..3a7511b3d 100644 --- a/resources/assets/js/volumes/cloneForm.vue +++ b/resources/assets/js/volumes/cloneForm.vue @@ -197,14 +197,14 @@ export default { }, cannotSubmit() { if (this.cannotSubmit) { - this.cloneBtnTitle = "The query has to be tested first before the volume can be cloned."; + this.cloneBtnTitle = "The file filter query has to be tested first before the volume can be cloned."; } else { this.cloneBtnTitle = ""; } }, noFilesFoundByPattern() { if (this.cannotSubmit && this.noFilesFoundByPattern) { - this.cloneBtnTitle = "For cloning file list must not be empty or filter file option needs to be unchecked."; + this.cloneBtnTitle = "The cloned volume would be empty based on the current file filter query."; } } }, diff --git a/resources/views/volumes/clone.blade.php b/resources/views/volumes/clone.blade.php index f3962c8f3..d21c1aecc 100644 --- a/resources/views/volumes/clone.blade.php +++ b/resources/views/volumes/clone.blade.php @@ -61,9 +61,7 @@ @endif
    -
    - -
    + @if ($volume->isImageVolume())