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 {
|
import {
|
||||||
MinimalNodeEntity,
|
MinimalNodeEntity,
|
||||||
MinimalNodeEntryEntity,
|
MinimalNodeEntryEntity,
|
||||||
Node
|
Node,
|
||||||
|
SiteEntry
|
||||||
} from 'alfresco-js-api';
|
} from 'alfresco-js-api';
|
||||||
import { NodePermissionService } from './node-permission.service';
|
import { NodePermissionService } from './node-permission.service';
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ export class ContentManagementService {
|
|||||||
folderEdited = new Subject<any>();
|
folderEdited = new Subject<any>();
|
||||||
folderCreated = new Subject<any>();
|
folderCreated = new Subject<any>();
|
||||||
libraryDeleted = new Subject<string>();
|
libraryDeleted = new Subject<string>();
|
||||||
libraryCreated = new Subject<string>();
|
libraryCreated = new Subject<SiteEntry>();
|
||||||
linksUnshared = new Subject<any>();
|
linksUnshared = new Subject<any>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ -109,7 +110,7 @@ export class ContentManagementService {
|
|||||||
this.store.dispatch(new SnackbarErrorAction(message));
|
this.store.dispatch(new SnackbarErrorAction(message));
|
||||||
});
|
});
|
||||||
|
|
||||||
dialogInstance.afterClosed().subscribe(node => {
|
dialogInstance.afterClosed().subscribe((node: SiteEntry) => {
|
||||||
if (node) {
|
if (node) {
|
||||||
this.libraryCreated.next(node);
|
this.libraryCreated.next(node);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,9 @@ export class LibrariesComponent extends PageComponent implements OnInit {
|
|||||||
|
|
||||||
this.subscriptions.push(
|
this.subscriptions.push(
|
||||||
this.content.libraryDeleted.subscribe(() => this.reload()),
|
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 { Component, OnInit, Output, EventEmitter } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { MatDialogRef } from '@angular/material';
|
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 { ContentApiService } from '../../services/content-api.service';
|
||||||
import { SiteIdValidator, forbidSpecialCharacters } from './form.validators';
|
import { SiteIdValidator, forbidSpecialCharacters } from './form.validators';
|
||||||
|
|
||||||
@ -108,9 +108,10 @@ export class LibraryDialogComponent implements OnInit {
|
|||||||
if (!form.valid) { return; }
|
if (!form.valid) { return; }
|
||||||
|
|
||||||
this.create().subscribe(
|
this.create().subscribe(
|
||||||
(folder: any) => {
|
(node: SiteEntry) => {
|
||||||
this.success.emit(folder);
|
|
||||||
dialog.close(folder);
|
this.success.emit(node);
|
||||||
|
dialog.close(node);
|
||||||
},
|
},
|
||||||
(error) => this.handleError(error)
|
(error) => this.handleError(error)
|
||||||
);
|
);
|
||||||
@ -120,7 +121,7 @@ export class LibraryDialogComponent implements OnInit {
|
|||||||
this.visibilityOption = event.value;
|
this.visibilityOption = event.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private create(): Observable<any> {
|
private create(): Observable<SiteEntry> {
|
||||||
const { contentApi, title, id, description, visibility } = this;
|
const { contentApi, title, id, description, visibility } = this;
|
||||||
const siteBody = <SiteBody>{
|
const siteBody = <SiteBody>{
|
||||||
id,
|
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(
|
return Observable.fromPromise(
|
||||||
this.api.sitesApi.createSite(siteBody, opts)
|
this.api.sitesApi.createSite(siteBody, opts)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user