mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
#484 add process actions for folder menus
This commit is contained in:
parent
6a2899d480
commit
21194e373a
@ -21,7 +21,9 @@ import {
|
|||||||
DOCUMENT_LIST_PROVIDERS,
|
DOCUMENT_LIST_PROVIDERS,
|
||||||
DocumentActionsService,
|
DocumentActionsService,
|
||||||
DocumentList,
|
DocumentList,
|
||||||
ContentActionModel, ContentActionHandler
|
ContentActionHandler,
|
||||||
|
DocumentActionModel,
|
||||||
|
FolderActionModel
|
||||||
} from 'ng2-alfresco-documentlist';
|
} from 'ng2-alfresco-documentlist';
|
||||||
import {
|
import {
|
||||||
MDL,
|
MDL,
|
||||||
@ -129,14 +131,16 @@ export class FilesComponent implements OnInit {
|
|||||||
|
|
||||||
private setupBpmActions(actions: any[]) {
|
private setupBpmActions(actions: any[]) {
|
||||||
actions.map(def => {
|
actions.map(def => {
|
||||||
let action = new ContentActionModel();
|
let documentAction = new DocumentActionModel();
|
||||||
action.target = 'document';
|
documentAction.title = 'Activiti: ' + (def.name || 'Unknown process');
|
||||||
action.title = 'Activiti: ' + (def.name || 'Unknown process');
|
documentAction.handler = this.getBpmActionHandler(def);
|
||||||
action.handler = this.getBpmActionHandler(def);
|
this.documentList.actions.push(documentAction);
|
||||||
this.documentList.actions.push(action);
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(this.documentList.actions);
|
let folderAction = new FolderActionModel();
|
||||||
|
folderAction.title = 'Activiti: ' + (def.name || 'Unknown process');
|
||||||
|
folderAction.handler = this.getBpmActionHandler(def);
|
||||||
|
this.documentList.actions.push(folderAction);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private getBpmActionHandler(processDefinition: any): ContentActionHandler {
|
private getBpmActionHandler(processDefinition: any): ContentActionHandler {
|
||||||
|
@ -34,3 +34,17 @@ export class ContentActionModel {
|
|||||||
export interface ContentActionHandler {
|
export interface ContentActionHandler {
|
||||||
(obj: any, target?: any): any;
|
(obj: any, target?: any): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class DocumentActionModel extends ContentActionModel {
|
||||||
|
constructor(json?: any) {
|
||||||
|
super(json);
|
||||||
|
this.target = 'document';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class FolderActionModel extends ContentActionModel {
|
||||||
|
constructor(json?: any) {
|
||||||
|
super(json);
|
||||||
|
this.target = 'folder';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user