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/03/03 21:23:31 UTC
[incubator-streampipes] branch dev updated: STREAMPIPES-86: Improve
validation of pipelines
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
The following commit(s) were added to refs/heads/dev by this push:
new d7f3619 STREAMPIPES-86: Improve validation of pipelines
new 9b850d3 Merge branch 'dev' of github.com:apache/incubator-streampipes into dev
d7f3619 is described below
commit d7f36192a1ca9f8a973aa561fd8f1439b5fc47b5
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Tue Mar 3 22:22:57 2020 +0100
STREAMPIPES-86: Improve validation of pipelines
---
.../pipeline-assembly/pipeline-assembly.controller.ts | 14 ++++++++++++--
.../pipeline-element-options.controller.ts | 4 +---
.../app/editor/components/pipeline/pipeline.controller.ts | 1 -
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly.controller.ts b/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly.controller.ts
index 791c3ba..b20e898 100644
--- a/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly.controller.ts
+++ b/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly.controller.ts
@@ -36,6 +36,8 @@ export class PipelineAssemblyController {
PipelinePositioningService: any;
PipelineValidationService: PipelineValidationService;
RestApi: RestApi;
+ $rootScope: any;
+
selectMode: any;
currentPipelineName: any;
currentPipelineDescription: any;
@@ -49,7 +51,8 @@ export class PipelineAssemblyController {
pipelineCacheRunning: boolean = false;
pipelineCached: boolean = false;
- constructor(JsplumbBridge,
+ constructor($rootScope,
+ JsplumbBridge,
PipelinePositioningService,
EditorDialogManager,
PipelineValidationService,
@@ -71,6 +74,7 @@ export class PipelineAssemblyController {
this.$state = $state;
this.TransitionService = TransitionService;
this.ShepherdService = ShepherdService;
+ this.$rootScope = $rootScope;
this.selectMode = true;
this.currentZoomLevel = 1;
@@ -96,6 +100,10 @@ export class PipelineAssemblyController {
} else {
this.checkAndDisplayCachedPipeline();
}
+
+ this.$rootScope.$on("pipeline.validate", () => {
+ this.pipelineValid = this.PipelineValidationService.isValidPipeline(this.rawPipelineModel);
+ });
}
autoLayout() {
@@ -223,7 +231,9 @@ export class PipelineAssemblyController {
}
-PipelineAssemblyController.$inject = ['JsplumbBridge',
+PipelineAssemblyController.$inject = [
+ '$rootScope',
+ 'JsplumbBridge',
'PipelinePositioningService',
'EditorDialogManager',
'PipelineValidationService',
diff --git a/ui/src/app/editor/components/pipeline-element-options/pipeline-element-options.controller.ts b/ui/src/app/editor/components/pipeline-element-options/pipeline-element-options.controller.ts
index f859130..33d8733 100644
--- a/ui/src/app/editor/components/pipeline-element-options/pipeline-element-options.controller.ts
+++ b/ui/src/app/editor/components/pipeline-element-options/pipeline-element-options.controller.ts
@@ -84,9 +84,7 @@ export class PipelineElementOptionsController {
removeElement(pipelineElement) {
this.deleteFunction(pipelineElement);
- this.$timeout(() => {
- this.pipelineValid = this.PipelineValidationService.isValidPipeline(this.rawPipelineModel);
- }, 200);
+ this.$rootScope.$broadcast("pipeline.validate");
}
diff --git a/ui/src/app/editor/components/pipeline/pipeline.controller.ts b/ui/src/app/editor/components/pipeline/pipeline.controller.ts
index abae2a0..196bb1f 100644
--- a/ui/src/app/editor/components/pipeline/pipeline.controller.ts
+++ b/ui/src/app/editor/components/pipeline/pipeline.controller.ts
@@ -210,7 +210,6 @@ export class PipelineController {
handleDeleteOption(pipelineElement) {
this.JsplumbBridge.removeAllEndpoints(pipelineElement.payload.DOM);
- //this.rawPipelineModel = this.rawPipelineModel.filter(item => !(item.payload.DOM == internalId));
angular.forEach(this.rawPipelineModel, pe => {
if (pe.payload.DOM == pipelineElement.payload.DOM) {
pe.settings.disabled = true;