[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:
Popovics András
2018-04-17 20:27:42 +01:00
committed by Eugenio Romano
parent 21ad4c2894
commit ee9393caf0
12 changed files with 569 additions and 242 deletions

View File

@@ -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);