mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
refactor: enable full sort capabilites on search
This commit is contained in:
committed by
Jovan Krunić
parent
03084b1c96
commit
a1bf950c88
@@ -75,7 +75,7 @@ export class ContextMenuService {
|
||||
/**
|
||||
* Container for the sort query
|
||||
*/
|
||||
sortQuery = new Subject<SCSearchSort>();
|
||||
sortQuery = new Subject<SCSearchSort[]>();
|
||||
|
||||
/**
|
||||
* Observable SortContext streams
|
||||
@@ -144,20 +144,22 @@ export class ContextMenuService {
|
||||
*
|
||||
* @param sortContext SortContext to build SCSearchSort from
|
||||
*/
|
||||
buildSortQuery = (sortContext: SortContext): SCSearchSort | undefined => {
|
||||
buildSortQuery = (sortContext: SortContext): SCSearchSort[] | undefined => {
|
||||
if (
|
||||
sortContext.value &&
|
||||
sortContext.value.length > 0 &&
|
||||
(sortContext.value === 'name' || sortContext.value === 'type')
|
||||
) {
|
||||
return {
|
||||
arguments: {
|
||||
field: sortContext.value,
|
||||
position: 0,
|
||||
return [
|
||||
{
|
||||
arguments: {
|
||||
field: sortContext.value,
|
||||
position: 0,
|
||||
},
|
||||
order: sortContext.reversed ? 'desc' : 'asc',
|
||||
type: 'ducet',
|
||||
},
|
||||
order: sortContext.reversed ? 'desc' : 'asc',
|
||||
type: 'ducet',
|
||||
};
|
||||
];
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user