diff --git a/e2e/resources/extensibility-configs/context-submenus-ext.json b/e2e/resources/extensibility-configs/context-submenus-ext.json index 403443cce..2e1d39423 100644 --- a/e2e/resources/extensibility-configs/context-submenus-ext.json +++ b/e2e/resources/extensibility-configs/context-submenus-ext.json @@ -979,6 +979,7 @@ { "id": "app.files.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "sortable": true, @@ -996,6 +997,7 @@ { "id": "app.files.modifiedBy", "key": "modifiedByUser.displayName", + "sortingKey": "modifiedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", "class": "adf-ellipsis-cell", @@ -1014,6 +1016,7 @@ { "id": "app.libraries.name", "key": "title", + "sortingKey": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.TITLE", "type": "text", "class": "adf-ellipsis-cell adf-expand-cell-5", @@ -1061,6 +1064,7 @@ { "id": "app.shared.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "sortable": true, @@ -1078,6 +1082,7 @@ { "id": "app.shared.modifiedBy", "key": "modifiedByUser.displayName", + "sortingKey": "modifiedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", "class": "adf-ellipsis-cell", @@ -1087,6 +1092,7 @@ { "id": "app.shared.sharedBy", "key": "sharedByUser.displayName", + "sortingKey": "sharedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.SHARED_BY", "type": "text", "class": "adf-ellipsis-cell", @@ -1124,6 +1130,7 @@ { "id": "app.recent.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "sortable": true, @@ -1186,6 +1193,7 @@ { "id": "app.favorites.modifiedBy", "key": "modifiedByUser.displayName", + "sortingKey": "modifiedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", "class": "adf-ellipsis-cell", @@ -1223,6 +1231,7 @@ { "id": "app.trashcan.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "sortable": true, @@ -1231,6 +1240,7 @@ { "id": "app.trashcan.deletedOn", "key": "archivedAt", + "sortingKey": "archivedAt", "title": "APP.DOCUMENT_LIST.COLUMNS.DELETED_ON", "type": "date", "format": "timeAgo", diff --git a/e2e/resources/extensibility-configs/document-presets-ext.json b/e2e/resources/extensibility-configs/document-presets-ext.json index c5a4008f8..044c0a095 100644 --- a/e2e/resources/extensibility-configs/document-presets-ext.json +++ b/e2e/resources/extensibility-configs/document-presets-ext.json @@ -898,6 +898,7 @@ { "id": "app.files.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "sortable": true, @@ -907,6 +908,7 @@ { "id": "app.files.modifiedBy", "key": "modifiedByUser.displayName", + "sortingKey": "modifiedByUser", "title": "Test header", "type": "text", "class": "adf-ellipsis-cell", @@ -916,6 +918,7 @@ { "id": "some.id.createdBy", "key": "createdByUser.displayName", + "sortingKey": "createdByUser", "title": "New column", "type": "text", "class": "adf-ellipsis-cell", @@ -934,6 +937,7 @@ { "id": "app.libraries.name", "key": "title", + "sortingKey": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.TITLE", "type": "text", "class": "adf-ellipsis-cell adf-expand-cell-5", @@ -981,6 +985,7 @@ { "id": "app.shared.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "sortable": true, @@ -998,6 +1003,7 @@ { "id": "app.shared.modifiedBy", "key": "modifiedByUser.displayName", + "sortingKey": "modifiedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", "class": "adf-ellipsis-cell", @@ -1007,6 +1013,7 @@ { "id": "app.shared.sharedBy", "key": "sharedByUser.displayName", + "sortingKey": "sharedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.SHARED_BY", "type": "text", "class": "adf-ellipsis-cell", @@ -1044,6 +1051,7 @@ { "id": "app.recent.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "sortable": true, @@ -1106,6 +1114,7 @@ { "id": "app.favorites.modifiedBy", "key": "modifiedByUser.displayName", + "sortingKey": "modifiedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", "class": "adf-ellipsis-cell", @@ -1143,6 +1152,7 @@ { "id": "app.trashcan.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "sortable": true, @@ -1151,6 +1161,7 @@ { "id": "app.trashcan.deletedOn", "key": "archivedAt", + "sortingKey": "archivedAt", "title": "APP.DOCUMENT_LIST.COLUMNS.DELETED_ON", "type": "date", "format": "timeAgo", diff --git a/extension.schema.json b/extension.schema.json index eadcf29f5..453b53b8b 100644 --- a/extension.schema.json +++ b/extension.schema.json @@ -562,6 +562,10 @@ "description": "Property key", "type": "string" }, + "sortingKey": { + "description": "Property key for server sorting", + "type": "string" + }, "type": { "description": "Column type", "type": "string", diff --git a/package-lock.json b/package-lock.json index d2b3b0b43..6027daa68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@alfresco/adf-cli": { - "version": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", - "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab.tgz", - "integrity": "sha512-Vq7J5D7YpvP7b8eJsauCykS3yNZElsUJwqQV9ZQ+B00HvHCMW2UUUd5VWLb9F/n82hKlsY9k8WSsDnP4aRcSIw==", + "version": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", + "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-3.10.0-83786bf271c258bae09595811212e6df1141c0e8.tgz", + "integrity": "sha512-Bc6pupiKXQQYoeltgvkjuj60mVFfZ5t/3cy9TBDHbLt9513VUfozBe4O4bn0CJcvBCYb+/mQUBZIIMFxzwddyQ==", "dev": true, "requires": { "@alfresco/js-api": "3.10.0-23b97d354151ced90eb2fc68f9d57cad852376d7", @@ -29,33 +29,33 @@ } }, "@alfresco/adf-content-services": { - "version": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab.tgz", - "integrity": "sha512-i89GrjsnhugcsNeAbBH/XEwAnEZI7fO9TezuAzBAw9pl2fr0jyjwvcHtrs0BmIT7+HsNv4AJ8ar9bCo7GDy0zg==", + "version": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-3.10.0-83786bf271c258bae09595811212e6df1141c0e8.tgz", + "integrity": "sha512-ReSvsHGOAPf8YSFxFGiseiY8Xg3a5GNAQb2Tfer5ClnLxmksAcLo/MoWPNmfNxLc8P6hYp9tSH/1zYdjyclO/g==", "requires": { "tslib": "^2.0.0" } }, "@alfresco/adf-core": { - "version": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab.tgz", - "integrity": "sha512-di++9RaUxJhHfb4N33+Bf/4QmxRG2b7FHZcS3qkTlk28S0GqobzsMizkccMHmwEU5nOF/yJHJGVpaFvF7zHNSg==", + "version": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-3.10.0-83786bf271c258bae09595811212e6df1141c0e8.tgz", + "integrity": "sha512-A04h+OQphkFH6v4eWqUQFISE3hLqmqRM5WIvSlwbM5KqBamPBGottmjnIbwezpnxpJ+pL6ZRyT2U6XAIb1Vc6Q==", "requires": { "tslib": "^2.0.0" } }, "@alfresco/adf-extensions": { - "version": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab.tgz", - "integrity": "sha512-ped6r42Exxl17MtXUjEyPh/U5kZGfeGcT80qhQ9aqPOjfAZnmcfSPz7u+/j5jScHWDRbgTFCltiwwxl3N+2m1w==", + "version": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-3.10.0-83786bf271c258bae09595811212e6df1141c0e8.tgz", + "integrity": "sha512-CRS7lZIDr+lhBxixIzhz8spASHiZRH+GBlCpsMXx9ZvPqmgiSPhWozFJ65Bx5c8jDV3cKk7DILqkfHT6UuaSNA==", "requires": { "tslib": "^2.0.0" } }, "@alfresco/adf-testing": { - "version": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", - "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab.tgz", - "integrity": "sha512-2hJpNATtoHN+YdLodnekmE9J6R6Qo9sxvwCyFRUYdbVCZiv4smWysOuuCNHQt1o2KD/syxYrwnG8HO2X9YZCRQ==", + "version": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", + "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-3.10.0-83786bf271c258bae09595811212e6df1141c0e8.tgz", + "integrity": "sha512-JmscyECHb5GdK26sMzKA2nidQfVpsZVZ07UnmJEwgnS3iFLO6nUfsZRWmGXxyNauyuZRDB1FRjEyt2OVF7eHCA==", "dev": true, "requires": { "tslib": "^2.0.0" diff --git a/package.json b/package.json index 9b6f49c1b..24378af04 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,9 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", - "@alfresco/adf-core": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", - "@alfresco/adf-extensions": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", + "@alfresco/adf-content-services": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", + "@alfresco/adf-core": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", + "@alfresco/adf-extensions": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", "@alfresco/js-api": "3.10.0-23b97d354151ced90eb2fc68f9d57cad852376d7", "@angular-custom-builders/lite-serve": "^0.2.2", "@angular/animations": "10.0.4", @@ -72,8 +72,8 @@ "zone.js": "~0.10.2" }, "devDependencies": { - "@alfresco/adf-cli": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", - "@alfresco/adf-testing": "3.10.0-61cac20ab3b1a76069dcfbfbe37619126d4b51ab", + "@alfresco/adf-cli": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", + "@alfresco/adf-testing": "3.10.0-83786bf271c258bae09595811212e6df1141c0e8", "@angular-devkit/build-angular": "~0.1000.4", "@angular-devkit/build-ng-packagr": "~0.1000.5", "@angular/cli": "^10.0.5", diff --git a/src/app/components/files/files.component.html b/src/app/components/files/files.component.html index 0fe16dc73..f669faad2 100644 --- a/src/app/components/files/files.component.html +++ b/src/app/components/files/files.component.html @@ -21,13 +21,13 @@ acaDocumentList acaContextActions [display]="documentDisplayMode$ | async" - [sorting]="['modifiedAt', 'desc']" selectionMode="multiple" [currentFolderId]="node?.id" [showHeader]="showHeader" [node]="nodeResult" [allowDropFiles]="true" [navigate]="false" + [sorting]="['modifiedAt', 'DESC']" [imageResolver]="imageResolver" (node-dblclick)="navigateTo($event.detail?.node)" (name-click)="navigateTo($event.detail?.node)" @@ -55,6 +55,7 @@ [format]="column.format" [class]="column.class" [sortable]="column.sortable" + [sortingKey]="column.sortingKey || column.key" > @@ -70,6 +71,7 @@ [format]="column.format" [class]="column.class" [sortable]="column.sortable" + [sortingKey]="column.sortingKey || column.key" > diff --git a/src/app/components/files/files.component.spec.ts b/src/app/components/files/files.component.spec.ts index 546f51819..e19adab38 100644 --- a/src/app/components/files/files.component.spec.ts +++ b/src/app/components/files/files.component.spec.ts @@ -139,7 +139,6 @@ describe('FilesComponent', () => { beforeEach(() => { spyOn(contentApi, 'getNode').and.returnValue(of({ entry: node })); spyOn(component, 'reload'); - fixture.detectChanges(); spyOn(component.documentList, 'loadFolder').and.callFake(() => {}); diff --git a/src/assets/app.extensions.json b/src/assets/app.extensions.json index c193580b3..813647261 100644 --- a/src/assets/app.extensions.json +++ b/src/assets/app.extensions.json @@ -1149,6 +1149,7 @@ { "id": "app.files.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "class": "adf-no-grow-cell adf-ellipsis-cell", @@ -1168,6 +1169,7 @@ { "id": "app.files.modifiedBy", "key": "modifiedByUser.displayName", + "sortingKey": "modifiedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", "class": "adf-ellipsis-cell adf-no-grow-cell", @@ -1186,6 +1188,7 @@ { "id": "app.libraries.name", "key": "title", + "sortingKey": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", "class": "adf-ellipsis-cell adf-expand-cell-3", @@ -1234,6 +1237,7 @@ { "id": "app.favorite.libraries.name", "key": "title", + "sortingKey": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", "class": "adf-ellipsis-cell adf-expand-cell-3", @@ -1292,6 +1296,7 @@ { "id": "app.shared.location", "key": "path.name", + "sortingKey": "path", "title": "APP.DOCUMENT_LIST.COLUMNS.LOCATION", "type": "text", "class": "adf-ellipsis-cell adf-no-grow-cell", @@ -1302,6 +1307,7 @@ { "id": "app.shared.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "class": "adf-no-grow-cell adf-ellipsis-cell", @@ -1311,6 +1317,7 @@ { "id": "app.shared.modifiedOn", "key": "modifiedAt", + "sortingKey": "modifiedAt", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON", "type": "date", "class": "adf-ellipsis-cell", @@ -1321,6 +1328,7 @@ { "id": "app.shared.modifiedBy", "key": "modifiedByUser.displayName", + "sortingKey": "modifiedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", "class": "adf-ellipsis-cell adf-no-grow-cell", @@ -1330,6 +1338,7 @@ { "id": "app.shared.sharedBy", "key": "sharedByUser.displayName", + "sortingKey": "sharedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.SHARED_BY", "type": "text", "class": "adf-ellipsis-cell adf-no-grow-cell", @@ -1368,6 +1377,7 @@ { "id": "app.recent.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "class": "adf-no-grow-cell adf-ellipsis-cell", @@ -1435,6 +1445,7 @@ { "id": "app.favorites.modifiedBy", "key": "modifiedByUser.displayName", + "sortingKey": "modifiedByUser", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", "class": "adf-ellipsis-cell adf-no-grow-cell", @@ -1473,6 +1484,7 @@ { "id": "app.trashcan.size", "key": "content.sizeInBytes", + "sortingKey": "sizeInBytes", "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", "type": "fileSize", "class": "adf-no-grow-cell adf-ellipsis-cell", @@ -1501,6 +1513,7 @@ { "id": "app.libraries.name", "key": "title", + "sortingKey": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", "class": "adf-ellipsis-cell adf-expand-cell-3",