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:
@@ -116,7 +116,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
let emitSpy = spyOn(component.success, 'emit');
|
||||
component.appId = 1;
|
||||
component.state = 'open';
|
||||
component.processDefinitionKey = null;
|
||||
fixture.detectChanges();
|
||||
tick();
|
||||
expect(emitSpy).toHaveBeenCalledWith(fakeProcessInstance);
|
||||
@@ -131,7 +130,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
);
|
||||
component.appId = 1;
|
||||
component.state = 'open';
|
||||
component.processDefinitionKey = null;
|
||||
component.success.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(component.rows).toBeDefined();
|
||||
@@ -147,7 +145,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
getProcessInstancesSpy = getProcessInstancesSpy.and.returnValue(of(fakeProcessInstancesWithNoName));
|
||||
component.appId = 1;
|
||||
component.state = 'open';
|
||||
component.processDefinitionKey = 'fakeprocess';
|
||||
component.success.subscribe( (res) => {
|
||||
expect(component.rows[0]['name']).toEqual('Fake Process Name - Nov 9, 2017, 12:36:14 PM');
|
||||
expect(component.rows[1]['name']).toEqual('Fake Process Name - Nov 9, 2017, 12:37:25 PM');
|
||||
@@ -198,7 +195,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
it('should emit onSuccess event when reload() called', fakeAsync(() => {
|
||||
component.appId = 1;
|
||||
component.state = 'open';
|
||||
component.processDefinitionKey = null;
|
||||
fixture.detectChanges();
|
||||
tick();
|
||||
let emitSpy = spyOn(component.success, 'emit');
|
||||
@@ -308,22 +304,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
component.ngOnChanges({'appId': change});
|
||||
});
|
||||
|
||||
it('should reload the list when the processDefinitionKey parameter changes', (done) => {
|
||||
const processDefinitionKey = 'fakeprocess';
|
||||
let change = new SimpleChange(null, processDefinitionKey, true);
|
||||
|
||||
component.success.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(component.rows).toBeDefined();
|
||||
expect(component.isListEmpty()).not.toBeTruthy();
|
||||
expect(component.rows.length).toEqual(2);
|
||||
expect(component.rows[0]['name']).toEqual('Process 773443333');
|
||||
done();
|
||||
});
|
||||
|
||||
component.ngOnChanges({'processDefinitionKey': change});
|
||||
});
|
||||
|
||||
it('should reload the list when the state parameter changes', (done) => {
|
||||
const state = 'open';
|
||||
let change = new SimpleChange(null, state, true);
|
||||
@@ -356,38 +336,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
component.ngOnChanges({'sort': change});
|
||||
});
|
||||
|
||||
it('should reload the process list when the processDefinitionKey parameter changes', (done) => {
|
||||
const processDefinitionKey = 'SimpleProcess';
|
||||
let change = new SimpleChange(null, processDefinitionKey, true);
|
||||
|
||||
component.success.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(component.rows).toBeDefined();
|
||||
expect(component.isListEmpty()).not.toBeTruthy();
|
||||
expect(component.rows.length).toEqual(2);
|
||||
expect(component.rows[0].name).toEqual('Process 773443333');
|
||||
done();
|
||||
});
|
||||
|
||||
component.ngOnChanges({'processDefinitionKey': change});
|
||||
});
|
||||
|
||||
it('should reload the process list when the processDefinitionKey parameter changes to null', (done) => {
|
||||
const processDefinitionKey = null;
|
||||
let change = new SimpleChange('SimpleProcess', processDefinitionKey, false);
|
||||
|
||||
component.success.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(component.rows).toBeDefined();
|
||||
expect(component.isListEmpty()).not.toBeTruthy();
|
||||
expect(component.rows.length).toEqual(2);
|
||||
expect(component.rows[0].name).toEqual('Process 773443333');
|
||||
done();
|
||||
});
|
||||
|
||||
component.ngOnChanges({'processDefinitionKey': change});
|
||||
});
|
||||
|
||||
it('should reload the process list when the processDefinitionId parameter changes', (done) => {
|
||||
const processDefinitionId = 'SimpleProcess:1:10';
|
||||
let change = new SimpleChange(null, processDefinitionId, true);
|
||||
|
@@ -62,12 +62,6 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On
|
||||
@Input()
|
||||
appId: number;
|
||||
|
||||
/** The Definition Key of the process.
|
||||
* @deprecated 2.4.0
|
||||
*/
|
||||
@Input()
|
||||
processDefinitionKey: string;
|
||||
|
||||
/** The Definition Id of the process. */
|
||||
@Input()
|
||||
processDefinitionId: string;
|
||||
@@ -175,7 +169,6 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On
|
||||
let changed: boolean = false;
|
||||
|
||||
let appId = changes['appId'];
|
||||
let processDefinitionKey = changes['processDefinitionKey'];
|
||||
let processDefinitionId = changes['processDefinitionId'];
|
||||
let processInstanceId = changes['processInstanceId'];
|
||||
let state = changes['state'];
|
||||
@@ -185,8 +178,6 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On
|
||||
|
||||
if (appId && appId.currentValue) {
|
||||
changed = true;
|
||||
} else if (processDefinitionKey) {
|
||||
changed = true;
|
||||
} else if (processDefinitionId) {
|
||||
changed = true;
|
||||
} else if (processInstanceId) {
|
||||
@@ -210,7 +201,7 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On
|
||||
|
||||
private load(requestNode: ProcessFilterParamRepresentationModel) {
|
||||
this.isLoading = true;
|
||||
this.processService.getProcesses(requestNode, this.processDefinitionKey)
|
||||
this.processService.getProcesses(requestNode)
|
||||
.subscribe(
|
||||
(response) => {
|
||||
this.rows = this.optimizeProcessDetails(response.data);
|
||||
|
@@ -66,7 +66,7 @@ export class ProcessService {
|
||||
* @returns List of processes
|
||||
*/
|
||||
getProcesses(requestNode: ProcessFilterParamRepresentationModel, processDefinitionKey?: string): Observable<ProcessListModel> {
|
||||
return this.getProcessInstances(requestNode, processDefinitionKey || null)
|
||||
return this.getProcessInstances(requestNode, processDefinitionKey)
|
||||
.pipe(catchError(() => {
|
||||
return of(new ProcessListModel({}));
|
||||
}));
|
||||
|
Reference in New Issue
Block a user