mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Do not list archived histories with regular ones
This commit is contained in:
@@ -32,7 +32,9 @@ export const useHistoryStore = defineStore("historyStore", () => {
|
||||
const storedHistories = ref<{ [key: string]: HistorySummary }>({});
|
||||
|
||||
const histories = computed(() => {
|
||||
return Object.values(storedHistories.value).sort(sortByObjectProp("name"));
|
||||
return Object.values(storedHistories.value)
|
||||
.filter((h) => !h.archived)
|
||||
.sort(sortByObjectProp("name"));
|
||||
});
|
||||
|
||||
const getFirstHistoryId = computed(() => {
|
||||
|
||||
@@ -171,7 +171,7 @@ class HistoryListGrid(grids.Grid):
|
||||
return trans.get_history()
|
||||
|
||||
def apply_query_filter(self, trans, query, **kwargs):
|
||||
return query.filter_by(user=trans.user, importing=False)
|
||||
return query.filter_by(user=trans.user, importing=False, archived=False)
|
||||
|
||||
|
||||
class SharedHistoryListGrid(grids.Grid):
|
||||
|
||||
@@ -158,7 +158,9 @@ class HistoriesService(ServiceBase, ConsumesModelStores, ServesExportStores):
|
||||
raise glx_exceptions.AdminRequiredException(message)
|
||||
else:
|
||||
filters += [model.History.user == current_user]
|
||||
# and any sent in from the query string
|
||||
# exclude archived histories
|
||||
filters += [model.History.archived == false()]
|
||||
# and apply any other filters
|
||||
filters += self.filters.parse_filters(filter_params)
|
||||
order_by = self._build_order_by(filter_query_params.order)
|
||||
|
||||
|
||||
@@ -904,3 +904,13 @@ class TestArchivingHistoriesWithoutExportRecord(ApiTestCase, BaseHistories):
|
||||
|
||||
archive_response = self.dataset_populator.archive_history(history_id)
|
||||
self._assert_status_code_is(archive_response, 409)
|
||||
|
||||
def test_archived_histories_are_not_listed_by_default(self):
|
||||
history_id = self.dataset_populator.new_history()
|
||||
archive_response = self.dataset_populator.archive_history(history_id)
|
||||
self._assert_status_code_is(archive_response, 200)
|
||||
assert archive_response.json()["archived"] is True
|
||||
|
||||
histories = self.dataset_populator.get_histories()
|
||||
for history in histories:
|
||||
assert history["id"] != history_id
|
||||
|
||||
Reference in New Issue
Block a user