You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2023/01/17 16:12:10 UTC

[streampipes] branch dev updated: [#877] Format and lint core-services module (#1116)

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

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


The following commit(s) were added to refs/heads/dev by this push:
     new 351cb5af4 [#877] Format and lint core-services module (#1116)
351cb5af4 is described below

commit 351cb5af44fd11629a090379cf753b01f7dc1e5d
Author: Aamir shaikh <56...@users.noreply.github.com>
AuthorDate: Tue Jan 17 21:42:05 2023 +0530

    [#877] Format and lint core-services module (#1116)
---
 ui/.eslintignore                                   |  1 -
 ui/.prettierignore                                 |  1 -
 .../semantic-type/semantic-type-utils.service.ts   |  8 +-
 .../template/PipelineInvocationBuilder.ts          | 86 ++++++++++++----------
 4 files changed, 50 insertions(+), 46 deletions(-)

diff --git a/ui/.eslintignore b/ui/.eslintignore
index 4d8829b09..c980966c1 100644
--- a/ui/.eslintignore
+++ b/ui/.eslintignore
@@ -21,7 +21,6 @@ cypress/fixtures/**/*.csv
 
 # Remove these in the future to lint additional modules
 # Please also see .prettierignore
-src/app/core-services
 src/app/core-ui
 src/app/CustomMaterial
 src/app/dashboard
diff --git a/ui/.prettierignore b/ui/.prettierignore
index 0cbcf99f4..3930e91ee 100644
--- a/ui/.prettierignore
+++ b/ui/.prettierignore
@@ -21,7 +21,6 @@ cypress/fixtures/**/*.csv
 
 # Remove these in the future to format additional modules
 # Please also see .eslintignore
-src/app/core-services
 src/app/core-ui
 src/app/CustomMaterial
 src/app/dashboard
diff --git a/ui/src/app/core-services/semantic-type/semantic-type-utils.service.ts b/ui/src/app/core-services/semantic-type/semantic-type-utils.service.ts
index ca4020cb3..a56a3f48c 100644
--- a/ui/src/app/core-services/semantic-type/semantic-type-utils.service.ts
+++ b/ui/src/app/core-services/semantic-type/semantic-type-utils.service.ts
@@ -21,24 +21,22 @@ import { EventProperty } from '@streampipes/platform-services';
 
 @Injectable()
 export class SemanticTypeUtilsService {
-
     public TIMESTAMP = 'http://schema.org/DateTime';
     public IMAGE = 'https://image.com';
     public NUMBER = 'http://schema.org/Number';
 
-    constructor() {
-    }
+    constructor() {}
 
     public getValue(inputValue, semanticType) {
         if (semanticType === this.TIMESTAMP) {
-            return new Date(inputValue).toLocaleString() ;
+            return new Date(inputValue).toLocaleString();
         } else {
             return inputValue;
         }
     }
 
     public isTimestamp(property: EventProperty): boolean {
-       return property.domainProperties.includes(this.TIMESTAMP);
+        return property.domainProperties.includes(this.TIMESTAMP);
     }
 
     public is(property: EventProperty, uri: string): boolean {
diff --git a/ui/src/app/core-services/template/PipelineInvocationBuilder.ts b/ui/src/app/core-services/template/PipelineInvocationBuilder.ts
index cec4cf053..03715cf48 100644
--- a/ui/src/app/core-services/template/PipelineInvocationBuilder.ts
+++ b/ui/src/app/core-services/template/PipelineInvocationBuilder.ts
@@ -15,54 +15,62 @@
  * limitations under the License.
  *
  */
-import { FreeTextStaticProperty, MappingPropertyUnary, PipelineTemplateInvocation } from '@streampipes/platform-services';
+import {
+    FreeTextStaticProperty,
+    MappingPropertyUnary,
+    PipelineTemplateInvocation,
+} from '@streampipes/platform-services';
 
 export class PipelineInvocationBuilder {
+    private pipelineTemplateInvocation: PipelineTemplateInvocation;
 
-  private pipelineTemplateInvocation: PipelineTemplateInvocation;
+    constructor(pipelineTemplateInvocation: PipelineTemplateInvocation) {
+        this.pipelineTemplateInvocation = pipelineTemplateInvocation;
+    }
 
-  constructor(pipelineTemplateInvocation: PipelineTemplateInvocation) {
-    this.pipelineTemplateInvocation = pipelineTemplateInvocation;
-  }
+    public static create(
+        pipelineTemplateInvocation: PipelineTemplateInvocation,
+    ) {
+        return new PipelineInvocationBuilder(pipelineTemplateInvocation);
+    }
 
-  public static create(pipelineTemplateInvocation: PipelineTemplateInvocation) {
-    return new PipelineInvocationBuilder(pipelineTemplateInvocation);
-  }
+    public setTemplateId(id: string) {
+        this.pipelineTemplateInvocation.pipelineTemplateId = id;
+        return this;
+    }
 
-  public setTemplateId(id: string) {
-    this.pipelineTemplateInvocation.pipelineTemplateId = id;
-    return this;
-  }
+    public setName(name: string) {
+        this.pipelineTemplateInvocation.kviName = name;
+        return this;
+    }
 
-  public setName(name: string) {
-    this.pipelineTemplateInvocation.kviName = name;
-    return this;
-  }
+    public setFreeTextStaticProperty(name: string, value: string) {
+        this.pipelineTemplateInvocation.staticProperties.forEach(property => {
+            if (
+                property instanceof FreeTextStaticProperty &&
+                'jsplumb_domId2' + name === property.internalName
+            ) {
+                property.value = value;
+            }
+        });
 
-  public setFreeTextStaticProperty(name: string, value: string) {
-    this.pipelineTemplateInvocation.staticProperties.forEach(property => {
-      if (property instanceof FreeTextStaticProperty && 'jsplumb_domId2' + name === property.internalName) {
-        property.value = value;
-      }
-    });
+        return this;
+    }
 
-    return this;
-  }
-
-  public setMappingPropertyUnary(name: string, value: string) {
-    this.pipelineTemplateInvocation.staticProperties.forEach(property => {
-      if (property instanceof MappingPropertyUnary && 'jsplumb_domId2' + name === property.internalName) {
-        property.selectedProperty = value;
-      }
-    });
-
-    return this;
-  }
-
-  public build() {
-    return this.pipelineTemplateInvocation;
-  }
+    public setMappingPropertyUnary(name: string, value: string) {
+        this.pipelineTemplateInvocation.staticProperties.forEach(property => {
+            if (
+                property instanceof MappingPropertyUnary &&
+                'jsplumb_domId2' + name === property.internalName
+            ) {
+                property.selectedProperty = value;
+            }
+        });
 
+        return this;
+    }
 
+    public build() {
+        return this.pipelineTemplateInvocation;
+    }
 }
-