mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
[WIP] Paginate History Store
Trying an approach with v-infinite-scroll in selector modal
This commit is contained in:
@@ -131,6 +131,17 @@ class FastAPIHistories:
|
||||
trans, serialization_params, filter_query_params, deleted_only=deleted, all_histories=all
|
||||
)
|
||||
|
||||
# THIS IS JUST A DUMMY ROUTE FOR WIP testing
|
||||
@router.get(
|
||||
"/api/histories/count",
|
||||
summary="Returns number of histories for the current user.",
|
||||
)
|
||||
def count(
|
||||
self,
|
||||
trans: ProvidesHistoryContext = DependsOnTrans,
|
||||
) -> int:
|
||||
return self.service.count(trans)
|
||||
|
||||
@router.get(
|
||||
"/api/histories/deleted",
|
||||
summary="Returns deleted histories for the current user.",
|
||||
|
||||
@@ -462,6 +462,23 @@ class HistoriesService(ServiceBase, ConsumesModelStores, ServesExportStores):
|
||||
]
|
||||
return rval
|
||||
|
||||
# THIS IS JUST A DUMMY FN FOR WIP testing
|
||||
def count(
|
||||
self,
|
||||
trans: ProvidesHistoryContext,
|
||||
):
|
||||
"""
|
||||
Returns number of histories for the current user.
|
||||
"""
|
||||
# bail early with current history if user is anonymous
|
||||
current_user = self.user_manager.current_user(trans)
|
||||
if self.user_manager.is_anonymous(current_user):
|
||||
current_history = self.manager.get_current(trans)
|
||||
if not current_history:
|
||||
return 0
|
||||
return 1
|
||||
return len(current_user.active_histories)
|
||||
|
||||
def published(
|
||||
self,
|
||||
trans: ProvidesHistoryContext,
|
||||
|
||||
Reference in New Issue
Block a user