IDs passed to bulkDownload are sorted in the same order as documents in the view

This commit is contained in:
Łukasz Czyż 2023-12-13 16:57:22 +01:00
parent e52c7e83f3
commit cec58a9cbc
2 changed files with 7 additions and 1 deletions

View File

@ -511,7 +511,7 @@ export class BulkEditorComponent
: 'originals'
this.documentService
.bulkDownload(
Array.from(this.list.selected),
this.list.getSelectedInOrder(),
downloadFileType,
this.downloadForm.get('downloadAsSingleFile').value,
this.downloadForm.get('downloadUseFormatting').value

View File

@ -358,6 +358,12 @@ export class DocumentListViewService {
return this.activeListViewState.selected
}
getSelectedInOrder(): number[] {
return this.activeListViewState.documents
.filter((item) => this.activeListViewState.selected.has(item.id))
.map((item) => item.id)
}
setSort(field: string, reverse: boolean) {
this.activeListViewState.sortField = field
this.activeListViewState.sortReverse = reverse