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 2022/07/27 09:13:35 UTC

[incubator-streampipes] branch dev updated: [hotfix] Fix template handling in adapters

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 4d23a43de [hotfix] Fix template handling in adapters
4d23a43de is described below

commit 4d23a43de439849f7a544935db716827eb4179a6
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Wed Jul 27 11:13:25 2022 +0200

    [hotfix] Fix template handling in adapters
---
 .../components/new-adapter/adapter-configuration.directive.ts        | 2 ++
 .../generic-adapter-configuration.component.ts                       | 5 +++++
 ui/src/app/connect/components/new-adapter/new-adapter.component.html | 2 ++
 ui/src/app/connect/components/new-adapter/new-adapter.component.ts   | 1 +
 .../specific-adapter-configuration.component.ts                      | 1 +
 5 files changed, 11 insertions(+)

diff --git a/ui/src/app/connect/components/new-adapter/adapter-configuration.directive.ts b/ui/src/app/connect/components/new-adapter/adapter-configuration.directive.ts
index c6f7ac28e..b5ba39701 100644
--- a/ui/src/app/connect/components/new-adapter/adapter-configuration.directive.ts
+++ b/ui/src/app/connect/components/new-adapter/adapter-configuration.directive.ts
@@ -47,6 +47,8 @@ export abstract class AdapterConfigurationDirective {
    */
   @Output() clickNextEmitter: EventEmitter<MatStepper> = new EventEmitter();
 
+  @Output() updateAdapterDescriptionEmitter: EventEmitter<AdapterDescriptionUnion> = new EventEmitter<AdapterDescriptionUnion>();
+
   availableTemplates: PipelineElementTemplate[];
   selectedTemplate: any = false;
 
diff --git a/ui/src/app/connect/components/new-adapter/generic-adapter-configuration/generic-adapter-configuration.component.ts b/ui/src/app/connect/components/new-adapter/generic-adapter-configuration/generic-adapter-configuration.component.ts
index ff6df2c46..80b93017e 100644
--- a/ui/src/app/connect/components/new-adapter/generic-adapter-configuration/generic-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/new-adapter/generic-adapter-configuration/generic-adapter-configuration.component.ts
@@ -72,6 +72,11 @@ export class GenericAdapterConfigurationComponent extends AdapterConfigurationDi
 
   afterTemplateReceived(adapterDescription: any) {
     this.protocolDescription = ProtocolDescription.fromData(adapterDescription.protocolDescription);
+    if (this.adapterDescription instanceof GenericAdapterSetDescription ||
+      this.adapterDescription instanceof GenericAdapterStreamDescription) {
+      this.adapterDescription.protocolDescription = this.protocolDescription;
+      this.updateAdapterDescriptionEmitter.emit(this.adapterDescription);
+    }
   }
 
 }
diff --git a/ui/src/app/connect/components/new-adapter/new-adapter.component.html b/ui/src/app/connect/components/new-adapter/new-adapter.component.html
index ff3275fb9..9c1a1ae20 100644
--- a/ui/src/app/connect/components/new-adapter/new-adapter.component.html
+++ b/ui/src/app/connect/components/new-adapter/new-adapter.component.html
@@ -44,6 +44,7 @@
                 <ng-template matStepLabel>Settings</ng-template>
                 <sp-specific-adapter-configuration
                         [adapterDescription]="adapter"
+                        (updateAdapterDescriptionEmitter)="adapter = $event"
                         (clickNextEmitter)="clickSpecificSettingsNextButton()"
                         (removeSelectionEmitter)="removeSelection()">
                 </sp-specific-adapter-configuration>
@@ -53,6 +54,7 @@
                 <ng-template matStepLabel>Settings</ng-template>
                 <sp-generic-adapter-configuration
                         [adapterDescription]="adapter"
+                        (updateAdapterDescriptionEmitter)="adapter = $event"
                         (clickNextEmitter)="clickProtocolSettingsNextButton()"
                         (removeSelectionEmitter)="removeSelection()">
                 </sp-generic-adapter-configuration>
diff --git a/ui/src/app/connect/components/new-adapter/new-adapter.component.ts b/ui/src/app/connect/components/new-adapter/new-adapter.component.ts
index 236a31ca5..1c81025bf 100644
--- a/ui/src/app/connect/components/new-adapter/new-adapter.component.ts
+++ b/ui/src/app/connect/components/new-adapter/new-adapter.component.ts
@@ -176,6 +176,7 @@ export class NewAdapterComponent implements OnInit, AfterViewInit {
 
   clickSpecificSettingsNextButton() {
     this.shepherdService.trigger('specific-settings-next-button');
+    console.log(this.adapter);
     this.guessEventSchema();
     this.goForward();
   }
diff --git a/ui/src/app/connect/components/new-adapter/specific-adapter-configuration/specific-adapter-configuration.component.ts b/ui/src/app/connect/components/new-adapter/specific-adapter-configuration/specific-adapter-configuration.component.ts
index 4e90fbeb7..2ef6de8a0 100644
--- a/ui/src/app/connect/components/new-adapter/specific-adapter-configuration/specific-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/new-adapter/specific-adapter-configuration/specific-adapter-configuration.component.ts
@@ -67,6 +67,7 @@ export class SpecificAdapterConfigurationComponent extends AdapterConfigurationD
 
   afterTemplateReceived(adapterDescription: any) {
     this.adapterDescription = AdapterDescription.fromDataUnion(adapterDescription);
+    this.updateAdapterDescriptionEmitter.emit(this.adapterDescription);
   }
 
 }