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

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


The following commit(s) were added to refs/heads/STREAMPIPES-483 by this push:
     new e620ef0  [STREAMPIPES-483] Fix edit domain property bug in event 
schema editor
e620ef0 is described below

commit e620ef0c7576fe5863190c529199ebd8926e61cb
Author: Philipp Zehnder <[email protected]>
AuthorDate: Mon Dec 27 13:32:49 2021 +0100

    [STREAMPIPES-483] Fix edit domain property bug in event schema editor
---
 .../fixtures/connect/schemaRules/expected.csv      |  4 +--
 ui/cypress/tests/adapter/schemaRules.smoke.ts      | 29 +++++++++++-----------
 .../edit-event-property.component.html             |  4 ++-
 .../edit-event-property.component.ts               |  6 +++--
 4 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/ui/cypress/fixtures/connect/schemaRules/expected.csv 
b/ui/cypress/fixtures/connect/schemaRules/expected.csv
index 6f81327..38a8aeb 100644
--- a/ui/cypress/fixtures/connect/schemaRules/expected.csv
+++ b/ui/cypress/fixtures/connect/schemaRules/expected.csv
@@ -1,2 +1,2 @@
-count;temperature
-122.0;11.0
+count;staticpropertyname;temperature
+122.0;id1;11.0
diff --git a/ui/cypress/tests/adapter/schemaRules.smoke.ts 
b/ui/cypress/tests/adapter/schemaRules.smoke.ts
index d28cdb8..1e2192c 100644
--- a/ui/cypress/tests/adapter/schemaRules.smoke.ts
+++ b/ui/cypress/tests/adapter/schemaRules.smoke.ts
@@ -20,6 +20,7 @@ import { ConnectUtils } from 
'../../support/utils/ConnectUtils';
 import { FileManagementUtils } from '../../support/utils/FileManagementUtils';
 import { GenericAdapterBuilder } from 
'../../support/builder/GenericAdapterBuilder';
 import { ConnectEventSchemaUtils } from 
'../../support/utils/ConnectEventSchemaUtils';
+import { DataLakeUtils } from '../../support/utils/DataLakeUtils';
 
 describe('Test Random Data Simulator Stream Adapter', () => {
     beforeEach('Setup Test', () => {
@@ -48,31 +49,29 @@ describe('Test Random Data Simulator Stream Adapter', () => 
{
         // wait till schema is shown
         cy.dataCy('sp-connect-schema-editor', { timeout: 60000 
}).should('be.visible');
 
-        // TODO FIX breaks adapter
         // Add static value to event
-        // ConnectEventSchemaUtils.addStaticProperty('staticPropertyName', 
'id1');
+        ConnectEventSchemaUtils.addStaticProperty('staticPropertyName', 'id1');
 
         // Delete one property
         ConnectEventSchemaUtils.deleteProperty('density');
 
-        // TODO FIX breaks adapter
         // TODO use data type class
-        // ConnectEventSchemaUtils.changePropertyDataType('temperature', 
'Float');
+        ConnectEventSchemaUtils.changePropertyDataType('temperature', 'Float');
 
         // Add a timestamp property
         ConnectEventSchemaUtils.addTimestampProperty();
 
-        // ConnectEventSchemaUtils.finishEventSchemaConfiguration();
-        //
-        // ConnectUtils.startSetAdapter(adapterConfiguration);
-        //
-        // // Wait till data is stored
-        // cy.wait(10000);
-        //
-        // DataLakeUtils.checkResults(
-        //     'adaptertotestschemarules',
-        //     'cypress/fixtures/connect/schemaRules/expected.csv',
-        //     true);
+        ConnectEventSchemaUtils.finishEventSchemaConfiguration();
+
+        ConnectUtils.startSetAdapter(adapterConfiguration);
+
+        // Wait till data is stored
+        cy.wait(10000);
+
+        DataLakeUtils.checkResults(
+            'adaptertotestschemarules',
+            'cypress/fixtures/connect/schemaRules/expected.csv',
+            true);
     });
 
 });
diff --git 
a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.html
 
b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.html
index 5168be5..a67a461 100644
--- 
a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.html
+++ 
b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.html
@@ -53,7 +53,9 @@
     <div class="form-group">
       <mat-form-field class="doubleWidth" color="accent">
         <input matInput placeholder="Semantic Type" class="dmainProperty" 
name="domainproperty" id="domainproperty"
-               [(ngModel)]="cachedProperty.domainProperties[0]" 
[matAutocomplete]="st" [formControl]="domainPropertyControl">
+               [(ngModel)]="cachedProperty.domainProperties[0]"
+               [matAutocomplete]="st"
+               [formControl]="domainPropertyControl">
       <mat-autocomplete #st="matAutocomplete" [panelWidth]="'300px'">
         <mat-option *ngFor="let semanticType of semanticTypes | async" 
[value]="semanticType" style="font-size: 10pt;">
           {{semanticType}}
diff --git 
a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
 
b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
index 5a37404..f77d809 100644
--- 
a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
+++ 
b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
@@ -53,7 +53,7 @@ export class EditEventPropertyComponent implements OnInit {
   isNumericProperty: boolean;
   isSaveBtnEnabled: boolean;
 
-  semanticTypes: Observable<Array<string>>;
+  semanticTypes: Observable<string[]>;
 
   private propertyForm: FormGroup;
   domainPropertyControl = new FormControl();
@@ -147,7 +147,9 @@ export class EditEventPropertyComponent implements OnInit {
   save(): void {
     this.property.label = this.cachedProperty.label;
     this.property.description = this.cachedProperty.description;
-    this.property.domainProperties = this.cachedProperty.domainProperties;
+
+    // remove undefined from domain properies array
+    this.property.domainProperties = 
this.cachedProperty.domainProperties.filter(n => n);
     this.property.runtimeName = this.cachedProperty.runtimeName;
     this.property.propertyScope = this.cachedProperty.propertyScope;
 

Reply via email to