mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACA-2137] Destination picker - use excludeSiteContent (#1043)
- remove ACA workaround - testing is done on ADF component
This commit is contained in:
committed by
Denys Vuika
parent
404b528a59
commit
c835fbe2f9
@@ -309,22 +309,6 @@ describe('NodeActionsService', () => {
|
|||||||
})
|
})
|
||||||
).toBe(true);
|
).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', () => {
|
describe('copyNodes', () => {
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ import {
|
|||||||
import {
|
import {
|
||||||
DocumentListService,
|
DocumentListService,
|
||||||
ContentNodeSelectorComponent,
|
ContentNodeSelectorComponent,
|
||||||
ContentNodeSelectorComponentData
|
ContentNodeSelectorComponentData,
|
||||||
|
ContentNodeDialogService
|
||||||
} from '@alfresco/adf-content-services';
|
} from '@alfresco/adf-content-services';
|
||||||
import {
|
import {
|
||||||
MinimalNodeEntity,
|
MinimalNodeEntity,
|
||||||
@@ -53,14 +54,6 @@ import { catchError, map, mergeMap } from 'rxjs/operators';
|
|||||||
export class NodeActionsService {
|
export class NodeActionsService {
|
||||||
static SNACK_MESSAGE_DURATION_WITH_UNDO = 10000;
|
static SNACK_MESSAGE_DURATION_WITH_UNDO = 10000;
|
||||||
static SNACK_MESSAGE_DURATION = 3000;
|
static SNACK_MESSAGE_DURATION = 3000;
|
||||||
static restrictedSiteContent = [
|
|
||||||
'blog',
|
|
||||||
'calendar',
|
|
||||||
'dataLists',
|
|
||||||
'discussions',
|
|
||||||
'links',
|
|
||||||
'wiki'
|
|
||||||
];
|
|
||||||
|
|
||||||
contentCopied: Subject<MinimalNodeEntity[]> = new Subject<
|
contentCopied: Subject<MinimalNodeEntity[]> = new Subject<
|
||||||
MinimalNodeEntity[]
|
MinimalNodeEntity[]
|
||||||
@@ -251,7 +244,7 @@ export class NodeActionsService {
|
|||||||
isSelectionValid: this.canCopyMoveInsideIt.bind(this),
|
isSelectionValid: this.canCopyMoveInsideIt.bind(this),
|
||||||
breadcrumbTransform: this.customizeBreadcrumb.bind(this),
|
breadcrumbTransform: this.customizeBreadcrumb.bind(this),
|
||||||
select: new Subject<MinimalNodeEntryEntity[]>(),
|
select: new Subject<MinimalNodeEntryEntity[]>(),
|
||||||
excludeSiteContent: []
|
excludeSiteContent: ContentNodeDialogService.nonDocumentSiteContent
|
||||||
};
|
};
|
||||||
|
|
||||||
this.dialog.open(ContentNodeSelectorComponent, <any>{
|
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() {
|
close() {
|
||||||
this.dialog.closeAll();
|
this.dialog.closeAll();
|
||||||
}
|
}
|
||||||
@@ -657,11 +639,7 @@ export class NodeActionsService {
|
|||||||
const node: MinimalNodeEntryEntity = row.node.entry;
|
const node: MinimalNodeEntryEntity = row.node.entry;
|
||||||
|
|
||||||
this.isSitesDestinationAvailable = !!node['guid'];
|
this.isSitesDestinationAvailable = !!node['guid'];
|
||||||
return (
|
return !node.isFile && node.nodeType !== 'app:folderlink';
|
||||||
!node.isFile &&
|
|
||||||
node.nodeType !== 'app:folderlink' &&
|
|
||||||
!this.isRestrictedSiteContent(node)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: review once 1.10-beta6 is out
|
// todo: review once 1.10-beta6 is out
|
||||||
|
|||||||
Reference in New Issue
Block a user