Skip to content

Commit c139be6

Browse files
clockworked247kkanthet
authored andcommitted
DHFPROD-1879 & DHFPROD-1821 bug fixes
Improper copying of settings between flows fixed + trash icon delete fix
1 parent f3e1917 commit c139be6

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

quick-start/src/main/ui/app/entities/entities.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,20 @@ export class EntitiesService {
3737
) {}
3838

3939
getEntities() {
40-
this.http.get(this.url('/entities/')).map((res: Response) => {
40+
let resp = this.http.get(this.url('/entities/')).map((res: Response) => {
4141
const entities: Array<any> = res.json();
4242
return entities.map((entity) => {
4343
return new Entity().fromJSON(entity);
4444
});
45-
}).subscribe((entities: Array<Entity>) => {
45+
}).share();
46+
47+
resp.subscribe((entities: Array<Entity>) => {
4648
this.entities = entities;
4749
this.entitiesChange.emit(this.entities);
4850
this.extractTypes();
4951
});
52+
53+
return resp;
5054
}
5155

5256
// getEntity(entityName: string) {

quick-start/src/main/ui/app/flows/flows.component.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ export class FlowsComponent implements OnInit, OnDestroy {
224224
localStorage.setItem(entity.name + '-collapsed', collapsed.toString());
225225
}
226226

227-
getEntities(): void {
228-
this.entitiesService.getEntities();
227+
getEntities(): Observable<Entity[]> {
228+
return this.entitiesService.getEntities();
229229
}
230230

231231
toggleEntity(entity: Entity): void {
@@ -327,12 +327,9 @@ export class FlowsComponent implements OnInit, OnDestroy {
327327
const actions = {
328328
save: (newFlow: Flow) => {
329329
this.entitiesService.createFlow(entity, flowType.toUpperCase(), newFlow).subscribe((flow: Flow) => {
330-
if (flowType.toUpperCase() === 'INPUT') {
331-
entity.inputFlows.push(flow);
332-
} else if (flowType.toUpperCase() === 'HARMONIZE') {
333-
entity.harmonizeFlows.push(flow);
334-
}
335-
this.setFlow(flow, flowType.toUpperCase());
330+
this.getEntities().subscribe(() => {
331+
this.setFlow(flow, flowType.toUpperCase());
332+
});
336333
});
337334
}
338335
};

quick-start/src/main/ui/app/mlcp/mlcp.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,9 @@ export class MlcpComponent implements OnChanges {
537537

538538
updateSetting(): void {
539539
// use setTimeout to solve ExpressionChangedAfterItHasBeenCheckedError
540-
setTimeout(this.updateMlcpCommand(), 0);
540+
setTimeout(() => {
541+
this.updateMlcpCommand()
542+
}, 0);
541543
}
542544

543545
updateMlcpCommand(): string {

quick-start/src/main/ui/app/shared/components/flows/flows-ui.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<i class="mdi" [ngClass]="{'mdi-import': type === 'Input', 'mdi-looks' : type === 'Harmonize'}"></i>
4747
{{ flow.flowName }}
4848
<span class="mdl-layout-spacer"></span>
49-
<i class="fa fa-trash" (click)="deleteFlow($event, flow, type.toUpperCase())"></i>
49+
<i class="fa fa-trash" (click)="deleteFlow(flow, type.toUpperCase())"></i>
5050
<i class="fa fa-bug" *ngIf="flowHasError(entity.name, flow.flowName)"></i>
5151
</span>
5252
</div>

0 commit comments

Comments
 (0)