mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Do not reload process instances in list after starting new instance
Refs #1048
This commit is contained in:
@@ -200,7 +200,6 @@ export class ActivitiDemoComponent implements AfterViewChecked {
|
|||||||
|
|
||||||
onStartProcessInstance(instance: ProcessInstance) {
|
onStartProcessInstance(instance: ProcessInstance) {
|
||||||
this.currentProcessInstanceId = instance.id;
|
this.currentProcessInstanceId = instance.id;
|
||||||
this.activitiprocesslist.reload(false);
|
|
||||||
this.activitiStartProcess.reset();
|
this.activitiStartProcess.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -199,19 +199,6 @@ describe('ActivitiProcessInstanceListComponent', () => {
|
|||||||
component.reload();
|
component.reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should avoid emitting onSuccess event when reload() called with emit=false', fakeAsync(() => {
|
|
||||||
spyOn(service, 'getProcessInstances').and.returnValue(Observable.of(fakeGlobalProcesses));
|
|
||||||
component.appId = '1';
|
|
||||||
component.state = 'open';
|
|
||||||
component.processDefinitionKey = null;
|
|
||||||
fixture.detectChanges();
|
|
||||||
tick();
|
|
||||||
let emitSpy = spyOn(component.onSuccess, 'emit');
|
|
||||||
component.reload(false);
|
|
||||||
tick();
|
|
||||||
expect(emitSpy).not.toHaveBeenCalled();
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('should emit row click event', (done) => {
|
it('should emit row click event', (done) => {
|
||||||
let row = new ObjectDataRow({
|
let row = new ObjectDataRow({
|
||||||
id: 999
|
id: 999
|
||||||
|
@@ -111,9 +111,9 @@ export class ActivitiProcessInstanceListComponent implements OnInit, OnChanges {
|
|||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public reload(emit?: boolean) {
|
public reload() {
|
||||||
this.requestNode = this.createRequestNode();
|
this.requestNode = this.createRequestNode();
|
||||||
this.load(this.requestNode, emit);
|
this.load(this.requestNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,17 +127,14 @@ export class ActivitiProcessInstanceListComponent implements OnInit, OnChanges {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private load(requestNode: TaskQueryRequestRepresentationModel, emit?: boolean) {
|
private load(requestNode: TaskQueryRequestRepresentationModel) {
|
||||||
emit = emit !== false;
|
|
||||||
this.processService.getProcessInstances(requestNode)
|
this.processService.getProcessInstances(requestNode)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(response) => {
|
(response) => {
|
||||||
let instancesRow = this.createDataRow(response);
|
let instancesRow = this.createDataRow(response);
|
||||||
this.renderInstances(instancesRow);
|
this.renderInstances(instancesRow);
|
||||||
this.selectFirst();
|
this.selectFirst();
|
||||||
if (emit) {
|
|
||||||
this.onSuccess.emit(response);
|
this.onSuccess.emit(response);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
this.onError.emit(error);
|
this.onError.emit(error);
|
||||||
|
Reference in New Issue
Block a user