mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
support ordering of document list columns (#1799)
This commit is contained in:
parent
dab9ddbdca
commit
092d430470
@ -111,6 +111,63 @@ describe('AppExtensionService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('documentList', () => {
|
||||
it('should support column orders', () => {
|
||||
applyConfig({
|
||||
$id: 'test',
|
||||
$name: 'test',
|
||||
$version: '1.0.0',
|
||||
$license: 'MIT',
|
||||
$vendor: 'Good company',
|
||||
$runtime: '1.5.0',
|
||||
features: {
|
||||
documentList: {
|
||||
files: [
|
||||
{
|
||||
id: 'app.files.thumbnail',
|
||||
key: '$thumbnail',
|
||||
type: 'image',
|
||||
order: 10
|
||||
},
|
||||
{
|
||||
id: 'app.files.name',
|
||||
key: 'name',
|
||||
title: 'APP.DOCUMENT_LIST.COLUMNS.NAME',
|
||||
type: 'text',
|
||||
order: 20
|
||||
}
|
||||
],
|
||||
libraries: [
|
||||
{
|
||||
id: 'app.libraries.thumbnail',
|
||||
key: '$thumbnail',
|
||||
type: 'image',
|
||||
order: 20
|
||||
},
|
||||
{
|
||||
id: 'app.libraries.name',
|
||||
key: 'title',
|
||||
title: 'APP.DOCUMENT_LIST.COLUMNS.NAME',
|
||||
type: 'text',
|
||||
order: 10
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const { files, libraries } = service.documentListPresets;
|
||||
|
||||
expect(files.length).toBe(2);
|
||||
expect(files[0].id).toBe('app.files.thumbnail');
|
||||
expect(files[1].id).toBe('app.files.name');
|
||||
|
||||
expect(libraries.length).toBe(2);
|
||||
expect(libraries[0].id).toBe('app.libraries.name');
|
||||
expect(libraries[1].id).toBe('app.libraries.thumbnail');
|
||||
});
|
||||
});
|
||||
|
||||
describe('actions', () => {
|
||||
beforeEach(() => {
|
||||
applyConfig({
|
||||
|
@ -195,8 +195,11 @@ export class AppExtensionService implements RuleContext {
|
||||
return this.loader.getElements<NavBarGroupRef>(config, 'features.navbar');
|
||||
}
|
||||
|
||||
protected getDocumentListPreset(config: ExtensionConfig, key: string) {
|
||||
return this.loader.getElements<DocumentListPresetRef>(config, `features.documentList.${key}`).filter((entry) => !entry.disabled);
|
||||
protected getDocumentListPreset(config: ExtensionConfig, key: string): DocumentListPresetRef[] {
|
||||
return this.loader
|
||||
.getElements<DocumentListPresetRef>(config, `features.documentList.${key}`)
|
||||
.filter((entry) => !entry.disabled)
|
||||
.sort(sortByOrder);
|
||||
}
|
||||
|
||||
getApplicationNavigation(elements): Array<NavBarGroupRef> {
|
||||
|
@ -1156,7 +1156,8 @@
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"sortable": false,
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 10
|
||||
},
|
||||
{
|
||||
"id": "app.files.name",
|
||||
@ -1166,7 +1167,8 @@
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-5",
|
||||
"sortable": true,
|
||||
"template": "app.columns.name",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 20
|
||||
},
|
||||
{
|
||||
"id": "app.files.size",
|
||||
@ -1176,7 +1178,8 @@
|
||||
"type": "fileSize",
|
||||
"class": "adf-no-grow-cell adf-ellipsis-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 30
|
||||
},
|
||||
{
|
||||
"id": "app.files.modifiedOn",
|
||||
@ -1186,7 +1189,8 @@
|
||||
"format": "timeAgo",
|
||||
"class": "adf-ellipsis-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 40
|
||||
},
|
||||
{
|
||||
"id": "app.files.modifiedBy",
|
||||
@ -1196,7 +1200,8 @@
|
||||
"type": "text",
|
||||
"class": "adf-ellipsis-cell adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 50
|
||||
}
|
||||
],
|
||||
"libraries": [
|
||||
@ -1205,7 +1210,8 @@
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"sortable": false,
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 10
|
||||
},
|
||||
{
|
||||
"id": "app.libraries.name",
|
||||
@ -1216,7 +1222,8 @@
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-3",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryName",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 20
|
||||
},
|
||||
{
|
||||
"id": "app.libraries.description",
|
||||
@ -1225,7 +1232,8 @@
|
||||
"type": "text",
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-5",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 30
|
||||
},
|
||||
{
|
||||
"id": "app.libraries.role",
|
||||
@ -1235,7 +1243,8 @@
|
||||
"class": "adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryRole",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 40
|
||||
},
|
||||
{
|
||||
"id": "app.libraries.visibility",
|
||||
@ -1245,7 +1254,8 @@
|
||||
"class": "adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryStatus",
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 50
|
||||
}
|
||||
],
|
||||
"favoriteLibraries": [
|
||||
@ -1254,7 +1264,8 @@
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"sortable": false,
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 10
|
||||
},
|
||||
{
|
||||
"id": "app.favorite.libraries.name",
|
||||
@ -1265,7 +1276,8 @@
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-3",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryName",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 20
|
||||
},
|
||||
{
|
||||
"id": "app.favorite.libraries.description",
|
||||
@ -1274,7 +1286,8 @@
|
||||
"type": "text",
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-5",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 30
|
||||
},
|
||||
{
|
||||
"id": "app.favorite.libraries.role",
|
||||
@ -1284,7 +1297,8 @@
|
||||
"class": "adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryRole",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 40
|
||||
},
|
||||
{
|
||||
"id": "app.favorite.libraries.visibility",
|
||||
@ -1294,7 +1308,8 @@
|
||||
"class": "adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryStatus",
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 50
|
||||
}
|
||||
],
|
||||
"shared": [
|
||||
@ -1303,7 +1318,8 @@
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"sortable": false,
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 10
|
||||
},
|
||||
{
|
||||
"id": "app.shared.name",
|
||||
@ -1313,7 +1329,8 @@
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-5",
|
||||
"sortable": true,
|
||||
"template": "app.columns.name",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 20
|
||||
},
|
||||
{
|
||||
"id": "app.shared.location",
|
||||
@ -1324,7 +1341,8 @@
|
||||
"class": "adf-ellipsis-cell adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.location",
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 30
|
||||
},
|
||||
{
|
||||
"id": "app.shared.size",
|
||||
@ -1334,7 +1352,8 @@
|
||||
"type": "fileSize",
|
||||
"class": "adf-no-grow-cell adf-ellipsis-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 40
|
||||
},
|
||||
{
|
||||
"id": "app.shared.modifiedOn",
|
||||
@ -1345,7 +1364,8 @@
|
||||
"class": "adf-ellipsis-cell",
|
||||
"format": "timeAgo",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 50
|
||||
},
|
||||
{
|
||||
"id": "app.shared.modifiedBy",
|
||||
@ -1355,7 +1375,8 @@
|
||||
"type": "text",
|
||||
"class": "adf-ellipsis-cell adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 60
|
||||
},
|
||||
{
|
||||
"id": "app.shared.sharedBy",
|
||||
@ -1365,7 +1386,8 @@
|
||||
"type": "text",
|
||||
"class": "adf-ellipsis-cell adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 70
|
||||
}
|
||||
],
|
||||
"recent": [
|
||||
@ -1374,7 +1396,8 @@
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"sortable": false,
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 10
|
||||
},
|
||||
{
|
||||
"id": "app.recent.name",
|
||||
@ -1384,7 +1407,8 @@
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-5",
|
||||
"sortable": true,
|
||||
"template": "app.columns.name",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 20
|
||||
},
|
||||
{
|
||||
"id": "app.recent.location",
|
||||
@ -1394,7 +1418,8 @@
|
||||
"class": "adf-ellipsis-cell adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.location",
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 30
|
||||
},
|
||||
{
|
||||
"id": "app.recent.size",
|
||||
@ -1404,7 +1429,8 @@
|
||||
"type": "fileSize",
|
||||
"class": "adf-no-grow-cell adf-ellipsis-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 40
|
||||
},
|
||||
{
|
||||
"id": "app.recent.modifiedOn",
|
||||
@ -1414,7 +1440,8 @@
|
||||
"format": "timeAgo",
|
||||
"class": "adf-ellipsis-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 50
|
||||
}
|
||||
],
|
||||
"favorites": [
|
||||
@ -1423,7 +1450,8 @@
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"sortable": false,
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 10
|
||||
},
|
||||
{
|
||||
"id": "app.favorites.name",
|
||||
@ -1433,7 +1461,8 @@
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-5",
|
||||
"sortable": true,
|
||||
"template": "app.columns.name",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 20
|
||||
},
|
||||
{
|
||||
"id": "app.favorites.location",
|
||||
@ -1443,7 +1472,8 @@
|
||||
"class": "adf-ellipsis-cell adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.location",
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 30
|
||||
},
|
||||
{
|
||||
"id": "app.favorites.size",
|
||||
@ -1452,7 +1482,8 @@
|
||||
"type": "fileSize",
|
||||
"class": "adf-no-grow-cell adf-ellipsis-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 40
|
||||
},
|
||||
{
|
||||
"id": "app.favorites.modifiedOn",
|
||||
@ -1462,7 +1493,8 @@
|
||||
"format": "timeAgo",
|
||||
"class": "adf-ellipsis-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 50
|
||||
},
|
||||
{
|
||||
"id": "app.favorites.modifiedBy",
|
||||
@ -1472,7 +1504,8 @@
|
||||
"type": "text",
|
||||
"class": "adf-ellipsis-cell adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 60
|
||||
}
|
||||
],
|
||||
"trashcan": [
|
||||
@ -1481,7 +1514,8 @@
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"sortable": false,
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 10
|
||||
},
|
||||
{
|
||||
"id": "app.trashcan.name",
|
||||
@ -1491,7 +1525,8 @@
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-5",
|
||||
"sortable": true,
|
||||
"template": "app.columns.trashcanName",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 20
|
||||
},
|
||||
{
|
||||
"id": "app.trashcan.location",
|
||||
@ -1501,7 +1536,8 @@
|
||||
"class": "adf-ellipsis-cell adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.location",
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 30
|
||||
},
|
||||
{
|
||||
"id": "app.trashcan.size",
|
||||
@ -1511,7 +1547,8 @@
|
||||
"type": "fileSize",
|
||||
"class": "adf-no-grow-cell adf-ellipsis-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 40
|
||||
},
|
||||
{
|
||||
"id": "app.trashcan.deletedOn",
|
||||
@ -1521,7 +1558,8 @@
|
||||
"format": "timeAgo",
|
||||
"class": "adf-ellipsis-cell",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 50
|
||||
}
|
||||
],
|
||||
"search-libraries": [
|
||||
@ -1530,7 +1568,8 @@
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"sortable": false,
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 10
|
||||
},
|
||||
{
|
||||
"id": "app.libraries.name",
|
||||
@ -1541,7 +1580,8 @@
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-3",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryName",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 20
|
||||
},
|
||||
{
|
||||
"id": "app.favorite.libraries.description",
|
||||
@ -1551,7 +1591,8 @@
|
||||
"class": "adf-ellipsis-cell adf-expand-cell-5",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryDescription",
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 30
|
||||
},
|
||||
{
|
||||
"id": "app.libraries.role",
|
||||
@ -1561,7 +1602,8 @@
|
||||
"class": "adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryRole",
|
||||
"desktopOnly": false
|
||||
"desktopOnly": false,
|
||||
"order": 40
|
||||
},
|
||||
{
|
||||
"id": "app.libraries.visibility",
|
||||
@ -1571,7 +1613,8 @@
|
||||
"class": "adf-no-grow-cell",
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryStatus",
|
||||
"desktopOnly": true
|
||||
"desktopOnly": true,
|
||||
"order": 50
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user