You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2021/06/14 16:06:40 UTC

[incubator-streampipes] branch STREAMPIPES-380 updated (e0e29f0 -> 14588a6)

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

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


    from e0e29f0  Add component for specific and generic adapters
     new 9cf8681  Prepare code to create configuration component
     new f215e30  Create configuration group
     new 14588a6  Refactored configurations for adapters

The 3 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:
 .../configuration-group.component.css}             |  0
 .../configuration-group.component.html             | 15 +++++++++
 .../configuration-group.component.ts               | 30 ++++++++++++++++++
 .../format-configuration.component.css}            |  0
 .../format-configuration.component.html            | 34 ++++++++++++++++++++
 .../format-configuration.component.ts}             | 15 +++------
 .../generic-adapter-configuration.component.css}   |  0
 .../generic-adapter-configuration.component.html   | 17 ++++++++++
 .../generic-adapter-configuration.component.ts}    | 15 +++------
 .../generic-adapter-settings.component.html        | 25 ---------------
 .../new-adapter/new-adapter.component.html         | 13 ++++----
 .../new-adapter/new-adapter.component.ts           |  4 ---
 .../select-format/select-format.component.css      |  3 --
 .../select-format/select-format.component.html     | 37 ----------------------
 .../specific-adapter-configuration.component.css}  |  0
 .../specific-adapter-configuration.component.html  | 15 +++++++++
 .../specific-adapter-configuration.component.ts}   | 17 +++-------
 .../specific-adapter-settings.component.html       | 22 -------------
 ui/src/app/connect/connect.module.ts               | 22 +++++++++----
 19 files changed, 144 insertions(+), 140 deletions(-)
 copy ui/src/app/connect/components/{specific-adapter-settings/specific-adapter-settings.component.css => configuration-group/configuration-group.component.css} (100%)
 create mode 100644 ui/src/app/connect/components/configuration-group/configuration-group.component.html
 create mode 100644 ui/src/app/connect/components/configuration-group/configuration-group.component.ts
 rename ui/src/app/connect/components/{generic-adapter-settings/generic-adapter-settings.component.css => format-configuration/format-configuration.component.css} (100%)
 create mode 100644 ui/src/app/connect/components/format-configuration/format-configuration.component.html
 rename ui/src/app/connect/components/{select-format/select-format.component.ts => format-configuration/format-configuration.component.ts} (86%)
 copy ui/src/app/connect/components/{specific-adapter-settings/specific-adapter-settings.component.css => generic-adapter-configuration/generic-adapter-configuration.component.css} (100%)
 create mode 100644 ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.html
 rename ui/src/app/connect/components/{generic-adapter-settings/generic-adapter-settings.component.ts => generic-adapter-configuration/generic-adapter-configuration.component.ts} (73%)
 delete mode 100644 ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.html
 delete mode 100644 ui/src/app/connect/components/select-format/select-format.component.css
 delete mode 100644 ui/src/app/connect/components/select-format/select-format.component.html
 rename ui/src/app/connect/components/{specific-adapter-settings/specific-adapter-settings.component.css => specific-adapter-configuration/specific-adapter-configuration.component.css} (100%)
 create mode 100644 ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.html
 rename ui/src/app/connect/components/{specific-adapter-settings/specific-adapter-settings.component.ts => specific-adapter-configuration/specific-adapter-configuration.component.ts} (65%)
 delete mode 100644 ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html

[incubator-streampipes] 03/03: Refactored configurations for adapters

Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch STREAMPIPES-380
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 14588a62170438f3afb324b0abdbcc81901a7261
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Mon Jun 14 18:06:07 2021 +0200

    Refactored configurations for adapters
---
 .../format-configuration.component.css}              |  0
 .../format-configuration.component.html}             |  4 ++--
 .../format-configuration.component.ts}               |  9 ++++-----
 .../generic-adapter-configuration.component.css}     |  0
 .../generic-adapter-configuration.component.html}    |  2 +-
 .../generic-adapter-configuration.component.ts}      |  9 ++++-----
 .../new-adapter/new-adapter.component.html           | 13 ++++++-------
 .../specific-adapter-configuration.component.css}    |  0
 .../specific-adapter-configuration.component.html}   |  0
 .../specific-adapter-configuration.component.ts}     |  9 ++++-----
 ui/src/app/connect/connect.module.ts                 | 20 +++++++++++++-------
 11 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.css b/ui/src/app/connect/components/format-configuration/format-configuration.component.css
