UBERF-7007 Show folders first in drive (#5645)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2024-05-23 00:03:20 +07:00 committed by GitHub
parent 95f26f4978
commit 2c89008374
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 4 deletions

View File

@ -23,6 +23,7 @@ import core, {
AccountRole,
IndexKind,
Ref,
SortingOrder,
DOMAIN_MODEL
} from '@hcengineering/core'
import { type Drive, type File, type Folder, type Resource, driveId } from '@hcengineering/drive'
@ -259,18 +260,25 @@ function defineResource (builder: Builder): void {
{
key: '',
presenter: drive.component.ResourcePresenter,
label: drive.string.Name
label: drive.string.Name,
sortingKey: 'name'
},
{
key: '$lookup.file.size',
presenter: drive.component.FileSizePresenter,
label: drive.string.Size
label: drive.string.Size,
sortingKey: '$lookup.file.size'
},
{
key: '$lookup.file.modifiedOn'
},
'createdBy'
],
options: {
sort: {
_class: SortingOrder.Descending
}
},
configOptions: {
hiddenKeys: ['name', 'file', 'parent', 'path'],
sortable: true

View File

@ -139,7 +139,7 @@
objectsRecieved = true
loading = 0
},
{ sort: getSort(sortKey), limit, ...options, lookup, total: false }
{ limit, ...options, sort: getSort(sortKey), lookup, total: false }
)
? 1
: 0
@ -155,7 +155,7 @@
(result) => {
total = result.total
},
{ sort: getSort(_sortKey), limit: 1, ...options, lookup, total: true }
{ limit: 1, ...options, sort: getSort(_sortKey), lookup, total: true }
)
const showContextMenu = async (ev: MouseEvent, object: Doc, row: number): Promise<void> => {