[ACA-2137] Destination picker - use excludeSiteContent (#1043)

- remove ACA workaround
- testing is done on ADF component
This commit is contained in:
Suzana Dirla
2019-03-26 11:27:15 +00:00
committed by Denys Vuika
parent 404b528a59
commit c835fbe2f9
2 changed files with 4 additions and 42 deletions
@@ -309,22 +309,6 @@ describe('NodeActionsService', () => {
})
).toBe(true);
});
it('should filter destination nodes and not show the restricted site content', () => {
const restrictedSiteContent = new TestNode(
'blog-id',
!isFile,
'blog',
[],
'cm:folder',
{ 'st:componentId': 'blog' }
);
expect(
testContentNodeSelectorComponentData.data.rowFilter({
node: restrictedSiteContent
})
).toBe(false);
});
});
describe('copyNodes', () => {
+4 -26
View File
@@ -36,7 +36,8 @@ import {
import {
DocumentListService,
ContentNodeSelectorComponent,
ContentNodeSelectorComponentData
ContentNodeSelectorComponentData,
ContentNodeDialogService
} from '@alfresco/adf-content-services';
import {
MinimalNodeEntity,
@@ -53,14 +54,6 @@ import { catchError, map, mergeMap } from 'rxjs/operators';
export class NodeActionsService {
static SNACK_MESSAGE_DURATION_WITH_UNDO = 10000;
static SNACK_MESSAGE_DURATION = 3000;
static restrictedSiteContent = [
'blog',
'calendar',
'dataLists',
'discussions',
'links',
'wiki'
];
contentCopied: Subject<MinimalNodeEntity[]> = new Subject<
MinimalNodeEntity[]
@@ -251,7 +244,7 @@ export class NodeActionsService {
isSelectionValid: this.canCopyMoveInsideIt.bind(this),
breadcrumbTransform: this.customizeBreadcrumb.bind(this),
select: new Subject<MinimalNodeEntryEntity[]>(),
excludeSiteContent: []
excludeSiteContent: ContentNodeDialogService.nonDocumentSiteContent
};
this.dialog.open(ContentNodeSelectorComponent, <any>{
@@ -299,17 +292,6 @@ export class NodeActionsService {
);
}
private isRestrictedSiteContent(entry) {
if (entry && entry.properties && entry.properties['st:componentId']) {
const restrictedItem = NodeActionsService.restrictedSiteContent.find(
restrictedId => entry.properties['st:componentId'] === restrictedId
);
return !!restrictedItem;
}
return false;
}
close() {
this.dialog.closeAll();
}
@@ -657,11 +639,7 @@ export class NodeActionsService {
const node: MinimalNodeEntryEntity = row.node.entry;
this.isSitesDestinationAvailable = !!node['guid'];
return (
!node.isFile &&
node.nodeType !== 'app:folderlink' &&
!this.isRestrictedSiteContent(node)
);
return !node.isFile && node.nodeType !== 'app:folderlink';
}
// todo: review once 1.10-beta6 is out