From 2817aa8fab90d220f3f4950ef30645b33a924069 Mon Sep 17 00:00:00 2001 From: Jake Rosenberg Date: Wed, 13 Sep 2023 14:13:52 -0500 Subject: [PATCH] hide trash folder for Community Data and published projects (#1093) Co-authored-by: Jake Rosenberg --- .../data-depot-listing/data-depot-listing.component.js | 7 +++++++ .../data-depot-listing/files-listing.template.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/designsafe/static/scripts/data-depot/components/data-depot-listing/data-depot-listing.component.js b/designsafe/static/scripts/data-depot/components/data-depot-listing/data-depot-listing.component.js index 449ee7d9a..85b77c9ae 100644 --- a/designsafe/static/scripts/data-depot/components/data-depot-listing/data-depot-listing.component.js +++ b/designsafe/static/scripts/data-depot/components/data-depot-listing/data-depot-listing.component.js @@ -224,6 +224,7 @@ class FilesListingCtrl { this.FileOperationService = FileOperationService; this.PublicationService = PublicationService; this.handleScroll = this.handleScroll.bind(this); + this.filterTrash = this.filterTrash.bind(this); } $onInit() { @@ -236,6 +237,12 @@ class FilesListingCtrl { } } + filterTrash(f) { + // Don't display the trash folder in Community listings. + return !(['designsafe.storage.community', 'designsafe.storage.published'].includes(this.listing.params.system) + && f.name.toLowerCase() === '.trash') + } + browse($event, file) { $event.preventDefault(); $event.stopPropagation(); diff --git a/designsafe/static/scripts/data-depot/components/data-depot-listing/files-listing.template.html b/designsafe/static/scripts/data-depot/components/data-depot-listing/files-listing.template.html index 1a80b5004..547abd192 100644 --- a/designsafe/static/scripts/data-depot/components/data-depot-listing/files-listing.template.html +++ b/designsafe/static/scripts/data-depot/components/data-depot-listing/files-listing.template.html @@ -26,7 +26,7 @@