[ACA-4728] fix file order in viewer (#3631)

* [ACA-4728] fix file order in viewer

* [ACA-4728] refactor viewer and preview, save and restore previous sorting in viewer and document pages when client sorting, add viewer unit tests

* [ACA-4728] remove duplicated license

* [ACA-4728] add missing imports

* [ACA-4728] address comments, improve initial sorting setting, improve tests, reduce duplication

* [ACA-4728] further reduce code duplication, remove/replace faulty unit tests

* [ACA-4728] move reusable unit test config to testing module

* [ACA-4728] address comments

* [ACA-4728] address comment - remove reduntant if

* [ACA-4728] update headers in new files
This commit is contained in:
Grzegorz Jaśkowski
2024-04-10 10:39:11 +02:00
committed by GitHub
parent 12c0b87c09
commit 92a1e25271
28 changed files with 1173 additions and 1485 deletions

View File

@@ -45,6 +45,7 @@
[class]="column.class"
[sortable]="column.sortable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
<ng-template let-context>
<adf-dynamic-column [id]="column.template" [context]="context"> </adf-dynamic-column>
@@ -64,6 +65,7 @@
[class]="column.class"
[sortable]="column.sortable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
</data-column>
</ng-container>

View File

@@ -40,6 +40,7 @@
[class]="column.class"
[sortable]="column.sortable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
<ng-template let-context>
<adf-dynamic-column [id]="column.template" [context]="context"> </adf-dynamic-column>
@@ -59,6 +60,7 @@
[class]="column.class"
[sortable]="column.sortable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
</data-column>
</ng-container>

View File

@@ -23,7 +23,7 @@
[node]="nodeResult"
[allowDropFiles]="true"
[navigate]="false"
[sorting]="['name', 'ASC']"
[sorting]="['name', 'asc']"
[imageResolver]="imageResolver"
[headerFilters]="true"
[filterValue]="queryParams"
@@ -31,7 +31,6 @@
[blurOnResize]="false"
(node-dblclick)="handleNodeClick($event)"
(name-click)="handleNodeClick($event)"
(sorting-changed)="onSortingChanged($event)"
(filterSelection)="onFilterSelected($event)"
(error)="onError()"
>

View File

@@ -39,7 +39,7 @@ import {
} from '@alfresco/aca-shared';
import { SetCurrentFolderAction, isAdmin, UploadFileVersionAction, showLoaderSelector } from '@alfresco/aca-shared/store';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { FilterSearch, ShareDataRow, FileUploadEvent, BreadcrumbModule, UploadModule, DocumentListModule } from '@alfresco/adf-content-services';
import { BreadcrumbModule, DocumentListModule, FileUploadEvent, FilterSearch, ShareDataRow, UploadModule } from '@alfresco/adf-content-services';
import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
@@ -74,14 +74,13 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
isAdmin = false;
selectedNode: NodeEntry;
queryParams = null;
showLoader$ = this.store.select(showLoaderSelector);
private nodePath: PathElement[];
columns: DocumentListPresetRef[] = [];
isFilterHeaderActive = false;
constructor(private route: ActivatedRoute, private contentApi: ContentApiService, private nodeActionsService: NodeActionsService) {
constructor(private contentApi: ContentApiService, private nodeActionsService: NodeActionsService, private route: ActivatedRoute) {
super();
}
@@ -103,9 +102,9 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
this.isValidPath = true;
if (node?.entry?.isFolder) {
this.updateCurrentNode(node.entry);
void this.updateCurrentNode(node.entry);
} else {
this.router.navigate(['/personal-files', node.entry.parentId], {
void this.router.navigate(['/personal-files', node.entry.parentId], {
replaceUrl: true
});
}
@@ -145,7 +144,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
const currentNodeId = this.route.snapshot.paramMap.get('folderId');
const urlWithoutParams = decodeURIComponent(this.router.url).split('?')[0];
const urlToNavigate: string[] = this.getUrlToNavigate(urlWithoutParams, currentNodeId, nodeId);
this.router.navigate(urlToNavigate);
void this.router.navigate(urlToNavigate);
}
private getUrlToNavigate(currentURL: string, currentNodeId: string, nextNodeId: string): string[] {
@@ -350,7 +349,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
this.isFilterHeaderActive = true;
this.navigateToFilter(activeFilters);
} else {
this.router.navigate(['.'], { relativeTo: this.route });
void this.router.navigate(['.'], { relativeTo: this.route });
this.isFilterHeaderActive = false;
this.showHeader = ShowHeaderMode.Data;
this.onAllFilterCleared();
@@ -369,7 +368,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
objectFromMap[filter.key] = paramValue;
});
this.router.navigate([], { relativeTo: this.route, queryParams: objectFromMap });
void this.router.navigate([], { relativeTo: this.route, queryParams: objectFromMap });
}
onError() {

View File

@@ -44,6 +44,7 @@
[class]="column.class"
[sortable]="column.sortable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
<ng-template let-context>
<adf-dynamic-column [id]="column.template" [context]="context"> </adf-dynamic-column>
@@ -63,6 +64,7 @@
[resizable]="column.resizable"
[sortable]="column.sortable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
</data-column>
</ng-container>

View File

@@ -40,6 +40,7 @@
[draggable]="column.draggable"
[resizable]="column.resizable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
<ng-template let-context>
<adf-dynamic-column [id]="column.template" [context]="context"> </adf-dynamic-column>
@@ -59,6 +60,7 @@
[isHidden]="column.isHidden"
[draggable]="column.draggable"
[resizable]="column.resizable"
[sortingKey]="column.sortingKey || column.key"
>
</data-column>
</ng-container>

View File

@@ -39,6 +39,7 @@
[isHidden]="column.isHidden"
[draggable]="column.draggable"
[resizable]="column.resizable"
[sortingKey]="column.sortingKey || column.key"
>
<ng-template let-context>
<adf-dynamic-column [id]="column.template" [context]="context"> </adf-dynamic-column>
@@ -58,6 +59,7 @@
[class]="column.class"
[sortable]="column.sortable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
</data-column>
</ng-container>

View File

@@ -45,6 +45,7 @@
[class]="column.class"
[sortable]="column.sortable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
<ng-template let-context>
<adf-dynamic-column [id]="column.template" [context]="context"> </adf-dynamic-column>
@@ -64,6 +65,7 @@
[draggable]="column.draggable"
[resizable]="column.resizable"
[isHidden]="column.isHidden"
[sortingKey]="column.sortingKey || column.key"
>
</data-column>
</ng-container>