Create Folder directive enhancement: custom nodeType (#3214)

This commit is contained in:
Popovics András
2018-04-19 13:03:38 +01:00
committed by Eugenio Romano
parent 0ff0573401
commit deb09e4d5f
7 changed files with 138 additions and 72 deletions

View File

@@ -47,6 +47,7 @@ export class FolderDialogComponent implements OnInit {
editTitle = 'CORE.FOLDER_DIALOG.EDIT_FOLDER_TITLE';
createTitle = 'CORE.FOLDER_DIALOG.CREATE_FOLDER_TITLE';
nodeType = 'cm:folder';
constructor(
private formBuilder: FormBuilder,
@@ -60,6 +61,7 @@ export class FolderDialogComponent implements OnInit {
if (data) {
this.editTitle = data.editTitle || this.editTitle;
this.createTitle = data.createTitle || this.createTitle;
this.nodeType = data.nodeType || this.nodeType;
}
}
@@ -116,8 +118,8 @@ export class FolderDialogComponent implements OnInit {
}
private create(): Observable<MinimalNodeEntryEntity> {
const { name, properties, nodesApi, data: { parentNodeId} } = this;
return nodesApi.createFolder(parentNodeId, { name, properties });
const { name, properties, nodeType, nodesApi, data: { parentNodeId} } = this;
return nodesApi.createFolder(parentNodeId, { name, properties, nodeType });
}
private edit(): Observable<MinimalNodeEntryEntity> {