mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1873] Remove all deprecated code from ADF (#4145)
* remove deprecated code part 1 * remove deprecation step 2 * fix spellcheck * fix * fix lint * fix not used import * remove deprecation * fix test first part after remove deprecation * fix test * fix sidebar demo shell
This commit is contained in:
@@ -63,13 +63,6 @@ export abstract class UploadBase implements OnInit, OnDestroy {
|
||||
@Output()
|
||||
success = new EventEmitter();
|
||||
|
||||
/**
|
||||
* Emitted when a folder is created.
|
||||
* @deprecated 2.4.0 No longer used by the framework
|
||||
*/
|
||||
@Output()
|
||||
createFolder = new EventEmitter();
|
||||
|
||||
/** Emitted when an error occurs. */
|
||||
@Output()
|
||||
error = new EventEmitter();
|
||||
|
@@ -23,9 +23,8 @@ import { ChangeDetectorRef, Component, Input, Output, EventEmitter, OnDestroy, O
|
||||
import { Subscription, merge } from 'rxjs';
|
||||
import { FileUploadingListComponent } from './file-uploading-list.component';
|
||||
|
||||
// @deprecated file-uploading-dialog TODO remove in 3.0.0
|
||||
@Component({
|
||||
selector: 'adf-file-uploading-dialog, file-uploading-dialog',
|
||||
selector: 'adf-file-uploading-dialog',
|
||||
templateUrl: './file-uploading-dialog.component.html',
|
||||
styleUrls: ['./file-uploading-dialog.component.scss']
|
||||
})
|
||||
|
@@ -151,18 +151,7 @@ describe('UploadDragAreaComponent', () => {
|
||||
spyOn(uploadService, 'uploadFilesInTheQueue');
|
||||
fixture.detectChanges();
|
||||
|
||||
let itemEntity = {
|
||||
fullPath: '/folder-fake/file-fake.png',
|
||||
isDirectory: false,
|
||||
isFile: true,
|
||||
relativeFolder: '/',
|
||||
name: 'file-fake.png',
|
||||
file: (callbackFile) => {
|
||||
let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' });
|
||||
callbackFile(fileFake);
|
||||
}
|
||||
};
|
||||
component.onFilesEntityDropped(itemEntity);
|
||||
component.onFilesDropped([new File(['fakefake'], 'file-fake.png', { type: 'image/png' })]);
|
||||
|
||||
expect(uploadService.addToQueue).not.toHaveBeenCalled();
|
||||
expect(uploadService.uploadFilesInTheQueue).not.toHaveBeenCalled();
|
||||
@@ -270,19 +259,9 @@ describe('UploadDragAreaComponent', () => {
|
||||
component.success = null;
|
||||
component.acceptedFilesType = '.png';
|
||||
fixture.detectChanges();
|
||||
let itemEntity = {
|
||||
fullPath: '/folder-fake/file-fake.png',
|
||||
isDirectory: false,
|
||||
isFile: true,
|
||||
name: 'file-fake.png',
|
||||
relativeFolder: '/',
|
||||
file: (callbackFile) => {
|
||||
let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' });
|
||||
callbackFile(fileFake);
|
||||
}
|
||||
};
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
component.onFilesEntityDropped(itemEntity);
|
||||
component.onFilesDropped([new File(['fakefake'], 'file-fake.png', { type: 'image/png' })]);
|
||||
expect(uploadService.uploadFilesInTheQueue).toHaveBeenCalledWith(null);
|
||||
});
|
||||
}));
|
||||
@@ -293,19 +272,8 @@ describe('UploadDragAreaComponent', () => {
|
||||
fixture.detectChanges();
|
||||
spyOn(uploadService, 'uploadFilesInTheQueue');
|
||||
|
||||
let itemEntity = {
|
||||
fullPath: '/folder-fake/file-fake.png',
|
||||
isDirectory: false,
|
||||
isFile: true,
|
||||
relativeFolder: '/',
|
||||
name: 'file-fake.png',
|
||||
file: (callbackFile) => {
|
||||
let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' });
|
||||
callbackFile(fileFake);
|
||||
}
|
||||
};
|
||||
fixture.whenStable().then(() => {
|
||||
component.onFilesEntityDropped(itemEntity);
|
||||
component.onFilesDropped([new File(['fakefake'], 'file-fake.png', { type: 'image/png' })]);
|
||||
expect(uploadService.uploadFilesInTheQueue).not.toHaveBeenCalledWith(null);
|
||||
});
|
||||
}));
|
||||
@@ -315,18 +283,7 @@ describe('UploadDragAreaComponent', () => {
|
||||
fixture.detectChanges();
|
||||
spyOn(uploadService, 'uploadFilesInTheQueue');
|
||||
|
||||
let itemEntity = {
|
||||
fullPath: '/folder-fake/file-fake.png',
|
||||
isDirectory: false,
|
||||
isFile: true,
|
||||
name: 'file-fake.png',
|
||||
relativeFolder: '/',
|
||||
file: (callbackFile) => {
|
||||
let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' });
|
||||
callbackFile(fileFake);
|
||||
}
|
||||
};
|
||||
component.onFilesEntityDropped(itemEntity);
|
||||
component.onFilesDropped([new File(['fakefake'], 'file-fake.png', { type: 'image/png' })]);
|
||||
expect(uploadService.uploadFilesInTheQueue).toHaveBeenCalledWith(null);
|
||||
}));
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import {
|
||||
EXTENDIBLE_COMPONENT, FileInfo, FileModel, FileUtils, NodePermissionSubject,
|
||||
NotificationService, TranslationService, UploadService, ContentService, PermissionsEnum
|
||||
} from '@alfresco/adf-core';
|
||||
import { Component, forwardRef, Input, ViewEncapsulation, NgZone } from '@angular/core';
|
||||
import { Component, forwardRef, ViewEncapsulation, NgZone } from '@angular/core';
|
||||
import { UploadBase } from './base-upload/upload-base';
|
||||
|
||||
@Component({
|
||||
@@ -34,15 +34,6 @@ import { UploadBase } from './base-upload/upload-base';
|
||||
})
|
||||
export class UploadDragAreaComponent extends UploadBase implements NodePermissionSubject {
|
||||
|
||||
/**
|
||||
* ID of parent folder node
|
||||
* @deprecated 2.4.0 - use rootFolderId ID of parent folder node
|
||||
*/
|
||||
@Input()
|
||||
set parentId(nodeId: string) {
|
||||
this.rootFolderId = nodeId;
|
||||
}
|
||||
|
||||
constructor(protected uploadService: UploadService,
|
||||
protected translationService: TranslationService,
|
||||
private notificationService: NotificationService,
|
||||
@@ -62,21 +53,6 @@ export class UploadDragAreaComponent extends UploadBase implements NodePermissio
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the file are dropped in the drag area.
|
||||
* @deprecated in 2.4.0: use `onFilesDropped` instead
|
||||
* @param item - FileEntity
|
||||
*/
|
||||
onFilesEntityDropped(item: any): void {
|
||||
if (!this.disabled) {
|
||||
item.file((file: File) => {
|
||||
// const fileModel = this.createFileModel(file, this.rootFolderId, item.fullPath.replace(item.name, ''));
|
||||
|
||||
this.uploadFiles([file]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a folder are dropped in the drag area
|
||||
*
|
||||
|
Reference in New Issue
Block a user