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/15 15:03:37 UTC

[incubator-streampipes] 02/02: Remove stepper variable from sub components

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 de605f25d8772ee7d95b1bdcd5d68d83f3a355fc
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Tue Jun 15 17:03:08 2021 +0200

    Remove stepper variable from sub components
---
 .../format-configuration.component.ts              | 10 +----
 .../generic-adapter-configuration.component.ts     |  7 +---
 .../new-adapter/new-adapter.component.html         | 18 ++++-----
 .../new-adapter/new-adapter.component.ts           | 46 ++++++----------------
 .../event-schema/event-schema.component.ts         |  9 +----
 .../specific-adapter-configuration.component.ts    |  7 +---
 .../start-adapter-configuration.component.ts       |  8 +---
 7 files changed, 25 insertions(+), 80 deletions(-)

diff --git a/ui/src/app/connect/components/format-configuration/format-configuration.component.ts b/ui/src/app/connect/components/format-configuration/format-configuration.component.ts
index b8f2c1f..8b7d1c0 100644
--- a/ui/src/app/connect/components/format-configuration/format-configuration.component.ts
+++ b/ui/src/app/connect/components/format-configuration/format-configuration.component.ts
@@ -21,12 +21,6 @@ export class FormatConfigurationComponent implements OnInit {
    */
   @Input() adapterDescription: AdapterDescriptionUnion;
 
-  /**
-   * Mat stepper to trigger next confifuration step when this is completed
-   */
-  @Input() stepper: MatStepper;
-
-
   @Output() goBackEmitter: EventEmitter<MatStepper> = new EventEmitter();
 
   /**
@@ -108,10 +102,10 @@ export class FormatConfigurationComponent implements OnInit {
   }
 
   public clickNext() {
-    this.clickNextEmitter.emit(this.stepper);
+    this.clickNextEmitter.emit();
   }
 
   public goBack() {
-    this.goBackEmitter.emit(this.stepper);
+    this.goBackEmitter.emit();
   }
 }
diff --git a/ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.ts b/ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.ts
index af3efbd..4669661 100644
--- a/ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/generic-adapter-configuration/generic-adapter-configuration.component.ts
@@ -21,11 +21,6 @@ export class GenericAdapterConfigurationComponent implements OnInit {
   @Input() adapterDescription: AdapterDescriptionUnion;
 
   /**
-   * Mat stepper to trigger next confifuration step when this is completed
-   */
-  @Input() stepper: MatStepper;
-
-  /**
    * Cancels the adapter configuration process
    */
   @Output() removeSelectionEmitter: EventEmitter<boolean> = new EventEmitter();
@@ -65,6 +60,6 @@ export class GenericAdapterConfigurationComponent implements OnInit {
   }
 
   public clickNext() {
-    this.clickNextEmitter.emit(this.stepper);
+    this.clickNextEmitter.emit();
   }
 }
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 099fb74..d263ed2 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
@@ -47,8 +47,7 @@
             <ng-template matStepLabel>Settings</ng-template>
             <sp-specific-adapter-configuration
                     [adapterDescription]="adapter"
-                    [stepper]="stepper"
-                    (clickNextEmitter)="clickSpecificSettingsNextButton($event)"
+                    (clickNextEmitter)="clickSpecificSettingsNextButton()"
                     (removeSelectionEmitter)="removeSelection()">
             </sp-specific-adapter-configuration>
         </mat-step>
@@ -57,8 +56,7 @@
             <ng-template matStepLabel>Settings</ng-template>
             <sp-generic-adapter-configuration
                     [adapterDescription]="adapter"
-                    [stepper]="stepper"
-                    (clickNextEmitter)="clickProtocolSettingsNextButton($event)"
+                    (clickNextEmitter)="clickProtocolSettingsNextButton()"
                     (removeSelectionEmitter)="removeSelection()">
             </sp-generic-adapter-configuration>
         </mat-step>
@@ -67,9 +65,8 @@
             <ng-template matStepLabel>Select Format</ng-template>
             <sp-format-configuration
                     [adapterDescription]="adapter"
-                    [stepper]="stepper"
-                    (clickNextEmitter)="clickFormatSelectionNextButton($event)"
-                    (goBackEmitter)="goBack($event)"
+                    (clickNextEmitter)="clickFormatSelectionNextButton()"
+                    (goBackEmitter)="goBack()"
                     (removeSelectionEmitter)="removeSelection()">
             </sp-format-configuration>
         </mat-step>
