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

bossenti pushed a commit to branch rel/0.95.0
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/rel/0.95.0 by this push:
     new 8207dab0cf fix(#2830): Data adapter losing dimension selection (#2888)
8207dab0cf is described below

commit 8207dab0cffb502ef0fb4260f1bf3ee682213c35
Author: Dominik Riemer <[email protected]>
AuthorDate: Wed May 22 10:20:41 2024 +0200

    fix(#2830): Data adapter losing dimension selection (#2888)
---
 .../convert/ToTransformedSchemaConverter.java      |  4 ++
 .../rules/value/AddTimestampRuleDescription.java   | 11 +++++
 .../src/lib/model/gen/streampipes-model.ts         | 57 +++++++++++++---------
 .../sp-exception-message.component.html            |  8 ++-
 .../sp-exception-message.component.scss            |  1 -
 .../services/transformation-rule.service.ts        | 13 +++--
 6 files changed, 63 insertions(+), 31 deletions(-)

diff --git 
a/streampipes-connect-shared/src/main/java/org/apache/streampipes/connect/shared/preprocessing/convert/ToTransformedSchemaConverter.java
 
b/streampipes-connect-shared/src/main/java/org/apache/streampipes/connect/shared/preprocessing/convert/ToTransformedSchemaConverter.java
index 60f282abd4..92b1674d0d 100644
--- 
a/streampipes-connect-shared/src/main/java/org/apache/streampipes/connect/shared/preprocessing/convert/ToTransformedSchemaConverter.java
+++ 
b/streampipes-connect-shared/src/main/java/org/apache/streampipes/connect/shared/preprocessing/convert/ToTransformedSchemaConverter.java
@@ -109,6 +109,10 @@ public class ToTransformedSchemaConverter implements 
ITransformationRuleVisitor,
   public void visit(AddTimestampRuleDescription rule) {
     var timestampProperty = 
EpProperties.timestampProperty(rule.getRuntimeKey());
     timestampProperty.setElementId(TIMESTAMP_ID_PREFIX + 
UUIDGenerator.generateUuid());
+    // null check required for backwards compatibility
+    if (rule.getPropertyScope() != null) {
+      timestampProperty.setPropertyScope(rule.getPropertyScope().name());
+    }
     this.properties.add(timestampProperty);
   }
 
diff --git 
a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/value/AddTimestampRuleDescription.java
 
b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/value/AddTimestampRuleDescription.java
index 379ac3b90b..1df522dbd0 100644
--- 
a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/value/AddTimestampRuleDescription.java
+++ 
b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/value/AddTimestampRuleDescription.java
@@ -20,10 +20,12 @@ package org.apache.streampipes.model.connect.rules.value;
 
 import org.apache.streampipes.model.connect.rules.ITransformationRuleVisitor;
 import org.apache.streampipes.model.connect.rules.TransformationRulePriority;
+import org.apache.streampipes.model.schema.PropertyScope;
 
 public class AddTimestampRuleDescription extends 
ValueTransformationRuleDescription {
 
   private String runtimeKey;
+  private PropertyScope propertyScope;
 
   public AddTimestampRuleDescription() {
     super();
@@ -36,6 +38,7 @@ public class AddTimestampRuleDescription extends 
ValueTransformationRuleDescript
   public AddTimestampRuleDescription(AddTimestampRuleDescription other) {
     super(other);
     this.runtimeKey = other.getRuntimeKey();
+    this.propertyScope = other.getPropertyScope();
   }
 
   public String getRuntimeKey() {
@@ -46,6 +49,14 @@ public class AddTimestampRuleDescription extends 
ValueTransformationRuleDescript
     this.runtimeKey = runtimeKey;
   }
 
+  public PropertyScope getPropertyScope() {
+    return propertyScope;
+  }
+
+  public void setPropertyScope(PropertyScope propertyScope) {
+    this.propertyScope = propertyScope;
+  }
+
   @Override
   public void accept(ITransformationRuleVisitor visitor) {
     visitor.visit(this);
diff --git 
a/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts
 
b/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts
index b3b8efeadf..1cd4d5a729 100644
--- 
a/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts
+++ 
b/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts
@@ -20,7 +20,7 @@
 /* tslint:disable */
 /* eslint-disable */
 // @ts-nocheck
-// Generated using typescript-generator version 3.2.1263 on 2024-03-28 
15:50:50.
+// Generated using typescript-generator version 3.2.1263 on 2024-05-21 
13:45:10.
 
 export class NamedStreamPipesEntity {
     '@class':
@@ -112,6 +112,7 @@ export class AdapterDescription extends 
VersionedNamedStreamPipesEntity {
     'correspondingServiceGroup': string;
     'createdAt': number;
     'dataStream': SpDataStream;
+    'deploymentConfiguration': ExtensionDeploymentConfiguration;
     'eventGrounding': EventGrounding;
     'eventSchema': EventSchema;
     'icon': string;
@@ -142,6 +143,10 @@ export class AdapterDescription extends 
VersionedNamedStreamPipesEntity {
         instance.correspondingServiceGroup = data.correspondingServiceGroup;
         instance.createdAt = data.createdAt;
         instance.dataStream = SpDataStream.fromData(data.dataStream);
+        instance.deploymentConfiguration =
+            ExtensionDeploymentConfiguration.fromData(
+                data.deploymentConfiguration,
+            );
         instance.eventGrounding = EventGrounding.fromData(data.eventGrounding);
         instance.eventSchema = EventSchema.fromData(data.eventSchema);
         instance.icon = data.icon;
@@ -320,6 +325,7 @@ export class ValueTransformationRuleDescription extends 
TransformationRuleDescri
 
 export class AddTimestampRuleDescription extends 
ValueTransformationRuleDescription {
     '@class': 
'org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription';
+    'propertyScope': PropertyScope;
     'runtimeKey': string;
 
     static 'fromData'(
@@ -331,6 +337,7 @@ export class AddTimestampRuleDescription extends 
ValueTransformationRuleDescript
         }
         const instance = target || new AddTimestampRuleDescription();
         super.fromData(data, instance);
+        instance.propertyScope = data.propertyScope;
         instance.runtimeKey = data.runtimeKey;
         return instance;
     }
@@ -1794,6 +1801,26 @@ export class ExportItem {
     }
 }
 
+export class ExtensionDeploymentConfiguration {
+    desiredServiceTags: SpServiceTag[];
+    selectedEndpointUrl: string;
+
+    static fromData(
+        data: ExtensionDeploymentConfiguration,
+        target?: ExtensionDeploymentConfiguration,
+    ): ExtensionDeploymentConfiguration {
+        if (!data) {
+            return data;
+        }
+        const instance = target || new ExtensionDeploymentConfiguration();
+        instance.desiredServiceTags = __getCopyArrayFn(SpServiceTag.fromData)(
+            data.desiredServiceTags,
+        );
+        instance.selectedEndpointUrl = data.selectedEndpointUrl;
+        return instance;
+    }
+}
+
 export class ExtensionItemDescription {
     appId: string;
     available: boolean;
@@ -2521,28 +2548,6 @@ export class PageResult extends DataSeries {
     }
 }
 
-export class PersistedDataStream {
-    measureName: string;
-    pipelineId: string;
-    pipelineName: string;
-    schema: EventSchema;
-
-    static fromData(
-        data: PersistedDataStream,
-        target?: PersistedDataStream,
-    ): PersistedDataStream {
-        if (!data) {
-            return data;
-        }
-        const instance = target || new PersistedDataStream();
-        instance.measureName = data.measureName;
-        instance.pipelineId = data.pipelineId;
-        instance.pipelineName = data.pipelineName;
-        instance.schema = EventSchema.fromData(data.schema);
-        return instance;
-    }
-}
-
 export class Pipeline extends ElementComposition {
     _id: string;
     _rev: string;
@@ -3267,6 +3272,7 @@ export class RuntimeOptionsRequest {
         | 'org.apache.streampipes.model.runtime.RuntimeOptionsResponse';
     'appId': string;
     'belongsTo': string;
+    'deploymentConfiguration': ExtensionDeploymentConfiguration;
     'inputStreams': SpDataStream[];
     'requestId': string;
     'staticProperties': StaticPropertyUnion[];
@@ -3282,6 +3288,10 @@ export class RuntimeOptionsRequest {
         instance['@class'] = data['@class'];
         instance.appId = data.appId;
         instance.belongsTo = data.belongsTo;
+        instance.deploymentConfiguration =
+            ExtensionDeploymentConfiguration.fromData(
+                data.deploymentConfiguration,
+            );
         instance.inputStreams = __getCopyArrayFn(SpDataStream.fromData)(
             data.inputStreams,
         );
@@ -4198,6 +4208,7 @@ export type SpServiceStatus =
 
 export type SpServiceTagPrefix =
     | 'SP_GROUP'
+    | 'CUSTOM'
     | 'ADAPTER'
     | 'DATA_STREAM'
     | 'DATA_PROCESSOR'
diff --git 
a/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.html
 
b/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.html
index 5f9b8ab1e0..04493f10e3 100644
--- 
a/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.html
+++ 
b/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.html
@@ -30,13 +30,17 @@
                     <h5 *ngIf="messageTimestamp" class="mr-15">
                         {{ messageTimestamp | date: 'short' }}
                     </h5>
-                    <h5 fxFlex class="color-warn">
+                    <h5 fxFlex>
                         {{ message.title || 'Error' }}
                     </h5>
                 </div>
                 <span fxFlex></span>
                 <div fxLayoutAlign="end center" *ngIf="showDetails">
-                    <button mat-button (click)="openDetailsDialog()">
+                    <button
+                        mat-button
+                        color="accent"
+                        (click)="openDetailsDialog()"
+                    >
                         <i class="material-icons">visibility</i>&nbsp;Details
                     </button>
                 </div>
diff --git 
a/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.scss
 
b/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.scss
index 26170c62ba..165ce8fb0f 100644
--- 
a/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.scss
+++ 
b/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.scss
@@ -18,7 +18,6 @@
 
 .error-panel {
     background: var(--color-bg-1);
-    border-radius: 5px;
 }
 
 .error {
diff --git a/ui/src/app/connect/services/transformation-rule.service.ts 
b/ui/src/app/connect/services/transformation-rule.service.ts
index b0fd79fa3d..443abebab9 100644
--- a/ui/src/app/connect/services/transformation-rule.service.ts
+++ b/ui/src/app/connect/services/transformation-rule.service.ts
@@ -30,6 +30,7 @@ import {
     EventPropertyUnion,
     EventSchema,
     MoveRuleDescription,
+    PropertyScope,
     RenameRuleDescription,
     SemanticType,
     TimestampTranfsformationRuleDescription,
@@ -55,22 +56,23 @@ export class TransformationRuleService {
         if (originalSchema == null || targetSchema == null) {
             console.log('Old and new schema must be defined');
         } else {
-            const addedTimestampProperties = this.getTimestampProperty(
+            const addedTimestampProperty = this.getTimestampProperty(
                 targetSchema.eventProperties,
             );
-            if (addedTimestampProperties) {
+            if (addedTimestampProperty) {
                 // add to old event schema for the case users moved the 
property to a nested property
-                originalSchema.eventProperties.push(addedTimestampProperties);
+                originalSchema.eventProperties.push(addedTimestampProperty);
 
                 const timestampRuleDescription: AddTimestampRuleDescription =
                     new AddTimestampRuleDescription();
                 timestampRuleDescription['@class'] =
                     
'org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription';
                 timestampRuleDescription.runtimeKey =
-                    addedTimestampProperties.runtimeName;
+                    addedTimestampProperty.runtimeName;
+                timestampRuleDescription.propertyScope =
+                    addedTimestampProperty.propertyScope as PropertyScope;
                 transformationRuleDescriptions.push(timestampRuleDescription);
             }
-
             const staticValueProperties = this.getStaticValueProperties(
                 targetSchema.eventProperties,
             );
@@ -84,6 +86,7 @@ export class TransformationRuleService {
                 rule.datatype = ep.runtimeType;
                 rule.label = ep.label;
                 rule.description = ep.description;
+                rule.propertyScope = ep.propertyScope as PropertyScope;
                 if (ep.domainProperties.length > 0) {
                     rule.semanticType = ep.domainProperties[0];
                 }

Reply via email to