similarity index 100%
rename from ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.css
rename to ui/src/app/connect/components/format-configuration/format-configuration.component.css
diff --git a/ui/src/app/connect/components/select-format/select-format.component.html b/ui/src/app/connect/components/format-configuration/format-configuration.component.html
similarity index 93%
rename from ui/src/app/connect/components/select-format/select-format.component.html
rename to ui/src/app/connect/components/format-configuration/format-configuration.component.html
index f6502cf..809820a 100644
--- a/ui/src/app/connect/components/select-format/select-format.component.html
+++ b/ui/src/app/connect/components/format-configuration/format-configuration.component.html
@@ -18,11 +18,11 @@
 
     <div *ngIf="selectedFormat">
         <div *ngIf="selectedFormat.config.length > 0">
-            <sp-configuration-group
+            <sp-configuration-groupkl
                     [configurationGroup]="formatForm"
                     [adapterId]="adapterDescription.appId"
                     [configuration]="selectedFormat.config">
-            </sp-configuration-group>
+            </sp-configuration-groupkl>
         </div>
 
         <div *ngIf="selectedFormat.config.length === 0" class="sp-blue-border padding" style="padding: 15px;">
diff --git a/ui/src/app/connect/components/select-format/select-format.component.ts b/ui/src/app/connect/components/format-configuration/format-configuration.component.ts
similarity index 91%
rename from ui/src/app/connect/components/select-format/select-format.component.ts
rename to ui/src/app/connect/components/format-configuration/format-configuration.component.ts
index 43f7993..398b34a 100644
--- a/ui/src/app/connect/components/select-format/select-format.component.ts
+++ b/ui/src/app/connect/components/format-configuration/format-configuration.component.ts
@@ -5,16 +5,15 @@ import {
   GenericAdapterSetDescription,
   GenericAdapterStreamDescription
 } from '../../../core-model/gen/streampipes-model';
-import { ConfigurationInfo } from '../../model/ConfigurationInfo';
 import { FormBuilder, FormGroup } from '@angular/forms';
 import { RestService } from '../../services/rest.service';
 
 @Component({
-  selector: 'sp-select-format',
-  templateUrl: './select-format.component.html',
-  styleUrls: ['./select-format.component.css']
+  selector: 'sp-format-configuration',
+  templateUrl: './format-configuration.component.html',
+  styleUrls: ['./format-configuration.component.css']
 })
