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

View File

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