- if (requirement.external){
- requirement.external = false;
- } else {
- requirement.external = true;
- }
- this.componentInstanceServiceNg2.updateInstanceRequirement(this.workspaceService.metadata.getTypeUrl(), this.workspaceService.metadata.uniqueId, this.component.uniqueId, requirement).subscribe((response:any) => {
- }, (error) => { console.log("An error has occured setting external: ", error); });;
-
+ this.store.dispatch(new TogglePanelLoadingAction({isLoading: true}));
+ requirement.external = !requirement.external;
+ this.componentInstanceServiceNg2.updateInstanceRequirement(this.workspaceService.metadata.getTypeUrl(), this.workspaceService.metadata.uniqueId, this.component.uniqueId, requirement)
+ .subscribe(() => {
+ this.eventListenerService.notifyObservers(GRAPH_EVENTS.ON_COMPONENT_INSTANCE_REQUIREMENT_EXTERNAL_CHANGED, this.component.uniqueId, requirement);
+ this.store.dispatch(new TogglePanelLoadingAction({isLoading: false}));
+ } , (error) => { console.log("An error has occured setting external: ", error);
+ requirement.external = !requirement.external;
+ this.store.dispatch(new TogglePanelLoadingAction({isLoading: false}));
+ });