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 2021/05/20 08:56:24 UTC

[incubator-streampipes] branch dev updated (a14b76f -> 4f4a4ed)

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a change to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git.


    from a14b76f  [STREAMPIPES-362] Add live preview feature to pipeline editor
     new 6c91340  [hotfix] Fix bug that prevented pipeline cached to be deleted
     new 4f4a4ed  [hotfix] Fix bug causing exception when building pipelines with multiple elements of same type

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../pipeline-assembly.component.ts                 |  7 -------
 .../components/pipeline/pipeline.component.ts      |  7 ++++++-
 ui/src/app/editor/services/jsplumb.service.ts      | 24 +++++++++++++++++-----
 3 files changed, 25 insertions(+), 13 deletions(-)

[incubator-streampipes] 02/02: [hotfix] Fix bug causing exception when building pipelines with multiple elements of same type

Posted by ri...@apache.org.
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 4f4a4ed47e2eb10c24370ca09e4aa49f28859154
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Thu May 20 10:56:10 2021 +0200

    [hotfix] Fix bug causing exception when building pipelines with multiple elements of same type
---
 .../components/pipeline/pipeline.component.ts      |  7 ++++++-
 ui/src/app/editor/services/jsplumb.service.ts      | 24 +++++++++++++++++-----
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/ui/src/app/editor/components/pipeline/pipeline.component.ts b/ui/src/app/editor/components/pipeline/pipeline.component.ts
index e9b8bc7..de33c1e 100644
--- a/ui/src/app/editor/components/pipeline/pipeline.component.ts
+++ b/ui/src/app/editor/components/pipeline/pipeline.component.ts
@@ -210,7 +210,12 @@ export class PipelineComponent implements OnInit, OnDestroy {
         let pipelineElement: PipelineElementUnion = this.findPipelineElementByElementId(pipelineElementId);
         if (ui.draggable.hasClass('draggable-icon')) {
           this.EditorService.makePipelineAssemblyEmpty(false);
-          var pipelineElementConfig = this.JsplumbService.createNewPipelineElementConfig(pipelineElement, this.PipelineEditorService.getCoordinates(ui, this.currentZoomLevel), false, false);
+          let newElementId = pipelineElement.elementId + ":" + this.JsplumbService.makeId(5);
+          let pipelineElementConfig = this.JsplumbService.createNewPipelineElementConfig(pipelineElement,
+              this.PipelineEditorService.getCoordinates(ui, this.currentZoomLevel),
+              false,
+              false,
+              newElementId);
           if ((this.isStreamInPipeline() && pipelineElementConfig.type == 'set') ||
               this.isSetInPipeline() && pipelineElementConfig.type == 'stream') {
             this.showMixedStreamAlert();
diff --git a/ui/src/app/editor/services/jsplumb.service.ts b/ui/src/app/editor/services/jsplumb.service.ts
index 8bdcf2e..5114b18 100644
--- a/ui/src/app/editor/services/jsplumb.service.ts
+++ b/ui/src/app/editor/services/jsplumb.service.ts
@@ -137,13 +137,14 @@ export class JsplumbService {
     createNewPipelineElementConfig(pipelineElement: PipelineElementUnion,
                                    coordinates,
                                    isPreview: boolean,
-                                   isCompleted: boolean): PipelineElementConfig {
+                                   isCompleted: boolean,
+                                   newElementId?: string): PipelineElementConfig {
         let displaySettings = isPreview ? 'connectable-preview' : 'connectable-editor';
         let connectable = "connectable";
         let pipelineElementConfig = {} as PipelineElementConfig;
         pipelineElementConfig.type = PipelineElementTypeUtils
             .toCssShortHand(PipelineElementTypeUtils.fromType(pipelineElement))
-        pipelineElementConfig.payload = this.clone(pipelineElement);
+        pipelineElementConfig.payload = this.clone(pipelineElement, newElementId);
         pipelineElementConfig.settings = {connectable: connectable,
             openCustomize: !(pipelineElement as any).configured,
             preview: isPreview,
@@ -163,18 +164,31 @@ export class JsplumbService {
         return pipelineElementConfig;
     }
 
-    clone(pipelineElement: PipelineElementUnion) {
+    clone(pipelineElement: PipelineElementUnion, newElementId?: string) {
         if (pipelineElement instanceof SpDataSet) {
             return SpDataSet.fromData(pipelineElement, new SpDataSet());
         } else if (pipelineElement instanceof SpDataStream) {
             return SpDataStream.fromData(pipelineElement, new SpDataStream());
         } else if (pipelineElement instanceof DataProcessorInvocation) {
-            return DataProcessorInvocation.fromData(pipelineElement, new DataProcessorInvocation());
+            let clonedPe = DataProcessorInvocation.fromData(pipelineElement, new DataProcessorInvocation());
+            if (newElementId) {
+                this.updateElementIds(clonedPe, newElementId)
+            }
+            return clonedPe;
         } else {
-            return DataSinkInvocation.fromData(pipelineElement, new DataSinkInvocation());
+            let clonedPe = DataSinkInvocation.fromData(pipelineElement, new DataSinkInvocation());
+            if (newElementId) {
+                this.updateElementIds(clonedPe, newElementId);
+            }
+            return clonedPe;
         }
     }
 
+    updateElementIds(pipelineElement: PipelineElementUnion, newElementId: string) {
+        pipelineElement.elementId = newElementId;
+        pipelineElement.uri = newElementId;
+    }
+
     makeId(count: number) {
         var text = "";
         var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

[incubator-streampipes] 01/02: [hotfix] Fix bug that prevented pipeline cached to be deleted

Posted by ri...@apache.org.
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 6c913400918f82c581f17ba47e411a6351ec150d
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Wed May 19 23:10:06 2021 +0200

    [hotfix] Fix bug that prevented pipeline cached to be deleted
---
 .../components/pipeline-assembly/pipeline-assembly.component.ts    | 7 -------
 1 file changed, 7 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 d4a0f68..e78ee18 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
@@ -197,13 +197,6 @@ export class PipelineAssemblyComponent implements OnInit {
         //$('#assembly').children().not('#clear, #submit').remove();
         this.JsplumbBridge.deleteEveryEndpoint();
         this.rawPipelineModel = [];
-        ($("#assembly") as any).panzoom("reset", {
-            disablePan: true,
-            increment: 0.25,
-            minScale: 0.5,
-            maxScale: 1.5,
-            contain: 'invert'
-        });
         this.currentZoomLevel = 1;
         this.JsplumbBridge.setZoom(this.currentZoomLevel);
         this.JsplumbBridge.repaintEverything();