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/09/02 16:20:05 UTC

[incubator-streampipes] branch dev updated: [hotfix] Change semantic types for numbers in data explorer

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 2fe7020  [hotfix] Change semantic types for numbers in data explorer
     new cec7c5d  Merge branch 'dev' of github.com:apache/incubator-streampipes into dev
2fe7020 is described below

commit 2fe7020d16ede5e8261dded46ef484ba3bd62144
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Wed Sep 2 18:17:35 2020 +0200

    [hotfix] Change semantic types for numbers in data explorer
---
 .../widgets/base/base-data-explorer-widget.ts       | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/ui/src/app/data-explorer/components/widgets/base/base-data-explorer-widget.ts b/ui/src/app/data-explorer/components/widgets/base/base-data-explorer-widget.ts
index ee55f5b..72c0eb7 100644
--- a/ui/src/app/data-explorer/components/widgets/base/base-data-explorer-widget.ts
+++ b/ui/src/app/data-explorer/components/widgets/base/base-data-explorer-widget.ts
@@ -139,12 +139,21 @@ export abstract class BaseDataExplorerWidget implements OnChanges {
   }
 
   isNumber(p: EventPropertyUnion): boolean {
-    return (p instanceof EventPropertyPrimitive &&
-      ((p as EventPropertyPrimitive).runtimeType === 'http://www.w3.org/2001/XMLSchema#number') ||
-      (p as EventPropertyPrimitive).runtimeType === 'http://www.w3.org/2001/XMLSchema#float') ||
-    ((p as EventPropertyPrimitive).runtimeType === 'http://www.w3.org/2001/XMLSchema#double') ||
-    ((p as EventPropertyPrimitive).runtimeType === 'http://www.w3.org/2001/XMLSchema#integer')
-      ? true : false;
+    if (p instanceof EventPropertyPrimitive) {
+      const runtimeType = (p as EventPropertyPrimitive).runtimeType;
+
+      return runtimeType === 'http://schema.org/Number' ||
+      runtimeType === 'http://www.w3.org/2001/XMLSchema#float' ||
+      runtimeType === 'http://www.w3.org/2001/XMLSchema#double' ||
+      runtimeType === 'http://www.w3.org/2001/XMLSchema#integer' ||
+      runtimeType === 'https://schema.org/Number' ||
+      runtimeType === 'https://www.w3.org/2001/XMLSchema#float' ||
+      runtimeType === 'https://www.w3.org/2001/XMLSchema#double' ||
+      runtimeType === 'https://www.w3.org/2001/XMLSchema#integer'
+        ? true : false;
+    } else {
+      return  false;
+    }
   }
 
   public isTimestamp(p: EventProperty) {