-export class SelectFormatComponent implements OnInit {
+export class FormatConfigurationComponent implements OnInit {
 
   /**
    * Adapter description the selected format is added to
diff --git a/ui/src/app/connect/components/select-format/select-format.component.css b/ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.css
similarity index 100%
rename from ui/src/app/connect/components/select-format/select-format.component.css
rename to ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.css
diff --git a/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.html b/ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.html
similarity index 83%
rename from ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.html
rename to ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.html
index 1d6f281..44f99f6 100644
--- a/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.html
+++ b/ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.html
@@ -9,7 +9,7 @@
         <sp-configuration-group
                 [configurationGroup]="genericAdapterForm"
                 [adapterId]="adapterDescription.appId"
-                [configuration]="adapterDescription.protocolDescription.config">
+                [configuration]="protocolDescription.config">
         </sp-configuration-group>
 
     </div>
diff --git a/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.ts b/ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.ts
similarity index 81%
rename from ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.ts
rename to ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.ts
index d17a650..3474e91 100644
--- a/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.ts
+++ b/ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.ts
@@ -5,15 +5,14 @@ import {
   GenericAdapterStreamDescription,
   ProtocolDescription
 } from '../../../core-model/gen/streampipes-model';
-import { ConfigurationInfo } from '../../model/ConfigurationInfo';
 import { FormBuilder, FormGroup } from '@angular/forms';
 
 @Component({
-  selector: 'sp-generic-adapter-settings',
-  templateUrl: './generic-adapter-settings.component.html',
-  styleUrls: ['./generic-adapter-settings.component.css']
+  selector: 'sp-generic-adapter-configuration',
+  templateUrl: './generic-adapter-configuration.component.html',
+  styleUrls: ['./generic-adapter-configuration.component.css']
 })
-export class GenericAdapterSettingsComponent implements OnInit {
+export class GenericAdapterConfigurationComponent implements OnInit {
 
   /**
    * Adapter description the selected format is added to
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 e59686a..0062463 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
@@ -40,15 +40,14 @@
                 <i class="material-icons">close</i>
             </button>
         </div>
-
     </div>
     <mat-horizontal-stepper [linear]="true" #stepper>
 
         <mat-step *ngIf="!isGenericAdapter">
-            <sp-specific-adapter-settings
+            <sp-specific-adapter-configuration
                     [adapterDescription]="adapter"
                     (validateEmitter)="validateSpecificAdapterForm($event)">
-            </sp-specific-adapter-settings>
+            </sp-specific-adapter-configuration>
 
             <div fxLayoutAlign="end">
                 <button class="mat-basic" mat-raised-button (click)="removeSelection()">Cancel</button>
@@ -61,10 +60,10 @@
         </mat-step>
 
         <mat-step *ngIf="isGenericAdapter">
-            <sp-generic-adapter-settings
+            <sp-generic-adapter-configuration
                     [adapterDescription]="adapter"
                     (validateEmitter)="validateGenericAdapterForm($event)">
-            </sp-generic-adapter-settings>
+            </sp-generic-adapter-configuration>
 
 
             <div fxLayoutAlign="end">
@@ -78,10 +77,10 @@
         </mat-step>
 
         <mat-step *ngIf="isGenericAdapter">
-            <sp-select-format
+            <sp-format-configuration
                     [adapterDescription]="adapter"
                     (validateEmitter)="validateFormat($event)">
-            </sp-select-format>
+            </sp-format-configuration>
 
             <div fxLayoutAlign="end">
                 <button class="mat-basic" mat-raised-button (click)="removeSelection()">Cancel</button>
diff --git a/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.css b/ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.css
similarity index 100%
rename from ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.css
rename to ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.css
diff --git a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html b/ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.html
similarity index 100%
rename from ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html
rename to ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.html
diff --git a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.ts b/ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.ts
similarity index 75%
rename from ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.ts
rename to ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.ts
index 52b606b..8605d62 100644
--- a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.ts
+++ b/ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.ts
@@ -1,14 +1,13 @@
 import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
 import { AdapterDescriptionUnion } from '../../../core-model/gen/streampipes-model';
-import { ConfigurationInfo } from '../../model/ConfigurationInfo';
 import { FormBuilder, FormGroup } from '@angular/forms';
 
 @Component({
-  selector: 'sp-specific-adapter-settings',
-  templateUrl: './specific-adapter-settings.component.html',
-  styleUrls: ['./specific-adapter-settings.component.css']
+  selector: 'sp-specific-adapter-configuration',
+  templateUrl: './specific-adapter-configuration.component.html',
+  styleUrls: ['./specific-adapter-configuration.component.css']
 })
-export class SpecificAdapterSettingsComponent implements OnInit {
+export class SpecificAdapterConfigurationComponent implements OnInit {
 
   /**
    * Adapter description the selected format is added to
diff --git a/ui/src/app/connect/connect.module.ts b/ui/src/app/connect/connect.module.ts
index b5fdbb4..79c1ff4 100644
--- a/ui/src/app/connect/connect.module.ts
+++ b/ui/src/app/connect/connect.module.ts
@@ -70,10 +70,11 @@ import { CoreUiModule } from '../core-ui/core-ui.module';
 // tslint:disable-next-line:max-line-length
 import { EditCorrectionValueComponent } from './dialog/edit-event-property/components/edit-correction-value/edit-correction-value.component';
 import { ExistingAdaptersComponent } from './components/data-marketplace/existing-adapters/existing-adapters.component';
-import { SelectFormatComponent } from './components/select-format/select-format.component';
-import { GenericAdapterSettingsComponent } from './components/generic-adapter-settings/generic-adapter-settings.component';
-import { SpecificAdapterSettingsComponent } from './components/specific-adapter-settings/specific-adapter-settings.component';
+// tslint:disable-next-line:max-line-length
+import { SpecificAdapterConfigurationComponent } from './components/specific-adapter-configuration/specific-adapter-configuration.component';
 import { ConfigurationGroupComponent } from './components/configuration-group/configuration-group.component';
+import { FormatConfigurationComponent } from './components/format-configuration/format-configuration.component';
+import { GenericAdapterConfigurationComponent } from './components/generic-adapter-configuration/generic-adapter-configuration.component';
 
 @NgModule({
     imports: [
@@ -119,9 +120,9 @@ import { ConfigurationGroupComponent } from './components/configuration-group/co
         PipelineElementRuntimeInfoComponent,
         TimestampPipe,
         EditCorrectionValueComponent,
-        SelectFormatComponent,
-        GenericAdapterSettingsComponent,
-        SpecificAdapterSettingsComponent,
+        FormatConfigurationComponent,
+        GenericAdapterConfigurationComponent,
+        SpecificAdapterConfigurationComponent,
         ConfigurationGroupComponent
     ],
     providers: [
@@ -136,6 +137,11 @@ import { ConfigurationGroupComponent } from './components/configuration-group/co
         TimestampPipe,
         xsService,
     ],
-    entryComponents: [ConnectComponent, AdapterStartedDialog, AdapterExportDialog, AdapterUploadDialog, EditEventPropertyComponent],
+    entryComponents: [
+        ConnectComponent,
+        AdapterStartedDialog,
+        AdapterExportDialog,
+        AdapterUploadDialog,
+        EditEventPropertyComponent],
 })
 export class ConnectModule { }

[incubator-streampipes] 02/03: Create configuration group

Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch STREAMPIPES-380
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit f215e30895a90381e2c9031096daac18b5037338
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Mon Jun 14 17:44:54 2021 +0200

    Create configuration group
---
 .../configuration-group.component.css              |  0
 .../configuration-group.component.html             | 15 +++++++++++
 .../configuration-group.component.ts               | 30 ++++++++++++++++++++++
 .../generic-adapter-settings.component.html        | 22 +++++-----------
 .../generic-adapter-settings.component.ts          |  6 -----
 .../select-format/select-format.component.html     | 21 +++++----------
 .../select-format/select-format.component.ts       |  6 -----
 .../specific-adapter-settings.component.html       | 18 ++++---------
 .../specific-adapter-settings.component.ts         |  8 ------
 ui/src/app/connect/connect.module.ts               |  4 ++-
 10 files changed, 66 insertions(+), 64 deletions(-)

diff --git a/ui/src/app/connect/components/configuration-group/configuration-group.component.css b/ui/src/app/connect/components/configuration-group/configuration-group.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/ui/src/app/connect/components/configuration-group/configuration-group.component.html b/ui/src/app/connect/components/configuration-group/configuration-group.component.html
new file mode 100644
index 0000000..b7b12c8
--- /dev/null
+++ b/ui/src/app/connect/components/configuration-group/configuration-group.component.html
@@ -0,0 +1,15 @@
+<div class="sp-blue-border padding" style="padding: 15px;">
+    <form [formGroup]="configurationGroup" fxFlex="100">
+        <div fxFlex="100" >
+            <app-static-property *ngFor="let config of configuration"
+                                 [staticProperty]="config"
+                                 [staticProperties]="configuration"
+                                 [adapterId]="adapterId"
+                                 [parentForm]="configurationGroup"
+                                 [fieldName]="config.internalName"
+                                 (updateEmitter)="triggerUpdate($event)"
+                                 [completedStaticProperty]="completedStaticProperty">
+            </app-static-property>
+        </div>
+    </form>
+</div>
diff --git a/ui/src/app/connect/components/configuration-group/configuration-group.component.ts b/ui/src/app/connect/components/configuration-group/configuration-group.component.ts
new file mode 100644
index 0000000..763b71f
--- /dev/null
+++ b/ui/src/app/connect/components/configuration-group/configuration-group.component.ts
@@ -0,0 +1,30 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { FormGroup } from '@angular/forms';
+import { StaticPropertyUnion } from '../../../core-model/gen/streampipes-model';
+import { ConfigurationInfo } from '../../model/ConfigurationInfo';
+
+@Component({
+  selector: 'sp-configuration-group',
+  templateUrl: './configuration-group.component.html',
+  styleUrls: ['./configuration-group.component.css']
+})
+export class ConfigurationGroupComponent implements OnInit {
+
+  @Input() configurationGroup: FormGroup;
+
+  @Input() adapterId: string;
+
+  @Input() configuration: StaticPropertyUnion[];
+
+  completedStaticProperty: ConfigurationInfo;
+
+  constructor() { }
+
+  ngOnInit(): void {
+  }
+
+  triggerUpdate(configurationInfo: ConfigurationInfo) {
+    this.completedStaticProperty = {...configurationInfo};
+  }
+
+}
diff --git a/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.html b/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.html
index 99fb2f7..1d6f281 100644
--- a/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.html
+++ b/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.html
@@ -5,21 +5,13 @@
         <div class="assemblyOptions sp-blue-bg">
             <h4 >Protocol settings</h4>
         </div>
-        <div class="sp-blue-border padding" style="padding: 15px;">
-            <form [formGroup]="genericAdapterForm" fxFlex="100">
-                <div fxFlex="100" >
-                    <app-static-property *ngFor="let config of protocolDescription.config"
-                                         [staticProperty]="config"
-                                         [staticProperties]="protocolDescription.config"
-                                         [adapterId]="adapterDescription.appId"
-                                         [parentForm]="genericAdapterForm"
-                                         [fieldName]="config.internalName"
-                                         (updateEmitter)="triggerUpdate($event)"
-                                         [completedStaticProperty]="completedStaticProperty">
-                    </app-static-property>
-                </div>
-            </form>
-        </div>
+
+        <sp-configuration-group
+                [configurationGroup]="genericAdapterForm"
+                [adapterId]="adapterDescription.appId"
+                [configuration]="adapterDescription.protocolDescription.config">
+        </sp-configuration-group>
+
     </div>
 
 </div>
diff --git a/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.ts b/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.ts
index f2212bb..d17a650 100644
--- a/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.ts
+++ b/ui/src/app/connect/components/generic-adapter-settings/generic-adapter-settings.component.ts
@@ -25,8 +25,6 @@ export class GenericAdapterSettingsComponent implements OnInit {
    */
   @Output() validateEmitter: EventEmitter<boolean> = new EventEmitter();
 
-  completedStaticProperty: ConfigurationInfo;
-
   genericAdapterForm: FormGroup;
 
   protocolDescription: ProtocolDescription;
@@ -49,8 +47,4 @@ export class GenericAdapterSettingsComponent implements OnInit {
     });
   }
 
