You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2020/08/31 20:47:52 UTC
[incubator-streampipes] 01/03: [hotfix] Fix unexpected delay while
closing the element customization dialog
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 7b79466bd745a3e0364aa5dd62ee29494484939e
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Mon Aug 31 21:36:31 2020 +0200
[hotfix] Fix unexpected delay while closing the element customization dialog
---
.../pipeline-assembly/pipeline-assembly.component.ts | 13 ++++++-------
.../pipeline-element-options.component.ts | 10 ----------
.../editor/components/pipeline/pipeline.component.ts | 17 ++++++++++++++---
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly.component.ts b/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly.component.ts
index 709d512..c2de226 100644
--- a/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly.component.ts
+++ b/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly.component.ts
@@ -16,7 +16,7 @@
*
*/
-import {Component, Input, OnInit,} from "@angular/core";
+import {Component, Input, NgZone, OnInit,} from "@angular/core";
import {JsplumbBridge} from "../../services/jsplumb-bridge.service";
import {PipelinePositioningService} from "../../services/pipeline-positioning.service";
import {PipelineValidationService} from "../../services/pipeline-validation.service";
@@ -75,7 +75,8 @@ export class PipelineAssemblyComponent implements OnInit {
private JsplumbService: JsplumbService,
private ShepherdService: ShepherdService,
private dialogService: DialogService,
- private dialog: MatDialog) {
+ private dialog: MatDialog,
+ private ngZone: NgZone) {
this.selectMode = true;
this.currentZoomLevel = 1;
@@ -88,10 +89,6 @@ export class PipelineAssemblyComponent implements OnInit {
} else {
this.checkAndDisplayCachedPipeline();
}
-
- // this.$rootScope.$on("pipeline.validate", () => {
- // this.pipelineValid = this.PipelineValidationService.isValidPipeline(this.rawPipelineModel);
- // });
}
ngAfterViewInit() {
@@ -230,7 +227,9 @@ export class PipelineAssemblyComponent implements OnInit {
setTimeout(() => {
this.PipelinePositioningService.displayPipeline(this.rawPipelineModel, "#assembly", false, autoLayout);
this.EditorService.makePipelineAssemblyEmpty(false);
- this.pipelineValid = this.PipelineValidationService.isValidPipeline(this.rawPipelineModel);
+ this.ngZone.run(() => {
+ this.pipelineValid = this.PipelineValidationService.isValidPipeline(this.rawPipelineModel);
+ });
});
}
diff --git a/ui/src/app/editor/components/pipeline-element-options/pipeline-element-options.component.ts b/ui/src/app/editor/components/pipeline-element-options/pipeline-element-options.component.ts
index 3a3ff5d..67d8a4b 100644
--- a/ui/src/app/editor/components/pipeline-element-options/pipeline-element-options.component.ts
+++ b/ui/src/app/editor/components/pipeline-element-options/pipeline-element-options.component.ts
@@ -119,16 +119,6 @@ export class PipelineElementOptionsComponent implements OnInit{
this.customize.emit(customizeInfo);
}
- openCustomizeDialog() {
- let restrictedEditMode = ! (this.isRootElement());
- // this.EditorDialogManager.showCustomizeDialog($("#" + this.pipelineElement.payload.dom), "", this.pipelineElement.payload, restrictedEditMode)
- // .then(() => {
- // this.JsplumbService.activateEndpoint(this.pipelineElement.payload.dom, !this.pipelineElement.payload.uncompleted);
- // }, () => {
- // this.JsplumbService.activateEndpoint(this.pipelineElement.payload.dom, !this.pipelineElement.payload.uncompleted);
- // });
- }
-
openHelpDialog() {
this.EditorService.openHelpDialog(this.pipelineElement.payload);
}
diff --git a/ui/src/app/editor/components/pipeline/pipeline.component.ts b/ui/src/app/editor/components/pipeline/pipeline.component.ts
index 97fff39..44694db 100644
--- a/ui/src/app/editor/components/pipeline/pipeline.component.ts
+++ b/ui/src/app/editor/components/pipeline/pipeline.component.ts
@@ -21,7 +21,15 @@ import {JsplumbService} from "../../services/jsplumb.service";
import {PipelineEditorService} from "../../services/pipeline-editor.service";
import {JsplumbBridge} from "../../services/jsplumb-bridge.service";
import {ShepherdService} from "../../../services/tour/shepherd.service";
-import {Component, EventEmitter, Input, OnInit, Output} from "@angular/core";
+import {
+ ChangeDetectorRef,
+ Component,
+ EventEmitter,
+ Input,
+ NgZone,
+ OnInit,
+ Output
+} from "@angular/core";
import {
InvocablePipelineElementUnion,
PipelineElementConfig,
@@ -97,7 +105,8 @@ export class PipelineComponent implements OnInit {
private ShepherdService: ShepherdService,
private PipelineValidationService: PipelineValidationService,
private dialogService: DialogService,
- private dialog: MatDialog) {
+ private dialog: MatDialog,
+ private ngZone: NgZone) {
this.plumbReady = false;
this.currentMouseOverElement = "";
this.currentPipelineModel = new Pipeline();
@@ -113,8 +122,10 @@ export class PipelineComponent implements OnInit {
}
validatePipeline() {
+ this.ngZone.run(() => {
this.pipelineValid = this.PipelineValidationService
.isValidPipeline(this.rawPipelineModel.filter(pe => !(pe.settings.disabled)));
+ });
}
ngOnDestroy() {
@@ -193,7 +204,7 @@ export class PipelineComponent implements OnInit {
if (ui.draggable.hasClass('set')) {
setTimeout(() => {
this.JsplumbService.setDropped(pipelineElementConfig.payload.dom, pipelineElementConfig.payload, true, false);
- }, 10);
+ }, 0);
}
else if (ui.draggable.hasClass('stream')) {
this.checkTopicModel(pipelineElementConfig);