@@ -81,8 +78,8 @@
                               [adapterDescription]="adapter"
                               [(eventSchema)]="eventSchema"
                               [(oldEventSchema)]="oldEventSchema"
-                             (clickNextEmitter)="clickEventSchemaNextButtonButton($event)"
-                             (goBackEmitter)="goBack($event)"
+                             (clickNextEmitter)="clickEventSchemaNextButtonButton()"
+                             (goBackEmitter)="goBack()"
                              (removeSelectionEmitter)="removeSelection()">
             </sp-event-schema>
         </mat-step>
@@ -91,9 +88,8 @@
             <ng-template matStepLabel>Start Adapter</ng-template>
             <sp-start-adapter-configuration
                     [adapterDescription]="adapter"
-                    [stepper]="stepper"
                     (removeSelectionEmitter)="removeSelection()"
-                    (goBackEmitter)="goBack($event)"
+                    (goBackEmitter)="goBack()"
                     (adapterStartedEmitter)="adapterWasStarted()">
             </sp-start-adapter-configuration>
         </mat-step>
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 3b4a59c..897ad81 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
@@ -26,17 +26,15 @@ import {
   Output,
   ViewChild
 } from '@angular/core';
-import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { FormBuilder, FormGroup } from '@angular/forms';
 import { MatStepper } from '@angular/material/stepper';
 import {
   AdapterDescription,
   AdapterDescriptionUnion,
   EventProperty,
-  EventRateTransformationRuleDescription,
   EventSchema,
   GenericAdapterSetDescription,
   GenericAdapterStreamDescription,
-  RemoveDuplicatesTransformationRuleDescription,
   SpecificAdapterSetDescription,
   SpecificAdapterStreamDescription,
   TransformationRuleDescriptionUnion
@@ -49,10 +47,7 @@ import { ConfigurationInfo } from '../../model/ConfigurationInfo';
 import { RestService } from '../../services/rest.service';
 import { EventSchemaComponent } from '../schema-editor/event-schema/event-schema.component';
 import { TransformationRuleService } from '../../services/transformation-rule.service';
-import { AdapterStartedDialog } from '../../dialog/adapter-started/adapter-started-dialog.component';
 import { IconService } from '../../services/icon.service';
-import { DialogService } from '../../../core-ui/dialog/base-dialog/base-dialog.service';
-import { PanelType } from '../../../core-ui/dialog/base-dialog/base-dialog.model';
 
 @Component({
     selector: 'sp-new-adapter',
@@ -67,7 +62,6 @@ export class NewAdapterComponent implements OnInit, AfterViewInit {
     isDataSetDescription = false;
     isDataStreamDescription = false;
 
-
     dataLakeTimestampField: string;
 
     @Input()
@@ -86,9 +80,6 @@ export class NewAdapterComponent implements OnInit, AfterViewInit {
     protocolConfigurationValid: boolean;
     formatConfigurationValid: boolean;
 
-
-    // startAdapterFormGroup: FormGroup;
-
     eventSchema: EventSchema;
     oldEventSchema: EventSchema;
 
@@ -182,36 +173,23 @@ export class NewAdapterComponent implements OnInit, AfterViewInit {
         this.changeDetectorRef.detectChanges();
     }
 
-    public showPreview(isPreviewEnabled) {
-        this.isPreviewEnabled = isPreviewEnabled;
-    }
-
-
-
-    validateFormat(valid) {
-        this.formatConfigurationValid = valid;
-    }
-
-    validateGenericAdapterForm(valid) {
-        this.genericAdapterSettingsFormValid = valid;
-    }
 
     removeSelection() {
         this.removeSelectionEmitter.emit();
     }
 
-    clickProtocolSettingsNextButton(stepper: MatStepper) {
+    clickProtocolSettingsNextButton() {
         this.shepherdService.trigger('specific-settings-next-button');
-        this.goForward(stepper);
+        this.goForward();
     }
 
-    clickSpecificSettingsNextButton(stepper: MatStepper) {
+    clickSpecificSettingsNextButton() {
         this.shepherdService.trigger('specific-settings-next-button');
         this.guessEventSchema();
-        this.goForward(stepper);
+        this.goForward();
     }
 
-    clickEventSchemaNextButtonButton(stepper: MatStepper) {
+    clickEventSchemaNextButtonButton() {
         if (this.isEditable) {
             this.setSchema();
         }
@@ -223,15 +201,13 @@ export class NewAdapterComponent implements OnInit, AfterViewInit {
         }
 
         this.shepherdService.trigger('event-schema-next-button');
-        this.goForward(stepper);
-
-
+        this.goForward();
     }
 
-    clickFormatSelectionNextButton(stepper: MatStepper) {
+    clickFormatSelectionNextButton() {
         this.shepherdService.trigger('format-selection-next-button');
         this.guessEventSchema();
-        this.goForward(stepper);
+        this.goForward();
     }
 
     guessEventSchema() {
@@ -289,11 +265,11 @@ export class NewAdapterComponent implements OnInit, AfterViewInit {
         this.adapter.rules = transformationRules;
     }
 
-    goBack(stepper: MatStepper) {
+    goBack() {
         this.myStepper.selectedIndex = this.myStepper.selectedIndex - 1;
     }
 
-    goForward(stepper: MatStepper) {
+    goForward() {
         this.myStepper.selectedIndex = this.myStepper.selectedIndex + 1;
     }
 
diff --git a/ui/src/app/connect/components/schema-editor/event-schema/event-schema.component.ts b/ui/src/app/connect/components/schema-editor/event-schema/event-schema.component.ts
index 1b4eba3..df4fe7e 100644
--- a/ui/src/app/connect/components/schema-editor/event-schema/event-schema.component.ts
+++ b/ui/src/app/connect/components/schema-editor/event-schema/event-schema.component.ts
@@ -49,11 +49,6 @@ export class EventSchemaComponent implements OnChanges {
 
   constructor(private restService: RestService, private dataTypesService: DataTypesService) { }
 
-  /**
-   * Mat stepper to trigger next confifuration step when this is completed
-   */
-  @Input() stepper: MatStepper;
-
   @Input() adapterDescription: AdapterDescription;
   @Input() isEditable = true;
   @Input() oldEventSchema: EventSchema;
@@ -212,10 +207,10 @@ export class EventSchemaComponent implements OnChanges {
   }
 
   public clickNext() {
-    this.clickNextEmitter.emit(this.stepper);
+    this.clickNextEmitter.emit();
   }
 
   public goBack() {
-    this.goBackEmitter.emit(this.stepper);
+    this.goBackEmitter.emit();
   }
 }
diff --git a/ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.ts b/ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.ts
index c7a3a18..1ba136b 100644
--- a/ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/specific-adapter-configuration/specific-adapter-configuration.component.ts
@@ -16,11 +16,6 @@ export class SpecificAdapterConfigurationComponent implements OnInit {
   @Input() adapterDescription: AdapterDescriptionUnion;
 
   /**
-   * Mat stepper to trigger next confifuration step when this is completed
-   */
-  @Input() stepper: MatStepper;
-
-  /**
    * Cancels the adapter configuration process
    */
   @Output() removeSelectionEmitter: EventEmitter<boolean> = new EventEmitter();
@@ -51,6 +46,6 @@ export class SpecificAdapterConfigurationComponent implements OnInit {
   }
 
   public clickNext() {
-    this.clickNextEmitter.emit(this.stepper);
+    this.clickNextEmitter.emit();
   }
 }
diff --git a/ui/src/app/connect/components/start-adapter-configuration/start-adapter-configuration.component.ts b/ui/src/app/connect/components/start-adapter-configuration/start-adapter-configuration.component.ts
index 85e2f9e..a5b361c 100644
--- a/ui/src/app/connect/components/start-adapter-configuration/start-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/start-adapter-configuration/start-adapter-configuration.component.ts
@@ -24,11 +24,6 @@ export class StartAdapterConfigurationComponent implements OnInit {
   @Input() adapterDescription: AdapterDescriptionUnion;
 
   /**
-   * Mat stepper to trigger next confifuration step when this is completed
-   */
-  @Input() stepper: MatStepper;
-
-  /**
    * Cancels the adapter configuration process
    */
   @Output() removeSelectionEmitter: EventEmitter<boolean> = new EventEmitter();
@@ -38,7 +33,6 @@ export class StartAdapterConfigurationComponent implements OnInit {
    */
   @Output() adapterStartedEmitter: EventEmitter<void> = new EventEmitter<void>();
 
-
   /**
    * Go to next configuration step when this is complete
    */
@@ -133,6 +127,6 @@ export class StartAdapterConfigurationComponent implements OnInit {
   }
 
   public goBack() {
-    this.goBackEmitter.emit(this.stepper);
+    this.goBackEmitter.emit();
   }
 }