-  triggerUpdate(configurationInfo: ConfigurationInfo) {
-    this.completedStaticProperty = {...configurationInfo};
-  }
-
 }
diff --git a/ui/src/app/connect/components/select-format/select-format.component.html b/ui/src/app/connect/components/select-format/select-format.component.html
index 50a4c52..f6502cf 100644
--- a/ui/src/app/connect/components/select-format/select-format.component.html
+++ b/ui/src/app/connect/components/select-format/select-format.component.html
@@ -17,23 +17,14 @@
     </div>
 
     <div *ngIf="selectedFormat">
-
         <div *ngIf="selectedFormat.config.length > 0">
-            <div class="sp-blue-border padding" style="padding: 15px;">
-                <form [formGroup]="formatForm" fxFlex="100">
-                    <app-static-property *ngFor="let config of selectedFormat.config"
-                                         [staticProperty]="config"
-                                         [staticProperties]="adapterDescription.config"
-                                         [adapterId]="adapterDescription.appId"
-                                         [parentForm]="formatForm"
-                                         [fieldName]="config.internalName"
-                                         (updateEmitter)="triggerUpdate($event)"
-                                         [completedStaticProperty]="completedStaticProperty">
-
-                    </app-static-property>
-                </form>
-            </div>
+            <sp-configuration-group
+                    [configurationGroup]="formatForm"
+                    [adapterId]="adapterDescription.appId"
+                    [configuration]="selectedFormat.config">
+            </sp-configuration-group>
         </div>
