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 2020/02/10 16:00:05 UTC

[incubator-streampipes] branch dev updated: STREAMPIPES-76: Consider domain property for live preview The domainproperty of each event property is now checked and the content is redered accordingly

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

zehnder 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 508bfc0  STREAMPIPES-76: Consider domain property for live preview The domainproperty of each event property is now checked and the content is redered accordingly
508bfc0 is described below

commit 508bfc028a99d6cda276645be073a1f4d1762e45
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Mon Feb 10 16:58:23 2020 +0100

    STREAMPIPES-76: Consider domain property for live preview
    The domainproperty of each event property is now checked and the content
    is redered accordingly
---
 .../component/adapter-started-dialog.component.ts   | 21 +++++++++++++++++++++
 .../component/dialog-adapter-started.html           |  4 +++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/ui/src/app/connect/new-adapter/component/adapter-started-dialog.component.ts b/ui/src/app/connect/new-adapter/component/adapter-started-dialog.component.ts
index 1df7c28..671e385 100644
--- a/ui/src/app/connect/new-adapter/component/adapter-started-dialog.component.ts
+++ b/ui/src/app/connect/new-adapter/component/adapter-started-dialog.component.ts
@@ -129,6 +129,27 @@ export class AdapterStartedDialog {
         });
     }
 
+    isPropertyType(property, type) {
+      return property.properties.domainProperties !== undefined && property.properties.domainProperties.length === 1 &&
+        property.properties.domainProperties[0] === type;
+    }
+
+    isImage(property) {
+        return this.isPropertyType(property, 'https://image.com');
+    }
+
+    isTimestamp(property) {
+      return this.isPropertyType(property, 'http://schema.org/DateTime');
+    }
+
+    hasNoDomainProperty(property) {
+        if (this.isTimestamp(property) || this.isImage(property)) {
+            return false;
+        } else {
+            return true;
+        }
+    }
+
     onCloseConfirm() {
         this.pollingActive = false;
         this.dialogRef.close('Confirm');
diff --git a/ui/src/app/connect/new-adapter/component/dialog-adapter-started.html b/ui/src/app/connect/new-adapter/component/dialog-adapter-started.html
index 3ea3d3c..c42fc08 100644
--- a/ui/src/app/connect/new-adapter/component/dialog-adapter-started.html
+++ b/ui/src/app/connect/new-adapter/component/dialog-adapter-started.html
@@ -79,7 +79,9 @@
                         <tbody id="preview-data-rows-id">
                         <tr *ngFor="let property of streamDescription.eventSchema.eventProperties">
                             <td>{{property.properties.runtimeName}}</td>
-                            <td>{{runtimeData[property.properties.runtimeName]}}</td>
+                            <td *ngIf="isImage(property)"> <img src="data:image/png;base64,{{runtimeData[property.properties.runtimeName]}}" style="max-width: 150px;" /> </td>
+                            <td *ngIf="isTimestamp(property)">{{runtimeData[property.properties.runtimeName] | date:'yyyy-MM-dd HH:mm:ss '}}</td>
+                            <td *ngIf="hasNoDomainProperty(property)">{{runtimeData[property.properties.runtimeName]}}</td>
                         </tr>
                         </tbody>
                     </table>