mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
[ACA-1894] - fixed missing behaviour for drag&drop (#5641)
This commit is contained in:
parent
697ce6e365
commit
444ebcdfd8
@ -342,6 +342,14 @@ describe('UploadService', () => {
|
|||||||
expect(result[0]).toBe(file2);
|
expect(result[0]).toBe(file2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should skip files if they are in an excluded folder when path is in options', () => {
|
||||||
|
const file1: any = { name: 'readmetoo.md', file : {}, options: { path: '/rollingPanda/'}};
|
||||||
|
const file2: any = { name: 'readme.md', file : { webkitRelativePath: '/test/' }};
|
||||||
|
const result = service.addToQueue(file1, file2);
|
||||||
|
expect(result.length).toBe(1);
|
||||||
|
expect(result[0]).toBe(file2);
|
||||||
|
});
|
||||||
|
|
||||||
it('should call onUploadDeleted if file was deleted', async(() => {
|
it('should call onUploadDeleted if file was deleted', async(() => {
|
||||||
const file = <any> ({ status: FileUploadStatus.Deleted });
|
const file = <any> ({ status: FileUploadStatus.Deleted });
|
||||||
spyOn(service.fileUploadDeleted, 'next');
|
spyOn(service.fileUploadDeleted, 'next');
|
||||||
|
@ -127,10 +127,11 @@ export class UploadService {
|
|||||||
private isParentFolderAllowed(file: FileModel): boolean {
|
private isParentFolderAllowed(file: FileModel): boolean {
|
||||||
let isAllowed: boolean = true;
|
let isAllowed: boolean = true;
|
||||||
const currentFile: any = file.file;
|
const currentFile: any = file.file;
|
||||||
if (currentFile && currentFile.webkitRelativePath) {
|
const fileRelativePath = currentFile.webkitRelativePath ? currentFile.webkitRelativePath : file.options.path;
|
||||||
|
if (currentFile && fileRelativePath) {
|
||||||
isAllowed =
|
isAllowed =
|
||||||
this.excludedFoldersList.filter((folderToExclude) => {
|
this.excludedFoldersList.filter((folderToExclude) => {
|
||||||
return currentFile.webkitRelativePath
|
return fileRelativePath
|
||||||
.split('/')
|
.split('/')
|
||||||
.some((pathElement) => {
|
.some((pathElement) => {
|
||||||
const minimatch = new Minimatch(folderToExclude, this.folderMatchingOptions);
|
const minimatch = new Minimatch(folderToExclude, this.folderMatchingOptions);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user