+
         <div *ngIf="selectedFormat.config.length === 0" class="sp-blue-border padding" style="padding: 15px;">
             <div  style="text-align:center;">
                 <h5 >(no further configuration needed)</h5>
diff --git a/ui/src/app/connect/components/select-format/select-format.component.ts b/ui/src/app/connect/components/select-format/select-format.component.ts
index 6c7a804..43f7993 100644
--- a/ui/src/app/connect/components/select-format/select-format.component.ts
+++ b/ui/src/app/connect/components/select-format/select-format.component.ts
@@ -36,8 +36,6 @@ export class SelectFormatComponent implements OnInit {
    */
   allFormats: FormatDescription[] = [];
 
-  completedStaticProperty: ConfigurationInfo;
-
   /**
    * The form group to validate the configuration for the foramt
    */
@@ -77,10 +75,6 @@ export class SelectFormatComponent implements OnInit {
     }
   }
 
-  triggerUpdate(configurationInfo: ConfigurationInfo) {
-    this.completedStaticProperty = {...configurationInfo};
-  }
-
   formatSelected(selectedFormat) {
     if (
       this.adapterDescription instanceof GenericAdapterSetDescription ||
diff --git a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html b/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html
index e65e3e2..939ec10 100644
--- a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html
+++ b/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html
@@ -5,19 +5,11 @@
             <h4>Basic settings</h4>
         </div>
 
-        <div class="sp-blue-border padding" style="padding: 15px;">
-            <form [formGroup]="specificAdapterForm" fxFlex="100">
-                <app-static-property *ngFor="let config of adapterDescription.config"
-                                     [staticProperty]="config"
-                                     [staticProperties]="adapterDescription.config"
-                                     [adapterId]="adapterDescription.appId"
-                                     [parentForm]="specificAdapterForm"
-                                     [fieldName]="config.internalName"
-                                     (updateEmitter)="triggerUpdate($event)"
-                                     [completedStaticProperty]="completedStaticProperty">
-                </app-static-property>
-            </form>
+        <sp-configuration-group
+                [configurationGroup]="specificAdapterForm"
+                [adapterId]="adapterDescription.appId"
+                [configuration]="adapterDescription.config">
+        </sp-configuration-group>
 
-        </div>
     </div>
 </div>
diff --git a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.ts b/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.ts
index e7aefd0..52b606b 100644
--- a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.ts
+++ b/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.ts
@@ -20,9 +20,6 @@ export class SpecificAdapterSettingsComponent implements OnInit {
    */
   @Output() validateEmitter: EventEmitter<boolean> = new EventEmitter();
 
-
-  completedStaticProperty: ConfigurationInfo;
-
   specificAdapterForm: FormGroup;
 
   constructor(
@@ -37,9 +34,4 @@ export class SpecificAdapterSettingsComponent implements OnInit {
     });
   }
 
-  triggerUpdate(configurationInfo: ConfigurationInfo) {
-    this.completedStaticProperty = {...configurationInfo};
-  }
-
-
 }
diff --git a/ui/src/app/connect/connect.module.ts b/ui/src/app/connect/connect.module.ts
index 676527d..b5fdbb4 100644
--- a/ui/src/app/connect/connect.module.ts
+++ b/ui/src/app/connect/connect.module.ts
@@ -73,6 +73,7 @@ import { ExistingAdaptersComponent } from './components/data-marketplace/existin
 import { SelectFormatComponent } from './components/select-format/select-format.component';
 import { GenericAdapterSettingsComponent } from './components/generic-adapter-settings/generic-adapter-settings.component';
 import { SpecificAdapterSettingsComponent } from './components/specific-adapter-settings/specific-adapter-settings.component';
+import { ConfigurationGroupComponent } from './components/configuration-group/configuration-group.component';
 
 @NgModule({
     imports: [
@@ -120,7 +121,8 @@ import { SpecificAdapterSettingsComponent } from './components/specific-adapter-
         EditCorrectionValueComponent,
         SelectFormatComponent,
         GenericAdapterSettingsComponent,
-        SpecificAdapterSettingsComponent
+        SpecificAdapterSettingsComponent,
+        ConfigurationGroupComponent
     ],
     providers: [
         RestService,

[incubator-streampipes] 01/03: Prepare code to create configuration component

Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch STREAMPIPES-380
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 9cf868129ffea91a10996967491ae926cb6ca379
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Mon Jun 14 17:27:49 2021 +0200

    Prepare code to create configuration component
---
 .../new-adapter/new-adapter.component.ts           |  4 ---
 .../select-format/select-format.component.css      |  3 --
 .../select-format/select-format.component.html     | 36 +++++++++++++---------
 .../specific-adapter-settings.component.html       |  1 +
 4 files changed, 22 insertions(+), 22 deletions(-)

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 6fbfef6..471a831 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
@@ -238,10 +238,6 @@ export class NewAdapterComponent implements OnInit, AfterViewInit {
         this.triggerDialog(false);
     }
 
-    validateProtocol(valid) {
-        this.protocolConfigurationValid = valid;
-    }
-
     validateFormat(valid) {
         this.formatConfigurationValid = valid;
     }
diff --git a/ui/src/app/connect/components/select-format/select-format.component.css b/ui/src/app/connect/components/select-format/select-format.component.css
index b5136d6..e69de29 100644
--- a/ui/src/app/connect/components/select-format/select-format.component.css
+++ b/ui/src/app/connect/components/select-format/select-format.component.css
@@ -1,3 +0,0 @@
-.format-configuration {
-    padding: 15px;
-}
diff --git a/ui/src/app/connect/components/select-format/select-format.component.html b/ui/src/app/connect/components/select-format/select-format.component.html
index 2d56715..50a4c52 100644
--- a/ui/src/app/connect/components/select-format/select-format.component.html
+++ b/ui/src/app/connect/components/select-format/select-format.component.html
@@ -16,22 +16,28 @@
         <h4>Configure format</h4>
     </div>
 
-    <div class="sp-blue-border padding format-configuration">
-        <div fxFlex="100" *ngIf="selectedFormat">
-            <form [formGroup]="formatForm" fxFlex="100">
-                <app-static-property *ngFor="let config of selectedFormat.config"
-                                     [staticProperty]="config"
-                                     [staticProperties]="adapterDescription.config"
-                                     [adapterId]="adapterDescription.appId"
-                                     [parentForm]="formatForm"
-                                     [fieldName]="config.internalName"
-                                     (updateEmitter)="triggerUpdate($event)"
-                                     [completedStaticProperty]="completedStaticProperty">
+    <div *ngIf="selectedFormat">
 
-                </app-static-property>
-                <h5 *ngIf="selectedFormat.config.length === 0" style="text-align:center;">(no further
-                    configuration needed)</h5>
-            </form>
+        <div *ngIf="selectedFormat.config.length > 0">
+            <div class="sp-blue-border padding" style="padding: 15px;">
+                <form [formGroup]="formatForm" fxFlex="100">
+                    <app-static-property *ngFor="let config of selectedFormat.config"
+                                         [staticProperty]="config"
+                                         [staticProperties]="adapterDescription.config"
+                                         [adapterId]="adapterDescription.appId"
+                                         [parentForm]="formatForm"
+                                         [fieldName]="config.internalName"
+                                         (updateEmitter)="triggerUpdate($event)"
+                                         [completedStaticProperty]="completedStaticProperty">
+
+                    </app-static-property>
+                </form>
+            </div>
+        </div>
+        <div *ngIf="selectedFormat.config.length === 0" class="sp-blue-border padding" style="padding: 15px;">
+            <div  style="text-align:center;">
+                <h5 >(no further configuration needed)</h5>
+            </div>
         </div>
     </div>
 </div>
diff --git a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html b/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html
index 47e44cb..e65e3e2 100644
--- a/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html
+++ b/ui/src/app/connect/components/specific-adapter-settings/specific-adapter-settings.component.html
@@ -4,6 +4,7 @@
         <div class="assemblyOptions sp-blue-bg">
             <h4>Basic settings</h4>
         </div>
+
         <div class="sp-blue-border padding" style="padding: 15px;">
             <form [formGroup]="specificAdapterForm" fxFlex="100">
                 <app-static-property *ngFor="let config of adapterDescription.config"