This is an automated email from the ASF dual-hosted git repository. zehnder pushed a commit to branch STREAMPIPES-145 in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 79144ae1e9f420eeb94e24fcb5632f495e74dd63 Author: Philipp Zehnder <[email protected]> AuthorDate: Thu Jul 2 09:49:01 2020 +0200 [STREAMPIPES-145] Add integer as possible data type --- .../edit-event-property-primitive.component.ts | 10 +++--- .../app/connect/schema-editor/data-type.service.ts | 42 ++++++++++++---------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/ui/src/app/connect/dialog/edit-event-property-primitive/edit-event-property-primitive.component.ts b/ui/src/app/connect/dialog/edit-event-property-primitive/edit-event-property-primitive.component.ts index 3ba4fa5..3413491 100644 --- a/ui/src/app/connect/dialog/edit-event-property-primitive/edit-event-property-primitive.component.ts +++ b/ui/src/app/connect/dialog/edit-event-property-primitive/edit-event-property-primitive.component.ts @@ -27,7 +27,7 @@ import { DomainPropertyProbabilityList } from '../../schema-editor/model/DomainP templateUrl: './edit-event-property-primitive.component.html', styleUrls: ['./edit-event-property-primitive.component.css'] }) -export class EditEventPropertyPrimitiveComponent implements OnInit, DoCheck { +export class EditEventPropertyPrimitiveComponent implements OnInit { soTimestamp = 'http://schema.org/DateTime'; @@ -60,12 +60,12 @@ export class EditEventPropertyPrimitiveComponent implements OnInit, DoCheck { ngOnInit() { this.isTimestampProperty = this.cachedProperty.domainProperties.some(dp => dp === this.soTimestamp); - (this.cachedProperty as any).timestampTransformationMultiplier = 1000; + // (this.cachedProperty as any).timestampTransformationMultiplier = 1000; } - ngDoCheck() { - (this.cachedProperty as any).propertyNumber = this.index; - } + // ngDoCheck() { + // (this.cachedProperty as any).propertyNumber = this.index; + // } staticValueAddedByUser() { if (this.cachedProperty.elementId.startsWith('http://eventProperty.de/staticValue/')) { diff --git a/ui/src/app/connect/schema-editor/data-type.service.ts b/ui/src/app/connect/schema-editor/data-type.service.ts index 2c385a8..137a302 100644 --- a/ui/src/app/connect/schema-editor/data-type.service.ts +++ b/ui/src/app/connect/schema-editor/data-type.service.ts @@ -16,35 +16,38 @@ * */ -import {Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; @Injectable() export class DataTypesService { - private dataTypes: {label: String, url: String}[]= [ - { - label: 'String - A textual datatype, e.g., \'machine1\'', - url: 'http://www.w3.org/2001/XMLSchema#string'}, - { - label: 'Boolean - A true/false value', - url: 'http://www.w3.org/2001/XMLSchema#boolean'}, - { - label: 'Float - A number, e.g., \'1.25\'', - url: 'http://www.w3.org/2001/XMLSchema#float' - }]; + private dataTypes: Array<{label: string, url: string}> = [ + { + label: 'String - A textual datatype, e.g., \'machine1\'', + url: 'http://www.w3.org/2001/XMLSchema#string'}, + { + label: 'Boolean - A true/false value', + url: 'http://www.w3.org/2001/XMLSchema#boolean'}, + { + label: 'Float - A number, e.g., \'1.25\'', + url: 'http://www.w3.org/2001/XMLSchema#float' + }, { + label: 'Integer - A number, e.g., \'2\'', + url: 'http://www.w3.org/2001/XMLSchema#integer' + } + ]; constructor() {} - getLabel(url: String): String { - for (let i = 0; i < this.dataTypes.length; i++) { - if (this.dataTypes[i].url === url) { - return this.dataTypes[i].label; + getLabel(url: string): string { + for (const dataType of this.dataTypes) { + if (dataType.url === url) { + return dataType.label; } } - - return 'Unvalid data type'; + return 'Invalid data type'; } - getUrl(id: number): String { + getUrl(id: number): string { return this.dataTypes[id].url; } @@ -59,6 +62,7 @@ export class DataTypesService { getStringTypeUrl(): string { return String(this.dataTypes[0].url); } + getBooleanTypeUrl(): string { return String(this.dataTypes[1].url); }
