[ADF-551] allow setting sorting in html (#1857)

* allow setting sorting in html

* readme update

* update readme

* restore permissions code

* - Remove the check permission from the datatable and move inside the documentlist

* Remove commented test
This commit is contained in:
Denys Vuika
2017-05-10 15:43:38 +01:00
committed by Eugenio Romano
parent 416d8c2a1b
commit b0be88ec37
7 changed files with 216 additions and 120 deletions

View File

@@ -415,86 +415,4 @@ describe('DataTable', () => {
expect(event.target.src).toBe(originalSrc);
});
it('should disable the action if there is no permission and disableWithNoPermission true', () => {
dataTable.data = new ObjectDataTableAdapter(
[{id: 1, name: 'xyz', allowableOperations: ['create', 'update']}],
[]
);
let row = dataTable.data.getRows();
let actions = [
{
disableWithNoPermission: true,
permission: 'delete',
target: 'folder',
title: 'action2'
}
];
let updateActions = dataTable.checkPermissions(row[0], actions);
expect(updateActions[0].disabled).toBe(true);
});
it('should not disable the action if there is no permission and disableWithNoPermission false', () => {
dataTable.data = new ObjectDataTableAdapter(
[{id: 1, name: 'xyz', allowableOperations: ['create', 'update']}],
[]
);
let row = dataTable.data.getRows();
let actions = [
{
disableWithNoPermission: false,
permission: 'delete',
target: 'folder',
title: 'action2'
}
];
let updateActions = dataTable.checkPermissions(row[0], actions);
expect(updateActions[0].disabled).toBeUndefined();
});
it('should not disable the action if there is the right permission', () => {
dataTable.data = new ObjectDataTableAdapter(
[{ id: 1, name: 'xyz', allowableOperations: ['create', 'update', 'delete'] }],
[]
);
let row = dataTable.data.getRows();
let actions = [
{
permission: 'delete',
target: 'folder',
title: 'action2'
}
];
let updateActions = dataTable.checkPermissions(row[0], actions);
expect(updateActions[0].disabled).toBeUndefined();
});
it('should not disable the action if there are no permissions', () => {
dataTable.data = new ObjectDataTableAdapter(
[{id: 1, name: 'xyz', allowableOperations: null}],
[]
);
let row = dataTable.data.getRows();
let actions = [
{
permission: 'delete',
target: 'folder',
title: 'action2'
}
];
let updateActions = dataTable.checkPermissions(row[0], actions);
expect(updateActions[0].disabled).toBeUndefined();
});
});