mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[AAE-5145] Add enum for content node selector actions (#7039)
* [AAE-5145] Add enum for content node selector actions * [AAE-5145] Fix lint and unit tests * Order imports back to original order * Rename to NodeAction
This commit is contained in:
@@ -24,6 +24,7 @@ import { Node, NodeEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { DocumentListService } from '../document-list/services/document-list.service';
|
||||
import { ContentNodeSelectorComponent } from './content-node-selector.component';
|
||||
import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface';
|
||||
import { NodeAction } from '../document-list/models/node-action.enum';
|
||||
import { NodeLockDialogComponent } from '../dialogs/node-lock.dialog';
|
||||
import { switchMap } from 'rxjs/operators';
|
||||
|
||||
@@ -61,7 +62,7 @@ export class ContentNodeDialogService {
|
||||
*/
|
||||
openFileBrowseDialogByFolderId(folderNodeId: string): Observable<Node[]> {
|
||||
return this.documentListService.getFolderNode(folderNodeId).pipe(switchMap((nodeEntry: NodeEntry) => {
|
||||
return this.openUploadFileDialog('Choose', nodeEntry.entry, true);
|
||||
return this.openUploadFileDialog(NodeAction.CHOOSE, nodeEntry.entry, true);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -126,7 +127,7 @@ export class ContentNodeDialogService {
|
||||
*/
|
||||
openFolderBrowseDialogByFolderId(folderNodeId: string): Observable<Node[]> {
|
||||
return this.documentListService.getFolderNode(folderNodeId).pipe(switchMap((node: NodeEntry) => {
|
||||
return this.openUploadFolderDialog('Choose', node.entry);
|
||||
return this.openUploadFolderDialog(NodeAction.CHOOSE, node.entry);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -138,7 +139,7 @@ export class ContentNodeDialogService {
|
||||
* @param excludeSiteContent The site content that should be filtered out
|
||||
* @returns Information about files that were copied/moved
|
||||
*/
|
||||
openCopyMoveDialog(action: string, contentEntry: Node, permission?: string, excludeSiteContent?: string[]): Observable<Node[]> {
|
||||
openCopyMoveDialog(action: NodeAction, contentEntry: Node, permission?: string, excludeSiteContent?: string[]): Observable<Node[]> {
|
||||
if (this.contentService.hasAllowableOperations(contentEntry, permission)) {
|
||||
|
||||
const select = new Subject<Node[]>();
|
||||
@@ -183,7 +184,7 @@ export class ContentNodeDialogService {
|
||||
* @param contentEntry Item to upload
|
||||
* @returns Information about the chosen folder(s)
|
||||
*/
|
||||
openUploadFolderDialog(action: string, contentEntry: Node): Observable<Node[]> {
|
||||
openUploadFolderDialog(action: NodeAction, contentEntry: Node): Observable<Node[]> {
|
||||
const select = new Subject<Node[]>();
|
||||
select.subscribe({
|
||||
complete: this.close.bind(this)
|
||||
@@ -211,7 +212,7 @@ export class ContentNodeDialogService {
|
||||
* @param showFilesInResult Show files in dialog search result
|
||||
* @returns Information about the chosen file(s)
|
||||
*/
|
||||
openUploadFileDialog(action: string, contentEntry: Node, showFilesInResult = false): Observable<Node[]> {
|
||||
openUploadFileDialog(action: NodeAction, contentEntry: Node, showFilesInResult = false): Observable<Node[]> {
|
||||
const select = new Subject<Node[]>();
|
||||
select.subscribe({
|
||||
complete: this.close.bind(this)
|
||||
|
Reference in New Issue
Block a user