mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-26 17:24:45 +00:00
[ACA-1571] File library - navigate into library after create process (#510)
* notify library ID conflict * navigate into library node
This commit is contained in:
parent
53c2e88689
commit
d5763f585d
@ -34,7 +34,8 @@ import { AppStore } from '../../store/states';
|
||||
import {
|
||||
MinimalNodeEntity,
|
||||
MinimalNodeEntryEntity,
|
||||
Node
|
||||
Node,
|
||||
SiteEntry
|
||||
} from 'alfresco-js-api';
|
||||
import { NodePermissionService } from './node-permission.service';
|
||||
|
||||
@ -47,7 +48,7 @@ export class ContentManagementService {
|
||||
folderEdited = new Subject<any>();
|
||||
folderCreated = new Subject<any>();
|
||||
libraryDeleted = new Subject<string>();
|
||||
libraryCreated = new Subject<string>();
|
||||
libraryCreated = new Subject<SiteEntry>();
|
||||
linksUnshared = new Subject<any>();
|
||||
|
||||
constructor(
|
||||
@ -109,7 +110,7 @@ export class ContentManagementService {
|
||||
this.store.dispatch(new SnackbarErrorAction(message));
|
||||
});
|
||||
|
||||
dialogInstance.afterClosed().subscribe(node => {
|
||||
dialogInstance.afterClosed().subscribe((node: SiteEntry) => {
|
||||
if (node) {
|
||||
this.libraryCreated.next(node);
|
||||
}
|
||||
|
@ -55,7 +55,9 @@ export class LibrariesComponent extends PageComponent implements OnInit {
|
||||
|
||||
this.subscriptions.push(
|
||||
this.content.libraryDeleted.subscribe(() => this.reload()),
|
||||
this.content.libraryCreated.subscribe(() => this.reload())
|
||||
this.content.libraryCreated.subscribe((node: SiteEntry) => {
|
||||
this.navigate(node.entry.guid);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatDialogRef } from '@angular/material';
|
||||
import { SiteBody } from 'alfresco-js-api';
|
||||
import { SiteBody, SiteEntry } from 'alfresco-js-api';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { SiteIdValidator, forbidSpecialCharacters } from './form.validators';
|
||||
|
||||
@ -108,9 +108,10 @@ export class LibraryDialogComponent implements OnInit {
|
||||
if (!form.valid) { return; }
|
||||
|
||||
this.create().subscribe(
|
||||
(folder: any) => {
|
||||
this.success.emit(folder);
|
||||
dialog.close(folder);
|
||||
(node: SiteEntry) => {
|
||||
|
||||
this.success.emit(node);
|
||||
dialog.close(node);
|
||||
},
|
||||
(error) => this.handleError(error)
|
||||
);
|
||||
@ -120,7 +121,7 @@ export class LibraryDialogComponent implements OnInit {
|
||||
this.visibilityOption = event.value;
|
||||
}
|
||||
|
||||
private create(): Observable<any> {
|
||||
private create(): Observable<SiteEntry> {
|
||||
const { contentApi, title, id, description, visibility } = this;
|
||||
const siteBody = <SiteBody>{
|
||||
id,
|
||||
|
@ -229,7 +229,9 @@ export class ContentApiService {
|
||||
);
|
||||
}
|
||||
|
||||
createSite(siteBody: SiteBody, opts?: {skipConfiguration?: boolean, skipAddToFavorites?: boolean}): Observable<SiteEntry> {
|
||||
createSite(
|
||||
siteBody: SiteBody,
|
||||
opts?: {fields?: Array<string>, skipConfiguration?: boolean, skipAddToFavorites?: boolean}): Observable<SiteEntry> {
|
||||
return Observable.fromPromise(
|
||||
this.api.sitesApi.createSite(siteBody, opts)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user