mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[APM-7] Feature enhancement for the create and edit folder directive (#3179)
* Add observable menu open state to the sidenav-layout component * add documentation, fix inversed value * Add success events to folder create/edit directives * Overridable dialog titles for the directives * Update the documentation
This commit is contained in:
committed by
Eugenio Romano
parent
21ad4c2894
commit
ee9393caf0
@@ -35,10 +35,16 @@ export class FolderCreateDirective {
|
||||
@Input('adf-create-folder')
|
||||
parentNodeId: string = DEFAULT_FOLDER_PARENT_ID;
|
||||
|
||||
@Input()
|
||||
title: string = null;
|
||||
|
||||
/** Emitted when the create folder give error for example a folder with same name already exist */
|
||||
@Output()
|
||||
error: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@Output()
|
||||
success: EventEmitter<MinimalNodeEntryEntity> = new EventEmitter<MinimalNodeEntryEntity>();
|
||||
|
||||
@HostListener('click', [ '$event' ])
|
||||
onClick(event) {
|
||||
event.preventDefault();
|
||||
@@ -55,7 +61,10 @@ export class FolderCreateDirective {
|
||||
const { parentNodeId } = this;
|
||||
|
||||
return {
|
||||
data: { parentNodeId },
|
||||
data: {
|
||||
parentNodeId,
|
||||
createTitle: this.title
|
||||
},
|
||||
width: `${width}px`
|
||||
};
|
||||
}
|
||||
@@ -68,6 +77,10 @@ export class FolderCreateDirective {
|
||||
this.error.emit(error);
|
||||
});
|
||||
|
||||
dialogInstance.componentInstance.success.subscribe((node: MinimalNodeEntryEntity) => {
|
||||
this.success.emit(node);
|
||||
});
|
||||
|
||||
dialogInstance.afterClosed().subscribe((node: MinimalNodeEntryEntity) => {
|
||||
if (node) {
|
||||
content.folderCreate.next(node);
|
||||
|
Reference in New Issue
Block a user