mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-1054] [Destination picker] File Libraries list should be sorted … (#132)
* [ACA-1054] [Destination picker] File Libraries list should be sorted by name manipulate the content-node-selector component from ACA by using the matDialogRef.componentInstance * [ACA-1054] fix node-actions.service tests
This commit is contained in:
@@ -27,7 +27,7 @@ import { EventEmitter, Injectable } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { Observable, Subject } from 'rxjs/Rx';
|
||||
|
||||
import { AlfrescoApiService, ContentService, NodesApiService, DataColumn } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, ContentService, NodesApiService, DataColumn, DataSorting } from '@alfresco/adf-core';
|
||||
import { DocumentListService, ContentNodeSelectorComponent, ContentNodeSelectorComponentData } from '@alfresco/adf-content-services';
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||
|
||||
@@ -194,11 +194,23 @@ export class NodeActionsService {
|
||||
select: new EventEmitter<MinimalNodeEntryEntity[]>()
|
||||
};
|
||||
|
||||
this.dialog.open(ContentNodeSelectorComponent, <any>{
|
||||
const matDialogRef = this.dialog.open(ContentNodeSelectorComponent, <any>{
|
||||
data,
|
||||
panelClass: 'adf-content-node-selector-dialog',
|
||||
width: '630px'
|
||||
});
|
||||
const destinationPicker = matDialogRef.componentInstance;
|
||||
const initialSiteChanged = destinationPicker.siteChanged;
|
||||
|
||||
destinationPicker.siteChanged = (chosenSite) => {
|
||||
initialSiteChanged.call(destinationPicker, chosenSite);
|
||||
|
||||
if (chosenSite.guid === '-mysites-') {
|
||||
destinationPicker.documentList.data.setSorting(new DataSorting('title', 'asc'));
|
||||
} else {
|
||||
destinationPicker.documentList.data.setSorting(new DataSorting('name', 'asc'));
|
||||
}
|
||||
};
|
||||
|
||||
return data.select;
|
||||
}
|
||||
|
Reference in New Issue
Block a user