diff --git a/demo-shell-ng2/app/components/files/files.component.css b/demo-shell-ng2/app/components/files/files.component.css
index 11a8ff4337..12d4d9c3c2 100644
--- a/demo-shell-ng2/app/components/files/files.component.css
+++ b/demo-shell-ng2/app/components/files/files.component.css
@@ -24,6 +24,14 @@ adf-document-list >>> adf-datatable tr.is-selected .image-table-cell {
position: relative;
}
+adf-document-list >>> adf-datatable tr.document-list__create {
+ background: green !important;
+}
+
+adf-document-list >>> adf-datatable tr.document-list__disable {
+ background: red !important;
+}
+
adf-document-list >>> adf-datatable tr.is-selected .image-table-cell::before {
content: "\E876"; /* "done" */
font-family: "Material Icons";
@@ -45,7 +53,8 @@ adf-document-list >>> adf-datatable tr.is-selected .image-table-cell::before {
.adf-demo-site-container-style {
margin-top: 10px;
margin-bottom: 10px;
- margin-left: 3%;
width: 100%;
min-width: 200px;
}
+
+
diff --git a/demo-shell-ng2/app/components/files/files.component.html b/demo-shell-ng2/app/components/files/files.component.html
index 1af7fa32ac..1e80674a68 100644
--- a/demo-shell-ng2/app/components/files/files.component.html
+++ b/demo-shell-ng2/app/components/files/files.component.html
@@ -1,7 +1,5 @@
-
Choose A Site from DropDown
-
diff --git a/demo-shell-ng2/app/components/files/files.component.ts b/demo-shell-ng2/app/components/files/files.component.ts
index 07226c23be..9efdc03efc 100644
--- a/demo-shell-ng2/app/components/files/files.component.ts
+++ b/demo-shell-ng2/app/components/files/files.component.ts
@@ -18,7 +18,7 @@
import { ChangeDetectorRef, Component, Input, OnInit, Optional, ViewChild } from '@angular/core';
import { MdDialog } from '@angular/material';
import { ActivatedRoute, Params } from '@angular/router';
-import { AlfrescoContentService, FileUploadCompleteEvent, FolderCreatedEvent, NotificationService, SiteModel, UploadService } from 'ng2-alfresco-core';
+import { AlfrescoContentService, FileUploadCompleteEvent, FolderCreatedEvent, NotificationService, PermissionsEnum, SiteModel, UploadService } from 'ng2-alfresco-core';
import { DocumentListComponent, DropdownSitesComponent, PermissionStyleModel } from 'ng2-alfresco-documentlist';
import { CreateFolderDialogComponent } from '../../dialogs/create-folder.dialog';
@@ -40,7 +40,7 @@ export class FilesComponent implements OnInit {
useCustomToolbar = true;
toolbarColor = 'default';
- useDropdownBreadcrumb = true;
+ useDropdownBreadcrumb = false;
selectionModes = [
{ value: 'none', viewValue: 'None' },
@@ -115,6 +115,9 @@ export class FilesComponent implements OnInit {
this.uploadService.fileUploadComplete.debounceTime(300).subscribe(value => this.onFileUploadComplete(value));
this.contentService.folderCreated.subscribe(value => this.onFolderCreated(value));
+
+ // this.permissionsStyle.push(new PermissionStyleModel('document-list__create', PermissionsEnum.CREATE));
+ // this.permissionsStyle.push(new PermissionStyleModel('document-list__disable', PermissionsEnum.NOT_CREATE, false, true));
}
onNavigationError(err: any) {
diff --git a/ng2-components/ng2-alfresco-core/src/services/alfresco-content.service.spec.ts b/ng2-components/ng2-alfresco-core/src/services/alfresco-content.service.spec.ts
index c6bc7b9c68..dbdb21d172 100644
--- a/ng2-components/ng2-alfresco-core/src/services/alfresco-content.service.spec.ts
+++ b/ng2-components/ng2-alfresco-core/src/services/alfresco-content.service.spec.ts
@@ -111,19 +111,29 @@ describe('AlfrescoContentService', () => {
});
});
- it('should havePermission should be false if allowableOperation is not present in the node', () => {
+ it('should havePermission be false if allowableOperation is not present in the node', () => {
let permissionNode = {};
expect(contentService.hasPermission(permissionNode, 'create')).toBeFalsy();
});
- it('should havePermission should be true if allowableOperation is present and you have the permission for the request operation', () => {
+ it('should havePermission be true if allowableOperation is present and you have the permission for the request operation', () => {
let permissionNode = {allowableOperations: ['delete', 'update', 'create', 'updatePermissions']};
expect(contentService.hasPermission(permissionNode, 'create')).toBeTruthy();
});
- it('should havePermission should be false if allowableOperation is present but you don\'t have the permission for the request operation', () => {
+ it('should havePermission be false if allowableOperation is present but you don\'t have the permission for the request operation', () => {
let permissionNode = {allowableOperations: ['delete', 'update', 'updatePermissions']};
expect(contentService.hasPermission(permissionNode, 'create')).toBeFalsy();
});
+
+ it('should havePermission works in the opposite way with negate value', () => {
+ let permissionNode = {allowableOperations: ['delete', 'update', 'updatePermissions']};
+ expect(contentService.hasPermission(permissionNode, '!create')).toBeTruthy();
+ });
+
+ it('should havePermission return false id no permission parameter are passed', () => {
+ let permissionNode = {allowableOperations: ['delete', 'update', 'updatePermissions']};
+ expect(contentService.hasPermission(permissionNode, null)).toBeFalsy();
+ });
});
diff --git a/ng2-components/ng2-alfresco-core/src/services/discovery-api.service.spec.ts b/ng2-components/ng2-alfresco-core/src/services/discovery-api.service.spec.ts
index 6775c76d43..20b1e10db3 100644
--- a/ng2-components/ng2-alfresco-core/src/services/discovery-api.service.spec.ts
+++ b/ng2-components/ng2-alfresco-core/src/services/discovery-api.service.spec.ts
@@ -90,7 +90,7 @@ let fakeBPMDiscoveryResponse: any = {
'minorVersion': '6'
};
-fdescribe('Discovery Api Service', () => {
+describe('Discovery Api Service', () => {
let service;
diff --git a/ng2-components/ng2-alfresco-documentlist/README.md b/ng2-components/ng2-alfresco-documentlist/README.md
index 44a1044e5f..857509187c 100644
--- a/ng2-components/ng2-alfresco-documentlist/README.md
+++ b/ng2-components/ng2-alfresco-documentlist/README.md
@@ -1060,6 +1060,7 @@ The permissionsStyle array can define different styles depending from the permi
[PermissionStyleModel](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-documentlist/src/models/permissions-style.model.ts)
| Property | Description |
+| --- | --- | --- | --- |
| isFile/isFolder | allow you to select if you want apply the style to file/folder nodes |
| permission | is an enum value [Permissions](https://github.com/Alfresco/alfresco-ng2-core/blob/master/ng2-components/ng2-alfresco-documentlist/src/models/permissions.enum.ts) |
| css| the name of the class to add |
@@ -1080,9 +1081,8 @@ this.permissionsStyle.push(new PermissionStyleModel('document-list__create', Per
```
```css
-
-adf-document-list >>> adf-datatable >>> tr.alfresco-datatable__row.document-list__create {
- color: rgb(57, 239, 121);
+adf-document-list >>> adf-datatable tr.document-list__create {
+ background: green !important;
}
```
@@ -1102,10 +1102,8 @@ this.permissionsStyle.push(new PermissionStyleModel('document-list__disable', Pe
```
```css
-
-adf-document-list >>> adf-datatable >>> tr.alfresco-datatable__row.document-list__disable {
- color: rgba(0, 0, 0, 0.28);
-
+adf-document-list >>> adf-datatable tr.document-list__disable {
+ background: red !important;
}
```
diff --git a/ng2-components/ng2-alfresco-documentlist/index.ts b/ng2-components/ng2-alfresco-documentlist/index.ts
index ce29c046fc..cb42ecd42b 100644
--- a/ng2-components/ng2-alfresco-documentlist/index.ts
+++ b/ng2-components/ng2-alfresco-documentlist/index.ts
@@ -59,6 +59,7 @@ export * from './src/models/content-action.model';
export * from './src/models/document-library.model';
export * from './src/models/permissions.model';
export * from './src/models/permissions-style.model';
+export * from './src/models/permissions-style.model';
export const DOCUMENT_LIST_DIRECTIVES: any[] = [
DocumentListComponent,
diff --git a/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.ts b/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.ts
index 8ca7ecf795..e887994742 100644
--- a/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.ts
+++ b/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.ts
@@ -256,10 +256,8 @@ export class ShareDataRow implements DataRow {
if (this.applyPermissionStyleToFolder(nodeEntity.entry, currentPermissionsStyle) || this.applyPermissionStyleToFile(nodeEntity.entry, currentPermissionsStyle)) {
- if (currentPermissionsStyle.permission.startsWith('!') && !this.documentListService.hasPermission(nodeEntity.entry, currentPermissionsStyle.permission)) {
- permissionsClasses += ` ${currentPermissionsStyle.css}`;
- } else if (this.documentListService.hasPermission(nodeEntity.entry, currentPermissionsStyle.permission)) {
- permissionsClasses += ` ${currentPermissionsStyle.css}`;
+ if (this.documentListService.hasPermission(nodeEntity.entry, currentPermissionsStyle.permission)) {
+ permissionsClasses += ` ${currentPermissionsStyle.css}`;
}
}