diff --git a/src/app/features/files/components/move-file-dialog/move-file-dialog.component.ts b/src/app/features/files/components/move-file-dialog/move-file-dialog.component.ts index 349080801..acde40ea3 100644 --- a/src/app/features/files/components/move-file-dialog/move-file-dialog.component.ts +++ b/src/app/features/files/components/move-file-dialog/move-file-dialog.component.ts @@ -167,6 +167,7 @@ export class MoveFileDialogComponent { if (file.id) { const filesLink = this.currentFolder()?.relationships.filesLink; const rootFolders = this.rootFolders(); + this.resetPagination(); if (filesLink) { this.dispatch.getFiles(filesLink); } else if (rootFolders) { @@ -176,6 +177,11 @@ export class MoveFileDialogComponent { }); } + resetPagination() { + this.first = 0; + this.pageNumber.set(1); + } + onFilesPageChange(event: PaginatorState): void { this.pageNumber.set(event.page! + 1); this.first = event.first!; diff --git a/src/app/features/files/pages/files/files.component.ts b/src/app/features/files/pages/files/files.component.ts index 61ec08c9f..0ff4735c0 100644 --- a/src/app/features/files/pages/files/files.component.ts +++ b/src/app/features/files/pages/files/files.component.ts @@ -190,7 +190,7 @@ export class FilesComponent { const result: Record = { ...menuMap }; - if (hasViewOnly || isRegistration) { + if (hasViewOnly || isRegistration || !this.canEdit()) { const allowed = new Set([FileMenuType.Download, FileMenuType.Embed, FileMenuType.Share]); (Object.keys(result) as FileMenuType[]).forEach((key) => { diff --git a/src/app/shared/components/files-tree/files-tree.component.ts b/src/app/shared/components/files-tree/files-tree.component.ts index d52fb6ea9..e5b8bc872 100644 --- a/src/app/shared/components/files-tree/files-tree.component.ts +++ b/src/app/shared/components/files-tree/files-tree.component.ts @@ -374,6 +374,7 @@ export class FilesTreeComponent implements OnDestroy, AfterViewInit { }, }) .onClose.subscribe((foldersStack) => { + this.resetPagination(); if (foldersStack) { this.foldersStack = [...foldersStack]; }