Skip to content

Commit

Permalink
Merge pull request galaxyproject#14552 from ahmedhamidawan/hist_switc…
Browse files Browse the repository at this point in the history
…h_hid_count

Include HID count in quick history menu switcher
  • Loading branch information
mvdbeek authored Sep 5, 2022
2 parents e1d9503 + 709a9f3 commit 2d14fdf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/src/components/History/Modals/SelectorModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default {
this.fields = [
{ key: "name", sortable: true },
{ key: "tags", sortable: true },
{ key: "count", label: "Items", sortable: true },
{ key: "update_time", label: "Updated", sortable: true },
];
},
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/managers/histories.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def __init__(
"name",
"deleted",
"purged",
# 'count'
"count",
"url",
# TODO: why these?
"published",
Expand Down
4 changes: 4 additions & 0 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2596,6 +2596,10 @@ def stage_addition(self, items):
def empty(self):
return self.hid_counter is None or self.hid_counter == 1

@property
def count(self):
return self.hid_counter - 1

def add_pending_items(self, set_output_hid=True):
# These are assumed to be either copies of existing datasets or new, empty datasets,
# so we don't need to set the quota.
Expand Down
5 changes: 5 additions & 0 deletions lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,11 @@ class HistorySummary(HistoryBase):
title="Published",
description="Whether this resource is currently publicly available to all users.",
)
count: int = Field(
...,
title="Count",
description="The number of items in the history.",
)
annotation: Optional[str] = AnnotationField
tags: TagCollection

Expand Down

0 comments on commit 2d14fdf

Please sign in to comment.