Skip to content

Commit

Permalink
hide trash folder for Community Data and published projects (#1093)
Browse files Browse the repository at this point in the history
Co-authored-by: Jake Rosenberg <[email protected]>
  • Loading branch information
jarosenb and Jake Rosenberg authored Sep 13, 2023
1 parent a03e1df commit 2817aa8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</thead>
<tbody>
<tr
data-ng-repeat="item in $ctrl.listing.listing"
data-ng-repeat="item in $ctrl.listing.listing.filter($ctrl.filterTrash)"
ng-class="{highlight: item.selected}"
>
<td class="unselectable">
Expand Down

0 comments on commit 2817aa8

Please sign in to comment.