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/10 21:36:40 UTC
[streampipes] branch dev updated: [#877] Apply UI linting to connect module (#1057)
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 a16878619 [#877] Apply UI linting to connect module (#1057)
a16878619 is described below
commit a168786190952bd7f62f020fae2d2e90efb3bd14
Author: Aamir shaikh <56...@users.noreply.github.com>
AuthorDate: Wed Jan 11 03:06:35 2023 +0530
[#877] Apply UI linting to connect module (#1057)
* [#877] Apply UI linting to connect module
* Modify edit-event-property.components.ts and optimize imports
---
ui/.eslintignore | 3 +-
ui/.prettierignore | 3 +-
.../adapter-configuration-header.component.html | 31 +-
.../adapter-configuration-header.component.scss | 2 +-
.../adapter-configuration-header.component.ts | 35 +-
.../adapter-configuration.component.html | 79 +-
.../adapter-configuration.component.scss | 17 +-
.../adapter-configuration.component.ts | 237 +--
.../adapter-template-configuration.directive.ts | 130 +-
.../format-configuration.component.html | 56 +-
.../format-configuration.component.scss | 4 +-
.../format-configuration.component.ts | 183 +-
.../format-item-json.component.html | 15 +-
.../format-item-json.component.scss | 36 +-
.../format-item-json/format-item-json.component.ts | 21 +-
.../format-item/format-item.component.html | 20 +-
.../format-item/format-item.component.scss | 34 +-
.../format-item/format-item.component.ts | 63 +-
.../format-list/format-list.component.html | 38 +-
.../format-list/format-list.component.scss | 18 +-
.../format-list/format-list.component.ts | 24 +-
.../generic-adapter-configuration.component.html | 80 +-
.../generic-adapter-configuration.component.scss | 4 +-
.../generic-adapter-configuration.component.ts | 106 +-
.../error-message/error-message.component.html | 5 +-
.../error-message/error-message.component.scss | 4 +-
.../error-message/error-message.component.ts | 22 +-
.../event-property-row.component.html | 145 +-
.../event-property-row.component.scss | 82 +-
.../event-property-row.component.ts | 384 ++--
.../event-schema-error-hints.component.cy.ts | 96 +-
.../event-schema-error-hints.component.html | 82 +-
.../event-schema-error-hints.component.scss | 23 +-
.../event-schema-error-hints.component.ts | 23 +-
.../event-schema-preview.component.html | 28 +-
.../event-schema-preview.component.scss | 18 +-
.../event-schema-preview.component.ts | 62 +-
.../event-schema/event-schema.component.html | 151 +-
.../event-schema/event-schema.component.scss | 153 +-
.../event-schema/event-schema.component.ts | 5 +-
.../loading-message/loading-message.component.html | 10 +-
.../loading-message/loading-message.component.scss | 1 -
.../loading-message/loading-message.component.ts | 10 +-
.../schema-editor-header.component.html | 68 +-
.../schema-editor-header.component.ts | 62 +-
.../specific-adapter-configuration.component.html | 79 +-
.../specific-adapter-configuration.component.scss | 2 +-
.../specific-adapter-configuration.component.ts | 92 +-
.../adapter-options-panel.component.html | 16 +-
.../adapter-options-panel.component.scss | 32 +-
.../adapter-options-panel.component.ts | 30 +-
.../start-adapter-configuration.component.html | 175 +-
.../start-adapter-configuration.component.scss | 2 -
.../start-adapter-configuration.component.ts | 301 +--
.../abstract-adapter-details.directive.ts | 74 +-
.../adapter-details-logs.component.html | 41 +-
.../adapter-details-logs.component.ts | 73 +-
.../adapter-details-metrics.component.html | 44 +-
.../adapter-details-metrics.component.ts | 73 +-
.../adapter-details-overview.component.html | 15 +-
.../adapter-details-overview.component.ts | 56 +-
.../adapter-details/adapter-details-tabs.ts | 23 +-
.../configuration-group.component.html | 22 +-
.../configuration-group.component.scss | 1 -
.../configuration-group.component.ts | 31 +-
.../adapter-description.component.html | 57 +-
.../adapter-description.component.scss | 10 +-
.../adapter-description.component.ts | 135 +-
.../data-marketplace.component.html | 102 +-
.../data-marketplace.component.scss | 32 +-
.../data-marketplace/data-marketplace.component.ts | 112 +-
.../edit-adapter/edit-adapter.component.html | 12 +-
.../edit-adapter/edit-adapter.component.ts | 59 +-
.../existing-adapters.component.html | 602 ++++--
.../existing-adapters.component.scss | 33 +-
.../existing-adapters.component.ts | 135 +-
.../filter-toolbar/filter-toolbar.component.html | 36 +-
.../filter-toolbar/filter-toolbar.component.scss | 23 +-
.../filter-toolbar/filter-toolbar.component.ts | 66 +-
.../new-adapter/new-adapter.component.html | 10 +-
.../new-adapter/new-adapter.component.ts | 59 +-
.../pipeline-element-runtime-info.component.html | 50 +-
.../pipeline-element-runtime-info.component.scss | 8 +-
.../pipeline-element-runtime-info.component.ts | 156 +-
ui/src/app/connect/connect.routes.ts | 16 +-
.../adapter-started-dialog.component.html | 97 +-
.../adapter-started-dialog.component.scss | 8 +-
.../adapter-started-dialog.component.ts | 245 +--
.../adapter-template-dialog.component.html | 32 +-
.../adapter-template-dialog.component.ts | 76 +-
.../can-not-edit-adapter-dialog.component.cy.ts | 38 +-
.../can-not-edit-adapter-dialog.component.html | 34 +-
.../delete-adapter-dialog.component.html | 56 +-
.../delete-adapter-dialog.component.scss | 2 +-
.../delete-adapter-dialog.component.ts | 37 +-
.../edit-data-type/edit-data-type.component.html | 16 +-
.../edit-data-type/edit-data-type.component.ts | 28 +-
.../edit-schema-transformation.component.html | 95 +-
.../edit-schema-transformation.component.ts | 94 +-
.../edit-unit-transformation.component.html | 124 +-
.../edit-unit-transformation.component.scss | 16 +-
.../edit-unit-transformation.component.ts | 265 +--
.../edit-correction-value.component.html | 27 +-
.../edit-correction-value.component.scss | 2 +-
.../edit-correction-value.component.ts | 59 +-
.../edit-timestamp-property.component.html | 61 +-
.../edit-timestamp-property.component.scss | 5 +-
.../edit-timestamp-property.component.ts | 22 +-
.../edit-value-transformation.component.html | 58 +-
.../edit-value-transformation.component.ts | 48 +-
.../ep-settings-section.component.html | 16 +-
.../ep-settings-section.component.scss | 12 +-
.../ep-settings-section.component.ts | 25 +-
.../edit-event-property.component.html | 146 +-
.../edit-event-property.component.scss | 1 -
.../edit-event-property.component.ts | 354 ++--
ui/src/app/connect/filter/adapter-filter.pipe.ts | 119 +-
.../app/connect/filter/json-pretty-print.pipe.ts | 16 +-
ui/src/app/connect/filter/timestamp.pipe.ts | 14 +-
ui/src/app/connect/model/ConfigurationInfo.ts | 10 +-
.../model/TimestampTransformationRuleMode.ts | 3 -
.../connect/model/adapter-filter-settings.model.ts | 6 +-
.../connect/services/adapter-template.service.ts | 31 +-
ui/src/app/connect/services/connect.service.ts | 148 +-
ui/src/app/connect/services/data-type.service.ts | 115 +-
ui/src/app/connect/services/rest.service.ts | 135 +-
.../services/transformation-rule.service.spec.ts | 580 +++---
.../services/transformation-rule.service.ts | 1039 ++++++----
.../app/connect/services/unit-provider.service.ts | 2137 ++++++++++----------
ui/src/app/editor/dialog/help/help.component.html | 2 +-
130 files changed, 6750 insertions(+), 5272 deletions(-)
diff --git a/ui/.eslintignore b/ui/.eslintignore
index 39c15862d..8d6d9c6d7 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/connect
src/app/core
src/app/core-model
src/app/core-services
@@ -34,4 +33,4 @@ src/app/files
src/app/info
src/app/login
src/app/notifications
-src/app/NS
+src/app/NS
\ No newline at end of file
diff --git a/ui/.prettierignore b/ui/.prettierignore
index c857a8374..ddd9b92a4 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/connect
src/app/core
src/app/core-model
src/app/core-services
@@ -34,4 +33,4 @@ src/app/files
src/app/info
src/app/login
src/app/notifications
-src/app/NS
+src/app/NS
\ No newline at end of file
diff --git a/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.html b/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.html
index 05d4cb368..c02354698 100644
--- a/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.html
@@ -17,18 +17,23 @@
-->
<div fxLayout="column" fxFlex="100">
- <div fxLayout="row" fxLayoutAlign="start center">
- <mat-icon *ngIf="!isDataStreamDescription" class="historic">lens</mat-icon>
- <mat-icon *ngIf="isDataStreamDescription" class="real-time">lens
- </mat-icon>
- <div fxLayoutAlign="start center">
- <p *ngIf="!isDataStreamDescription">Data Set</p>
- <p *ngIf="isDataStreamDescription">Data Stream</p>
+ <div fxLayout="row" fxLayoutAlign="start center">
+ <mat-icon *ngIf="!isDataStreamDescription" class="historic"
+ >lens</mat-icon
+ >
+ <mat-icon *ngIf="isDataStreamDescription" class="real-time"
+ >lens
+ </mat-icon>
+ <div fxLayoutAlign="start center">
+ <p *ngIf="!isDataStreamDescription">Data Set</p>
+ <p *ngIf="isDataStreamDescription">Data Stream</p>
+ </div>
+ <span fxFlex></span>
</div>
- <span fxFlex></span>
- </div>
- <h1 *ngIf="!isEditMode"
- class="new-adapter-title">New Adapter: {{displayName}}</h1>
- <h1 *ngIf="isEditMode"
- class="new-adapter-title">Edit Adapter: {{displayName}}</h1>
+ <h1 *ngIf="!isEditMode" class="new-adapter-title">
+ New Adapter: {{ displayName }}
+ </h1>
+ <h1 *ngIf="isEditMode" class="new-adapter-title">
+ Edit Adapter: {{ displayName }}
+ </h1>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.scss b/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.scss
index f77f08615..178de8251 100644
--- a/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.scss
@@ -22,5 +22,5 @@
}
.real-time {
cursor: pointer;
- color: #FFEB3B;
+ color: #ffeb3b;
}
diff --git a/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.ts b/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.ts
index 7c186bc9f..990c4bbde 100644
--- a/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/adapter-configuration-header/adapter-configuration-header.component.ts
@@ -19,28 +19,25 @@
import { Component, Input } from '@angular/core';
@Component({
- selector: 'sp-adapter-configuration-header',
- templateUrl: './adapter-configuration-header.component.html',
- styleUrls: ['./adapter-configuration-header.component.scss']
+ selector: 'sp-adapter-configuration-header',
+ templateUrl: './adapter-configuration-header.component.html',
+ styleUrls: ['./adapter-configuration-header.component.scss'],
})
export class AdapterConfigurationHeaderComponent {
+ /**
+ * Used to display the type of the configured adapter
+ */
+ @Input() displayName = '';
- /**
- * Used to display the type of the configured adapter
- */
- @Input() displayName = '';
+ /**
+ * Indicates whether the adapter is a data set or data stream adapter
+ */
+ @Input() isDataStreamDescription = true;
- /**
- * Indicates whether the adapter is a data set or data stream adapter
- */
- @Input() isDataStreamDescription = true;
-
- /**
- * Use different title when in edit mode
- */
- @Input() isEditMode;
-
- constructor() {
- }
+ /**
+ * Use different title when in edit mode
+ */
+ @Input() isEditMode;
+ constructor() {}
}
diff --git a/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.html b/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.html
index 1d2217a8c..7def4d66e 100644
--- a/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.html
@@ -17,75 +17,86 @@
-->
<sp-basic-view [padding]="true" [showBackLink]="false">
-
<div nav fxFlex="100" fxLayout="row" fxLayoutAlign="end center">
<button mat-icon-button (click)="removeSelection()" matTooltip="Cancel">
<i class="material-icons">close</i>
</button>
</div>
<div fxLayout="column" fxLayoutAlign="center stretch" *ngIf="adapter">
+ <sp-adapter-configuration-header
+ [displayName]="displayName"
+ [isDataStreamDescription]="isDataStreamDescription"
+ [isEditMode]="isEditMode"
+ ></sp-adapter-configuration-header>
- <sp-adapter-configuration-header [displayName]="displayName"
- [isDataStreamDescription]="isDataStreamDescription"
- [isEditMode]="isEditMode"></sp-adapter-configuration-header>
-
- <mat-horizontal-stepper [linear]="true" #stepper color="accent" class="stepper">
+ <mat-horizontal-stepper
+ [linear]="true"
+ #stepper
+ color="accent"
+ class="stepper"
+ >
<mat-step *ngIf="!isGenericAdapter">
<ng-template matStepLabel>Settings</ng-template>
<sp-specific-adapter-configuration
- [adapterDescription]="adapter"
- (updateAdapterDescriptionEmitter)="adapter = $event"
- (clickNextEmitter)="clickSpecificSettingsNextButton()"
- (removeSelectionEmitter)="removeSelection()">
+ [adapterDescription]="adapter"
+ (updateAdapterDescriptionEmitter)="adapter = $event"
+ (clickNextEmitter)="clickSpecificSettingsNextButton()"
+ (removeSelectionEmitter)="removeSelection()"
+ >
</sp-specific-adapter-configuration>
</mat-step>
<mat-step *ngIf="isGenericAdapter">
<ng-template matStepLabel>Settings</ng-template>
<sp-generic-adapter-configuration
- [adapterDescription]="adapter"
- (updateAdapterDescriptionEmitter)="adapter = $event"
- (clickNextEmitter)="clickProtocolSettingsNextButton()"
- (removeSelectionEmitter)="removeSelection()">
+ [adapterDescription]="adapter"
+ (updateAdapterDescriptionEmitter)="adapter = $event"
+ (clickNextEmitter)="clickProtocolSettingsNextButton()"
+ (removeSelectionEmitter)="removeSelection()"
+ >
</sp-generic-adapter-configuration>
</mat-step>
<mat-step *ngIf="isGenericAdapter">
<ng-template matStepLabel>Select Format</ng-template>
<sp-format-configuration
- [adapterDescription]="adapter"
- (clickNextEmitter)="clickFormatSelectionNextButton()"
- (goBackEmitter)="goBack()"
- (removeSelectionEmitter)="removeSelection()">
+ [adapterDescription]="adapter"
+ (clickNextEmitter)="clickFormatSelectionNextButton()"
+ (goBackEmitter)="goBack()"
+ (removeSelectionEmitter)="removeSelection()"
+ >
</sp-format-configuration>
</mat-step>
<mat-step>
<ng-template matStepLabel>Configure fields</ng-template>
- <sp-event-schema #eschema fxLayout="column" fxFlex="100"
- [adapterDescription]="adapter"
- [(eventSchema)]="eventSchema"
- [(oldEventSchema)]="oldEventSchema"
- [isEditMode]="isEditMode"
- (clickNextEmitter)="clickEventSchemaNextButtonButton()"
- (goBackEmitter)="goBack()"
- (removeSelectionEmitter)="removeSelection()">
+ <sp-event-schema
+ #eschema
+ fxLayout="column"
+ fxFlex="100"
+ [adapterDescription]="adapter"
+ [(eventSchema)]="eventSchema"
+ [(oldEventSchema)]="oldEventSchema"
+ [isEditMode]="isEditMode"
+ (clickNextEmitter)="clickEventSchemaNextButtonButton()"
+ (goBackEmitter)="goBack()"
+ (removeSelectionEmitter)="removeSelection()"
+ >
</sp-event-schema>
</mat-step>
<mat-step>
<ng-template matStepLabel>Start Adapter</ng-template>
<sp-start-adapter-configuration
- [adapterDescription]="adapter"
- [eventSchema]="eventSchema"
- [isEditMode]="isEditMode"
- (removeSelectionEmitter)="removeSelection()"
- (goBackEmitter)="goBack()"
- (adapterStartedEmitter)="adapterWasStarted()">
+ [adapterDescription]="adapter"
+ [eventSchema]="eventSchema"
+ [isEditMode]="isEditMode"
+ (removeSelectionEmitter)="removeSelection()"
+ (goBackEmitter)="goBack()"
+ (adapterStartedEmitter)="adapterWasStarted()"
+ >
</sp-start-adapter-configuration>
</mat-step>
-
</mat-horizontal-stepper>
-
</div>
</sp-basic-view>
diff --git a/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.scss b/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.scss
index dd3608ea4..70b3b9dd7 100644
--- a/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.scss
@@ -16,14 +16,13 @@
*
*/
-
.new-adapter-title {
- margin-top:5px;
+ margin-top: 5px;
}
.configuration-box {
- width:100%;
- margin-bottom:10px;
+ width: 100%;
+ margin-bottom: 10px;
box-shadow: 1px 1px 2px #555;
border: 1px solid gray;
padding: 10px 10px 10px 60px;
@@ -31,17 +30,17 @@
}
.padding {
- padding:15px;
- margin-bottom:2%;
+ padding: 15px;
+ margin-bottom: 2%;
}
.stepper-button {
- margin-left:10px;
+ margin-left: 10px;
}
.disable-editing {
- pointer-events: none !important;
- opacity:0.5;
+ pointer-events: none !important;
+ opacity: 0.5;
}
.stepper {
diff --git a/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.ts b/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.ts
index 6f9c40e85..e3a8a5ab1 100644
--- a/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/adapter-configuration.component.ts
@@ -20,12 +20,12 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { MatStepper } from '@angular/material/stepper';
import {
- AdapterDescriptionUnion,
- EventSchema,
- GenericAdapterSetDescription,
- GenericAdapterStreamDescription,
- SpecificAdapterSetDescription,
- SpecificAdapterStreamDescription
+ AdapterDescriptionUnion,
+ EventSchema,
+ GenericAdapterSetDescription,
+ GenericAdapterStreamDescription,
+ SpecificAdapterSetDescription,
+ SpecificAdapterStreamDescription,
} from '@streampipes/platform-services';
import { ShepherdService } from '../../../services/tour/shepherd.service';
import { ConnectService } from '../../services/connect.service';
@@ -34,128 +34,137 @@ import { TransformationRuleService } from '../../services/transformation-rule.se
import { Router } from '@angular/router';
@Component({
- selector: 'sp-adapter-configuration',
- templateUrl: './adapter-configuration.component.html',
- styleUrls: ['./adapter-configuration.component.scss']
+ selector: 'sp-adapter-configuration',
+ templateUrl: './adapter-configuration.component.html',
+ styleUrls: ['./adapter-configuration.component.scss'],
})
export class AdapterConfigurationComponent implements OnInit {
+ /**
+ * Used to display the type of the configured adapter
+ */
+ @Input() displayName = '';
+ @Input() adapter: AdapterDescriptionUnion;
+ @Input() isEditMode;
+
+ /**
+ * Required to render the corresponding components
+ */
+ isDataStreamDescription = true;
+ isGenericAdapter = false;
+
+ myStepper: MatStepper;
+ parentForm: UntypedFormGroup;
+
+ eventSchema: EventSchema;
+ oldEventSchema: EventSchema;
+
+ private eventSchemaComponent: EventSchemaComponent;
+
+ constructor(
+ private transformationRuleService: TransformationRuleService,
+ private shepherdService: ShepherdService,
+ private connectService: ConnectService,
+ private _formBuilder: UntypedFormBuilder,
+ private router: Router,
+ ) {}
+
+ ngOnInit() {
+ this.parentForm = this._formBuilder.group({});
+
+ this.isDataStreamDescription =
+ this.connectService.isDataStreamDescription(this.adapter);
+ this.isGenericAdapter = this.connectService.isGenericDescription(
+ this.adapter,
+ );
+
+ this.eventSchema = this.connectService.getEventSchema(this.adapter);
+ }
+
+ removeSelection() {
+ this.router.navigate(['connect', 'create']).then();
+ }
- /**
- * Used to display the type of the configured adapter
- */
- @Input() displayName = '';
- @Input() adapter: AdapterDescriptionUnion;
- @Input() isEditMode;
-
- /**
- * Required to render the corresponding components
- */
- isDataStreamDescription = true;
- isGenericAdapter = false;
-
- myStepper: MatStepper;
- parentForm: UntypedFormGroup;
-
- eventSchema: EventSchema;
- oldEventSchema: EventSchema;
-
- private eventSchemaComponent: EventSchemaComponent;
-
- constructor(
- private transformationRuleService: TransformationRuleService,
- private shepherdService: ShepherdService,
- private connectService: ConnectService,
- private _formBuilder: UntypedFormBuilder,
- private router: Router,
- ) {
- }
-
- ngOnInit() {
- this.parentForm = this._formBuilder.group({});
-
- this.isDataStreamDescription = this.connectService.isDataStreamDescription(this.adapter);
- this.isGenericAdapter = this.connectService.isGenericDescription(this.adapter);
-
- this.eventSchema = this.connectService.getEventSchema(this.adapter);
-
- }
-
- removeSelection() {
- this.router.navigate(['connect', 'create']).then();
- }
-
- clickProtocolSettingsNextButton() {
- this.shepherdService.trigger('specific-settings-next-button');
- this.goForward();
- }
-
- clickSpecificSettingsNextButton() {
- this.shepherdService.trigger('specific-settings-next-button');
- this.guessEventSchema();
- this.goForward();
- }
-
- clickEventSchemaNextButtonButton() {
- this.setSchema();
-
- this.shepherdService.trigger('event-schema-next-button');
- this.goForward();
- }
-
- clickFormatSelectionNextButton() {
- this.shepherdService.trigger('format-selection-next-button');
- this.guessEventSchema();
- this.goForward();
- }
-
- guessEventSchema() {
- const eventSchema: EventSchema = this.connectService.getEventSchema(this.adapter);
- if (eventSchema.eventProperties.length === 0) {
- this.eventSchemaComponent.guessSchema();
- } else {
- this.oldEventSchema = eventSchema;
+ clickProtocolSettingsNextButton() {
+ this.shepherdService.trigger('specific-settings-next-button');
+ this.goForward();
}
+ clickSpecificSettingsNextButton() {
+ this.shepherdService.trigger('specific-settings-next-button');
+ this.guessEventSchema();
+ this.goForward();
+ }
- }
+ clickEventSchemaNextButtonButton() {
+ this.setSchema();
- public setSchema() {
+ this.shepherdService.trigger('event-schema-next-button');
+ this.goForward();
+ }
- if (this.adapter instanceof GenericAdapterSetDescription) {
- (this.adapter as GenericAdapterSetDescription).dataSet.eventSchema = this.eventSchema;
- } else if (this.adapter instanceof SpecificAdapterSetDescription) {
- (this.adapter as SpecificAdapterSetDescription).dataSet.eventSchema = this.eventSchema;
- } else if (this.adapter instanceof GenericAdapterStreamDescription) {
- (this.adapter as GenericAdapterStreamDescription).dataStream.eventSchema = this.eventSchema;
- } else if (this.adapter instanceof SpecificAdapterStreamDescription) {
- (this.adapter as SpecificAdapterStreamDescription).dataStream.eventSchema = this.eventSchema;
- } else {
- console.log('Error: Adapter type is unknown');
+ clickFormatSelectionNextButton() {
+ this.shepherdService.trigger('format-selection-next-button');
+ this.guessEventSchema();
+ this.goForward();
}
- this.transformationRuleService.setOldEventSchema(this.oldEventSchema);
+ guessEventSchema() {
+ const eventSchema: EventSchema = this.connectService.getEventSchema(
+ this.adapter,
+ );
+ if (eventSchema.eventProperties.length === 0) {
+ this.eventSchemaComponent.guessSchema();
+ } else {
+ this.oldEventSchema = eventSchema;
+ }
+ }
- this.transformationRuleService.setNewEventSchema(this.eventSchema);
- this.adapter.rules = this.transformationRuleService.getTransformationRuleDescriptions();
- }
+ public setSchema() {
+ if (this.adapter instanceof GenericAdapterSetDescription) {
+ (this.adapter as GenericAdapterSetDescription).dataSet.eventSchema =
+ this.eventSchema;
+ } else if (this.adapter instanceof SpecificAdapterSetDescription) {
+ (
+ this.adapter as SpecificAdapterSetDescription
+ ).dataSet.eventSchema = this.eventSchema;
+ } else if (this.adapter instanceof GenericAdapterStreamDescription) {
+ (
+ this.adapter as GenericAdapterStreamDescription
+ ).dataStream.eventSchema = this.eventSchema;
+ } else if (this.adapter instanceof SpecificAdapterStreamDescription) {
+ (
+ this.adapter as SpecificAdapterStreamDescription
+ ).dataStream.eventSchema = this.eventSchema;
+ } else {
+ console.log('Error: Adapter type is unknown');
+ }
+
+ this.transformationRuleService.setOldEventSchema(this.oldEventSchema);
+
+ this.transformationRuleService.setNewEventSchema(this.eventSchema);
+ this.adapter.rules =
+ this.transformationRuleService.getTransformationRuleDescriptions();
+ }
- goBack() {
- this.myStepper.selectedIndex = this.myStepper.selectedIndex - 1;
- }
+ goBack() {
+ this.myStepper.selectedIndex = this.myStepper.selectedIndex - 1;
+ }
- goForward() {
- this.myStepper.selectedIndex = this.myStepper.selectedIndex + 1;
- }
+ goForward() {
+ this.myStepper.selectedIndex = this.myStepper.selectedIndex + 1;
+ }
- public adapterWasStarted() {
- this.router.navigate(['connect']).then();
- }
+ public adapterWasStarted() {
+ this.router.navigate(['connect']).then();
+ }
- @ViewChild(EventSchemaComponent) set schemaComponent(eventSchemaComponent: EventSchemaComponent) {
- this.eventSchemaComponent = eventSchemaComponent;
- }
+ @ViewChild(EventSchemaComponent) set schemaComponent(
+ eventSchemaComponent: EventSchemaComponent,
+ ) {
+ this.eventSchemaComponent = eventSchemaComponent;
+ }
- @ViewChild('stepper') set stepperComponent(stepperComponent: MatStepper) {
- this.myStepper = stepperComponent;
- }
+ @ViewChild('stepper') set stepperComponent(stepperComponent: MatStepper) {
+ this.myStepper = stepperComponent;
+ }
}
diff --git a/ui/src/app/connect/components/adapter-configuration/directives/adapter-template-configuration.directive.ts b/ui/src/app/connect/components/adapter-configuration/directives/adapter-template-configuration.directive.ts
index fdb58f133..34109c542 100644
--- a/ui/src/app/connect/components/adapter-configuration/directives/adapter-template-configuration.directive.ts
+++ b/ui/src/app/connect/components/adapter-configuration/directives/adapter-template-configuration.directive.ts
@@ -18,77 +18,87 @@
import { Directive, EventEmitter, Input, Output } from '@angular/core';
import { MatStepper } from '@angular/material/stepper';
-import { AdapterDescriptionUnion, PipelineElementTemplate, PipelineElementTemplateService } from '@streampipes/platform-services';
+import {
+ AdapterDescriptionUnion,
+ PipelineElementTemplate,
+ PipelineElementTemplateService,
+} from '@streampipes/platform-services';
import { UntypedFormBuilder } from '@angular/forms';
import { AdapterTemplateService } from '../../../services/adapter-template.service';
import { DialogService } from '@streampipes/shared-ui';
@Directive()
export abstract class AdapterTemplateConfigurationDirective {
+ /**
+ * Adapter description the selected format is added to
+ */
+ @Input() adapterDescription: AdapterDescriptionUnion;
+
+ cachedAdapterDescription: AdapterDescriptionUnion;
+
+ /**
+ * Cancels the adapter configuration process
+ */
+ @Output() removeSelectionEmitter: EventEmitter<boolean> =
+ new EventEmitter();
+
+ /**
+ * Go to next configuration step when this is complete
+ */
+ @Output() clickNextEmitter: EventEmitter<MatStepper> = new EventEmitter();
+
+ @Output()
+ updateAdapterDescriptionEmitter: EventEmitter<AdapterDescriptionUnion> =
+ new EventEmitter<AdapterDescriptionUnion>();
+
+ availableTemplates: PipelineElementTemplate[];
+ selectedTemplate: any = false;
+
+ protected constructor(
+ protected _formBuilder: UntypedFormBuilder,
+ protected dialogService: DialogService,
+ protected pipelineElementTemplateService: PipelineElementTemplateService,
+ protected adapterTemplateService: AdapterTemplateService,
+ ) {}
+
+ onInit(): void {
+ this.loadPipelineElementTemplates();
+ }
- /**
- * Adapter description the selected format is added to
- */
- @Input() adapterDescription: AdapterDescriptionUnion;
-
- cachedAdapterDescription: AdapterDescriptionUnion;
-
- /**
- * Cancels the adapter configuration process
- */
- @Output() removeSelectionEmitter: EventEmitter<boolean> = new EventEmitter();
-
- /**
- * Go to next configuration step when this is complete
- */
- @Output() clickNextEmitter: EventEmitter<MatStepper> = new EventEmitter();
-
- @Output() updateAdapterDescriptionEmitter: EventEmitter<AdapterDescriptionUnion> = new EventEmitter<AdapterDescriptionUnion>();
-
- availableTemplates: PipelineElementTemplate[];
- selectedTemplate: any = false;
-
- protected constructor(protected _formBuilder: UntypedFormBuilder,
- protected dialogService: DialogService,
- protected pipelineElementTemplateService: PipelineElementTemplateService,
- protected adapterTemplateService: AdapterTemplateService) {
- }
-
- onInit(): void {
- this.loadPipelineElementTemplates();
- }
-
- public removeSelection() {
- this.removeSelectionEmitter.emit();
- }
-
- public clickNext() {
- this.clickNextEmitter.emit();
- }
+ public removeSelection() {
+ this.removeSelectionEmitter.emit();
+ }
- loadPipelineElementTemplates() {
- this.pipelineElementTemplateService
- .getPipelineElementTemplates(this.adapterDescription.appId)
- .subscribe(templates => {
- this.availableTemplates = templates;
- });
- }
+ public clickNext() {
+ this.clickNextEmitter.emit();
+ }
- loadTemplate(event: any) {
- if (!event.value) {
- this.adapterDescription = {...this.cachedAdapterDescription};
- this.selectedTemplate = false;
- } else {
- this.selectedTemplate = event.value;
- this.pipelineElementTemplateService.getConfiguredAdapterForTemplate(event.value._id, this.adapterDescription)
- .subscribe(adapterDescription => {
- this.afterTemplateReceived(adapterDescription);
- });
+ loadPipelineElementTemplates() {
+ this.pipelineElementTemplateService
+ .getPipelineElementTemplates(this.adapterDescription.appId)
+ .subscribe(templates => {
+ this.availableTemplates = templates;
+ });
}
- }
- abstract openTemplateDialog(): void;
+ loadTemplate(event: any) {
+ if (!event.value) {
+ this.adapterDescription = { ...this.cachedAdapterDescription };
+ this.selectedTemplate = false;
+ } else {
+ this.selectedTemplate = event.value;
+ this.pipelineElementTemplateService
+ .getConfiguredAdapterForTemplate(
+ event.value._id,
+ this.adapterDescription,
+ )
+ .subscribe(adapterDescription => {
+ this.afterTemplateReceived(adapterDescription);
+ });
+ }
+ }
- abstract afterTemplateReceived(adapterDescription: any);
+ abstract openTemplateDialog(): void;
+ abstract afterTemplateReceived(adapterDescription: any);
}
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.html b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.html
index 7a998c529..59481642b 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.html
@@ -18,25 +18,34 @@
<div fxFlex="100" fxLayout="column">
<sp-basic-inner-panel panelTitle="Select format" outerMargin="20px 0px">
- <sp-format-list fxFlex="100"
- (selectedFormatEmitter)="formatSelected($event)"
- [selectedFormat]="selectedFormat">
+ <sp-format-list
+ fxFlex="100"
+ (selectedFormatEmitter)="formatSelected($event)"
+ [selectedFormat]="selectedFormat"
+ >
</sp-format-list>
</sp-basic-inner-panel>
- <sp-basic-inner-panel panelTitle="Configure Format" outerMargin="10px 0px 20px 0px" *ngIf="selectedFormat">
-
+ <sp-basic-inner-panel
+ panelTitle="Configure Format"
+ outerMargin="10px 0px 20px 0px"
+ *ngIf="selectedFormat"
+ >
<div *ngIf="selectedFormat">
<div *ngIf="selectedFormat.config.length > 0">
<sp-configuration-group
- [configurationGroup]="formatForm"
- [adapterId]="adapterDescription.appId"
- [configuration]="selectedFormat.config">
+ [configurationGroup]="formatForm"
+ [adapterId]="adapterDescription.appId"
+ [configuration]="selectedFormat.config"
+ >
</sp-configuration-group>
</div>
- <div *ngIf="selectedFormat.config.length === 0" style="padding: 15px;">
- <div style="text-align:center;">
+ <div
+ *ngIf="selectedFormat.config.length === 0"
+ style="padding: 15px"
+ >
+ <div style="text-align: center">
<h5>(no further configuration needed)</h5>
</div>
</div>
@@ -44,14 +53,25 @@
</sp-basic-inner-panel>
<div fxLayoutAlign="end">
- <button class="mat-basic" mat-raised-button (click)="removeSelection()">Cancel</button>
- <button class="mat-basic stepper-button" mat-raised-button (click)="goBack()">Back</button>
- <button class="stepper-button"
- id="format-selection-next-button"
- data-cy="sp-format-selection-next-button"
- [disabled]="!formatConfigurationValid"
- (click)="clickNext()"
- color="accent" mat-raised-button>
+ <button class="mat-basic" mat-raised-button (click)="removeSelection()">
+ Cancel
+ </button>
+ <button
+ class="mat-basic stepper-button"
+ mat-raised-button
+ (click)="goBack()"
+ >
+ Back
+ </button>
+ <button
+ class="stepper-button"
+ id="format-selection-next-button"
+ data-cy="sp-format-selection-next-button"
+ [disabled]="!formatConfigurationValid"
+ (click)="clickNext()"
+ color="accent"
+ mat-raised-button
+ >
Next
</button>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.scss b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.scss
index 5050c24e9..c360c4aa9 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.scss
@@ -17,5 +17,5 @@
*/
.stepper-button {
- margin-left:10px;
-}
\ No newline at end of file
+ margin-left: 10px;
+}
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.ts b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.ts
index 2c4082032..5de192214 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-configuration.component.ts
@@ -18,105 +18,114 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import {
- AdapterDescriptionUnion,
- FormatDescription,
- GenericAdapterSetDescription,
- GenericAdapterStreamDescription
+ AdapterDescriptionUnion,
+ FormatDescription,
+ GenericAdapterSetDescription,
+ GenericAdapterStreamDescription,
} from '@streampipes/platform-services';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { RestService } from '../../../services/rest.service';
import { MatStepper } from '@angular/material/stepper';
@Component({
- selector: 'sp-format-configuration',
- templateUrl: './format-configuration.component.html',
- styleUrls: ['./format-configuration.component.scss']
+ selector: 'sp-format-configuration',
+ templateUrl: './format-configuration.component.html',
+ styleUrls: ['./format-configuration.component.scss'],
})
export class FormatConfigurationComponent implements OnInit {
-
- /**
- * Adapter description the selected format is added to
- */
- @Input() adapterDescription: AdapterDescriptionUnion;
-
- @Output() goBackEmitter: EventEmitter<MatStepper> = new EventEmitter();
-
- /**
- * Cancels the adapter configuration process
- */
- @Output() removeSelectionEmitter: EventEmitter<boolean> = new EventEmitter();
-
- /**
- * Go to next configuration step when this is complete
- */
- @Output() clickNextEmitter: EventEmitter<MatStepper> = new EventEmitter();
-
- formatConfigurationValid: boolean;
-
- /**
- * Local reference of the format description from the adapter description
- */
- selectedFormat: FormatDescription;
-
- /**
- * The form group to validate the configuration for the format
- */
- formatForm: UntypedFormGroup;
-
- constructor(
- private restService: RestService,
- private _formBuilder: UntypedFormBuilder) {
- }
-
- ngOnInit(): void {
-
- // initialize form for validation
- this.formatForm = this._formBuilder.group({});
- this.formatForm.statusChanges.subscribe((status) => {
- this.formatConfigurationValid = this.formatForm.valid;
- });
-
- // ensure that adapter description is a generic adapter
- if (this.adapterDescription instanceof GenericAdapterSetDescription ||
- this.adapterDescription instanceof GenericAdapterStreamDescription) {
- this.selectedFormat = this.adapterDescription.formatDescription;
- }
- if (this.adapterDescription instanceof GenericAdapterSetDescription) {
- if ((this.adapterDescription as GenericAdapterSetDescription).formatDescription !== undefined) {
- this.formatConfigurationValid = this.formatForm.valid;
- }
- }
- if (this.adapterDescription instanceof GenericAdapterStreamDescription) {
- if ((this.adapterDescription as GenericAdapterStreamDescription).formatDescription !== undefined) {
- this.formatConfigurationValid = this.formatForm.valid;
- }
+ /**
+ * Adapter description the selected format is added to
+ */
+ @Input() adapterDescription: AdapterDescriptionUnion;
+
+ @Output() goBackEmitter: EventEmitter<MatStepper> = new EventEmitter();
+
+ /**
+ * Cancels the adapter configuration process
+ */
+ @Output() removeSelectionEmitter: EventEmitter<boolean> =
+ new EventEmitter();
+
+ /**
+ * Go to next configuration step when this is complete
+ */
+ @Output() clickNextEmitter: EventEmitter<MatStepper> = new EventEmitter();
+
+ formatConfigurationValid: boolean;
+
+ /**
+ * Local reference of the format description from the adapter description
+ */
+ selectedFormat: FormatDescription;
+
+ /**
+ * The form group to validate the configuration for the format
+ */
+ formatForm: UntypedFormGroup;
+
+ constructor(
+ private restService: RestService,
+ private _formBuilder: UntypedFormBuilder,
+ ) {}
+
+ ngOnInit(): void {
+ // initialize form for validation
+ this.formatForm = this._formBuilder.group({});
+ this.formatForm.statusChanges.subscribe(status => {
+ this.formatConfigurationValid = this.formatForm.valid;
+ });
+
+ // ensure that adapter description is a generic adapter
+ if (
+ this.adapterDescription instanceof GenericAdapterSetDescription ||
+ this.adapterDescription instanceof GenericAdapterStreamDescription
+ ) {
+ this.selectedFormat = this.adapterDescription.formatDescription;
+ }
+ if (this.adapterDescription instanceof GenericAdapterSetDescription) {
+ if (
+ (this.adapterDescription as GenericAdapterSetDescription)
+ .formatDescription !== undefined
+ ) {
+ this.formatConfigurationValid = this.formatForm.valid;
+ }
+ }
+ if (
+ this.adapterDescription instanceof GenericAdapterStreamDescription
+ ) {
+ if (
+ (this.adapterDescription as GenericAdapterStreamDescription)
+ .formatDescription !== undefined
+ ) {
+ this.formatConfigurationValid = this.formatForm.valid;
+ }
+ }
+
+ this.formatConfigurationValid = false;
}
- this.formatConfigurationValid = false;
- }
-
- formatSelected(selectedFormat) {
- if (
- this.adapterDescription instanceof GenericAdapterSetDescription ||
- this.adapterDescription instanceof GenericAdapterStreamDescription
- ) {
- this.adapterDescription.formatDescription = selectedFormat;
- this.selectedFormat = selectedFormat;
- if (selectedFormat.config.length === 0) {
- this.formatConfigurationValid = this.formatForm.valid;
- }
+ formatSelected(selectedFormat) {
+ if (
+ this.adapterDescription instanceof GenericAdapterSetDescription ||
+ this.adapterDescription instanceof GenericAdapterStreamDescription
+ ) {
+ this.adapterDescription.formatDescription = selectedFormat;
+ this.selectedFormat = selectedFormat;
+ if (selectedFormat.config.length === 0) {
+ this.formatConfigurationValid = this.formatForm.valid;
+ }
+ }
}
- }
- public removeSelection() {
- this.removeSelectionEmitter.emit();
- }
+ public removeSelection() {
+ this.removeSelectionEmitter.emit();
+ }
- public clickNext() {
- this.clickNextEmitter.emit();
- }
+ public clickNext() {
+ this.clickNextEmitter.emit();
+ }
- public goBack() {
- this.goBackEmitter.emit();
- }
+ public goBack() {
+ this.goBackEmitter.emit();
+ }
}
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.html b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.html
index 5c36b30cb..3f0558ab6 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.html
@@ -16,12 +16,13 @@
~
-->
-<div fxFlex="100"
- fxLayout="column"
- matTooltip="Select one of the supported json formats"
- data-cy="connect-select-json-formats"
- class="format-box"
- [ngClass]="{selectedItem: isSelected}" >
+<div
+ fxFlex="100"
+ fxLayout="column"
+ matTooltip="Select one of the supported json formats"
+ data-cy="connect-select-json-formats"
+ class="format-box"
+ [ngClass]="{ selectedItem: isSelected }"
+>
<div class="format-label">Json</div>
</div>
-
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.scss b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.scss
index 2d626c461..adfd2c157 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.scss
@@ -16,33 +16,31 @@
*
*/
-
.format-label {
- line-height:50px;
- margin: auto;
- text-align: center;
- font-weight: bold;
- font-size: 1.3em;
+ line-height: 50px;
+ margin: auto;
+ text-align: center;
+ font-weight: bold;
+ font-size: 1.3em;
}
.format-box {
- min-height: 50px;
- box-shadow: 1px 1px 2px #555;
- border: 1px solid gray;
- cursor: pointer;
- padding: 10px;
- opacity: 0.7;
- margin: 10px;
- background: #ffffff;
+ min-height: 50px;
+ box-shadow: 1px 1px 2px #555;
+ border: 1px solid gray;
+ cursor: pointer;
+ padding: 10px;
+ opacity: 0.7;
+ margin: 10px;
+ background: #ffffff;
}
.format-box:hover {
- opacity: 1;
+ opacity: 1;
}
.selectedItem {
- opacity: 1;
- background-color: var(--color-accent);
- color: var(--color-bg-2);
+ opacity: 1;
+ background-color: var(--color-accent);
+ color: var(--color-bg-2);
}
-
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.ts b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.ts
index cfc24c5b6..abcb3e4f6 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item-json/format-item-json.component.ts
@@ -16,21 +16,16 @@
*
*/
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, Input } from '@angular/core';
@Component({
- selector: 'sp-format-item-json',
- templateUrl: './format-item-json.component.html',
- styleUrls: ['./format-item-json.component.scss']
+ selector: 'sp-format-item-json',
+ templateUrl: './format-item-json.component.html',
+ styleUrls: ['./format-item-json.component.scss'],
})
-export class FormatItemJsonComponent implements OnInit {
-
- @Input()
- isSelected: boolean;
-
- constructor() { }
-
- ngOnInit(): void {
- }
+export class FormatItemJsonComponent {
+ @Input()
+ isSelected: boolean;
+ constructor() {}
}
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.html b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.html
index db77998fb..8289013dc 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.html
@@ -16,13 +16,15 @@
~
-->
-<div fxFlex="100"
- fxLayout="column"
- matTooltip="{{format.description}}"
- [attr.data-cy]="format.name.split(' ').join('_').toLowerCase()"
- *ngIf="!$any(format).edit || !hasConfig"
- class="format-box"
- (click)="formatEditable()"
- [ngClass]="{selectedItem: isSelected()}" >
- <div class="format-label"> {{format.name}} </div>
+<div
+ fxFlex="100"
+ fxLayout="column"
+ matTooltip="{{ format.description }}"
+ [attr.data-cy]="format.name.split(' ').join('_').toLowerCase()"
+ *ngIf="!$any(format).edit || !hasConfig"
+ class="format-box"
+ (click)="formatEditable()"
+ [ngClass]="{ selectedItem: isSelected() }"
+>
+ <div class="format-label">{{ format.name }}</div>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.scss b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.scss
index 3aa1b93a4..adfd2c157 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.scss
@@ -17,30 +17,30 @@
*/
.format-label {
- line-height:50px;
- margin: auto;
- text-align: center;
- font-weight: bold;
- font-size: 1.3em;
+ line-height: 50px;
+ margin: auto;
+ text-align: center;
+ font-weight: bold;
+ font-size: 1.3em;
}
.format-box {
- min-height: 50px;
- box-shadow: 1px 1px 2px #555;
- border: 1px solid gray;
- cursor: pointer;
- padding: 10px;
- opacity: 0.7;
- margin: 10px;
- background: #ffffff;
+ min-height: 50px;
+ box-shadow: 1px 1px 2px #555;
+ border: 1px solid gray;
+ cursor: pointer;
+ padding: 10px;
+ opacity: 0.7;
+ margin: 10px;
+ background: #ffffff;
}
.format-box:hover {
- opacity: 1;
+ opacity: 1;
}
.selectedItem {
- opacity: 1;
- background-color: var(--color-accent);
- color: var(--color-bg-2);
+ opacity: 1;
+ background-color: var(--color-accent);
+ color: var(--color-bg-2);
}
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.ts b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.ts
index 77f2662a1..ac283d5ad 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-item/format-item.component.ts
@@ -21,41 +21,42 @@ import { ShepherdService } from '../../../../../services/tour/shepherd.service';
import { FormatDescription } from '@streampipes/platform-services';
@Component({
- selector: 'sp-format-item',
- templateUrl: './format-item.component.html',
- styleUrls: ['./format-item.component.scss'],
+ selector: 'sp-format-item',
+ templateUrl: './format-item.component.html',
+ styleUrls: ['./format-item.component.scss'],
})
export class FormatItemComponent {
- @Input()
- format: FormatDescription;
- @Input()
- selectedFormat: FormatDescription;
- @Output()
- validateEmitter = new EventEmitter();
- @Output()
- editableEmitter = new EventEmitter();
- @Output()
- selectedFormatEmitter = new EventEmitter();
-
- hasConfig: boolean;
-
- constructor(private shepherdService: ShepherdService) {
- this.hasConfig = true;
- }
-
- formatEditable() {
- this.selectedFormat = this.format;
- this.selectedFormatEmitter.emit(this.selectedFormat);
+ @Input()
+ format: FormatDescription;
+ @Input()
+ selectedFormat: FormatDescription;
+ @Output()
+ validateEmitter = new EventEmitter();
+ @Output()
+ editableEmitter = new EventEmitter();
+ @Output()
+ selectedFormatEmitter = new EventEmitter();
+
+ hasConfig: boolean;
+
+ constructor(private shepherdService: ShepherdService) {
+ this.hasConfig = true;
+ }
- this.shepherdService.trigger('select-' + this.selectedFormat.name.toLocaleLowerCase());
+ formatEditable() {
+ this.selectedFormat = this.format;
+ this.selectedFormatEmitter.emit(this.selectedFormat);
- }
+ this.shepherdService.trigger(
+ 'select-' + this.selectedFormat.name.toLocaleLowerCase(),
+ );
+ }
- isSelected(): boolean {
- if (!this.selectedFormat || !this.format) {
- return false;
- } else {
- return this.selectedFormat.name === this.format.name;
+ isSelected(): boolean {
+ if (!this.selectedFormat || !this.format) {
+ return false;
+ } else {
+ return this.selectedFormat.name === this.format.name;
+ }
}
- }
}
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.html b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.html
index 81eefc039..0cf18c2c0 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.html
@@ -17,33 +17,35 @@
-->
<div fxLayout="row wrap" fxLayoutAlign="start stretch">
-
<div fxFlex="25">
<sp-format-item-json
- [isSelected]="selectJsonFormats"
- (click)="selectJsonFormat()"></sp-format-item-json>
+ [isSelected]="selectJsonFormats"
+ (click)="selectJsonFormat()"
+ ></sp-format-item-json>
</div>
- <div fxFlex="25"
- *ngFor="let format of allFormats">
- <sp-format-item [format]="format" (validateEmitter)="validateAll($event)"
- (editableEmitter)="formatEditable($event)"
- [selectedFormat]="selectedFormat"
- (selectedFormatEmitter)="formatSelected($event)">
+ <div fxFlex="25" *ngFor="let format of allFormats">
+ <sp-format-item
+ [format]="format"
+ (validateEmitter)="validateAll($event)"
+ (editableEmitter)="formatEditable($event)"
+ [selectedFormat]="selectedFormat"
+ (selectedFormatEmitter)="formatSelected($event)"
+ >
</sp-format-item>
</div>
- <div fxFlex="100"
- class="format-title"
- *ngIf="selectJsonFormats">
+ <div fxFlex="100" class="format-title" *ngIf="selectJsonFormats">
<h4>Select JSON format</h4>
</div>
- <div fxFlex="25"
- *ngFor="let format of showJsonFormats">
- <sp-format-item [format]="format" (validateEmitter)="validateAll($event)"
- (editableEmitter)="formatEditable($event)"
- [selectedFormat]="selectedFormat"
- (selectedFormatEmitter)="formatSelected($event)">
+ <div fxFlex="25" *ngFor="let format of showJsonFormats">
+ <sp-format-item
+ [format]="format"
+ (validateEmitter)="validateAll($event)"
+ (editableEmitter)="formatEditable($event)"
+ [selectedFormat]="selectedFormat"
+ (selectedFormatEmitter)="formatSelected($event)"
+ >
</sp-format-item>
</div>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.scss b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.scss
index 61c683a5d..ed17d379e 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.scss
@@ -17,16 +17,16 @@
*/
.fullWidth {
- width: 100%;
- height: 100%;
+ width: 100%;
+ height: 100%;
}
.format-title {
- margin-top: 10px;
- margin-left: 5px;
- padding-left: 5px;
- border-left: 4px solid var(--color-accent);
- font-weight: 600;
- font-size: 13pt;
- white-space: nowrap;
+ margin-top: 10px;
+ margin-left: 5px;
+ padding-left: 5px;
+ border-left: 4px solid var(--color-accent);
+ font-weight: 600;
+ font-size: 13pt;
+ white-space: nowrap;
}
diff --git a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.ts b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.ts
index 65d18a4b7..997be28b5 100644
--- a/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/format-configuration/format-list/format-list.component.ts
@@ -23,15 +23,14 @@ import { RestService } from '../../../../services/rest.service';
@Component({
selector: 'sp-format-list',
templateUrl: './format-list.component.html',
- styleUrls: ['./format-list.component.scss']
- })
-
+ styleUrls: ['./format-list.component.scss'],
+})
export class FormatListComponent implements OnInit {
-
@Input() public selectedFormat: FormatDescription;
@Output() validateEmitter = new EventEmitter();
- @Output() public selectedFormatEmitter = new EventEmitter<FormatDescription>();
+ @Output() public selectedFormatEmitter =
+ new EventEmitter<FormatDescription>();
/**
* Contains all the available formats that a user can select from
@@ -61,15 +60,14 @@ export class FormatListComponent implements OnInit {
}
});
});
-
}
formatEditable(selectedFormat) {
- this.allFormats.forEach(format => {
- if (format !== selectedFormat) {
- (format as any).edit = false;
- }
- });
+ this.allFormats.forEach(format => {
+ if (format !== selectedFormat) {
+ (format as any).edit = false;
+ }
+ });
}
formatSelected(selectedFormat: FormatDescription) {
@@ -80,7 +78,6 @@ export class FormatListComponent implements OnInit {
this.selectedFormat = selectedFormat;
this.selectedFormatEmitter.emit(this.selectedFormat);
-
}
selectJsonFormat() {
@@ -89,10 +86,9 @@ export class FormatListComponent implements OnInit {
this.selectedFormat = this.allJsonFormats[2];
this.selectedFormatEmitter.emit(this.selectedFormat);
-
}
validateAll(allValid) {
- this.validateEmitter.emit(allValid);
+ this.validateEmitter.emit(allValid);
}
}
diff --git a/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.html b/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.html
index 9dd1a3d13..ef8caae73 100644
--- a/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.html
@@ -19,44 +19,82 @@
<div fxFlex="100" fxLayout="column">
<div fxFlex="100" fxLayout="column">
<div fxFlex="100" fxLayout="column">
- <sp-basic-inner-panel panelTitle="Protocol Settings" outerMargin="20px 0px">
- <div header fxFlex="100" fxLayout="row" fxLayoutAlign="end center" class="pr-5">
- <div fxFlex="100" fxLayout="row" fxLayoutAlign="end center"
- *ngIf="availableTemplates && availableTemplates.length > 0">
- <mat-form-field class="form-field" floatLabel="never" color="accent">
+ <sp-basic-inner-panel
+ panelTitle="Protocol Settings"
+ outerMargin="20px 0px"
+ >
+ <div
+ header
+ fxFlex="100"
+ fxLayout="row"
+ fxLayoutAlign="end center"
+ class="pr-5"
+ >
+ <div
+ fxFlex="100"
+ fxLayout="row"
+ fxLayoutAlign="end center"
+ *ngIf="
+ availableTemplates && availableTemplates.length > 0
+ "
+ >
+ <mat-form-field
+ class="form-field"
+ floatLabel="never"
+ color="accent"
+ >
<mat-label>Use template</mat-label>
- <mat-select (selectionChange)="loadTemplate($event)"
- [(value)]="selectedTemplate">
+ <mat-select
+ (selectionChange)="loadTemplate($event)"
+ [(value)]="selectedTemplate"
+ >
<mat-option>--</mat-option>
- <mat-option [value]="template" *ngFor="let template of availableTemplates">
- {{template.templateName}}
+ <mat-option
+ [value]="template"
+ *ngFor="let template of availableTemplates"
+ >
+ {{ template.templateName }}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<sp-configuration-group
- [configurationGroup]="genericAdapterForm"
- [adapterId]="adapterDescription.appId"
- [configuration]="protocolDescription.config">
+ [configurationGroup]="genericAdapterForm"
+ [adapterId]="adapterDescription.appId"
+ [configuration]="protocolDescription.config"
+ >
</sp-configuration-group>
</sp-basic-inner-panel>
</div>
</div>
<div fxLayoutAlign="end">
- <button class="mat-basic"
- mat-raised-button
- (click)="removeSelection()"
- style="margin-right: 10px;">Cancel
+ <button
+ class="mat-basic"
+ mat-raised-button
+ (click)="removeSelection()"
+ style="margin-right: 10px"
+ >
+ Cancel
</button>
- <button mat-button mat-raised-button
- class="mat-basic"
- (click)="openTemplateDialog()">Store config as template
+ <button
+ mat-button
+ mat-raised-button
+ class="mat-basic"
+ (click)="openTemplateDialog()"
+ >
+ Store config as template
</button>
<div id="generic-settings-next-button">
- <button class="stepper-button" [disabled]="!genericAdapterSettingsFormValid"
- (click)="clickNext()" color="accent" mat-raised-button>Next
+ <button
+ class="stepper-button"
+ [disabled]="!genericAdapterSettingsFormValid"
+ (click)="clickNext()"
+ color="accent"
+ mat-raised-button
+ >
+ Next
</button>
</div>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.scss b/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.scss
index 5050c24e9..c360c4aa9 100644
--- a/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.scss
@@ -17,5 +17,5 @@
*/
.stepper-button {
- margin-left:10px;
-}
\ No newline at end of file
+ margin-left: 10px;
+}
diff --git a/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.ts b/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.ts
index 9dc6222e7..cd26b04ae 100644
--- a/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/generic-adapter-configuration/generic-adapter-configuration.component.ts
@@ -18,10 +18,10 @@
import { Component, OnInit } from '@angular/core';
import {
- GenericAdapterSetDescription,
- GenericAdapterStreamDescription,
- ProtocolDescription,
- PipelineElementTemplateService
+ GenericAdapterSetDescription,
+ GenericAdapterStreamDescription,
+ ProtocolDescription,
+ PipelineElementTemplateService,
} from '@streampipes/platform-services';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { AdapterTemplateConfigurationDirective } from '../directives/adapter-template-configuration.directive';
@@ -29,54 +29,74 @@ import { AdapterTemplateService } from '../../../services/adapter-template.servi
import { DialogService } from '@streampipes/shared-ui';
@Component({
- selector: 'sp-generic-adapter-configuration',
- templateUrl: './generic-adapter-configuration.component.html',
- styleUrls: ['./generic-adapter-configuration.component.scss']
+ selector: 'sp-generic-adapter-configuration',
+ templateUrl: './generic-adapter-configuration.component.html',
+ styleUrls: ['./generic-adapter-configuration.component.scss'],
})
-export class GenericAdapterConfigurationComponent extends AdapterTemplateConfigurationDirective implements OnInit {
+export class GenericAdapterConfigurationComponent
+ extends AdapterTemplateConfigurationDirective
+ implements OnInit
+{
+ genericAdapterSettingsFormValid: boolean;
- genericAdapterSettingsFormValid: boolean;
+ genericAdapterForm: UntypedFormGroup;
- genericAdapterForm: UntypedFormGroup;
+ protocolDescription: ProtocolDescription;
- protocolDescription: ProtocolDescription;
-
- constructor(_formBuilder: UntypedFormBuilder,
- dialogService: DialogService,
- pipelineElementTemplateService: PipelineElementTemplateService,
- adapterTemplateService: AdapterTemplateService) {
- super(_formBuilder, dialogService, pipelineElementTemplateService, adapterTemplateService);
- }
-
- ngOnInit(): void {
- super.onInit();
- if (this.adapterDescription instanceof GenericAdapterSetDescription ||
- this.adapterDescription instanceof GenericAdapterStreamDescription) {
- this.protocolDescription = this.adapterDescription.protocolDescription;
+ constructor(
+ _formBuilder: UntypedFormBuilder,
+ dialogService: DialogService,
+ pipelineElementTemplateService: PipelineElementTemplateService,
+ adapterTemplateService: AdapterTemplateService,
+ ) {
+ super(
+ _formBuilder,
+ dialogService,
+ pipelineElementTemplateService,
+ adapterTemplateService,
+ );
}
- // initialize form for validation
- this.genericAdapterForm = this._formBuilder.group({});
- this.genericAdapterForm.statusChanges.subscribe((_) => {
- this.genericAdapterSettingsFormValid = this.genericAdapterForm.valid;
- });
- }
+ ngOnInit(): void {
+ super.onInit();
+ if (
+ this.adapterDescription instanceof GenericAdapterSetDescription ||
+ this.adapterDescription instanceof GenericAdapterStreamDescription
+ ) {
+ this.protocolDescription =
+ this.adapterDescription.protocolDescription;
+ }
- openTemplateDialog(): void {
- const dialogRef = this.adapterTemplateService.getDialog(this.protocolDescription.config, this.protocolDescription.appId);
+ // initialize form for validation
+ this.genericAdapterForm = this._formBuilder.group({});
+ this.genericAdapterForm.statusChanges.subscribe(_ => {
+ this.genericAdapterSettingsFormValid =
+ this.genericAdapterForm.valid;
+ });
+ }
- dialogRef.afterClosed().subscribe(_ => {
- this.loadPipelineElementTemplates();
- });
- }
+ openTemplateDialog(): void {
+ const dialogRef = this.adapterTemplateService.getDialog(
+ this.protocolDescription.config,
+ this.protocolDescription.appId,
+ );
- afterTemplateReceived(adapterDescription: any) {
- this.protocolDescription = ProtocolDescription.fromData(adapterDescription.protocolDescription);
- if (this.adapterDescription instanceof GenericAdapterSetDescription ||
- this.adapterDescription instanceof GenericAdapterStreamDescription) {
- this.adapterDescription.protocolDescription = this.protocolDescription;
- this.updateAdapterDescriptionEmitter.emit(this.adapterDescription);
+ dialogRef.afterClosed().subscribe(_ => {
+ this.loadPipelineElementTemplates();
+ });
}
- }
+ afterTemplateReceived(adapterDescription: any) {
+ this.protocolDescription = ProtocolDescription.fromData(
+ adapterDescription.protocolDescription,
+ );
+ if (
+ this.adapterDescription instanceof GenericAdapterSetDescription ||
+ this.adapterDescription instanceof GenericAdapterStreamDescription
+ ) {
+ this.adapterDescription.protocolDescription =
+ this.protocolDescription;
+ this.updateAdapterDescriptionEmitter.emit(this.adapterDescription);
+ }
+ }
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.html b/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.html
index ecfdf152a..254695234 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.html
@@ -18,7 +18,10 @@
<div fxLayout="column" fxFlex="100">
<div fxLayout="row" fxLayoutAlign="center center" fxFlex="100">
- <div fxLayoutAlign="start center" class="error-text"> There was an error while guessing the schema of your configured data source:</div>
+ <div fxLayoutAlign="start center" class="error-text">
+ There was an error while guessing the schema of your
+ configured data source:
+ </div>
</div>
<div fxLayout="row" fxLayoutAlign="center center" class="mt-10">
<sp-exception-message [message]="errorMessage"></sp-exception-message>
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.scss b/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.scss
index 8eec370bd..8a0f012b1 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.scss
@@ -17,9 +17,9 @@
*/
.error-color {
- color: #963e3e;
+ color: #963e3e;
}
.error-text {
- font-size: 12pt;
+ font-size: 12pt;
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.ts
index b6dc01d70..4ef638d05 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/error-message/error-message.component.ts
@@ -16,24 +16,18 @@
*
*/
-import { Component, Input, OnInit } from '@angular/core';
-import { Notification } from '@streampipes/platform-services';
+import { Component, Input } from '@angular/core';
import { StreamPipesErrorMessage } from '../../../../../../../projects/streampipes/platform-services/src/lib/model/gen/streampipes-model';
@Component({
- selector: 'sp-error-message',
- templateUrl: './error-message.component.html',
- styleUrls: ['./error-message.component.scss']
+ selector: 'sp-error-message',
+ templateUrl: './error-message.component.html',
+ styleUrls: ['./error-message.component.scss'],
})
-export class ErrorMessageComponent implements OnInit {
+export class ErrorMessageComponent {
+ @Input() errorMessage: StreamPipesErrorMessage;
- @Input() errorMessage: StreamPipesErrorMessage;
-
- showErrorMessage = false;
-
- constructor() { }
-
- ngOnInit(): void {
- }
+ showErrorMessage = false;
+ constructor() {}
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.html b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.html
index cf07a44ba..64579a124 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.html
@@ -19,77 +19,142 @@
<div fxLayout="row" fxFlex="100" fxLayoutGap="10px">
<div fxLayout="row" fxLayoutAlign="start center">
<div>
- <b style="white-space: nowrap">
- {{ label }}
- </b>
+ <b style="white-space: nowrap">
+ {{ label }}
+ </b>
</div>
- <div fxLayoutAlign="start center" *ngIf="originalRuntimeName" class="ml-5">
- <span class="runtime-info">{{originalRuntimeName}}</span>
- <span fxLayoutAlign="center center"
- *ngIf="originalRuntimeName !== node.data.runtimeName">
+ <div
+ fxLayoutAlign="start center"
+ *ngIf="originalRuntimeName"
+ class="ml-5"
+ >
+ <span class="runtime-info">{{ originalRuntimeName }}</span>
+ <span
+ fxLayoutAlign="center center"
+ *ngIf="originalRuntimeName !== node.data.runtimeName"
+ >
<i class="material-icons">arrow_right</i>
</span>
- <span class="runtime-info"
- *ngIf="originalRuntimeName !== node.data.runtimeName">{{node.data.runtimeName}}
+ <span
+ class="runtime-info"
+ *ngIf="originalRuntimeName !== node.data.runtimeName"
+ >{{ node.data.runtimeName }}
</span>
</div>
- <p style="margin: 0px 10px 10px;" *ngIf="isList">[List]</p>
+ <p style="margin: 0px 10px 10px" *ngIf="isList">[List]</p>
</div>
- <div fxLayout="row" fxLayoutAlign="end center" fxFlex="100" fxLayoutGap="20px">
- <div class="timestamp-property" *ngIf="timestampProperty" fxLayoutAlign="end center" fxLayout="row">
- <mat-icon *ngIf="timestampProperty" class="timestamp-icon" fxLayout="row" fxLayoutAlign="start center">
+ <div
+ fxLayout="row"
+ fxLayoutAlign="end center"
+ fxFlex="100"
+ fxLayoutGap="20px"
+ >
+ <div
+ class="timestamp-property"
+ *ngIf="timestampProperty"
+ fxLayoutAlign="end center"
+ fxLayout="row"
+ >
+ <mat-icon
+ *ngIf="timestampProperty"
+ class="timestamp-icon"
+ fxLayout="row"
+ fxLayoutAlign="start center"
+ >
access_time
</mat-icon>
- <span style="margin-left: -5px;">marked as timestamp</span>
+ <span style="margin-left: -5px">marked as timestamp</span>
</div>
<div fxLayoutAlign="end center" class="runtime-type-info-outer">
- <div fxLayout="row" fxLayoutAlign="start center" fxFlex="100" *ngIf="runtimeType" >
- <span class="runtime-info runtime-type-info">{{originalRuntimeType}}</span>
- <span fxLayoutAlign="center center" *ngIf="originalRuntimeType !== runtimeType"><i class="material-icons">arrow_right</i></span>
- <span class="runtime-info runtime-type-info" *ngIf="originalRuntimeType !== runtimeType">{{runtimeType}}</span>
+ <div
+ fxLayout="row"
+ fxLayoutAlign="start center"
+ fxFlex="100"
+ *ngIf="runtimeType"
+ >
+ <span class="runtime-info runtime-type-info">{{
+ originalRuntimeType
+ }}</span>
+ <span
+ fxLayoutAlign="center center"
+ *ngIf="originalRuntimeType !== runtimeType"
+ ><i class="material-icons">arrow_right</i></span
+ >
+ <span
+ class="runtime-info runtime-type-info"
+ *ngIf="originalRuntimeType !== runtimeType"
+ >{{ runtimeType }}</span
+ >
</div>
</div>
<div fxLayoutAlign="end center" class="status-outer">
- <span *ngIf="showFieldStatus"
- [ngClass]="'status status-' +fieldStatusInfo[originalRuntimeName].fieldStatus.toLowerCase()"
- [matTooltip]="fieldStatusInfo[originalRuntimeName].additionalInfo">{{fieldStatusInfo[originalRuntimeName].fieldStatus}}</span>
+ <span
+ *ngIf="showFieldStatus"
+ [ngClass]="
+ 'status status-' +
+ fieldStatusInfo[
+ originalRuntimeName
+ ].fieldStatus.toLowerCase()
+ "
+ [matTooltip]="
+ fieldStatusInfo[originalRuntimeName].additionalInfo
+ "
+ >{{ fieldStatusInfo[originalRuntimeName].fieldStatus }}</span
+ >
</div>
<div *ngIf="isPrimitive" fxLayoutAlign="end center">
<mat-form-field class="small-select" color="accent">
- <mat-select [(ngModel)]="node.data.propertyScope" panelClass="small-select"
- [attr.data-cy]="'property-scope-' + label">
- <mat-option value="MEASUREMENT_PROPERTY">Measurement</mat-option>
- <mat-option value="DIMENSION_PROPERTY">Dimension</mat-option>
+ <mat-select
+ [(ngModel)]="node.data.propertyScope"
+ panelClass="small-select"
+ [attr.data-cy]="'property-scope-' + label"
+ >
+ <mat-option value="MEASUREMENT_PROPERTY"
+ >Measurement</mat-option
+ >
+ <mat-option value="DIMENSION_PROPERTY"
+ >Dimension</mat-option
+ >
<mat-option value="HEADER_PROPERTY">Header</mat-option>
</mat-select>
</mat-form-field>
</div>
- <div fxLayoutAlign="end center"
- *ngIf="isNested">
- <button [disabled]="!isEditable" color="accent" mat-button (click)=addNestedProperty(node.data)>
+ <div fxLayoutAlign="end center" *ngIf="isNested">
+ <button
+ [disabled]="!isEditable"
+ color="accent"
+ mat-button
+ (click)="addNestedProperty(node.data)"
+ >
<mat-icon matTooltip="Add a Nested Property">queue</mat-icon>
</button>
</div>
<div
- fxLayoutAlign="end center"
- class="ml-5 mr-5"
- *ngIf="isNested || isPrimitive || isList">
- <button [disabled]="!isEditable" color="accent" mat-button
- (click)="openEditDialog(node.data)"
- [attr.data-cy]="'edit-' + label.toLowerCase()">
+ fxLayoutAlign="end center"
+ class="ml-5 mr-5"
+ *ngIf="isNested || isPrimitive || isList"
+ >
+ <button
+ [disabled]="!isEditable"
+ color="accent"
+ mat-button
+ (click)="openEditDialog(node.data)"
+ [attr.data-cy]="'edit-' + label.toLowerCase()"
+ >
<mat-icon>edit</mat-icon> Edit field
</button>
</div>
<div fxLayoutAlign="end center">
<mat-checkbox
- *ngIf="isNested || isPrimitive || isList"
- (click)="selectProperty(node.data.id, undefined)"
- [disabled]="!isEditable"
- [class.checkbox-selected]="node.data.selected"
- [checked]="node.data.selected"
- [attr.data-cy]="'delete-property-' + label.toLowerCase()">
+ *ngIf="isNested || isPrimitive || isList"
+ (click)="selectProperty(node.data.id, undefined)"
+ [disabled]="!isEditable"
+ [class.checkbox-selected]="node.data.selected"
+ [checked]="node.data.selected"
+ [attr.data-cy]="'delete-property-' + label.toLowerCase()"
+ >
</mat-checkbox>
</div>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.scss b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.scss
index ec2466197..60d1eb5f3 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.scss
@@ -16,77 +16,77 @@
*
*/
-
-::ng-deep .mat-checkbox-checked.mat-accent .mat-checkbox-background, .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background {
- background-color: var(--color-accent) !important;
+::ng-deep .mat-checkbox-checked.mat-accent .mat-checkbox-background,
+.mat-checkbox-indeterminate.mat-accent .mat-checkbox-background {
+ background-color: var(--color-accent) !important;
}
-::ng-deep .mat-checkbox:not(.mat-checkbox-disabled).mat-accent .mat-checkbox-ripple .mat-ripple-element {
- background-color: var(--color-accent) !important;
+::ng-deep
+ .mat-checkbox:not(.mat-checkbox-disabled).mat-accent
+ .mat-checkbox-ripple
+ .mat-ripple-element {
+ background-color: var(--color-accent) !important;
}
.checkbox-selected {
- opacity: 1 !important;
+ opacity: 1 !important;
}
.timestamp-property {
- margin-left: 15px;
- border-radius: 10px;
- background: var(--color-processor);
- padding: 0px 10px;
- font-size: 12px;
- color: #FFFFFF;
+ margin-left: 15px;
+ border-radius: 10px;
+ background: var(--color-processor);
+ padding: 0px 10px;
+ font-size: 12px;
+ color: #ffffff;
}
.timestamp-icon {
- font-size: 12px;
+ font-size: 12px;
}
.status-good {
- background: #75c575;
- color: white;
+ background: #75c575;
+ color: white;
}
.status-bad {
- background: #d2a169;
- color: white;
+ background: #d2a169;
+ color: white;
}
.status {
- width: 70px;
- min-width: 70px;
- text-align: center;
- padding: 5px;
- border-radius: 5px;
+ width: 70px;
+ min-width: 70px;
+ text-align: center;
+ padding: 5px;
+ border-radius: 5px;
}
.status-outer {
- width: 70px;
- min-width: 70px;
+ width: 70px;
+ min-width: 70px;
}
.runtime-info {
- border-radius: 5px;
- color: var(--color-default-text);
- font-size: 10pt;
- text-align: center;
+ border-radius: 5px;
+ color: var(--color-default-text);
+ font-size: 10pt;
+ text-align: center;
}
.runtime-type-info {
- border-radius: 5px;
- color: var(--color-default-text);
- font-size: 10pt;
- width: 70px;
- border: 1px solid var(--color-bg-3);
- text-align: center;
+ border-radius: 5px;
+ color: var(--color-default-text);
+ font-size: 10pt;
+ width: 70px;
+ border: 1px solid var(--color-bg-3);
+ text-align: center;
}
.runtime-type-info-outer {
- padding: 3px;
- border-radius: 5px;
- width: 170px;
- text-align: center;
-
+ padding: 3px;
+ border-radius: 5px;
+ width: 170px;
+ text-align: center;
}
-
-
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.ts
index cd561af21..04f37751f 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.ts
@@ -16,205 +16,237 @@
*
*/
-import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
+import {
+ Component,
+ EventEmitter,
+ Input,
+ OnChanges,
+ OnInit,
+ Output,
+ SimpleChanges,
+} from '@angular/core';
import { UUID } from 'angular2-uuid';
import { TreeNode } from '@circlon/angular-tree-component';
import { MatDialog } from '@angular/material/dialog';
import {
- EventProperty,
- EventPropertyList,
- EventPropertyNested,
- EventPropertyPrimitive,
- EventPropertyUnion,
- EventSchema,
- FieldStatusInfo,
- GuessTypeInfo
-
+ EventProperty,
+ EventPropertyList,
+ EventPropertyNested,
+ EventPropertyPrimitive,
+ EventPropertyUnion,
+ EventSchema,
+ FieldStatusInfo,
+ GuessTypeInfo,
} from '@streampipes/platform-services';
import { EditEventPropertyComponent } from '../../../../dialog/edit-event-property/edit-event-property.component';
import { DialogService, PanelType } from '@streampipes/shared-ui';
@Component({
- selector: 'event-property-row',
- templateUrl: './event-property-row.component.html',
- styleUrls: ['./event-property-row.component.scss']
+ selector: 'sp-event-property-row',
+ templateUrl: './event-property-row.component.html',
+ styleUrls: ['./event-property-row.component.scss'],
})
export class EventPropertyRowComponent implements OnInit {
+ @Input() node: TreeNode;
+ @Input() isEditable = true;
+ @Input() eventSchema: EventSchema = new EventSchema();
+ @Input() originalEventSchema: EventSchema;
+ @Input() countSelected: number;
+ @Input() eventPreview: Record<string, GuessTypeInfo>[];
+ @Input() fieldStatusInfo: Record<string, FieldStatusInfo>;
+
+ @Output() isEditableChange = new EventEmitter<boolean>();
+ @Output() eventSchemaChange = new EventEmitter<EventSchema>();
+ @Output() originalEventSchemaChange = new EventEmitter<EventSchema>();
+ @Output() refreshTreeEmitter = new EventEmitter<boolean>();
+ @Output() countSelectedChange = new EventEmitter<number>();
+
+ label: string;
+ isPrimitive = false;
+ isNested = false;
+ isList = false;
+ timestampProperty = false;
+ showEventPreview = false;
+ showFieldStatus = false;
+
+ runtimeType: string;
+ originalRuntimeType: string;
+ originalRuntimeName: string;
+
+ constructor(
+ private dialog: MatDialog,
+ private dialogService: DialogService,
+ ) {}
+
+ ngOnInit() {
+ this.label = this.getLabel(this.node.data);
+ this.isPrimitive = this.isEventPropertyPrimitive(this.node.data);
+ this.isList = this.isEventPropertyList(this.node.data);
+ this.isNested = this.isEventPropertyNested(this.node.data);
+ this.timestampProperty = this.isTimestampProperty(this.node.data);
+
+ if (this.node.data instanceof EventProperty) {
+ this.originalRuntimeName = this.findOriginalProperty().runtimeName;
+ this.showFieldStatus =
+ this.fieldStatusInfo &&
+ this.fieldStatusInfo[this.originalRuntimeName] !== undefined;
+ this.showEventPreview =
+ this.eventPreview &&
+ this.eventPreview.length > 0 &&
+ this.eventPreview[0][this.originalRuntimeName] !== undefined;
+ if (this.isPrimitive) {
+ this.originalRuntimeType = this.parseType(
+ this.findOriginalProperty().runtimeType,
+ );
+ this.runtimeType = this.parseType(
+ (this.node.data as EventPropertyPrimitive).runtimeType,
+ );
+ }
+ }
- @Input() node: TreeNode;
- @Input() isEditable = true;
- @Input() eventSchema: EventSchema = new EventSchema();
- @Input() originalEventSchema: EventSchema;
- @Input() countSelected: number;
- @Input() eventPreview: Record<string, GuessTypeInfo>[];
- @Input() fieldStatusInfo: Record<string, FieldStatusInfo>;
-
- @Output() isEditableChange = new EventEmitter<boolean>();
- @Output() eventSchemaChange = new EventEmitter<EventSchema>();
- @Output() originalEventSchemaChange = new EventEmitter<EventSchema>();
- @Output() refreshTreeEmitter = new EventEmitter<boolean>();
- @Output() countSelectedChange = new EventEmitter<number>();
-
- label: string;
- isPrimitive = false;
- isNested = false;
- isList = false;
- timestampProperty = false;
- showEventPreview = false;
- showFieldStatus = false;
-
- runtimeType: string;
- originalRuntimeType: string;
- originalRuntimeName: string;
-
- constructor(private dialog: MatDialog,
- private dialogService: DialogService) {
-
- }
-
- ngOnInit() {
- this.label = this.getLabel(this.node.data);
- this.isPrimitive = this.isEventPropertyPrimitive(this.node.data);
- this.isList = this.isEventPropertyList(this.node.data);
- this.isNested = this.isEventPropertyNested(this.node.data);
- this.timestampProperty = this.isTimestampProperty(this.node.data);
-
- if (this.node.data instanceof EventProperty) {
- this.originalRuntimeName = this.findOriginalProperty().runtimeName;
- this.showFieldStatus = this.fieldStatusInfo && this.fieldStatusInfo[this.originalRuntimeName] !== undefined;
- this.showEventPreview = this.eventPreview && this.eventPreview.length > 0 && this.eventPreview[0][this.originalRuntimeName] !== undefined;
- if (this.isPrimitive) {
- this.originalRuntimeType = this.parseType(this.findOriginalProperty().runtimeType);
- this.runtimeType = this.parseType((this.node.data as EventPropertyPrimitive).runtimeType);
- }
+ if (!this.node.data.propertyScope) {
+ this.node.data.propertyScope = 'MEASUREMENT_PROPERTY';
+ }
}
- if (!this.node.data.propertyScope) {
- this.node.data.propertyScope = 'MEASUREMENT_PROPERTY';
+ private findOriginalProperty(): any {
+ return this.originalEventSchema.eventProperties.find(
+ ep => ep.elementId === this.node.data.elementId,
+ );
}
- }
-
- private findOriginalProperty(): any {
- return this.originalEventSchema.eventProperties
- .find(ep => ep.elementId === this.node.data.elementId);
- }
-
- private parseType(runtimeType: string) {
- return runtimeType.split('#')[1].toUpperCase();
- }
-
- private isEventPropertyPrimitive(instance: EventProperty): boolean {
- return instance instanceof EventPropertyPrimitive;
- }
-
- private isEventPropertyNested(instance: EventProperty): boolean {
- return instance instanceof EventPropertyNested;
- }
-
- private isEventPropertyList(instance: EventProperty): boolean {
- return instance instanceof EventPropertyList;
- }
-
- public getLabel(eventProperty: EventProperty) {
- if (eventProperty.label && eventProperty.label !== '') {
- return eventProperty.label;
- } else if (eventProperty.runtimeName !== undefined && eventProperty.runtimeName !== '') {
- return eventProperty.runtimeName;
+
+ private parseType(runtimeType: string) {
+ return runtimeType.split('#')[1].toUpperCase();
}
- if (this.isEventPropertyNested(eventProperty)) {
- return 'Nested Property';
+
+ private isEventPropertyPrimitive(instance: EventProperty): boolean {
+ return instance instanceof EventPropertyPrimitive;
}
- if (eventProperty instanceof EventSchema) {
- return '';
+
+ private isEventPropertyNested(instance: EventProperty): boolean {
+ return instance instanceof EventPropertyNested;
}
- return 'Property';
- }
-
- isTimestampProperty(node) {
- if (node.domainProperties && node.domainProperties.some(dp => dp === 'http://schema.org/DateTime')) {
- node.runtimeType = 'http://www.w3.org/2001/XMLSchema#long';
- return true;
- } else {
- return false;
+
+ private isEventPropertyList(instance: EventProperty): boolean {
+ return instance instanceof EventPropertyList;
}
- }
-
- public openEditDialog(data): void {
- const dialogRef = this.dialogService.open(EditEventPropertyComponent, {
- panelType: PanelType.SLIDE_IN_PANEL,
- title: 'Edit field ' + data.runtimeName,
- width: '50vw',
- data: {
- 'property': data,
- 'isEditable': this.isEditable
- }
- });
-
- dialogRef.afterClosed().subscribe(refresh => {
- this.timestampProperty = this.isTimestampProperty(this.node.data);
- this.refreshTreeEmitter.emit(true);
- });
- }
-
- public selectProperty(id: string, eventProperties: any): void {
- if (!this.isEditable) {
- return;
+
+ public getLabel(eventProperty: EventProperty) {
+ if (eventProperty.label && eventProperty.label !== '') {
+ return eventProperty.label;
+ } else if (
+ eventProperty.runtimeName !== undefined &&
+ eventProperty.runtimeName !== ''
+ ) {
+ return eventProperty.runtimeName;
+ }
+ if (this.isEventPropertyNested(eventProperty)) {
+ return 'Nested Property';
+ }
+ if (eventProperty instanceof EventSchema) {
+ return '';
+ }
+ return 'Property';
}
- eventProperties = eventProperties || this.eventSchema.eventProperties;
- for (const eventProperty of eventProperties) {
- if (eventProperty.eventProperties && eventProperty.eventProperties.length > 0) {
- if (eventProperty.id === id) {
- if (eventProperty.selected) {
- eventProperty.selected = undefined;
- this.countSelected--;
- this.selectProperty('none', eventProperty.eventProperties);
- } else {
- eventProperty.selected = true;
- this.countSelected++;
- this.selectProperty('all', eventProperty.eventProperties);
- }
- } else if (id === 'all') {
- eventProperty.selected = true;
- this.countSelected++;
- this.selectProperty('all', eventProperty.eventProperties);
- } else if (id === 'none') {
- eventProperty.selected = undefined;
- this.countSelected--;
- this.selectProperty('none', eventProperty.eventProperties);
+
+ isTimestampProperty(node) {
+ if (
+ node.domainProperties &&
+ node.domainProperties.some(
+ dp => dp === 'http://schema.org/DateTime',
+ )
+ ) {
+ node.runtimeType = 'http://www.w3.org/2001/XMLSchema#long';
+ return true;
} else {
- this.selectProperty(id, eventProperty.eventProperties);
+ return false;
+ }
+ }
+
+ public openEditDialog(data): void {
+ const dialogRef = this.dialogService.open(EditEventPropertyComponent, {
+ panelType: PanelType.SLIDE_IN_PANEL,
+ title: 'Edit field ' + data.runtimeName,
+ width: '50vw',
+ data: {
+ property: data,
+ isEditable: this.isEditable,
+ },
+ });
+
+ dialogRef.afterClosed().subscribe(refresh => {
+ this.timestampProperty = this.isTimestampProperty(this.node.data);
+ this.refreshTreeEmitter.emit(true);
+ });
+ }
+
+ public selectProperty(id: string, eventProperties: any): void {
+ if (!this.isEditable) {
+ return;
}
- } else {
- if (eventProperty.id === id) {
- if (eventProperty.selected) {
- eventProperty.selected = undefined;
- this.countSelected--;
- } else {
- eventProperty.selected = true;
- this.countSelected++;
-
- }
- } else if (id === 'all') {
- eventProperty.selected = true;
- this.countSelected++;
- } else if (id === 'none') {
- eventProperty.selected = undefined;
- this.countSelected--;
+ eventProperties = eventProperties || this.eventSchema.eventProperties;
+ for (const eventProperty of eventProperties) {
+ if (
+ eventProperty.eventProperties &&
+ eventProperty.eventProperties.length > 0
+ ) {
+ if (eventProperty.id === id) {
+ if (eventProperty.selected) {
+ eventProperty.selected = undefined;
+ this.countSelected--;
+ this.selectProperty(
+ 'none',
+ eventProperty.eventProperties,
+ );
+ } else {
+ eventProperty.selected = true;
+ this.countSelected++;
+ this.selectProperty(
+ 'all',
+ eventProperty.eventProperties,
+ );
+ }
+ } else if (id === 'all') {
+ eventProperty.selected = true;
+ this.countSelected++;
+ this.selectProperty('all', eventProperty.eventProperties);
+ } else if (id === 'none') {
+ eventProperty.selected = undefined;
+ this.countSelected--;
+ this.selectProperty('none', eventProperty.eventProperties);
+ } else {
+ this.selectProperty(id, eventProperty.eventProperties);
+ }
+ } else {
+ if (eventProperty.id === id) {
+ if (eventProperty.selected) {
+ eventProperty.selected = undefined;
+ this.countSelected--;
+ } else {
+ eventProperty.selected = true;
+ this.countSelected++;
+ }
+ } else if (id === 'all') {
+ eventProperty.selected = true;
+ this.countSelected++;
+ } else if (id === 'none') {
+ eventProperty.selected = undefined;
+ this.countSelected--;
+ }
+ }
}
- }
+ this.countSelectedChange.emit(this.countSelected);
+ this.refreshTreeEmitter.emit(false);
}
- this.countSelectedChange.emit(this.countSelected);
- this.refreshTreeEmitter.emit(false);
- }
-
- public addNestedProperty(eventProperty: EventPropertyNested): void {
- const uuid: string = UUID.UUID();
- if (!eventProperty.eventProperties) {
- eventProperty.eventProperties = new Array<EventPropertyUnion>();
+
+ public addNestedProperty(eventProperty: EventPropertyNested): void {
+ const uuid: string = UUID.UUID();
+ if (!eventProperty.eventProperties) {
+ eventProperty.eventProperties = new Array<EventPropertyUnion>();
+ }
+ const property: EventPropertyNested = new EventPropertyNested();
+ property.elementId = uuid;
+ eventProperty.eventProperties.push(property);
+ this.refreshTreeEmitter.emit(false);
}
- const property: EventPropertyNested = new EventPropertyNested();
- property.elementId = uuid;
- eventProperty.eventProperties.push(property);
- this.refreshTreeEmitter.emit(false);
- }
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.cy.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.cy.ts
index 4251117e7..43544df78 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.cy.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.cy.ts
@@ -20,78 +20,86 @@ import { EventSchemaErrorHintsComponent } from './event-schema-error-hints.compo
import { UserErrorMessage } from '../../../../../core-model/base/UserErrorMessage';
describe('EventSchemaErrorHints', () => {
-
- it('schema ok', () => {
- mount(`<sp-event-schema-error-hints
+ it('schema ok', () => {
+ mount(`<sp-event-schema-error-hints
[isError]="false"
[isLoading]="false"
[schemaErrorHints]=[]>
</sp-event-schema-error-hints>`);
- cy.dataCy('schema-validation-ok').should('be.visible');
- cy.get('.schema-validation-text-ok').contains('Schema ok');
- cy.get('.material-icons').contains('check_circle');
- });
+ cy.dataCy('schema-validation-ok').should('be.visible');
+ cy.get('.schema-validation-text-ok').contains('Schema ok');
+ cy.get('.material-icons').contains('check_circle');
+ });
- it('loading is true', () => {
- mount(`<sp-event-schema-error-hints
+ it('loading is true', () => {
+ mount(`<sp-event-schema-error-hints
[isError]="false"
[isLoading]="true"
[schemaErrorHints]=[]>
</sp-event-schema-error-hints>`);
- cy.dataCy('schema-validation-ok').should('not.exist');
- cy.dataCy('schema-validation-error').should('not.exist');
- });
+ cy.dataCy('schema-validation-ok').should('not.exist');
+ cy.dataCy('schema-validation-error').should('not.exist');
+ });
- it('error is true', () => {
- mount(`<sp-event-schema-error-hints
+ it('error is true', () => {
+ mount(`<sp-event-schema-error-hints
[isError]="true"
[isLoading]="false"
[schemaErrorHints]=[]>
</sp-event-schema-error-hints>`);
- cy.dataCy('schema-validation-ok').should('not.exist');
- cy.dataCy('schema-validation-error').should('not.exist');
- });
-
- const sampleHint = new UserErrorMessage('sample error', 'This is a test error');
+ cy.dataCy('schema-validation-ok').should('not.exist');
+ cy.dataCy('schema-validation-error').should('not.exist');
+ });
- it('display one error', () => {
+ const sampleHint = new UserErrorMessage(
+ 'sample error',
+ 'This is a test error',
+ );
- mount(`<sp-event-schema-error-hints
+ it('display one error', () => {
+ mount(
+ `<sp-event-schema-error-hints
[isError]="false"
[isLoading]="false"
[schemaErrorHints]="schemaErrorHints">
</sp-event-schema-error-hints>`,
- {'schemaErrorHints': [sampleHint]});
-
- cy.dataCy('schema-validation-ok').should('not.exist');
- cy.dataCy('schema-validation-error').should('be.visible').should('have.length', 1);
- cy.get('.schema-validation-text-error').contains(sampleHint.title);
- cy.dataCy('schema-validation-error-content').contains(sampleHint.content);
- cy.get('.material-icons').contains('warning');
- });
-
- it('display multiple errors', () => {
+ { schemaErrorHints: [sampleHint] },
+ );
+
+ cy.dataCy('schema-validation-ok').should('not.exist');
+ cy.dataCy('schema-validation-error')
+ .should('be.visible')
+ .should('have.length', 1);
+ cy.get('.schema-validation-text-error').contains(sampleHint.title);
+ cy.dataCy('schema-validation-error-content').contains(
+ sampleHint.content,
+ );
+ cy.get('.material-icons').contains('warning');
+ });
- mount(`<sp-event-schema-error-hints
+ it('display multiple errors', () => {
+ mount(
+ `<sp-event-schema-error-hints
[isError]="false"
[isLoading]="false"
[schemaErrorHints]="schemaErrorHints">
</sp-event-schema-error-hints>`,
- {'schemaErrorHints': [sampleHint, sampleHint, sampleHint]});
-
- cy.dataCy('schema-validation-ok').should('not.exist');
- cy.dataCy('schema-validation-error').should('be.visible').should('have.length', 3);
- });
+ { schemaErrorHints: [sampleHint, sampleHint, sampleHint] },
+ );
-
- const mount = (template: string, cp?) => {
- cy.mount(template, {
- declarations: [EventSchemaErrorHintsComponent],
- componentProperties: cp
+ cy.dataCy('schema-validation-ok').should('not.exist');
+ cy.dataCy('schema-validation-error')
+ .should('be.visible')
+ .should('have.length', 3);
});
- };
-});
+ const mount = (template: string, cp?) => {
+ cy.mount(template, {
+ declarations: [EventSchemaErrorHintsComponent],
+ componentProperties: cp,
+ });
+ };
+});
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.html b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.html
index 16d54b903..24d022c7b 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.html
@@ -16,38 +16,56 @@
~
-->
<div>
- <div fxLayout="column"
- fxFlex="100"
- fxLayoutAlign="start center"
- data-cy="schema-validation-ok"
- *ngIf="!isLoading && !isError && schemaErrorHints.length === 0"
- class="schema-validation schema-validation-ok">
- <div fxFlex="100"
- fxLayout="row"
- fxLayoutAlign="start center"
- class="schema-validation-text-ok">
- <i class="material-icons">check_circle</i> <b>Schema ok</b>
+ <div
+ fxLayout="column"
+ fxFlex="100"
+ fxLayoutAlign="start center"
+ data-cy="schema-validation-ok"
+ *ngIf="!isLoading && !isError && schemaErrorHints.length === 0"
+ class="schema-validation schema-validation-ok"
+ >
+ <div
+ fxFlex="100"
+ fxLayout="row"
+ fxLayoutAlign="start center"
+ class="schema-validation-text-ok"
+ >
+ <i class="material-icons">check_circle</i> <b>Schema ok</b>
+ </div>
</div>
- </div>
- <div fxLayout="column"
- fxFlex="100"
- *ngIf="!isLoading && !isError && schemaErrorHints.length > 0">
- <div fxFlex="100"
- fxLayout="column"
- [ngClass]="schemaErrorHint.level === 'error' ? 'schema-validation schema-validation-error' : 'schema-validation schema-validation-warning'"
- fxLayoutAlign="start center"
- data-cy="schema-validation-error"
- *ngFor="let schemaErrorHint of schemaErrorHints">
- <div fxFlex="100"
- fxLayout="row"
- fxLayoutAlign="center start"
- [ngClass]="schemaErrorHint.level === 'error' ? 'schema-validation-text-error' : 'schema-validation-text-warning'">
- <i class="material-icons">warning</i>
- <b>{{schemaErrorHint.title}}</b>
- </div>
- <div data-cy="schema-validation-error-content">
- <span>{{schemaErrorHint.content}}</span>
- </div>
+ <div
+ fxLayout="column"
+ fxFlex="100"
+ *ngIf="!isLoading && !isError && schemaErrorHints.length > 0"
+ >
+ <div
+ fxFlex="100"
+ fxLayout="column"
+ [ngClass]="
+ schemaErrorHint.level === 'error'
+ ? 'schema-validation schema-validation-error'
+ : 'schema-validation schema-validation-warning'
+ "
+ fxLayoutAlign="start center"
+ data-cy="schema-validation-error"
+ *ngFor="let schemaErrorHint of schemaErrorHints"
+ >
+ <div
+ fxFlex="100"
+ fxLayout="row"
+ fxLayoutAlign="center start"
+ [ngClass]="
+ schemaErrorHint.level === 'error'
+ ? 'schema-validation-text-error'
+ : 'schema-validation-text-warning'
+ "
+ >
+ <i class="material-icons">warning</i>
+ <b>{{ schemaErrorHint.title }}</b>
+ </div>
+ <div data-cy="schema-validation-error-content">
+ <span>{{ schemaErrorHint.content }}</span>
+ </div>
+ </div>
</div>
- </div>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.scss b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.scss
index ec5781c63..10632de87 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.scss
@@ -17,34 +17,33 @@
*/
.schema-validation {
- margin-bottom: 10px;
- border: 2px solid var(--color-bg-3);
- padding: 10px;
- min-height: 50px;
- text-align: center;
+ margin-bottom: 10px;
+ border: 2px solid var(--color-bg-3);
+ padding: 10px;
+ min-height: 50px;
+ text-align: center;
}
.schema-validation-ok {
- border: 2px solid #629f62;
+ border: 2px solid #629f62;
}
.schema-validation-error {
- border: 2px solid #963e3e;
+ border: 2px solid #963e3e;
}
.schema-validation-warning {
- border: 2px solid #d09836;
+ border: 2px solid #d09836;
}
.schema-validation-text-ok {
- color: #629f62;
+ color: #629f62;
}
.schema-validation-text-error {
- color: #963e3e;
+ color: #963e3e;
}
.schema-validation-text-warning {
- color: #d09836;
+ color: #d09836;
}
-
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.ts
index 8b61fe59f..add86c52c 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-error-hints/event-schema-error-hints.component.ts
@@ -16,25 +16,20 @@
*
*/
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, Input } from '@angular/core';
import { UserErrorMessage } from '../../../../../core-model/base/UserErrorMessage';
@Component({
- selector: 'sp-event-schema-error-hints',
- templateUrl: './event-schema-error-hints.component.html',
- styleUrls: ['./event-schema-error-hints.component.scss']
+ selector: 'sp-event-schema-error-hints',
+ templateUrl: './event-schema-error-hints.component.html',
+ styleUrls: ['./event-schema-error-hints.component.scss'],
})
-export class EventSchemaErrorHintsComponent implements OnInit {
+export class EventSchemaErrorHintsComponent {
+ @Input() schemaErrorHints: UserErrorMessage[];
- @Input() schemaErrorHints: UserErrorMessage[];
+ @Input() isLoading: boolean;
- @Input() isLoading: boolean;
-
- @Input() isError: boolean;
-
- constructor() { }
-
- ngOnInit(): void {
- }
+ @Input() isError: boolean;
+ constructor() {}
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.html b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.html
index d3cad53f6..a55ad96ce 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.html
@@ -19,23 +19,35 @@
<div fxFlex="100" fxLayout="row" fxLayoutGap="15px">
<div fxFlex="50" fxLayout="column">
<sp-basic-inner-panel [showTitle]="true" panelTitle="Original (Parsed)">
- <pre [innerHTML]="originalField | jsonpretty" class="preview-text"></pre>
+ <pre
+ [innerHTML]="originalField | jsonpretty"
+ class="preview-text"
+ ></pre>
</sp-basic-inner-panel>
</div>
<div fxFlex="50" fxLayout="column">
- <sp-basic-inner-panel [showTitle]="true" panelTitle="Result" fxFlex="100">
+ <sp-basic-inner-panel
+ [showTitle]="true"
+ panelTitle="Result"
+ fxFlex="100"
+ >
<div header fxLayoutAlign="end center" fxFlex="100">
- <button color="accent"
- mat-button
- data-cy="connect-schema-update-preview-btn"
- matTooltip="Update event preview"
- (click)="updateEventPreview()">
+ <button
+ color="accent"
+ mat-button
+ data-cy="connect-schema-update-preview-btn"
+ matTooltip="Update event preview"
+ (click)="updateEventPreview()"
+ >
<mat-icon>refresh</mat-icon>
<span> Update result preview</span>
</button>
</div>
- <pre [innerHTML]="desiredField | jsonpretty" class="preview-text"></pre>
+ <pre
+ [innerHTML]="desiredField | jsonpretty"
+ class="preview-text"
+ ></pre>
</sp-basic-inner-panel>
</div>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.scss b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.scss
index eddad5e07..96d8d2c82 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.scss
@@ -17,13 +17,13 @@
*/
.preview-text {
- background-color: black;
- font: 9pt Inconsolata, monospace;
- text-shadow: 0 0 5px #C8C8C8;
- color: white;
- padding: 10px;
- max-width: 100%;
- max-height: 300px;
- overflow-y: scroll;
- white-space: pre-wrap;
+ background-color: black;
+ font: 9pt Inconsolata, monospace;
+ text-shadow: 0 0 5px #c8c8c8;
+ color: white;
+ padding: 10px;
+ max-width: 100%;
+ max-height: 300px;
+ overflow-y: scroll;
+ white-space: pre-wrap;
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.ts
index d7dc13cc1..0cab6c67c 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.ts
@@ -20,47 +20,45 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { EventSchema, GuessTypeInfo } from '@streampipes/platform-services';
@Component({
- selector: 'sp-event-schema-preview',
- templateUrl: './event-schema-preview.component.html',
- styleUrls: ['./event-schema-preview.component.scss']
+ selector: 'sp-event-schema-preview',
+ templateUrl: './event-schema-preview.component.html',
+ styleUrls: ['./event-schema-preview.component.scss'],
})
export class EventSchemaPreviewComponent implements OnInit {
+ @Input() originalEventSchema: EventSchema;
+ @Input() desiredEventSchema: EventSchema;
- @Input() originalEventSchema: EventSchema;
- @Input() desiredEventSchema: EventSchema;
+ @Input() originalPreview: Record<string, GuessTypeInfo>;
+ @Input() desiredPreview: Record<string, GuessTypeInfo>;
- @Input() originalPreview: Record<string, GuessTypeInfo>;
- @Input() desiredPreview: Record<string, GuessTypeInfo>;
+ @Output() updatePreviewEmitter = new EventEmitter();
- @Output() updatePreviewEmitter = new EventEmitter();
+ originalField: Record<string, any>;
+ desiredField: Record<string, any>;
- originalField: Record<string, any>;
- desiredField: Record<string, any>;
-
- ngOnInit(): void {
- this.originalField = this.toSimpleMap(this.originalPreview);
- this.desiredField = this.toSimpleMap(this.desiredPreview);
- }
+ ngOnInit(): void {
+ this.originalField = this.toSimpleMap(this.originalPreview);
+ this.desiredField = this.toSimpleMap(this.desiredPreview);
+ }
- toSimpleMap(event: Record<string, GuessTypeInfo>): Record<string, any> {
- let result: Record<string, any> = {};
+ toSimpleMap(event: Record<string, GuessTypeInfo>): Record<string, any> {
+ let result: Record<string, any> = {};
- for (const key in event) {
- result[key] = event[key].value;
- }
+ for (const key in event) {
+ result[key] = event[key].value;
+ }
- result = Object.keys(result).sort().reduce(
- (obj, key) => {
- obj[key] = result[key];
- return obj;
- },
- {}
- );
+ result = Object.keys(result)
+ .sort()
+ .reduce((obj, key) => {
+ obj[key] = result[key];
+ return obj;
+ }, {});
- return result;
- }
+ return result;
+ }
- public updateEventPreview() {
- this.updatePreviewEmitter.emit();
- }
+ public updateEventPreview() {
+ this.updatePreviewEmitter.emit();
+ }
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.html b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.html
index 456847635..cbf963125 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.html
@@ -16,92 +16,131 @@
~
-->
-
<div fxLayout="column" fxLayoutAlign="center" class="mt-20">
<div fxFlex="90" fxLayout="column">
-
- <sp-event-schema-error-hints [schemaErrorHints]="schemaErrorHints"
- [isError]="isError"
- [isLoading]="isLoading">
+ <sp-event-schema-error-hints
+ [schemaErrorHints]="schemaErrorHints"
+ [isError]="isError"
+ [isLoading]="isLoading"
+ >
</sp-event-schema-error-hints>
- <sp-basic-inner-panel [showTitle]="false" outerMargin="0px 0px 20px 0px">
+ <sp-basic-inner-panel
+ [showTitle]="false"
+ outerMargin="0px 0px 20px 0px"
+ >
<div header *ngIf="!isLoading && !isError" fxFlex="100">
- <sp-schema-editor-header fxFlex="100"
- [countSelected]="countSelected"
- (addNestedPropertyEmitter)="addNestedProperty()"
- (addStaticValuePropertyEmitter)="addStaticValueProperty()"
- (addTimestampPropertyEmitter)="addTimestampProperty()"
- (guessSchemaEmitter)="guessSchema()"
- (updatePreviewEmitter)="updatePreview()"
- (removeSelectedPropertiesEmitter)="removeSelectedProperties()">
+ <sp-schema-editor-header
+ fxFlex="100"
+ [countSelected]="countSelected"
+ (addNestedPropertyEmitter)="addNestedProperty()"
+ (addStaticValuePropertyEmitter)="addStaticValueProperty()"
+ (addTimestampPropertyEmitter)="addTimestampProperty()"
+ (guessSchemaEmitter)="guessSchema()"
+ (updatePreviewEmitter)="updatePreview()"
+ (removeSelectedPropertiesEmitter)="
+ removeSelectedProperties()
+ "
+ >
</sp-schema-editor-header>
</div>
<div header *ngIf="!isLoading && isError" fxFlex="100">
<div fxLayout="row" fxLayoutAlign="end center">
- <button color="accent"
- mat-button
- mat-icon-button
- matTooltip="Refresh Schema"
- (click)="guessSchema()">
+ <button
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Refresh Schema"
+ (click)="guessSchema()"
+ >
<mat-icon>refresh</mat-icon>
</button>
</div>
</div>
<div fxFlex="100">
-
<sp-loading-message *ngIf="isLoading"></sp-loading-message>
<sp-error-message
- [errorMessage]="errorMessage"
- *ngIf="isError && !isLoading">
+ [errorMessage]="errorMessage"
+ *ngIf="isError && !isLoading"
+ >
</sp-error-message>
- <div *ngIf="!isError && !isLoading && eventSchema && oldEventSchema && nodes"
- fxLayout="column"
- fxLayoutAlign="space-evenly stretched"
- class="drag-drop-tree"
- data-cy="sp-connect-schema-editor">
- <tree-root #tree
- [nodes]="nodes"
- [options]="options"
- (updateData)="onUpdateData(tree)">
- <ng-template #treeNodeTemplate let-node let-index="index">
- <event-property-row
- [node]="node"
- [(isEditable)]="isEditable"
- [(eventSchema)]="eventSchema"
- [(originalEventSchema)]="oldEventSchema"
- [eventPreview]="eventPreview"
- [fieldStatusInfo]="fieldStatusInfo"
- (refreshTreeEmitter)="refreshTree($event)"
- [(countSelected)]="countSelected"></event-property-row>
+ <div
+ *ngIf="
+ !isError &&
+ !isLoading &&
+ eventSchema &&
+ oldEventSchema &&
+ nodes
+ "
+ fxLayout="column"
+ fxLayoutAlign="space-evenly stretched"
+ class="drag-drop-tree"
+ data-cy="sp-connect-schema-editor"
+ >
+ <tree-root
+ #tree
+ [nodes]="nodes"
+ [options]="options"
+ (updateData)="onUpdateData(tree)"
+ >
+ <ng-template
+ #treeNodeTemplate
+ let-node
+ let-index="index"
+ >
+ <sp-event-property-row
+ [node]="node"
+ [(isEditable)]="isEditable"
+ [(eventSchema)]="eventSchema"
+ [(originalEventSchema)]="oldEventSchema"
+ [eventPreview]="eventPreview"
+ [fieldStatusInfo]="fieldStatusInfo"
+ (refreshTreeEmitter)="refreshTree($event)"
+ [(countSelected)]="countSelected"
+ ></sp-event-property-row>
</ng-template>
</tree-root>
</div>
</div>
</sp-basic-inner-panel>
</div>
- <div fxFlex="100" *ngIf="desiredPreview && isPreviewEnabled && !isLoading && !isError">
- <sp-event-schema-preview [originalEventSchema]="oldEventSchema"
- [desiredEventSchema]="eventSchema"
- [originalPreview]="eventPreview[0]"
- [desiredPreview]="desiredPreview"
- (updatePreviewEmitter)="updatePreview()"></sp-event-schema-preview>
+ <div
+ fxFlex="100"
+ *ngIf="desiredPreview && isPreviewEnabled && !isLoading && !isError"
+ >
+ <sp-event-schema-preview
+ [originalEventSchema]="oldEventSchema"
+ [desiredEventSchema]="eventSchema"
+ [originalPreview]="eventPreview[0]"
+ [desiredPreview]="desiredPreview"
+ (updatePreviewEmitter)="updatePreview()"
+ ></sp-event-schema-preview>
</div>
</div>
-
<div fxLayoutAlign="end" class="mt-10">
- <button class="mat-basic" mat-raised-button (click)="removeSelection()">Cancel</button>
- <button class="mat-basic stepper-button" mat-raised-button (click)="goBack()">Back</button>
- <button class="stepper-button"
- id="event-schema-next-button"
- data-cy="sp-event-schema-next-button"
- color="accent" mat-raised-button
- (click)="clickNext()"
- [disabled]="!validEventSchema">
+ <button class="mat-basic" mat-raised-button (click)="removeSelection()">
+ Cancel
+ </button>
+ <button
+ class="mat-basic stepper-button"
+ mat-raised-button
+ (click)="goBack()"
+ >
+ Back
+ </button>
+ <button
+ class="stepper-button"
+ id="event-schema-next-button"
+ data-cy="sp-event-schema-next-button"
+ color="accent"
+ mat-raised-button
+ (click)="clickNext()"
+ [disabled]="!validEventSchema"
+ >
Next
</button>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.scss b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.scss
index 8def70745..3fd9bb2b2 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.scss
@@ -17,161 +17,164 @@
*/
ul {
- list-style-type: none;
+ list-style-type: none;
}
.wrapper {
- display: table;
+ display: table;
}
.container {
- display: table-cell;
- background-color: rgba(255, 255, 255, 0.2);
- width: 50%;
+ display: table-cell;
+ background-color: rgba(255, 255, 255, 0.2);
+ width: 50%;
}
.container:nth-child(odd) {
- background-color: rgba(0, 0, 0, 0.2);
+ background-color: rgba(0, 0, 0, 0.2);
}
.container div,
.gu-mirror {
- margin: 10px;
- padding: 10px;
- background-color: rgba(0, 0, 0, 0.2);
- transition: opacity 0.4s ease-in-out;
+ margin: 10px;
+ padding: 10px;
+ background-color: rgba(0, 0, 0, 0.2);
+ transition: opacity 0.4s ease-in-out;
}
.container div {
- cursor: move;
- cursor: grab;
- cursor: -moz-grab;
- cursor: -webkit-grab;
+ cursor: move;
+ cursor: grab;
+ cursor: -moz-grab;
+ cursor: -webkit-grab;
}
.gu-mirror {
- cursor: grabbing;
- cursor: -moz-grabbing;
- cursor: -webkit-grabbing;
+ cursor: grabbing;
+ cursor: -moz-grabbing;
+ cursor: -webkit-grabbing;
}
.error-message {
- background-color: black;
- color: white;
- padding: 10px;
- width: 95%;
+ background-color: black;
+ color: white;
+ padding: 10px;
+ width: 95%;
}
:host ::ng-deep .tree-node {
- color: var(--color-default-text);
- border-left: none;
- border-right: none;
- border-bottom: none;
- border-top: 1px solid #000;
- border-radius: 0;
- background: transparent;
- margin: 0;
+ color: var(--color-default-text);
+ border-left: none;
+ border-right: none;
+ border-bottom: none;
+ border-top: 1px solid #000;
+ border-radius: 0;
+ background: transparent;
+ margin: 0;
}
:host ::ng-deep tree-node-expander {
- display: none;
+ display: none;
}
:host ::ng-deep .node-content-wrapper {
- flex: 1;
+ flex: 1;
}
:host ::ng-deep .node-content-wrapper:hover {
- background-color: var(--color-bg-2);
+ background-color: var(--color-bg-2);
}
-:host ::ng-deep .node-content-wrapper-active, .node-content-wrapper-focused {
- background: transparent;
+:host ::ng-deep .node-content-wrapper-active,
+.node-content-wrapper-focused {
+ background: transparent;
}
:host ::ng-deep .node-drop-slot {
- position: relative;
- /*background: red;*/
- /* padding: 8px 0;*/
- height: 14px !important;
- margin: -7px 0;
- z-index: 1000;
+ position: relative;
+ /*background: red;*/
+ /* padding: 8px 0;*/
+ height: 14px !important;
+ margin: -7px 0;
+ z-index: 1000;
}
:host ::ng-deep .node-drop-slot.is-dragging-over {
- background-color: rgb(27, 20, 100);
- border: none;
+ background-color: rgb(27, 20, 100);
+ border: none;
}
:host ::ng-deep .tree-node-expanded {
- border-left: 2px dashed black;
+ border-left: 2px dashed black;
}
:host ::ng-deep tree-viewport {
- overflow: hidden;
+ overflow: hidden;
}
:host ::ng-deep .tree-node-level-1 {
- border: none;
+ border: none;
}
-:host ::ng-deep .node-content-wrapper-focused, .node-content-wrapper:hover, .node-content-wrapper-active, .node-content-wrapper.node-content-wrapper-active:hover, .node-content-wrapper-active.node-content-wrapper-focused {
- background: none !important;
+:host ::ng-deep .node-content-wrapper-focused,
+.node-content-wrapper:hover,
+.node-content-wrapper-active,
+.node-content-wrapper.node-content-wrapper-active:hover,
+.node-content-wrapper-active.node-content-wrapper-focused {
+ background: none !important;
}
.dimension-star {
- margin-left: -27px;
- margin-right: 3px;
+ margin-left: -27px;
+ margin-right: 3px;
}
:host ::ng-deep .node-content-wrapper .dimension-star {
- opacity: 0.2;
+ opacity: 0.2;
}
:host ::ng-deep .node-content-wrapper:hover .dimension-star {
- opacity: 1;
+ opacity: 1;
}
:host ::ng-deep .node-content-wrapper mat-checkbox {
- opacity: 0.2;
+ opacity: 0.2;
}
:host ::ng-deep .node-content-wrapper:hover mat-checkbox {
- opacity: 1;
+ opacity: 1;
}
-
.dimension-property {
- color: #ffa23b !important;
- opacity: 1 !important;
+ color: #ffa23b !important;
+ opacity: 1 !important;
}
.historic {
- cursor: pointer;
- color: #ffa23b;
+ cursor: pointer;
+ color: #ffa23b;
}
.real-time {
- cursor: pointer;
- color: #FFEB3B;
+ cursor: pointer;
+ color: #ffeb3b;
}
.new-adapter-title {
- margin-top:5px;
+ margin-top: 5px;
}
.configuration-box {
- width:100%;
- margin-bottom:10px;
- box-shadow: 1px 1px 2px #555;
- border: 1px solid gray;
- padding: 10px 10px 10px 60px;
- margin-left: 20px;
+ width: 100%;
+ margin-bottom: 10px;
+ box-shadow: 1px 1px 2px #555;
+ border: 1px solid gray;
+ padding: 10px 10px 10px 60px;
+ margin-left: 20px;
}
.padding {
- padding:15px;
- margin-bottom:2%;
+ padding: 15px;
+ margin-bottom: 2%;
}
.stepper-button {
- margin-left:10px;
+ margin-left: 10px;
}
.disable-editing {
-pointer-events: none !important;
-opacity:0.5;
+ pointer-events: none !important;
+ opacity: 0.5;
}
-
.add-schema button:disabled {
- color: rgba(0, 0, 0, 0.26);
+ color: rgba(0, 0, 0, 0.26);
}
.mt-20 {
- margin-top: 20px;
+ margin-top: 20px;
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.ts
index 0fcbd1082..984f6e9ba 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.ts
@@ -187,7 +187,7 @@ export class EventSchemaComponent implements OnChanges {
public refreshTree(refreshPreview = true): void {
this.nodes = new Array<EventProperty>();
- this.nodes.push((this.eventSchema as unknown) as EventProperty);
+ this.nodes.push(this.eventSchema as unknown as EventProperty);
this.validEventSchema = this.checkIfValid(this.eventSchema);
if (refreshPreview) {
this.updatePreview();
@@ -264,7 +264,8 @@ export class EventSchemaComponent implements OnChanges {
this.isPreviewEnabled = false;
this.transformationRuleService.setOldEventSchema(this.oldEventSchema);
this.transformationRuleService.setNewEventSchema(this.eventSchema);
- const ruleDescriptions = this.transformationRuleService.getTransformationRuleDescriptions();
+ const ruleDescriptions =
+ this.transformationRuleService.getTransformationRuleDescriptions();
if (this.eventPreview && this.eventPreview.length > 0) {
this.restService
.getAdapterEventPreview({
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.html b/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.html
index 4ef8106d2..04f9f7149 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.html
@@ -16,9 +16,15 @@
~
-->
-<div fxLayout="column" >
+<div fxLayout="column">
<div fxLayoutAlign="center">
- <mat-spinner fxLayoutAlign="center" style="margin: 10px 0 5px 0" color="accent" [diameter]="30">Loading</mat-spinner>
+ <mat-spinner
+ fxLayoutAlign="center"
+ style="margin: 10px 0 5px 0"
+ color="accent"
+ [diameter]="30"
+ >Loading</mat-spinner
+ >
</div>
<div fxLayoutAlign="center">
<h4>Guessing the event schema...</h4>
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.scss b/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.scss
index 58ba04bdd..13cbc4aac 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.scss
@@ -15,4 +15,3 @@
* limitations under the License.
*
*/
-
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.ts
index eeea191f0..4d3af332c 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/loading-message/loading-message.component.ts
@@ -19,12 +19,10 @@
import { Component } from '@angular/core';
@Component({
- selector: 'sp-loading-message',
- templateUrl: './loading-message.component.html',
- styleUrls: ['./loading-message.component.scss']
+ selector: 'sp-loading-message',
+ templateUrl: './loading-message.component.html',
+ styleUrls: ['./loading-message.component.scss'],
})
export class LoadingMessageComponent {
-
- constructor() { }
-
+ constructor() {}
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/schema-editor-header/schema-editor-header.component.html b/ui/src/app/connect/components/adapter-configuration/schema-editor/schema-editor-header/schema-editor-header.component.html
index 06e109de5..d3ea80965 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/schema-editor-header/schema-editor-header.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/schema-editor-header/schema-editor-header.component.html
@@ -18,49 +18,59 @@
<div fxLayout="row" fxFlex="100">
<div fxFlex fxLayoutAlign="start center" fxLayout="row">
- <button color="accent"
- mat-button
- data-cy="connect-add-nested-property"
- matTooltip="Add a Nested Property"
- (click)=addNestedProperty()>
+ <button
+ color="accent"
+ mat-button
+ data-cy="connect-add-nested-property"
+ matTooltip="Add a Nested Property"
+ (click)="addNestedProperty()"
+ >
<mat-icon>queue</mat-icon>
<span> Add nested</span>
</button>
- <button color="accent"
- mat-button
- data-cy="connect-add-static-property"
- matTooltip="Add a static value to event"
- (click)="addStaticValueProperty()">
+ <button
+ color="accent"
+ mat-button
+ data-cy="connect-add-static-property"
+ matTooltip="Add a static value to event"
+ (click)="addStaticValueProperty()"
+ >
<mat-icon>add</mat-icon>
<span> Add static value</span>
</button>
- <button color="accent"
- mat-button
- data-cy="connect-schema-add-timestamp-btn"
- matTooltip="Add timestamp to event schema"
- (click)="addTimestampProperty()">
+ <button
+ color="accent"
+ mat-button
+ data-cy="connect-schema-add-timestamp-btn"
+ matTooltip="Add timestamp to event schema"
+ (click)="addTimestampProperty()"
+ >
<mat-icon>access_time</mat-icon>
<span> Add timestamp</span>
</button>
</div>
<div fxLayout="row" fxLayoutAlign="end center">
- <button color="accent"
- mat-button
- mat-icon-button
- matTooltip="Refresh Schema"
- data-cy="refresh-schema"
- (click)="guessSchema()">
+ <button
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Refresh Schema"
+ data-cy="refresh-schema"
+ (click)="guessSchema()"
+ >
<mat-icon>refresh</mat-icon>
</button>
- <button style="padding-right:0"
- color="accent"
- mat-button
- mat-icon-button
- matTooltip="Remove selected Properties"
- [disabled]="countSelected == 0"
- (click)="removeSelectedProperties()"
- data-cy="connect-schema-delete-properties-btn">
+ <button
+ style="padding-right: 0"
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Remove selected Properties"
+ [disabled]="countSelected === 0"
+ (click)="removeSelectedProperties()"
+ data-cy="connect-schema-delete-properties-btn"
+ >
<mat-icon>delete</mat-icon>
</button>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/schema-editor-header/schema-editor-header.component.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/schema-editor-header/schema-editor-header.component.ts
index 7bcd8cc3c..b5409983d 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/schema-editor-header/schema-editor-header.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/schema-editor-header/schema-editor-header.component.ts
@@ -16,48 +16,42 @@
*
*/
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
-import { UserErrorMessage } from '../../../../../core-model/base/UserErrorMessage';
+import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
- selector: 'sp-schema-editor-header',
- templateUrl: './schema-editor-header.component.html',
- styleUrls: ['./schema-editor-header.component.scss']
+ selector: 'sp-schema-editor-header',
+ templateUrl: './schema-editor-header.component.html',
+ styleUrls: ['./schema-editor-header.component.scss'],
})
-export class SchemaEditorHeaderComponent implements OnInit {
+export class SchemaEditorHeaderComponent {
+ @Input() countSelected: number;
+ @Output() addNestedPropertyEmitter = new EventEmitter();
+ @Output() addStaticValuePropertyEmitter = new EventEmitter();
+ @Output() addTimestampPropertyEmitter = new EventEmitter();
+ @Output() guessSchemaEmitter = new EventEmitter();
+ @Output() updatePreviewEmitter = new EventEmitter();
+ @Output() removeSelectedPropertiesEmitter = new EventEmitter();
- @Input() countSelected: number;
+ constructor() {}
- @Output() addNestedPropertyEmitter = new EventEmitter();
- @Output() addStaticValuePropertyEmitter = new EventEmitter();
- @Output() addTimestampPropertyEmitter = new EventEmitter();
- @Output() guessSchemaEmitter = new EventEmitter();
- @Output() updatePreviewEmitter = new EventEmitter();
- @Output() removeSelectedPropertiesEmitter = new EventEmitter();
+ public addNestedProperty() {
+ this.addNestedPropertyEmitter.emit();
+ }
- constructor() { }
+ public addStaticValueProperty() {
+ this.addStaticValuePropertyEmitter.emit();
+ }
- ngOnInit(): void {
- }
+ public addTimestampProperty() {
+ this.addTimestampPropertyEmitter.emit();
+ }
- public addNestedProperty() {
- this.addNestedPropertyEmitter.emit();
- }
+ public guessSchema() {
+ this.guessSchemaEmitter.emit();
+ }
- public addStaticValueProperty() {
- this.addStaticValuePropertyEmitter.emit();
- }
-
- public addTimestampProperty() {
- this.addTimestampPropertyEmitter.emit();
- }
-
- public guessSchema() {
- this.guessSchemaEmitter.emit();
- }
-
- public removeSelectedProperties() {
- this.removeSelectedPropertiesEmitter.emit();
- }
+ public removeSelectedProperties() {
+ this.removeSelectedPropertiesEmitter.emit();
+ }
}
diff --git a/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.html b/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.html
index 5754e1c8d..5fc885948 100644
--- a/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.html
@@ -18,40 +18,79 @@
<div fxFlex="100" fxLayout="column">
<div fxFlex="100" fxLayout="column">
- <sp-basic-inner-panel panelTitle="Basic Settings" outerMargin="20px 0px">
- <div header fxFlex="100" fxLayout="row" fxLayoutAlign="end center" class="pr-5">
- <div fxFlex="100" fxLayout="row" fxLayoutAlign="end center" *ngIf="availableTemplates && availableTemplates.length > 0">
- <mat-form-field class="form-field" floatLabel="never" color="accent">
+ <sp-basic-inner-panel
+ panelTitle="Basic Settings"
+ outerMargin="20px 0px"
+ >
+ <div
+ header
+ fxFlex="100"
+ fxLayout="row"
+ fxLayoutAlign="end center"
+ class="pr-5"
+ >
+ <div
+ fxFlex="100"
+ fxLayout="row"
+ fxLayoutAlign="end center"
+ *ngIf="availableTemplates && availableTemplates.length > 0"
+ >
+ <mat-form-field
+ class="form-field"
+ floatLabel="never"
+ color="accent"
+ >
<mat-label>Use template</mat-label>
- <mat-select (selectionChange)="loadTemplate($event)"
- [(value)]="selectedTemplate">
+ <mat-select
+ (selectionChange)="loadTemplate($event)"
+ [(value)]="selectedTemplate"
+ >
<mat-option>--</mat-option>
- <mat-option [value]="template" *ngFor="let template of availableTemplates">
- {{template.templateName}}
+ <mat-option
+ [value]="template"
+ *ngFor="let template of availableTemplates"
+ >
+ {{ template.templateName }}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<sp-configuration-group
- [configurationGroup]="specificAdapterForm"
- [adapterId]="adapterDescription.appId"
- [configuration]="adapterDescription.config">
+ [configurationGroup]="specificAdapterForm"
+ [adapterId]="adapterDescription.appId"
+ [configuration]="adapterDescription.config"
+ >
</sp-configuration-group>
</sp-basic-inner-panel>
</div>
<div fxLayoutAlign="end">
- <button class="mat-basic"
- mat-raised-button
- style="margin-right: 10px;"
- (click)="removeSelection()">Cancel</button>
- <button mat-button mat-raised-button
- class="mat-basic"
- (click)="openTemplateDialog()">Store config as template</button>
+ <button
+ class="mat-basic"
+ mat-raised-button
+ style="margin-right: 10px"
+ (click)="removeSelection()"
+ >
+ Cancel
+ </button>
+ <button
+ mat-button
+ mat-raised-button
+ class="mat-basic"
+ (click)="openTemplateDialog()"
+ >
+ Store config as template
+ </button>
<div id="specific-settings-next-button">
- <button class="stepper-button" [disabled]="!specificAdapterSettingsFormValid"
- (click)="clickNext()" color="accent" mat-raised-button>Next
+ <button
+ class="stepper-button"
+ [disabled]="!specificAdapterSettingsFormValid"
+ (click)="clickNext()"
+ color="accent"
+ mat-raised-button
+ >
+ Next
</button>
</div>
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.scss b/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.scss
index 5c16e27b5..c360c4aa9 100644
--- a/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.scss
@@ -17,5 +17,5 @@
*/
.stepper-button {
- margin-left:10px;
+ margin-left: 10px;
}
diff --git a/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.ts b/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.ts
index 2070696f5..1bbba4134 100644
--- a/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/specific-adapter-configuration/specific-adapter-configuration.component.ts
@@ -17,58 +17,72 @@
*/
import { Component, OnInit } from '@angular/core';
-import { AdapterDescription, PipelineElementTemplateService } from '@streampipes/platform-services';
+import {
+ AdapterDescription,
+ PipelineElementTemplateService,
+} from '@streampipes/platform-services';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { DialogService } from '@streampipes/shared-ui';
import { AdapterTemplateService } from '../../../services/adapter-template.service';
import { AdapterTemplateConfigurationDirective } from '../directives/adapter-template-configuration.directive';
@Component({
- selector: 'sp-specific-adapter-configuration',
- templateUrl: './specific-adapter-configuration.component.html',
- styleUrls: ['./specific-adapter-configuration.component.scss']
+ selector: 'sp-specific-adapter-configuration',
+ templateUrl: './specific-adapter-configuration.component.html',
+ styleUrls: ['./specific-adapter-configuration.component.scss'],
})
-export class SpecificAdapterConfigurationComponent extends AdapterTemplateConfigurationDirective implements OnInit {
+export class SpecificAdapterConfigurationComponent
+ extends AdapterTemplateConfigurationDirective
+ implements OnInit
+{
+ specificAdapterSettingsFormValid: boolean;
- specificAdapterSettingsFormValid: boolean;
+ specificAdapterForm: UntypedFormGroup;
- specificAdapterForm: UntypedFormGroup;
-
-
- constructor(_formBuilder: UntypedFormBuilder,
- dialogService: DialogService,
- pipelineElementTemplateService: PipelineElementTemplateService,
- adapterTemplateService: AdapterTemplateService) {
- super(_formBuilder, dialogService, pipelineElementTemplateService, adapterTemplateService);
- }
+ constructor(
+ _formBuilder: UntypedFormBuilder,
+ dialogService: DialogService,
+ pipelineElementTemplateService: PipelineElementTemplateService,
+ adapterTemplateService: AdapterTemplateService,
+ ) {
+ super(
+ _formBuilder,
+ dialogService,
+ pipelineElementTemplateService,
+ adapterTemplateService,
+ );
+ }
- ngOnInit(): void {
- super.onInit();
- this.cachedAdapterDescription = {...this.adapterDescription};
- // initialize form for validation
- this.specificAdapterForm = this._formBuilder.group({});
- this.specificAdapterForm.statusChanges.subscribe((_) => {
- this.specificAdapterSettingsFormValid = this.specificAdapterForm.valid;
- });
+ ngOnInit(): void {
+ super.onInit();
+ this.cachedAdapterDescription = { ...this.adapterDescription };
+ // initialize form for validation
+ this.specificAdapterForm = this._formBuilder.group({});
+ this.specificAdapterForm.statusChanges.subscribe(_ => {
+ this.specificAdapterSettingsFormValid =
+ this.specificAdapterForm.valid;
+ });
- // Go directly to event schema configuration when adapter has no configuration properties
- if (this.adapterDescription.config.length === 0) {
- this.specificAdapterSettingsFormValid = true;
+ // Go directly to event schema configuration when adapter has no configuration properties
+ if (this.adapterDescription.config.length === 0) {
+ this.specificAdapterSettingsFormValid = true;
+ }
}
- }
-
- openTemplateDialog(): void {
- const dialogRef = this.adapterTemplateService.getDialog(this.adapterDescription.config, this.adapterDescription.appId);
- dialogRef.afterClosed().subscribe(_ => {
- this.loadPipelineElementTemplates();
- });
- }
+ openTemplateDialog(): void {
+ const dialogRef = this.adapterTemplateService.getDialog(
+ this.adapterDescription.config,
+ this.adapterDescription.appId,
+ );
- afterTemplateReceived(adapterDescription: any) {
- this.adapterDescription = AdapterDescription.fromDataUnion(adapterDescription);
- this.updateAdapterDescriptionEmitter.emit(this.adapterDescription);
- }
+ dialogRef.afterClosed().subscribe(_ => {
+ this.loadPipelineElementTemplates();
+ });
+ }
+ afterTemplateReceived(adapterDescription: any) {
+ this.adapterDescription =
+ AdapterDescription.fromDataUnion(adapterDescription);
+ this.updateAdapterDescriptionEmitter.emit(this.adapterDescription);
+ }
}
-
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.html b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.html
index 4a769b4d2..fe4fc3030 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.html
@@ -19,23 +19,27 @@
<div fxFlex="100" fxLayout="column" class="options-panel">
<div fxLayout="row" fxFlex="100" fxLayoutAlign="start start">
<div class="mr-15" fxLayoutAlign="start start">
- <mat-icon class="icon">{{optionIcon}}</mat-icon>
+ <mat-icon class="icon">{{ optionIcon }}</mat-icon>
</div>
<div fxFlex fxLayout="column">
<div fxFlex="100" class="title" fxLayout="row">
<div fxLayoutAlign="start start" class="mr-15">
- <mat-checkbox (change)="optionSelectedEmitter.emit($event.checked)"
- [attr.data-cy]="dataCy" class="large-checkbox">
+ <mat-checkbox
+ (change)="optionSelectedEmitter.emit($event.checked)"
+ [attr.data-cy]="dataCy"
+ class="large-checkbox"
+ >
</mat-checkbox>
</div>
<div fxFlex fxLayout="column">
- <div>{{optionTitle}}</div>
- <mat-hint class="description">{{optionDescription}}</mat-hint>
+ <div>{{ optionTitle }}</div>
+ <mat-hint class="description">{{
+ optionDescription
+ }}</mat-hint>
</div>
</div>
<ng-content></ng-content>
</div>
</div>
-
</div>
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.scss b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.scss
index 60e5397f5..275840dfb 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.scss
@@ -17,29 +17,29 @@
*/
.options-panel {
- border-left: 4px solid var(--color-accent);
- border-bottom: 1px solid var(--color-bg-2);
- border-top: 1px solid var(--color-bg-2);
- border-right: 1px solid var(--color-bg-2);
- padding: 8px;
- background: var(--color-bg-1);
- margin-top: 6px;
- margin-bottom: 6px;
+ border-left: 4px solid var(--color-accent);
+ border-bottom: 1px solid var(--color-bg-2);
+ border-top: 1px solid var(--color-bg-2);
+ border-right: 1px solid var(--color-bg-2);
+ padding: 8px;
+ background: var(--color-bg-1);
+ margin-top: 6px;
+ margin-bottom: 6px;
}
.title {
- color: var(--color-default-text);
- font-weight: 600;
- font-size: 13pt;
- margin-bottom: 10px;
+ color: var(--color-default-text);
+ font-weight: 600;
+ font-size: 13pt;
+ margin-bottom: 10px;
}
.description {
- font-size: 10pt;
+ font-size: 10pt;
}
.icon {
- margin-right: 10px;
- color: var(--color-accent);
- font-size: 22pt;
+ margin-right: 10px;
+ color: var(--color-accent);
+ font-size: 22pt;
}
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.ts b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.ts
index 399ff42de..e18e4e380 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/adapter-options-panel/adapter-options-panel.component.ts
@@ -19,27 +19,23 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
@Component({
- selector: 'sp-adapter-options-panel',
- templateUrl: './adapter-options-panel.component.html',
- styleUrls: ['./adapter-options-panel.component.scss']
+ selector: 'sp-adapter-options-panel',
+ templateUrl: './adapter-options-panel.component.html',
+ styleUrls: ['./adapter-options-panel.component.scss'],
})
export class SpAdapterOptionsPanelComponent {
+ @Input()
+ optionTitle: string;
- @Input()
- optionTitle: string;
+ @Input()
+ optionDescription: string;
- @Input()
- optionDescription: string;
+ @Input()
+ optionIcon: string;
- @Input()
- optionIcon: string;
-
- @Input()
- dataCy: string;
-
- @Output()
- optionSelectedEmitter: EventEmitter<boolean> = new EventEmitter<boolean>();
+ @Input()
+ dataCy: string;
+ @Output()
+ optionSelectedEmitter: EventEmitter<boolean> = new EventEmitter<boolean>();
}
-
-
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
index 3f7e1f361..6c85414eb 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
@@ -17,53 +17,86 @@
-->
<div [formGroup]="startAdapterForm" fxLayout="column" fxFlex="100">
- <sp-basic-inner-panel panelTitle="Adapter settings" outerMargin="20px 0px 10px 0px">
+ <sp-basic-inner-panel
+ panelTitle="Adapter settings"
+ outerMargin="20px 0px 10px 0px"
+ >
<div fxFlex="100">
<div fxLayoutAlign="center" fxLayout="column" fxFlex="100">
<mat-form-field color="accent">
- <input formControlName="adapterName"
- matInput id="input-AdapterName" placeholder="Adapter Name"
- data-cy="sp-adapter-name" required>
+ <input
+ formControlName="adapterName"
+ matInput
+ id="input-AdapterName"
+ placeholder="Adapter Name"
+ data-cy="sp-adapter-name"
+ required
+ />
</mat-form-field>
<mat-form-field color="accent">
- <input matInput id="input-AdapterDescription" [ngModelOptions]="{standalone: true}"
- placeholder="Adapter Description" [(ngModel)]="adapterDescription.description">
+ <input
+ matInput
+ id="input-AdapterDescription"
+ [ngModelOptions]="{ standalone: true }"
+ placeholder="Adapter Description"
+ [(ngModel)]="adapterDescription.description"
+ />
</mat-form-field>
</div>
</div>
</sp-basic-inner-panel>
<div fxFlex="100" fxLayout="column">
- <sp-adapter-options-panel optionTitle="Remove Duplicates"
- optionDescription="Avoid duplicated events within a certain time interval"
- optionIcon="cleaning_services"
- dataCy="connect-remove-duplicates-box"
- (optionSelectedEmitter)="removeDuplicates = $event">
+ <sp-adapter-options-panel
+ optionTitle="Remove Duplicates"
+ optionDescription="Avoid duplicated events within a certain time interval"
+ optionIcon="cleaning_services"
+ dataCy="connect-remove-duplicates-box"
+ (optionSelectedEmitter)="removeDuplicates = $event"
+ >
<mat-form-field *ngIf="removeDuplicates" color="accent">
- <input matInput id="input-removeDuplicatesTime"
- [ngModelOptions]="{standalone: true}" placeholder="Remove Duplicates Time Window"
- [(ngModel)]="removeDuplicatesTime"
- data-cy="connect-remove-duplicates-input">
+ <input
+ matInput
+ id="input-removeDuplicatesTime"
+ [ngModelOptions]="{ standalone: true }"
+ placeholder="Remove Duplicates Time Window"
+ [(ngModel)]="removeDuplicatesTime"
+ data-cy="connect-remove-duplicates-input"
+ />
</mat-form-field>
</sp-adapter-options-panel>
-
- <sp-adapter-options-panel optionTitle="Reduce event rate"
- optionDescription="Send maximum one event in the specified time window"
- optionIcon="speed"
- dataCy="connect-reduce-event-rate-box"
- (optionSelectedEmitter)="eventRateReduction = $event">
+ <sp-adapter-options-panel
+ optionTitle="Reduce event rate"
+ optionDescription="Send maximum one event in the specified time window"
+ optionIcon="speed"
+ dataCy="connect-reduce-event-rate-box"
+ (optionSelectedEmitter)="eventRateReduction = $event"
+ >
<mat-form-field *ngIf="eventRateReduction" color="accent">
- <input type="number" matInput id="input-evenRateTime"
- [ngModelOptions]="{standalone: true}" [(ngModel)]="eventRateTime"
- placeholder="Time Window (Milliseconds)" matTooltipPosition="above"
- data-cy="connect-reduce-event-input">
+ <input
+ type="number"
+ matInput
+ id="input-evenRateTime"
+ [ngModelOptions]="{ standalone: true }"
+ [(ngModel)]="eventRateTime"
+ placeholder="Time Window (Milliseconds)"
+ matTooltipPosition="above"
+ data-cy="connect-reduce-event-input"
+ />
</mat-form-field>
<mat-form-field *ngIf="eventRateReduction" color="accent">
<mat-label>Event Aggregation</mat-label>
- <mat-select [(ngModel)]="eventRateMode" [ngModelOptions]="{standalone: true}">
- <mat-option class="md-elevation-z1" style="background: white;"
- matTooltip="Last Event in Time Window" value="none">
+ <mat-select
+ [(ngModel)]="eventRateMode"
+ [ngModelOptions]="{ standalone: true }"
+ >
+ <mat-option
+ class="md-elevation-z1"
+ style="background: white"
+ matTooltip="Last Event in Time Window"
+ value="none"
+ >
None
</mat-option>
</mat-select>
@@ -71,49 +104,71 @@
</sp-adapter-options-panel>
<!-- Start pipeline template to store raw events in data lake -->
- <sp-adapter-options-panel optionTitle="Persist events"
- optionDescription="Store all events of this source in the internal data store"
- optionIcon="save"
- dataCy="sp-store-in-datalake"
- (optionSelectedEmitter)="handlePersistOption($event)">
- <mat-form-field *ngIf="saveInDataLake"
- color="accent">
+ <sp-adapter-options-panel
+ optionTitle="Persist events"
+ optionDescription="Store all events of this source in the internal data store"
+ optionIcon="save"
+ dataCy="sp-store-in-datalake"
+ (optionSelectedEmitter)="handlePersistOption($event)"
+ >
+ <mat-form-field *ngIf="saveInDataLake" color="accent">
<mat-label>Select Time Field</mat-label>
- <mat-select [(ngModel)]="dataLakeTimestampField"
- [ngModelOptions]="{standalone: true}"
- data-cy="sp-store-in-datalake-timestamp">
- <mat-option class="md-elevation-z1" style="background: white;"
- *ngFor="let timestampField of eventSchema.eventProperties | timestampFilter"
- [value]="timestampField.runtimeName">
- {{timestampField.runtimeName}}
+ <mat-select
+ [(ngModel)]="dataLakeTimestampField"
+ [ngModelOptions]="{ standalone: true }"
+ data-cy="sp-store-in-datalake-timestamp"
+ >
+ <mat-option
+ class="md-elevation-z1"
+ style="background: white"
+ *ngFor="
+ let timestampField of eventSchema.eventProperties
+ | timestampFilter
+ "
+ [value]="timestampField.runtimeName"
+ >
+ {{ timestampField.runtimeName }}
</mat-option>
</mat-select>
</mat-form-field>
</sp-adapter-options-panel>
</div>
- <div fxLayoutAlign="end" style="margin-top: 10px;">
- <button class="mat-basic" mat-raised-button (click)="removeSelection()">Cancel</button>
- <button style="margin-left:10px;" class="mat-basic stepper-button" mat-raised-button (click)="goBack()">Back
+ <div fxLayoutAlign="end" style="margin-top: 10px">
+ <button class="mat-basic" mat-raised-button (click)="removeSelection()">
+ Cancel
+ </button>
+ <button
+ style="margin-left: 10px"
+ class="mat-basic stepper-button"
+ mat-raised-button
+ (click)="goBack()"
+ >
+ Back
</button>
- <button *ngIf="!isEditMode"
- [disabled]="!(startAdapterSettingsFormValid)"
- mat-raised-button
- id="button-startAdapter"
- color="accent"
- (click)="startAdapter()"
- mat-button style="margin-left:10px;">
+ <button
+ *ngIf="!isEditMode"
+ [disabled]="!startAdapterSettingsFormValid"
+ mat-raised-button
+ id="button-startAdapter"
+ color="accent"
+ (click)="startAdapter()"
+ mat-button
+ style="margin-left: 10px"
+ >
Start Adapter
</button>
- <button *ngIf="isEditMode"
- [disabled]="!(startAdapterSettingsFormValid)"
- mat-raised-button
- data-cy="store-edit-adapter"
- color="accent"
- (click)="editAdapter()"
- mat-button style="margin-left:10px;">
+ <button
+ *ngIf="isEditMode"
+ [disabled]="!startAdapterSettingsFormValid"
+ mat-raised-button
+ data-cy="store-edit-adapter"
+ color="accent"
+ (click)="editAdapter()"
+ mat-button
+ style="margin-left: 10px"
+ >
Edit Adapter
</button>
</div>
</div>
-
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.scss b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.scss
index c2ade4c2e..13cbc4aac 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.scss
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.scss
@@ -15,5 +15,3 @@
* limitations under the License.
*
*/
-
-
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts
index 4fbe6bec7..fbff3bcb0 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts
@@ -18,12 +18,17 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import {
- AdapterDescriptionUnion,
- EventRateTransformationRuleDescription,
- EventSchema,
- RemoveDuplicatesTransformationRuleDescription,
+ AdapterDescriptionUnion,
+ EventRateTransformationRuleDescription,
+ EventSchema,
+ RemoveDuplicatesTransformationRuleDescription,
} from '@streampipes/platform-services';
-import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
+import {
+ UntypedFormBuilder,
+ UntypedFormControl,
+ UntypedFormGroup,
+ Validators,
+} from '@angular/forms';
import { MatStepper } from '@angular/material/stepper';
import { AdapterStartedDialog } from '../../../dialog/adapter-started/adapter-started-dialog.component';
import { DialogService, PanelType } from '@streampipes/shared-ui';
@@ -31,146 +36,162 @@ import { ShepherdService } from '../../../../services/tour/shepherd.service';
import { TimestampPipe } from '../../../filter/timestamp.pipe';
@Component({
- selector: 'sp-start-adapter-configuration',
- templateUrl: './start-adapter-configuration.component.html',
- styleUrls: ['./start-adapter-configuration.component.scss']
+ selector: 'sp-start-adapter-configuration',
+ templateUrl: './start-adapter-configuration.component.html',
+ styleUrls: ['./start-adapter-configuration.component.scss'],
})
export class StartAdapterConfigurationComponent implements OnInit {
+ /**
+ * Adapter description the selected format is added to
+ */
+ @Input() adapterDescription: AdapterDescriptionUnion;
+
+ @Input() eventSchema: EventSchema;
+
+ @Input() isEditMode;
+
+ /**
+ * Cancels the adapter configuration process
+ */
+ @Output() removeSelectionEmitter: EventEmitter<boolean> =
+ new EventEmitter();
+
+ /**
+ * Is called when the adapter was created
+ */
+ @Output() adapterStartedEmitter: EventEmitter<void> =
+ new EventEmitter<void>();
+
+ /**
+ * Go to next configuration step when this is complete
+ */
+ @Output() goBackEmitter: EventEmitter<MatStepper> = new EventEmitter();
+
+ @Output() updateAdapterEmitter: EventEmitter<void> =
+ new EventEmitter<void>();
+
+ /**
+ * The form group to validate the configuration for the format
+ */
+ startAdapterForm: UntypedFormGroup;
+
+ startAdapterSettingsFormValid = false;
+
+ // preprocessing rule variables
+ removeDuplicates = false;
+ removeDuplicatesTime: number;
+
+ eventRateReduction = false;
+ eventRateTime: number;
+ eventRateMode = 'none';
+
+ saveInDataLake = false;
+ dataLakeTimestampField: string;
+
+ constructor(
+ private dialogService: DialogService,
+ private shepherdService: ShepherdService,
+ private _formBuilder: UntypedFormBuilder,
+ private timestampPipe: TimestampPipe,
+ ) {}
+
+ ngOnInit(): void {
+ // initialize form for validation
+ this.startAdapterForm = this._formBuilder.group({});
+ this.startAdapterForm.addControl(
+ 'adapterName',
+ new UntypedFormControl(
+ this.adapterDescription.name,
+ Validators.required,
+ ),
+ );
+ this.startAdapterForm.valueChanges.subscribe(
+ v => (this.adapterDescription.name = v.adapterName),
+ );
+ this.startAdapterForm.statusChanges.subscribe(() => {
+ this.startAdapterSettingsFormValid = this.startAdapterForm.valid;
+ });
+ this.startAdapterSettingsFormValid = this.startAdapterForm.valid;
+ }
- /**
- * Adapter description the selected format is added to
- */
- @Input() adapterDescription: AdapterDescriptionUnion;
-
- @Input() eventSchema: EventSchema;
-
- @Input() isEditMode;
-
- /**
- * Cancels the adapter configuration process
- */
- @Output() removeSelectionEmitter: EventEmitter<boolean> = new EventEmitter();
-
- /**
- * Is called when the adapter was created
- */
- @Output() adapterStartedEmitter: EventEmitter<void> = new EventEmitter<void>();
-
- /**
- * Go to next configuration step when this is complete
- */
- @Output() goBackEmitter: EventEmitter<MatStepper> = new EventEmitter();
-
- @Output() updateAdapterEmitter: EventEmitter<void> = new EventEmitter<void>();
-
- /**
- * The form group to validate the configuration for the format
- */
- startAdapterForm: UntypedFormGroup;
-
- startAdapterSettingsFormValid = false;
-
- // preprocessing rule variables
- removeDuplicates = false;
- removeDuplicatesTime: number;
-
- eventRateReduction = false;
- eventRateTime: number;
- eventRateMode = 'none';
-
- saveInDataLake = false;
- dataLakeTimestampField: string;
-
-
- constructor(
- private dialogService: DialogService,
- private shepherdService: ShepherdService,
- private _formBuilder: UntypedFormBuilder,
- private timestampPipe: TimestampPipe) {
- }
-
- ngOnInit(): void {
- // initialize form for validation
- this.startAdapterForm = this._formBuilder.group({});
- this.startAdapterForm.addControl('adapterName', new UntypedFormControl(this.adapterDescription.name, Validators.required));
- this.startAdapterForm.valueChanges.subscribe(v => this.adapterDescription.name = v.adapterName);
- this.startAdapterForm.statusChanges.subscribe(() => {
- this.startAdapterSettingsFormValid = this.startAdapterForm.valid;
- });
- this.startAdapterSettingsFormValid = this.startAdapterForm.valid;
- }
-
- findDefaultTimestamp(selected: boolean) {
- if (selected) {
- const timestampFields = this.timestampPipe.transform(this.eventSchema.eventProperties);
- if (timestampFields.length > 0) {
- this.dataLakeTimestampField = timestampFields[0].runtimeName;
- }
- } else {
- this.dataLakeTimestampField = '';
+ findDefaultTimestamp(selected: boolean) {
+ if (selected) {
+ const timestampFields = this.timestampPipe.transform(
+ this.eventSchema.eventProperties,
+ );
+ if (timestampFields.length > 0) {
+ this.dataLakeTimestampField = timestampFields[0].runtimeName;
+ }
+ } else {
+ this.dataLakeTimestampField = '';
+ }
}
- }
-
- public editAdapter() {
- const dialogRef = this.dialogService.open(AdapterStartedDialog, {
- panelType: PanelType.STANDARD_PANEL,
- title: 'Adapter edit',
- width: '70vw',
- data: {
- 'adapter': this.adapterDescription,
- 'editMode': true
- }
- });
-
- dialogRef.afterClosed().subscribe(() => {
- this.adapterStartedEmitter.emit();
- });
- }
-
- public startAdapter() {
- if (this.removeDuplicates) {
- const removeDuplicates: RemoveDuplicatesTransformationRuleDescription = new RemoveDuplicatesTransformationRuleDescription();
- removeDuplicates['@class'] = 'org.apache.streampipes.model.connect.rules.stream.RemoveDuplicatesTransformationRuleDescription';
- removeDuplicates.filterTimeWindow = (this.removeDuplicatesTime) as any;
- this.adapterDescription.rules.push(removeDuplicates);
+
+ public editAdapter() {
+ const dialogRef = this.dialogService.open(AdapterStartedDialog, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: 'Adapter edit',
+ width: '70vw',
+ data: {
+ adapter: this.adapterDescription,
+ editMode: true,
+ },
+ });
+
+ dialogRef.afterClosed().subscribe(() => {
+ this.adapterStartedEmitter.emit();
+ });
}
- if (this.eventRateReduction) {
- const eventRate: EventRateTransformationRuleDescription = new EventRateTransformationRuleDescription();
- eventRate['@class'] = 'org.apache.streampipes.model.connect.rules.stream.EventRateTransformationRuleDescription';
- eventRate.aggregationTimeWindow = this.eventRateTime;
- eventRate.aggregationType = this.eventRateMode;
- this.adapterDescription.rules.push(eventRate);
+
+ public startAdapter() {
+ if (this.removeDuplicates) {
+ const removeDuplicates: RemoveDuplicatesTransformationRuleDescription =
+ new RemoveDuplicatesTransformationRuleDescription();
+ removeDuplicates['@class'] =
+ 'org.apache.streampipes.model.connect.rules.stream.RemoveDuplicatesTransformationRuleDescription';
+ removeDuplicates.filterTimeWindow = this
+ .removeDuplicatesTime as any;
+ this.adapterDescription.rules.push(removeDuplicates);
+ }
+ if (this.eventRateReduction) {
+ const eventRate: EventRateTransformationRuleDescription =
+ new EventRateTransformationRuleDescription();
+ eventRate['@class'] =
+ 'org.apache.streampipes.model.connect.rules.stream.EventRateTransformationRuleDescription';
+ eventRate.aggregationTimeWindow = this.eventRateTime;
+ eventRate.aggregationType = this.eventRateMode;
+ this.adapterDescription.rules.push(eventRate);
+ }
+
+ const dialogRef = this.dialogService.open(AdapterStartedDialog, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: 'Adapter generation',
+ width: '70vw',
+ data: {
+ adapter: this.adapterDescription,
+ saveInDataLake: this.saveInDataLake,
+ dataLakeTimestampField: this.dataLakeTimestampField,
+ editMode: false,
+ },
+ });
+
+ this.shepherdService.trigger('button-startAdapter');
+
+ dialogRef.afterClosed().subscribe(() => {
+ this.adapterStartedEmitter.emit();
+ });
}
- const dialogRef = this.dialogService.open(AdapterStartedDialog, {
- panelType: PanelType.STANDARD_PANEL,
- title: 'Adapter generation',
- width: '70vw',
- data: {
- 'adapter': this.adapterDescription,
- 'saveInDataLake': this.saveInDataLake,
- 'dataLakeTimestampField': this.dataLakeTimestampField,
- 'editMode': false
- }
- });
-
- this.shepherdService.trigger('button-startAdapter');
-
- dialogRef.afterClosed().subscribe(() => {
- this.adapterStartedEmitter.emit();
- });
- }
-
- public removeSelection() {
- this.removeSelectionEmitter.emit();
- }
-
- public goBack() {
- this.goBackEmitter.emit();
- }
-
- handlePersistOption(selected: boolean) {
- this.saveInDataLake = selected;
- this.findDefaultTimestamp(selected);
- }
+ public removeSelection() {
+ this.removeSelectionEmitter.emit();
+ }
+
+ public goBack() {
+ this.goBackEmitter.emit();
+ }
+
+ handlePersistOption(selected: boolean) {
+ this.saveInDataLake = selected;
+ this.findDefaultTimestamp(selected);
+ }
}
diff --git a/ui/src/app/connect/components/adapter-details/abstract-adapter-details.directive.ts b/ui/src/app/connect/components/adapter-details/abstract-adapter-details.directive.ts
index 92507ed5d..9a39eaea3 100644
--- a/ui/src/app/connect/components/adapter-details/abstract-adapter-details.directive.ts
+++ b/ui/src/app/connect/components/adapter-details/abstract-adapter-details.directive.ts
@@ -18,49 +18,53 @@
import { AuthService } from '../../../services/auth.service';
import { ActivatedRoute } from '@angular/router';
-import { AdapterDescriptionUnion, AdapterService, AdapterMonitoringService } from '@streampipes/platform-services';
+import {
+ AdapterDescriptionUnion,
+ AdapterService,
+ AdapterMonitoringService,
+} from '@streampipes/platform-services';
import { SpNavigationItem } from '@streampipes/shared-ui';
import { SpAdapterDetailsTabs } from './adapter-details-tabs';
import { SpBreadcrumbService } from '../../../../../projects/streampipes/shared-ui/src/lib/services/breadcrumb.service';
export abstract class SpAbstractAdapterDetailsDirective {
+ currentAdapterId: string;
+ tabs: SpNavigationItem[] = [];
+ adapter: AdapterDescriptionUnion;
- currentAdapterId: string;
- tabs: SpNavigationItem[] = [];
- adapter: AdapterDescriptionUnion;
+ constructor(
+ protected authService: AuthService,
+ protected activatedRoute: ActivatedRoute,
+ protected adapterService: AdapterService,
+ protected adapterMonitoringService: AdapterMonitoringService,
+ protected breadcrumbService: SpBreadcrumbService,
+ ) {}
+ onInit(): void {
+ this.authService.user$.subscribe(user => {
+ const elementId = this.activatedRoute.snapshot.params.elementId;
+ if (elementId) {
+ this.tabs = new SpAdapterDetailsTabs().getTabs(elementId);
+ this.currentAdapterId = elementId;
+ this.loadAdapter();
+ }
+ });
+ }
- constructor(protected authService: AuthService,
- protected activatedRoute: ActivatedRoute,
- protected adapterService: AdapterService,
- protected adapterMonitoringService: AdapterMonitoringService,
- protected breadcrumbService: SpBreadcrumbService) {
- }
+ loadAdapter(): void {
+ this.adapterService.getAdapter(this.currentAdapterId).subscribe(res => {
+ this.adapter = res;
+ this.onAdapterLoaded();
+ });
+ }
- onInit(): void {
- this.authService.user$.subscribe(user => {
- const elementId = this.activatedRoute.snapshot.params.elementId;
- if (elementId) {
- this.tabs = new SpAdapterDetailsTabs().getTabs(elementId);
- this.currentAdapterId = elementId;
- this.loadAdapter();
- }
- });
- }
-
- loadAdapter(): void {
- this.adapterService.getAdapter(this.currentAdapterId).subscribe(res => {
- this.adapter = res;
- this.onAdapterLoaded();
- });
- }
-
- triggerUpdate(): void {
- this.adapterMonitoringService.triggerMonitoringUpdate().subscribe(() => {
- this.onAdapterLoaded();
- });
- }
-
- abstract onAdapterLoaded(): void;
+ triggerUpdate(): void {
+ this.adapterMonitoringService
+ .triggerMonitoringUpdate()
+ .subscribe(() => {
+ this.onAdapterLoaded();
+ });
+ }
+ abstract onAdapterLoaded(): void;
}
diff --git a/ui/src/app/connect/components/adapter-details/adapter-details-logs/adapter-details-logs.component.html b/ui/src/app/connect/components/adapter-details/adapter-details-logs/adapter-details-logs.component.html
index 08526dcc3..039d5eb4b 100644
--- a/ui/src/app/connect/components/adapter-details/adapter-details-logs/adapter-details-logs.component.html
+++ b/ui/src/app/connect/components/adapter-details/adapter-details-logs/adapter-details-logs.component.html
@@ -16,27 +16,30 @@
~
-->
-<sp-basic-nav-tabs [spNavigationItems]="tabs"
- [activeLink]="'logs'"
- [showBackLink]="true"
- [backLinkTarget]="['connect']">
-
- <div nav fxFlex="100" fxLayout="row" fxLayoutAlign="end center">
- <button mat-button
+<sp-basic-nav-tabs
+ [spNavigationItems]="tabs"
+ [activeLink]="'logs'"
+ [showBackLink]="true"
+ [backLinkTarget]="['connect']"
+>
+ <div nav fxFlex="100" fxLayout="row" fxLayoutAlign="end center">
+ <button
+ mat-button
mat-icon-button
color="accent"
class="mr-10"
matTooltip="Refresh"
- (click)="triggerUpdate()">
- <i class="material-icons">refresh</i>
- </button>
- </div>
- <div fxFlex="100" fxLayout="column" *ngIf="adapter">
- <sp-simple-logs [elementName]="adapter.name"
- [logs]="adapterLogs"
- fxFlex="100"
- fxLayout="column"></sp-simple-logs>
- </div>
-
-
+ (click)="triggerUpdate()"
+ >
+ <i class="material-icons">refresh</i>
+ </button>
+ </div>
+ <div fxFlex="100" fxLayout="column" *ngIf="adapter">
+ <sp-simple-logs
+ [elementName]="adapter.name"
+ [logs]="adapterLogs"
+ fxFlex="100"
+ fxLayout="column"
+ ></sp-simple-logs>
+ </div>
</sp-basic-nav-tabs>
diff --git a/ui/src/app/connect/components/adapter-details/adapter-details-logs/adapter-details-logs.component.ts b/ui/src/app/connect/components/adapter-details/adapter-details-logs/adapter-details-logs.component.ts
index f71620e99..ab1c5081a 100644
--- a/ui/src/app/connect/components/adapter-details/adapter-details-logs/adapter-details-logs.component.ts
+++ b/ui/src/app/connect/components/adapter-details/adapter-details-logs/adapter-details-logs.component.ts
@@ -20,41 +20,60 @@ import { Component, OnInit } from '@angular/core';
import { SpAbstractAdapterDetailsDirective } from '../abstract-adapter-details.directive';
import { AuthService } from '../../../../services/auth.service';
import { ActivatedRoute } from '@angular/router';
-import { AdapterService, AdapterMonitoringService, SpLogEntry } from '@streampipes/platform-services';
+import {
+ AdapterService,
+ AdapterMonitoringService,
+ SpLogEntry,
+} from '@streampipes/platform-services';
import { SpPipelineRoutes } from '../../../../pipelines/pipelines.routes';
import { SpBreadcrumbService } from '@streampipes/shared-ui';
import { SpConnectRoutes } from '../../../connect.routes';
@Component({
- selector: 'sp-adapter-details-logs',
- templateUrl: './adapter-details-logs.component.html',
- styleUrls: ['./adapter-details-logs.component.scss']
+ selector: 'sp-adapter-details-logs',
+ templateUrl: './adapter-details-logs.component.html',
+ styleUrls: ['./adapter-details-logs.component.scss'],
})
-export class SpAdapterDetailsLogsComponent extends SpAbstractAdapterDetailsDirective implements OnInit {
+export class SpAdapterDetailsLogsComponent
+ extends SpAbstractAdapterDetailsDirective
+ implements OnInit
+{
+ adapterLogs: SpLogEntry[];
- adapterLogs: SpLogEntry[];
+ constructor(
+ authService: AuthService,
+ activatedRoute: ActivatedRoute,
+ adapterService: AdapterService,
+ adapterMonitoringService: AdapterMonitoringService,
+ breadcrumbService: SpBreadcrumbService,
+ ) {
+ super(
+ authService,
+ activatedRoute,
+ adapterService,
+ adapterMonitoringService,
+ breadcrumbService,
+ );
+ }
- constructor(authService: AuthService,
- activatedRoute: ActivatedRoute,
- adapterService: AdapterService,
- adapterMonitoringService: AdapterMonitoringService,
- breadcrumbService: SpBreadcrumbService) {
- super(authService, activatedRoute, adapterService, adapterMonitoringService, breadcrumbService);
- }
+ ngOnInit(): void {
+ super.onInit();
+ }
- ngOnInit(): void {
- super.onInit();
- }
-
- loadLogs(): void {
- this.adapterMonitoringService.getLogInfoForAdapter(this.currentAdapterId).subscribe(res => {
- this.adapterLogs = res;
- });
- }
-
- onAdapterLoaded(): void {
- this.breadcrumbService.updateBreadcrumb([SpConnectRoutes.BASE, {label: this.adapter.name}, {label: 'Logs'}]);
- this.loadLogs();
- }
+ loadLogs(): void {
+ this.adapterMonitoringService
+ .getLogInfoForAdapter(this.currentAdapterId)
+ .subscribe(res => {
+ this.adapterLogs = res;
+ });
+ }
+ onAdapterLoaded(): void {
+ this.breadcrumbService.updateBreadcrumb([
+ SpConnectRoutes.BASE,
+ { label: this.adapter.name },
+ { label: 'Logs' },
+ ]);
+ this.loadLogs();
+ }
}
diff --git a/ui/src/app/connect/components/adapter-details/adapter-details-metrics/adapter-details-metrics.component.html b/ui/src/app/connect/components/adapter-details/adapter-details-metrics/adapter-details-metrics.component.html
index 8e602c2c5..0ebb4af9c 100644
--- a/ui/src/app/connect/components/adapter-details/adapter-details-metrics/adapter-details-metrics.component.html
+++ b/ui/src/app/connect/components/adapter-details/adapter-details-metrics/adapter-details-metrics.component.html
@@ -16,28 +16,32 @@
~
-->
-<sp-basic-nav-tabs [spNavigationItems]="tabs"
- [activeLink]="'metrics'"
- [showBackLink]="true"
- [backLinkTarget]="['connect']">
- <div nav fxFlex="100" fxLayout="row" fxLayoutAlign="end center">
- <button mat-button
+<sp-basic-nav-tabs
+ [spNavigationItems]="tabs"
+ [activeLink]="'metrics'"
+ [showBackLink]="true"
+ [backLinkTarget]="['connect']"
+>
+ <div nav fxFlex="100" fxLayout="row" fxLayoutAlign="end center">
+ <button
+ mat-button
mat-icon-button
color="accent"
class="mr-10"
matTooltip="Refresh"
- (click)="triggerUpdate()">
- <i class="material-icons">refresh</i>
- </button>
- </div>
- <div fxFlex="100" fxLayout="column" *ngIf="adapter && adapterMetrics">
- <sp-simple-metrics [elementName]="adapter.name"
- lastPublishedLabel="Last published message"
- statusValueLabel="Published messages"
- [lastTimestamp]="adapterMetrics.lastTimestamp"
- [statusValue]="adapterMetrics.messagesOut.counter">
- </sp-simple-metrics>
- </div>
-
-
+ (click)="triggerUpdate()"
+ >
+ <i class="material-icons">refresh</i>
+ </button>
+ </div>
+ <div fxFlex="100" fxLayout="column" *ngIf="adapter && adapterMetrics">
+ <sp-simple-metrics
+ [elementName]="adapter.name"
+ lastPublishedLabel="Last published message"
+ statusValueLabel="Published messages"
+ [lastTimestamp]="adapterMetrics.lastTimestamp"
+ [statusValue]="adapterMetrics.messagesOut.counter"
+ >
+ </sp-simple-metrics>
+ </div>
</sp-basic-nav-tabs>
diff --git a/ui/src/app/connect/components/adapter-details/adapter-details-metrics/adapter-details-metrics.component.ts b/ui/src/app/connect/components/adapter-details/adapter-details-metrics/adapter-details-metrics.component.ts
index 4544d04ce..83310d4df 100644
--- a/ui/src/app/connect/components/adapter-details/adapter-details-metrics/adapter-details-metrics.component.ts
+++ b/ui/src/app/connect/components/adapter-details/adapter-details-metrics/adapter-details-metrics.component.ts
@@ -20,40 +20,59 @@ import { Component, OnInit } from '@angular/core';
import { SpAbstractAdapterDetailsDirective } from '../abstract-adapter-details.directive';
import { AuthService } from '../../../../services/auth.service';
import { ActivatedRoute } from '@angular/router';
-import { AdapterService, AdapterMonitoringService, SpMetricsEntry } from '@streampipes/platform-services';
+import {
+ AdapterService,
+ AdapterMonitoringService,
+ SpMetricsEntry,
+} from '@streampipes/platform-services';
import { SpBreadcrumbService } from '@streampipes/shared-ui';
import { SpConnectRoutes } from '../../../connect.routes';
@Component({
- selector: 'sp-adapter-details-metrics',
- templateUrl: './adapter-details-metrics.component.html',
- styleUrls: []
+ selector: 'sp-adapter-details-metrics',
+ templateUrl: './adapter-details-metrics.component.html',
+ styleUrls: [],
})
-export class SpAdapterDetailsMetricsComponent extends SpAbstractAdapterDetailsDirective implements OnInit {
+export class SpAdapterDetailsMetricsComponent
+ extends SpAbstractAdapterDetailsDirective
+ implements OnInit
+{
+ adapterMetrics: SpMetricsEntry;
- adapterMetrics: SpMetricsEntry;
+ constructor(
+ authService: AuthService,
+ activatedRoute: ActivatedRoute,
+ adapterService: AdapterService,
+ adapterMonitoringService: AdapterMonitoringService,
+ breadcrumbService: SpBreadcrumbService,
+ ) {
+ super(
+ authService,
+ activatedRoute,
+ adapterService,
+ adapterMonitoringService,
+ breadcrumbService,
+ );
+ }
- constructor(authService: AuthService,
- activatedRoute: ActivatedRoute,
- adapterService: AdapterService,
- adapterMonitoringService: AdapterMonitoringService,
- breadcrumbService: SpBreadcrumbService) {
- super(authService, activatedRoute, adapterService, adapterMonitoringService, breadcrumbService);
- }
+ ngOnInit(): void {
+ super.onInit();
+ }
- ngOnInit(): void {
- super.onInit();
- }
-
- loadMetrics(): void {
- this.adapterMonitoringService.getMetricsInfoForAdapter(this.currentAdapterId).subscribe(res => {
- this.adapterMetrics = res;
- });
- }
-
- onAdapterLoaded(): void {
- this.breadcrumbService.updateBreadcrumb([SpConnectRoutes.BASE, {label: this.adapter.name}, {label: 'Metrics'}]);
- this.loadMetrics();
- }
+ loadMetrics(): void {
+ this.adapterMonitoringService
+ .getMetricsInfoForAdapter(this.currentAdapterId)
+ .subscribe(res => {
+ this.adapterMetrics = res;
+ });
+ }
+ onAdapterLoaded(): void {
+ this.breadcrumbService.updateBreadcrumb([
+ SpConnectRoutes.BASE,
+ { label: this.adapter.name },
+ { label: 'Metrics' },
+ ]);
+ this.loadMetrics();
+ }
}
diff --git a/ui/src/app/connect/components/adapter-details/adapter-details-overview/adapter-details-overview.component.html b/ui/src/app/connect/components/adapter-details/adapter-details-overview/adapter-details-overview.component.html
index 50cb84629..987235ec6 100644
--- a/ui/src/app/connect/components/adapter-details/adapter-details-overview/adapter-details-overview.component.html
+++ b/ui/src/app/connect/components/adapter-details/adapter-details-overview/adapter-details-overview.component.html
@@ -16,12 +16,11 @@
~
-->
-<sp-basic-nav-tabs [spNavigationItems]="tabs"
- [activeLink]="'overview'"
- [showBackLink]="true"
- [backLinkTarget]="['connect']">
-
- <h1>Overview</h1>
-
-
+<sp-basic-nav-tabs
+ [spNavigationItems]="tabs"
+ [activeLink]="'overview'"
+ [showBackLink]="true"
+ [backLinkTarget]="['connect']"
+>
+ <h1>Overview</h1>
</sp-basic-nav-tabs>
diff --git a/ui/src/app/connect/components/adapter-details/adapter-details-overview/adapter-details-overview.component.ts b/ui/src/app/connect/components/adapter-details/adapter-details-overview/adapter-details-overview.component.ts
index 872ed6d50..f4a390e37 100644
--- a/ui/src/app/connect/components/adapter-details/adapter-details-overview/adapter-details-overview.component.ts
+++ b/ui/src/app/connect/components/adapter-details/adapter-details-overview/adapter-details-overview.component.ts
@@ -20,31 +20,47 @@ import { Component, OnInit } from '@angular/core';
import { SpAbstractAdapterDetailsDirective } from '../abstract-adapter-details.directive';
import { AuthService } from '../../../../services/auth.service';
import { ActivatedRoute } from '@angular/router';
-import { AdapterService, AdapterMonitoringService } from '@streampipes/platform-services';
+import {
+ AdapterService,
+ AdapterMonitoringService,
+} from '@streampipes/platform-services';
import { SpBreadcrumbService } from '@streampipes/shared-ui';
import { SpConnectRoutes } from '../../../connect.routes';
@Component({
- selector: 'sp-adapter-details-overview',
- templateUrl: './adapter-details-overview.component.html',
- styleUrls: ['./adapter-details-overview.component.scss']
+ selector: 'sp-adapter-details-overview',
+ templateUrl: './adapter-details-overview.component.html',
+ styleUrls: ['./adapter-details-overview.component.scss'],
})
-export class SpAdapterDetailsOverviewComponent extends SpAbstractAdapterDetailsDirective implements OnInit {
+export class SpAdapterDetailsOverviewComponent
+ extends SpAbstractAdapterDetailsDirective
+ implements OnInit
+{
+ constructor(
+ authService: AuthService,
+ activatedRoute: ActivatedRoute,
+ adapterService: AdapterService,
+ adapterMonitoringService: AdapterMonitoringService,
+ breadcrumbService: SpBreadcrumbService,
+ ) {
+ super(
+ authService,
+ activatedRoute,
+ adapterService,
+ adapterMonitoringService,
+ breadcrumbService,
+ );
+ }
- constructor(authService: AuthService,
- activatedRoute: ActivatedRoute,
- adapterService: AdapterService,
- adapterMonitoringService: AdapterMonitoringService,
- breadcrumbService: SpBreadcrumbService) {
- super(authService, activatedRoute, adapterService, adapterMonitoringService, breadcrumbService);
- }
-
- ngOnInit(): void {
- super.onInit();
- }
-
- onAdapterLoaded(): void {
- this.breadcrumbService.updateBreadcrumb([SpConnectRoutes.BASE, {label: this.adapter.name}, {label: 'Overview'}]);
- }
+ ngOnInit(): void {
+ super.onInit();
+ }
+ onAdapterLoaded(): void {
+ this.breadcrumbService.updateBreadcrumb([
+ SpConnectRoutes.BASE,
+ { label: this.adapter.name },
+ { label: 'Overview' },
+ ]);
+ }
}
diff --git a/ui/src/app/connect/components/adapter-details/adapter-details-tabs.ts b/ui/src/app/connect/components/adapter-details/adapter-details-tabs.ts
index 518b887bd..5dc34a559 100644
--- a/ui/src/app/connect/components/adapter-details/adapter-details-tabs.ts
+++ b/ui/src/app/connect/components/adapter-details/adapter-details-tabs.ts
@@ -19,12 +19,19 @@
import { SpNavigationItem } from '@streampipes/shared-ui';
export class SpAdapterDetailsTabs {
-
- public getTabs(elementId: string): SpNavigationItem[] {
- return [
- //{itemId: 'overview', itemTitle: 'Overview', itemLink: ['connect', 'details', elementId, 'overview']},
- {itemId: 'metrics', itemTitle: 'Metrics', itemLink: ['connect', 'details', elementId, 'metrics']},
- {itemId: 'logs', itemTitle: 'Logs', itemLink: ['connect', 'details', elementId, 'logs']}
- ];
- }
+ public getTabs(elementId: string): SpNavigationItem[] {
+ return [
+ //{itemId: 'overview', itemTitle: 'Overview', itemLink: ['connect', 'details', elementId, 'overview']},
+ {
+ itemId: 'metrics',
+ itemTitle: 'Metrics',
+ itemLink: ['connect', 'details', elementId, 'metrics'],
+ },
+ {
+ itemId: 'logs',
+ itemTitle: 'Logs',
+ itemLink: ['connect', 'details', elementId, 'logs'],
+ },
+ ];
+ }
}
diff --git a/ui/src/app/connect/components/configuration-group/configuration-group.component.html b/ui/src/app/connect/components/configuration-group/configuration-group.component.html
index 04e5b2ba7..33428bef6 100644
--- a/ui/src/app/connect/components/configuration-group/configuration-group.component.html
+++ b/ui/src/app/connect/components/configuration-group/configuration-group.component.html
@@ -16,17 +16,19 @@
~
-->
-<div style="padding: 15px;">
+<div style="padding: 15px">
<form [formGroup]="configurationGroup" fxFlex="100">
- <div fxFlex="100" >
- <app-static-property *ngFor="let config of configuration"
- [staticProperty]="config"
- [staticProperties]="configuration"
- [adapterId]="adapterId"
- [parentForm]="configurationGroup"
- [fieldName]="config.internalName"
- (updateEmitter)="triggerUpdate($event)"
- [completedStaticProperty]="completedStaticProperty">
+ <div fxFlex="100">
+ <app-static-property
+ *ngFor="let config of configuration"
+ [staticProperty]="config"
+ [staticProperties]="configuration"
+ [adapterId]="adapterId"
+ [parentForm]="configurationGroup"
+ [fieldName]="config.internalName"
+ (updateEmitter)="triggerUpdate($event)"
+ [completedStaticProperty]="completedStaticProperty"
+ >
</app-static-property>
</div>
</form>
diff --git a/ui/src/app/connect/components/configuration-group/configuration-group.component.scss b/ui/src/app/connect/components/configuration-group/configuration-group.component.scss
index 58ba04bdd..13cbc4aac 100644
--- a/ui/src/app/connect/components/configuration-group/configuration-group.component.scss
+++ b/ui/src/app/connect/components/configuration-group/configuration-group.component.scss
@@ -15,4 +15,3 @@
* limitations under the License.
*
*/
-
diff --git a/ui/src/app/connect/components/configuration-group/configuration-group.component.ts b/ui/src/app/connect/components/configuration-group/configuration-group.component.ts
index 41574d1c1..f546b7b7e 100644
--- a/ui/src/app/connect/components/configuration-group/configuration-group.component.ts
+++ b/ui/src/app/connect/components/configuration-group/configuration-group.component.ts
@@ -16,33 +16,28 @@
*
*/
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, Input } from '@angular/core';
import { UntypedFormGroup } from '@angular/forms';
import { StaticPropertyUnion } from '@streampipes/platform-services';
import { ConfigurationInfo } from '../../model/ConfigurationInfo';
@Component({
- selector: 'sp-configuration-group',
- templateUrl: './configuration-group.component.html',
- styleUrls: ['./configuration-group.component.scss']
+ selector: 'sp-configuration-group',
+ templateUrl: './configuration-group.component.html',
+ styleUrls: ['./configuration-group.component.scss'],
})
-export class ConfigurationGroupComponent implements OnInit {
+export class ConfigurationGroupComponent {
+ @Input() configurationGroup: UntypedFormGroup;
- @Input() configurationGroup: UntypedFormGroup;
+ @Input() adapterId: string;
- @Input() adapterId: string;
+ @Input() configuration: StaticPropertyUnion[];
- @Input() configuration: StaticPropertyUnion[];
+ completedStaticProperty: ConfigurationInfo;
- completedStaticProperty: ConfigurationInfo;
-
- constructor() { }
-
- ngOnInit(): void {
- }
-
- triggerUpdate(configurationInfo: ConfigurationInfo) {
- this.completedStaticProperty = {...configurationInfo};
- }
+ constructor() {}
+ triggerUpdate(configurationInfo: ConfigurationInfo) {
+ this.completedStaticProperty = { ...configurationInfo };
+ }
}
diff --git a/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.html b/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.html
index 52aa74ae5..6f78c27ef 100644
--- a/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.html
+++ b/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.html
@@ -16,19 +16,43 @@
~
-->
-<div [className]="className" fxFlex="100"
- fxLayout="column">
+<div [className]="className" fxFlex="100" fxLayout="column">
<div fxLayout="column">
- <div class="type" fxLayout="row" fxLayoutAlign="start start" fxFlex="100">
- <div class="type-data" fxLayout="row" fxLayoutAlign="start center" fxFlex>
- <mat-icon *ngIf="isDataSetDescription" class="historic">lens</mat-icon>
- <mat-icon *ngIf="isDataStreamDescription" class="real-time">lens</mat-icon>
+ <div
+ class="type"
+ fxLayout="row"
+ fxLayoutAlign="start start"
+ fxFlex="100"
+ >
+ <div
+ class="type-data"
+ fxLayout="row"
+ fxLayoutAlign="start center"
+ fxFlex
+ >
+ <mat-icon *ngIf="isDataSetDescription" class="historic"
+ >lens</mat-icon
+ >
+ <mat-icon *ngIf="isDataStreamDescription" class="real-time"
+ >lens</mat-icon
+ >
<p *ngIf="isDataSetDescription">Data Set</p>
<p *ngIf="isDataStreamDescription">Data Stream</p>
</div>
- <div fxLayout="row" fxLayoutAlign="end end" style="margin-left:5px;">
- <button class="small-button-add mat-basic no-min-width" (click)="$event.stopPropagation();"
- mat-raised-button mat-button [matMenuTriggerFor]="menu"><span style="font-size:12px;">...</span></button>
+ <div
+ fxLayout="row"
+ fxLayoutAlign="end end"
+ style="margin-left: 5px"
+ >
+ <button
+ class="small-button-add mat-basic no-min-width"
+ (click)="$event.stopPropagation()"
+ mat-raised-button
+ mat-button
+ [matMenuTriggerFor]="menu"
+ >
+ <span style="font-size: 12px">...</span>
+ </button>
<mat-menu #menu="matMenu">
<button mat-menu-item (click)="removeAdapter()">
<mat-icon>delete</mat-icon>
@@ -38,10 +62,19 @@
</div>
</div>
<div fxLayoutAlign="start center" fxLayout="column" class="icon">
- <img *ngIf="getIconUrl() && !adapter.icon" [src]="getIconUrl()" class="iconImg"/>
- <img *ngIf="adapter.icon" [src]="adapter.icon" style="min-height: 50px;" class="iconImg"/>
+ <img
+ *ngIf="getIconUrl() && !adapter.icon"
+ [src]="getIconUrl()"
+ class="iconImg"
+ />
+ <img
+ *ngIf="adapter.icon"
+ [src]="adapter.icon"
+ style="min-height: 50px"
+ class="iconImg"
+ />
</div>
- <h3>{{adapter.name}}</h3>
+ <h3>{{ adapter.name }}</h3>
</div>
<div fxLayout="row">
<div fxFlex="70" class="description" fxLayoutAlign="start start">
diff --git a/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.scss b/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.scss
index 94ea44faf..939098875 100644
--- a/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.scss
+++ b/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.scss
@@ -55,8 +55,8 @@
margin: 0;
}
.iconImg {
- max-height:50px;
- max-width:80%;
+ max-height: 50px;
+ max-width: 80%;
}
.historic {
cursor: pointer;
@@ -64,10 +64,10 @@
}
.real-time {
cursor: pointer;
- color: #FFEB3B;
+ color: #ffeb3b;
}
.icon {
- margin-top:20px;
- height:50px;
+ margin-top: 20px;
+ height: 50px;
}
diff --git a/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.ts b/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.ts
index b17d6f24e..93026e555 100644
--- a/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.ts
+++ b/ui/src/app/connect/components/data-marketplace/adapter-description/adapter-description.component.ts
@@ -19,81 +19,102 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ConnectService } from '../../../services/connect.service';
import { MatDialog } from '@angular/material/dialog';
-import { AdapterDescription, AdapterService } from '@streampipes/platform-services';
+import {
+ AdapterDescription,
+ AdapterService,
+} from '@streampipes/platform-services';
import { DialogService } from '@streampipes/shared-ui';
import { MatSnackBar } from '@angular/material/snack-bar';
@Component({
- selector: 'sp-adapter-description',
- templateUrl: './adapter-description.component.html',
- styleUrls: ['./adapter-description.component.scss']
+ selector: 'sp-adapter-description',
+ templateUrl: './adapter-description.component.html',
+ styleUrls: ['./adapter-description.component.scss'],
})
export class AdapterDescriptionComponent implements OnInit {
+ @Input()
+ adapter: AdapterDescription;
- @Input()
- adapter: AdapterDescription;
+ @Output()
+ updateAdapterEmitter: EventEmitter<void> = new EventEmitter<void>();
- @Output()
- updateAdapterEmitter: EventEmitter<void> = new EventEmitter<void>();
+ @Output()
+ createTemplateEmitter: EventEmitter<AdapterDescription> =
+ new EventEmitter<AdapterDescription>();
- @Output()
- createTemplateEmitter: EventEmitter<AdapterDescription> = new EventEmitter<AdapterDescription>();
+ deleting = false;
+ className = '';
+ isDataSetDescription = false;
+ isDataStreamDescription = false;
+ isRunningAdapter = false;
+ adapterLabel: string;
- deleting = false;
- className = '';
- isDataSetDescription = false;
- isDataStreamDescription = false;
- isRunningAdapter = false;
- adapterLabel: string;
+ constructor(
+ private connectService: ConnectService,
+ private dataMarketplaceService: AdapterService,
+ private dialogService: DialogService,
+ public dialog: MatDialog,
+ private _snackBar: MatSnackBar,
+ ) {}
- constructor(private connectService: ConnectService,
- private dataMarketplaceService: AdapterService,
- private dialogService: DialogService,
- public dialog: MatDialog,
- private _snackBar: MatSnackBar) {
- }
+ ngOnInit() {
+ if (this.adapter.name == null) {
+ this.adapter.name = '';
+ }
+ this.isDataSetDescription = this.connectService.isDataSetDescription(
+ this.adapter,
+ );
+ this.isDataStreamDescription =
+ this.connectService.isDataStreamDescription(this.adapter);
+ this.isRunningAdapter =
+ this.adapter.elementId !== undefined &&
+ !(this.adapter as any).isTemplate;
+ this.adapterLabel = this.adapter.name.split(' ').join('_');
+ this.className = this.getClassName();
+ }
- ngOnInit() {
- if (this.adapter.name == null) {
- this.adapter.name = '';
+ isGenericDescription(): boolean {
+ return this.connectService.isGenericDescription(this.adapter);
}
- this.isDataSetDescription = this.connectService.isDataSetDescription(this.adapter);
- this.isDataStreamDescription = this.connectService.isDataStreamDescription(this.adapter);
- this.isRunningAdapter = (this.adapter.elementId !== undefined && !(this.adapter as any).isTemplate);
- this.adapterLabel = this.adapter.name.split(' ').join('_');
- this.className = this.getClassName();
- }
- isGenericDescription(): boolean {
- return this.connectService.isGenericDescription(this.adapter);
- }
+ getClassName() {
+ let className = this.isRunningAdapter
+ ? 'adapter-box'
+ : 'adapter-description-box';
- getClassName() {
- let className = this.isRunningAdapter ? 'adapter-box' : 'adapter-description-box';
+ if (this.isDataSetDescription) {
+ className += ' adapter-box-set';
+ } else {
+ className += ' adapter-box-stream';
+ }
- if (this.isDataSetDescription) {
- className += ' adapter-box-set';
- } else {
- className += ' adapter-box-stream';
+ return className;
}
- return className;
- }
-
- getIconUrl() {
- // TODO Use "this.adapter.includesAssets" if boolean demoralizing is working
- if (this.adapter.includedAssets.length > 0) {
- return this.dataMarketplaceService.getAssetUrl(this.adapter.appId) + '/icon';
- } else {
- return `assets/img/connect/${this.adapter.iconUrl}`;
+ getIconUrl() {
+ // TODO Use "this.adapter.includesAssets" if boolean demoralizing is working
+ if (this.adapter.includedAssets.length > 0) {
+ return (
+ this.dataMarketplaceService.getAssetUrl(this.adapter.appId) +
+ '/icon'
+ );
+ } else {
+ return `assets/img/connect/${this.adapter.iconUrl}`;
+ }
}
- }
- removeAdapter(): void {
- this.dataMarketplaceService.deleteAdapterDescription(this.adapter.elementId).subscribe(_ => {
- this.updateAdapterEmitter.emit();
- }, _ => {
- this._snackBar.open('Cannot delete an adapter which has an active instance running.');
- });
- }
+ removeAdapter(): void {
+ this.dataMarketplaceService
+ .deleteAdapterDescription(this.adapter.elementId)
+ .subscribe(
+ _ => {
+ this.updateAdapterEmitter.emit();
+ },
+ _ => {
+ this._snackBar.open(
+ 'Cannot delete an adapter which has an active instance running.',
+ );
+ },
+ );
+ }
}
diff --git a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html
index 61d9949d9..2edc1192c 100644
--- a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html
+++ b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.html
@@ -16,44 +16,92 @@
~
-->
-<sp-basic-view showBackLink="true" [backLinkTarget]="['connect']" [padding]="true">
-
+<sp-basic-view
+ showBackLink="true"
+ [backLinkTarget]="['connect']"
+ [padding]="true"
+>
<div nav fxFlex="100" fxLayoutAlign="start center" fxLayout="row">
<sp-connect-filter-toolbar
- class="filter-bar-margin"
- (filterChangedEmitter)="applyFilter($event)">
+ class="filter-bar-margin"
+ (filterChangedEmitter)="applyFilter($event)"
+ >
</sp-connect-filter-toolbar>
- <div fxFlex="100" fxLayout="row" fxLayoutAlign="end center"
- style="padding-left:10px;padding-right:10px;font-size:14px;" class="page-container-nav">
- <button mat-icon-button id="startAdapterTutorial3" (click)="startAdapterTutorial3()"
- matTooltip="Tutorial: Generic Adapter">
+ <div
+ fxFlex="100"
+ fxLayout="row"
+ fxLayoutAlign="end center"
+ style="padding-left: 10px; padding-right: 10px; font-size: 14px"
+ class="page-container-nav"
+ >
+ <button
+ mat-icon-button
+ id="startAdapterTutorial3"
+ (click)="startAdapterTutorial3()"
+ matTooltip="Tutorial: Generic Adapter"
+ >
<mat-icon color="accent">school</mat-icon>
</button>
</div>
</div>
<div fxLayout="column" fxFlex="100">
- <sp-basic-header-title-component title="Select Adapter"></sp-basic-header-title-component>
+ <sp-basic-header-title-component
+ title="Select Adapter"
+ ></sp-basic-header-title-component>
<div fxFlex="100" fxLayout="column" fxLayoutAlign="center start">
- <div class="container-fluid marketplace-container" *ngIf="adapterLoadingError" fxFlex="100"
- fxLayoutAlign="center center" fxLayout="row">
- <h4>Available adapters could not be loaded. Did you start a Connect worker node?</h4>
+ <div
+ class="container-fluid marketplace-container"
+ *ngIf="adapterLoadingError"
+ fxFlex="100"
+ fxLayoutAlign="center center"
+ fxLayout="row"
+ >
+ <h4>
+ Available adapters could not be loaded. Did you start a
+ Connect worker node?
+ </h4>
</div>
- <div class="container-fluid marketplace-container" *ngIf="adaptersLoading" fxFlex="100"
- fxLayoutAlign="center center" fxLayout="row">
- <mat-spinner [mode]="'indeterminate'" [diameter]="20" color="accent"></mat-spinner>
- <h4> Searching for available adapters, please wait...</h4>
+ <div
+ class="container-fluid marketplace-container"
+ *ngIf="adaptersLoading"
+ fxFlex="100"
+ fxLayoutAlign="center center"
+ fxLayout="row"
+ >
+ <mat-spinner
+ [mode]="'indeterminate'"
+ [diameter]="20"
+ color="accent"
+ ></mat-spinner>
+ <h4>
+ Searching for available adapters, please wait...
+ </h4>
</div>
- <div class="container-fluid marketplace-container"
- *ngIf="!adaptersLoading && !adapterLoadingError && currentFilter">
- <div fxLayout="row wrap" fxLayoutAlign="start stretch"
- class="adapter-description-container">
- <sp-adapter-description attr.id="{{adapterDescription.name.replaceAll(' ', '_')}}"
- class="adapter-description"
- fxFlex="33"
- (updateAdapterEmitter)="getAdapterDescriptions()"
- (click)="selectAdapter(adapterDescription.appId)"
- *ngFor="let adapterDescription of adapterDescriptions | adapterFilter:currentFilter"
- [adapter]="adapterDescription"></sp-adapter-description>
+ <div
+ class="container-fluid marketplace-container"
+ *ngIf="
+ !adaptersLoading && !adapterLoadingError && currentFilter
+ "
+ >
+ <div
+ fxLayout="row wrap"
+ fxLayoutAlign="start stretch"
+ class="adapter-description-container"
+ >
+ <sp-adapter-description
+ attr.id="{{
+ adapterDescription.name.replaceAll(' ', '_')
+ }}"
+ class="adapter-description"
+ fxFlex="33"
+ (updateAdapterEmitter)="getAdapterDescriptions()"
+ (click)="selectAdapter(adapterDescription.appId)"
+ *ngFor="
+ let adapterDescription of adapterDescriptions
+ | adapterFilter : currentFilter
+ "
+ [adapter]="adapterDescription"
+ ></sp-adapter-description>
</div>
</div>
</div>
diff --git a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.scss b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.scss
index 6f91e02ca..d8fb526a8 100644
--- a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.scss
+++ b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.scss
@@ -17,44 +17,42 @@
*/
.adapter-description-container {
- width: 100%;
+ width: 100%;
}
.adapter-description {
- padding: 15px;
+ padding: 15px;
}
.data-marketplace-container {
- padding-bottom: 10px;
+ padding-bottom: 10px;
}
.marketplace-container {
- width:100%;
+ width: 100%;
}
.page-container-connect {
- min-height: calc(100vh - 70px);
+ min-height: calc(100vh - 70px);
}
.pl-5 {
- padding-left:5px;
+ padding-left: 5px;
}
.box {
- width: 200px; height: 300px;
- position: relative;
- border: 1px solid #BBB;
- background: #EEE;
+ width: 200px;
+ height: 300px;
+ position: relative;
+ border: 1px solid #bbb;
+ background: #eee;
}
.icon-style {
- margin: 15px 4px 0px 0px;
- color: var(--color-accent);
+ margin: 15px 4px 0px 0px;
+ color: var(--color-accent);
}
.filter-bar-margin {
- margin-left: 10px;
- padding-left: 10px;
+ margin-left: 10px;
+ padding-left: 10px;
}
-
-
-
diff --git a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.ts b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.ts
index 6cf253ddd..1d2b6dbb8 100644
--- a/ui/src/app/connect/components/data-marketplace/data-marketplace.component.ts
+++ b/ui/src/app/connect/components/data-marketplace/data-marketplace.component.ts
@@ -19,75 +19,83 @@
import { Component, OnInit } from '@angular/core';
import { ShepherdService } from '../../../services/tour/shepherd.service';
import { ConnectService } from '../../services/connect.service';
-import { AdapterDescriptionUnion, AdapterService } from '@streampipes/platform-services';
+import {
+ AdapterDescriptionUnion,
+ AdapterService,
+} from '@streampipes/platform-services';
import { DialogService, SpBreadcrumbService } from '@streampipes/shared-ui';
import { Router } from '@angular/router';
import { AdapterFilterSettingsModel } from '../../model/adapter-filter-settings.model';
import { SpConnectRoutes } from '../../connect.routes';
@Component({
- selector: 'sp-data-marketplace',
- templateUrl: './data-marketplace.component.html',
- styleUrls: ['./data-marketplace.component.scss']
+ selector: 'sp-data-marketplace',
+ templateUrl: './data-marketplace.component.html',
+ styleUrls: ['./data-marketplace.component.scss'],
})
export class DataMarketplaceComponent implements OnInit {
+ adapterDescriptions: AdapterDescriptionUnion[];
- adapterDescriptions: AdapterDescriptionUnion[];
+ adaptersLoading = true;
+ adapterLoadingError = false;
- adaptersLoading = true;
- adapterLoadingError = false;
+ currentFilter: AdapterFilterSettingsModel;
- currentFilter: AdapterFilterSettingsModel;
+ constructor(
+ private dataMarketplaceService: AdapterService,
+ private shepherdService: ShepherdService,
+ private connectService: ConnectService,
+ private dialogService: DialogService,
+ private router: Router,
+ private breadcrumbService: SpBreadcrumbService,
+ ) {}
- constructor(private dataMarketplaceService: AdapterService,
- private shepherdService: ShepherdService,
- private connectService: ConnectService,
- private dialogService: DialogService,
- private router: Router,
- private breadcrumbService: SpBreadcrumbService) {
- }
+ ngOnInit() {
+ this.breadcrumbService.updateBreadcrumb([
+ SpConnectRoutes.BASE,
+ this.breadcrumbService.removeLink(SpConnectRoutes.CREATE),
+ ]);
+ this.getAdapterDescriptions();
+ }
- ngOnInit() {
- this.breadcrumbService.updateBreadcrumb([SpConnectRoutes.BASE, this.breadcrumbService.removeLink(SpConnectRoutes.CREATE)]);
- this.getAdapterDescriptions();
- }
+ getAdapterDescriptions(): void {
+ this.adaptersLoading = true;
+ this.adapterDescriptions = [];
- getAdapterDescriptions(): void {
- this.adaptersLoading = true;
- this.adapterDescriptions = [];
+ this.dataMarketplaceService.getAdapterDescriptions().subscribe(
+ allAdapters => {
+ this.adapterDescriptions = allAdapters;
+ this.adapterDescriptions.sort((a, b) =>
+ a.name.localeCompare(b.name),
+ );
+ this.adaptersLoading = false;
+ },
+ error => {
+ console.log(error);
+ this.adaptersLoading = false;
+ this.adapterLoadingError = true;
+ },
+ );
+ }
- this.dataMarketplaceService
- .getAdapterDescriptions()
- .subscribe((allAdapters) => {
- this.adapterDescriptions = allAdapters;
- this.adapterDescriptions
- .sort((a, b) => a.name.localeCompare(b.name));
- this.adaptersLoading = false;
- }, error => {
- console.log(error);
- this.adaptersLoading = false;
- this.adapterLoadingError = true;
- });
- }
+ startAdapterTutorial() {
+ this.shepherdService.startAdapterTour();
+ }
- startAdapterTutorial() {
- this.shepherdService.startAdapterTour();
- }
+ startAdapterTutorial2() {
+ this.shepherdService.startAdapterTour2();
+ }
- startAdapterTutorial2() {
- this.shepherdService.startAdapterTour2();
- }
+ startAdapterTutorial3() {
+ this.shepherdService.startAdapterTour3();
+ }
- startAdapterTutorial3() {
- this.shepherdService.startAdapterTour3();
- }
+ selectAdapter(appId: string) {
+ this.router.navigate(['connect', 'create', appId]);
+ // this.shepherdService.trigger('select-adapter');
+ }
- selectAdapter(appId: string) {
- this.router.navigate(['connect', 'create', appId]);
- // this.shepherdService.trigger('select-adapter');
- }
-
- applyFilter(filter: AdapterFilterSettingsModel) {
- this.currentFilter = { ...filter };
- }
+ applyFilter(filter: AdapterFilterSettingsModel) {
+ this.currentFilter = { ...filter };
+ }
}
diff --git a/ui/src/app/connect/components/edit-adapter/edit-adapter.component.html b/ui/src/app/connect/components/edit-adapter/edit-adapter.component.html
index 5832b6b26..aceb1fec8 100644
--- a/ui/src/app/connect/components/edit-adapter/edit-adapter.component.html
+++ b/ui/src/app/connect/components/edit-adapter/edit-adapter.component.html
@@ -16,9 +16,9 @@
~
-->
-
-<sp-adapter-configuration *ngIf="initialized"
- [isEditMode]="true"
- [displayName]="adapterName"
- [adapter]="adapter"></sp-adapter-configuration>
-
+<sp-adapter-configuration
+ *ngIf="initialized"
+ [isEditMode]="true"
+ [displayName]="adapterName"
+ [adapter]="adapter"
+></sp-adapter-configuration>
diff --git a/ui/src/app/connect/components/edit-adapter/edit-adapter.component.ts b/ui/src/app/connect/components/edit-adapter/edit-adapter.component.ts
index f81646c96..0c60a6547 100644
--- a/ui/src/app/connect/components/edit-adapter/edit-adapter.component.ts
+++ b/ui/src/app/connect/components/edit-adapter/edit-adapter.component.ts
@@ -19,36 +19,43 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
-import { AdapterDescriptionUnion, AdapterService } from '@streampipes/platform-services';
+import {
+ AdapterDescriptionUnion,
+ AdapterService,
+} from '@streampipes/platform-services';
import { SpBreadcrumbService } from '@streampipes/shared-ui';
import { SpConnectRoutes } from '../../connect.routes';
@Component({
- selector: 'sp-edit-adapter',
- templateUrl: './edit-adapter.component.html',
- styleUrls: ['./edit-adapter.component.scss']
+ selector: 'sp-edit-adapter',
+ templateUrl: './edit-adapter.component.html',
+ styleUrls: ['./edit-adapter.component.scss'],
})
export class EditAdapterComponent implements OnInit {
-
- initialized = false;
- adapterName = '';
- adapter: AdapterDescriptionUnion = undefined;
-
- constructor(private adapterService: AdapterService,
- private breadcrumbService: SpBreadcrumbService,
- private route: ActivatedRoute) { }
-
- ngOnInit(): void {
-
- this.adapterService.getAdapter(this.route.snapshot.params.elementId).subscribe(adapter => {
-
- this.adapter = adapter;
- this.adapterName = adapter.name;
- this.initialized = true;
-
- this.breadcrumbService.updateBreadcrumb(this.breadcrumbService
- .makeRoute([SpConnectRoutes.BASE, SpConnectRoutes.EDIT], this.adapterName));
- });
- }
-
+ initialized = false;
+ adapterName = '';
+ adapter: AdapterDescriptionUnion = undefined;
+
+ constructor(
+ private adapterService: AdapterService,
+ private breadcrumbService: SpBreadcrumbService,
+ private route: ActivatedRoute,
+ ) {}
+
+ ngOnInit(): void {
+ this.adapterService
+ .getAdapter(this.route.snapshot.params.elementId)
+ .subscribe(adapter => {
+ this.adapter = adapter;
+ this.adapterName = adapter.name;
+ this.initialized = true;
+
+ this.breadcrumbService.updateBreadcrumb(
+ this.breadcrumbService.makeRoute(
+ [SpConnectRoutes.BASE, SpConnectRoutes.EDIT],
+ this.adapterName,
+ ),
+ );
+ });
+ }
}
diff --git a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
index f998e9559..4f1fbe342 100644
--- a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
+++ b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
@@ -16,232 +16,400 @@
~
-->
<sp-basic-view [showBackLink]="false" [padding]="true">
-
- <div nav fxFlex="100" fxLayoutAlign="start center" fxLayout="row" class="pl-10">
- <button mat-button
+ <div
+ nav
+ fxFlex="100"
+ fxLayoutAlign="start center"
+ fxLayout="row"
+ class="pl-10"
+ >
+ <button
+ mat-button
mat-raised-button
color="accent"
data-cy="connect-create-new-adapter-button"
- (click)="createNewAdapter()">
- <i class="material-icons">add</i> New adapter
- </button>
- <sp-connect-filter-toolbar
- class="filter-bar-margin"
- (filterChangedEmitter)="applyFilter($event)">
- </sp-connect-filter-toolbar>
- <div fxFlex
- fxLayout="row"
- fxLayoutAlign="end center">
- <button mat-button
- mat-icon-button
- matTooltip="Refresh adapters"
- matTooltipPosition="below"
- color="accent"
- (click)="getAdaptersRunning()">
- <i class="material-icons">
- refresh
- </i>
- </button>
+ (click)="createNewAdapter()"
+ >
+ <i class="material-icons">add</i> New adapter
+ </button>
+ <sp-connect-filter-toolbar
+ class="filter-bar-margin"
+ (filterChangedEmitter)="applyFilter($event)"
+ >
+ </sp-connect-filter-toolbar>
+ <div fxFlex fxLayout="row" fxLayoutAlign="end center">
+ <button
+ mat-button
+ mat-icon-button
+ matTooltip="Refresh adapters"
+ matTooltipPosition="below"
+ color="accent"
+ (click)="getAdaptersRunning()"
+ >
+ <i class="material-icons"> refresh </i>
+ </button>
+ </div>
</div>
- </div>
- <div fxFlex="100" fxLayout="column">
- <sp-basic-header-title-component title="My adapters"></sp-basic-header-title-component>
- <div fxFlex="100" fxLayout="row" fxLayoutAlign="center start">
- <sp-basic-inner-panel [showTitle]="false" innerPadding="0" outerMargin="0" fxFlex="90" [hideToolbar]="true">
- <div fxFlex="100" fxLayout="column" *ngIf="filteredAdapters.length > 0">
- <div fxFlex="100" fxLayout="column">
- <table fxFlex="100" mat-table [dataSource]="dataSource" style="width: 100%;" matSort>
- <ng-container matColumnDef="start">
- <th mat-header-cell *matHeaderCellDef> Start</th>
- <td mat-cell *matCellDef="let adapter">
- <button color="accent"
- mat-button
- mat-icon-button
- matTooltip="Start adapter"
- matTooltipPosition="above"
- data-cy="start-adapter"
- (click)="startAdapter(adapter)"
- *ngIf="(connectService.isDataStreamDescription(adapter)) && !adapter.running">
- <i class="material-icons">play_arrow</i>
- </button>
- <button color="accent"
- mat-button
- mat-icon-button
- matTooltip="Stop adapter"
- matTooltipPosition="above"
- data-cy="stop-adapter"
- (click)="stopAdapter(adapter)"
- *ngIf="(connectService.isDataStreamDescription(adapter)) && adapter.running">
- <i class="material-icons">stop</i>
- </button>
- </td>
- </ng-container>
-
- <ng-container matColumnDef="name">
- <th mat-header-cell
- mat-sort-header
- *matHeaderCellDef> Name</th>
- <td mat-cell *matCellDef="let adapter">
- <div><b style="margin-bottom:0;"
- data-cy="adapter-name">{{adapter.name}}</b>
- </div>
- <span>{{adapter.description != '' ? adapter.description : '-'}}</span>
- </td>
- </ng-container>
- <ng-container matColumnDef="adapterBase">
- <th mat-header-cell *matHeaderCellDef> Adapter</th>
- <td mat-cell *matCellDef="let adapter">
- <img class="adapter-icon"
- *ngIf="getIconUrl(adapter) && !adapter.icon"
- [src]="getIconUrl(adapter)"
- [alt]="adapter.name"
- />
- <img class="adapter-icon"
- *ngIf="adapter.icon"
- [alt]="adapter.name"
- [src]="adapter.icon"/>
- </td>
- </ng-container>
- <ng-container matColumnDef="adapterType">
- <th mat-header-cell *matHeaderCellDef> Type</th>
- <td mat-cell *matCellDef="let adapter">
- <div class="type-data" fxLayout="row" fxLayoutAlign="start start">
- <div fxLayout="row" fxLayoutAlign="center center">
- <mat-icon *ngIf="connectService.isDataSetDescription(adapter)"
- class="historic">
- lens
- </mat-icon>
- <mat-icon *ngIf="connectService.isDataStreamDescription(adapter)"
- class="real-time">
- lens
- </mat-icon>
- <div fxFlex="100" fxLayoutAlign="center center">
- <span *ngIf="connectService.isDataSetDescription(adapter)"> Data Set</span>
- <span *ngIf="connectService.isDataStreamDescription(adapter)"> Data Stream</span>
- </div>
- </div>
- </div>
- </td>
- </ng-container>
- <ng-container matColumnDef="lastModified">
- <th mat-header-cell *matHeaderCellDef> Created</th>
- <td mat-cell *matCellDef="let adapter">
- <h5>{{adapter.createdAt | date:'dd.MM.yyyy HH:mm'}}</h5>
- </td>
- </ng-container>
+ <div fxFlex="100" fxLayout="column">
+ <sp-basic-header-title-component
+ title="My adapters"
+ ></sp-basic-header-title-component>
+ <div fxFlex="100" fxLayout="row" fxLayoutAlign="center start">
+ <sp-basic-inner-panel
+ [showTitle]="false"
+ innerPadding="0"
+ outerMargin="0"
+ fxFlex="90"
+ [hideToolbar]="true"
+ >
+ <div
+ fxFlex="100"
+ fxLayout="column"
+ *ngIf="filteredAdapters.length > 0"
+ >
+ <div fxFlex="100" fxLayout="column">
+ <table
+ fxFlex="100"
+ mat-table
+ [dataSource]="dataSource"
+ style="width: 100%"
+ matSort
+ >
+ <ng-container matColumnDef="start">
+ <th mat-header-cell *matHeaderCellDef>Start</th>
+ <td mat-cell *matCellDef="let adapter">
+ <button
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Start adapter"
+ matTooltipPosition="above"
+ data-cy="start-adapter"
+ (click)="startAdapter(adapter)"
+ *ngIf="
+ connectService.isDataStreamDescription(
+ adapter
+ ) && !adapter.running
+ "
+ >
+ <i class="material-icons">play_arrow</i>
+ </button>
+ <button
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Stop adapter"
+ matTooltipPosition="above"
+ data-cy="stop-adapter"
+ (click)="stopAdapter(adapter)"
+ *ngIf="
+ connectService.isDataStreamDescription(
+ adapter
+ ) && adapter.running
+ "
+ >
+ <i class="material-icons">stop</i>
+ </button>
+ </td>
+ </ng-container>
- <ng-container matColumnDef="messagesSent">
- <th mat-header-cell *matHeaderCellDef matTooltip="Messages sent since last start">#Messages</th>
- <td mat-cell *matCellDef="let adapter">
- <span class="monitoring-info">{{adapterMetrics[adapter.elementId] ? adapterMetrics[adapter.elementId].messagesOut.counter : 0}}</span>
- </td>
- </ng-container>
+ <ng-container matColumnDef="name">
+ <th
+ mat-header-cell
+ mat-sort-header
+ *matHeaderCellDef
+ >
+ Name
+ </th>
+ <td mat-cell *matCellDef="let adapter">
+ <div>
+ <b
+ style="margin-bottom: 0"
+ data-cy="adapter-name"
+ >{{ adapter.name }}</b
+ >
+ </div>
+ <span>{{
+ adapter.description !== ''
+ ? adapter.description
+ : '-'
+ }}</span>
+ </td>
+ </ng-container>
+ <ng-container matColumnDef="adapterBase">
+ <th mat-header-cell *matHeaderCellDef>
+ Adapter
+ </th>
+ <td mat-cell *matCellDef="let adapter">
+ <img
+ class="adapter-icon"
+ *ngIf="
+ getIconUrl(adapter) && !adapter.icon
+ "
+ [src]="getIconUrl(adapter)"
+ [alt]="adapter.name"
+ />
+ <img
+ class="adapter-icon"
+ *ngIf="adapter.icon"
+ [alt]="adapter.name"
+ [src]="adapter.icon"
+ />
+ </td>
+ </ng-container>
+ <ng-container matColumnDef="adapterType">
+ <th mat-header-cell *matHeaderCellDef>Type</th>
+ <td mat-cell *matCellDef="let adapter">
+ <div
+ class="type-data"
+ fxLayout="row"
+ fxLayoutAlign="start start"
+ >
+ <div
+ fxLayout="row"
+ fxLayoutAlign="center center"
+ >
+ <mat-icon
+ *ngIf="
+ connectService.isDataSetDescription(
+ adapter
+ )
+ "
+ class="historic"
+ >
+ lens
+ </mat-icon>
+ <mat-icon
+ *ngIf="
+ connectService.isDataStreamDescription(
+ adapter
+ )
+ "
+ class="real-time"
+ >
+ lens
+ </mat-icon>
+ <div
+ fxFlex="100"
+ fxLayoutAlign="center center"
+ >
+ <span
+ *ngIf="
+ connectService.isDataSetDescription(
+ adapter
+ )
+ "
+ > Data Set</span
+ >
+ <span
+ *ngIf="
+ connectService.isDataStreamDescription(
+ adapter
+ )
+ "
+ > Data Stream</span
+ >
+ </div>
+ </div>
+ </div>
+ </td>
+ </ng-container>
+ <ng-container matColumnDef="lastModified">
+ <th mat-header-cell *matHeaderCellDef>
+ Created
+ </th>
+ <td mat-cell *matCellDef="let adapter">
+ <h5>
+ {{
+ adapter.createdAt
+ | date : 'dd.MM.yyyy HH:mm'
+ }}
+ </h5>
+ </td>
+ </ng-container>
- <ng-container matColumnDef="lastMessage">
- <th mat-header-cell *matHeaderCellDef> Last message</th>
- <td mat-cell *matCellDef="let adapter">
- <span class="monitoring-info">{{adapterMetrics[adapter.elementId] ? (adapterMetrics[adapter.elementId].lastTimestamp | date : 'medium') : 'n/a'}}</span>
- </td>
- </ng-container>
+ <ng-container matColumnDef="messagesSent">
+ <th
+ mat-header-cell
+ *matHeaderCellDef
+ matTooltip="Messages sent since last start"
+ >
+ #Messages
+ </th>
+ <td mat-cell *matCellDef="let adapter">
+ <span class="monitoring-info">{{
+ adapterMetrics[adapter.elementId]
+ ? adapterMetrics[adapter.elementId]
+ .messagesOut.counter
+ : 0
+ }}</span>
+ </td>
+ </ng-container>
- <ng-container matColumnDef="action">
- <th mat-header-cell *matHeaderCellDef> Action</th>
- <td mat-cell *matCellDef="let adapter">
- <div fxLayout="row">
- <span fxFlex
- fxFlexOrder="1"
- fxLayout="row"
- fxLayoutAlign="center center">
- <button color="accent"
- mat-button mat-icon-button
- matTooltip="Show details"
- matTooltipPosition="above"
- data-cy="details-adapter"
- (click)="navigateToDetailsOverviewPage(adapter)">
- <i class="material-icons">search</i>
- </button>
- </span>
- <span fxFlex
- fxFlexOrder="2"
- fxLayout="row"
- fxLayoutAlign="center center">
- <button color="accent"
- mat-button mat-icon-button
- matTooltip="Show info"
- matTooltipPosition="above"
- data-cy="info-adapter"
- (click)="openHelpDialog(adapter)">
- <i class="material-icons">help_outline</i>
- </button>
- </span>
- <span fxFlex
- fxFlexOrder="3"
- fxLayout="row"
- fxLayoutAlign="center center"
- *ngIf="isAdmin">
- <button color="accent"
- mat-button
- mat-icon-button
- matTooltip="Manage permissions"
- matTooltipPosition="above"
- (click)="showPermissionsDialog(adapter)">
- <i class="material-icons">share</i>
- </button>
- </span>
- <span fxFlex
- fxFlexOrder="4"
- fxLayout="row"
- fxLayoutAlign="center center">
- <button color="accent"
- mat-button
- mat-icon-button
- matTooltip="Edit adapter"
- data-cy="edit-adapter"
- matTooltipPosition="above"
- [disabled]="adapter.running"
- (click)="editAdapter(adapter)">
- <i class="material-icons">edit</i>
- </button>
- </span>
- <span fxFlex
- fxFlexOrder="5"
- fxLayout="row"
- fxLayoutAlign="center center">
- <button color="accent"
- mat-button
- mat-icon-button
- matTooltip="Delete adapter"
- data-cy="delete-adapter"
- matTooltipPosition="above"
- (click)="deleteAdapter(adapter)">
- <i class="material-icons">delete</i>
- </button>
- </span>
- </div>
- </td>
- </ng-container>
+ <ng-container matColumnDef="lastMessage">
+ <th mat-header-cell *matHeaderCellDef>
+ Last message
+ </th>
+ <td mat-cell *matCellDef="let adapter">
+ <span class="monitoring-info">{{
+ adapterMetrics[adapter.elementId]
+ ? (adapterMetrics[adapter.elementId]
+ .lastTimestamp
+ | date : 'medium')
+ : 'n/a'
+ }}</span>
+ </td>
+ </ng-container>
- <tr mat-header-row
- *matHeaderRowDef="displayedColumns"></tr>
- <tr mat-row
- *matRowDef="let row; columns: displayedColumns;"></tr>
+ <ng-container matColumnDef="action">
+ <th mat-header-cell *matHeaderCellDef>
+ Action
+ </th>
+ <td mat-cell *matCellDef="let adapter">
+ <div fxLayout="row">
+ <span
+ fxFlex
+ fxFlexOrder="1"
+ fxLayout="row"
+ fxLayoutAlign="center center"
+ >
+ <button
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Show details"
+ matTooltipPosition="above"
+ data-cy="details-adapter"
+ (click)="
+ navigateToDetailsOverviewPage(
+ adapter
+ )
+ "
+ >
+ <i class="material-icons"
+ >search</i
+ >
+ </button>
+ </span>
+ <span
+ fxFlex
+ fxFlexOrder="2"
+ fxLayout="row"
+ fxLayoutAlign="center center"
+ >
+ <button
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Show info"
+ matTooltipPosition="above"
+ data-cy="info-adapter"
+ (click)="
+ openHelpDialog(adapter)
+ "
+ >
+ <i class="material-icons"
+ >help_outline</i
+ >
+ </button>
+ </span>
+ <span
+ fxFlex
+ fxFlexOrder="3"
+ fxLayout="row"
+ fxLayoutAlign="center center"
+ *ngIf="isAdmin"
+ >
+ <button
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Manage permissions"
+ matTooltipPosition="above"
+ (click)="
+ showPermissionsDialog(
+ adapter
+ )
+ "
+ >
+ <i class="material-icons"
+ >share</i
+ >
+ </button>
+ </span>
+ <span
+ fxFlex
+ fxFlexOrder="4"
+ fxLayout="row"
+ fxLayoutAlign="center center"
+ >
+ <button
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Edit adapter"
+ data-cy="edit-adapter"
+ matTooltipPosition="above"
+ [disabled]="adapter.running"
+ (click)="editAdapter(adapter)"
+ >
+ <i class="material-icons"
+ >edit</i
+ >
+ </button>
+ </span>
+ <span
+ fxFlex
+ fxFlexOrder="5"
+ fxLayout="row"
+ fxLayoutAlign="center center"
+ >
+ <button
+ color="accent"
+ mat-button
+ mat-icon-button
+ matTooltip="Delete adapter"
+ data-cy="delete-adapter"
+ matTooltipPosition="above"
+ (click)="deleteAdapter(adapter)"
+ >
+ <i class="material-icons"
+ >delete</i
+ >
+ </button>
+ </span>
+ </div>
+ </td>
+ </ng-container>
- </table>
- </div>
- <div fxFlex="100" fxLayoutAlign="end end">
- <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]"
- [pageSize]="20"
- color="accent">
- </mat-paginator>
- </div>
- </div>
- <div fxFlex="100"
- fxLayout="column"
- fxLayoutAlign="center center"
- *ngIf="existingAdapters.length == 0">
- <h5>(no adapters available)</h5>
+ <tr
+ mat-header-row
+ *matHeaderRowDef="displayedColumns"
+ ></tr>
+ <tr
+ mat-row
+ *matRowDef="let row; columns: displayedColumns"
+ ></tr>
+ </table>
+ </div>
+ <div fxFlex="100" fxLayoutAlign="end end">
+ <mat-paginator
+ [pageSizeOptions]="[5, 10, 25, 100]"
+ [pageSize]="20"
+ color="accent"
+ >
+ </mat-paginator>
+ </div>
+ </div>
+ <div
+ fxFlex="100"
+ fxLayout="column"
+ fxLayoutAlign="center center"
+ *ngIf="existingAdapters.length === 0"
+ >
+ <h5>(no adapters available)</h5>
+ </div>
+ </sp-basic-inner-panel>
</div>
- </sp-basic-inner-panel>
</div>
- </div>
</sp-basic-view>
diff --git a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.scss b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.scss
index 17b2cfe28..6678a718a 100644
--- a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.scss
+++ b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.scss
@@ -16,45 +16,42 @@
*
*/
-
.mat-table {
-
}
.mat-paginator {
- border-top: 1px solid rgba(0,0,0,.12);
+ border-top: 1px solid rgba(0, 0, 0, 0.12);
}
.mat-row:nth-child(even) {
- background-color: var(--color-bg-1);
+ background-color: var(--color-bg-1);
}
.mat-row:nth-child(odd) {
- background-color: var(--color-bg-2);
+ background-color: var(--color-bg-2);
}
.adapter-icon {
- max-height:50px;
+ max-height: 50px;
}
.historic {
- cursor: pointer;
- color: #ffa23b;
+ cursor: pointer;
+ color: #ffa23b;
}
.real-time {
- cursor: pointer;
- color: #FFEB3B;
+ cursor: pointer;
+ color: #ffeb3b;
}
.filter-bar-margin {
- margin-left: 10px;
- padding-left: 10px;
+ margin-left: 10px;
+ padding-left: 10px;
}
.monitoring-info {
- color: var(--color-default-text);
- background: var(--color-bg-3);
- border-radius: 5px;
- padding: 5px;
- text-align: center;
+ color: var(--color-default-text);
+ background: var(--color-bg-3);
+ border-radius: 5px;
+ padding: 5px;
+ text-align: center;
}
-
diff --git a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
index cd2d702cc..da5d4a016 100644
--- a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
+++ b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
@@ -18,21 +18,22 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import {
- AdapterService,
- AdapterDescriptionUnion,
- AdapterMonitoringService,
- PipelineElementService,
- SpMetricsEntry,
- StreamPipesErrorMessage, PipelineService,
+ AdapterService,
+ AdapterDescriptionUnion,
+ AdapterMonitoringService,
+ PipelineElementService,
+ SpMetricsEntry,
+ StreamPipesErrorMessage,
+ PipelineService,
} from '@streampipes/platform-services';
import { MatTableDataSource } from '@angular/material/table';
import { ConnectService } from '../../services/connect.service';
import {
- DialogRef,
- DialogService,
- PanelType,
- SpBreadcrumbService,
- SpExceptionDetailsDialogComponent
+ DialogRef,
+ DialogService,
+ PanelType,
+ SpBreadcrumbService,
+ SpExceptionDetailsDialogComponent,
} from '@streampipes/shared-ui';
import { DeleteAdapterDialogComponent } from '../../dialog/delete-adapter-dialog/delete-adapter-dialog.component';
import { MatPaginator } from '@angular/material/paginator';
@@ -77,7 +78,7 @@ export class ExistingAdaptersComponent implements OnInit {
dataSource: MatTableDataSource<AdapterDescriptionUnion>;
isAdmin = false;
- adapterMetrics: Record<string, SpMetricsEntry> = {};
+ adapterMetrics: Record<string, SpMetricsEntry> = {};
constructor(
public connectService: ConnectService,
@@ -89,7 +90,7 @@ export class ExistingAdaptersComponent implements OnInit {
private router: Router,
private adapterFilter: AdapterFilterPipe,
private breadcrumbService: SpBreadcrumbService,
- private adapterMonitoringService: AdapterMonitoringService
+ private adapterMonitoringService: AdapterMonitoringService,
) {}
ngOnInit(): void {
@@ -145,27 +146,33 @@ export class ExistingAdaptersComponent implements OnInit {
});
}
- getMonitoringInfos(adapters: AdapterDescriptionUnion[]) {
- const observables = adapters
- .map(adapter => adapter.elementId)
- .map(elementId => this.adapterMonitoringService.getMetricsInfoForAdapter(elementId));
+ getMonitoringInfos(adapters: AdapterDescriptionUnion[]) {
+ const observables = adapters
+ .map(adapter => adapter.elementId)
+ .map(elementId =>
+ this.adapterMonitoringService.getMetricsInfoForAdapter(
+ elementId,
+ ),
+ );
- this.adapterMonitoringService.triggerMonitoringUpdate().subscribe(() => {
- zip(...observables).subscribe(metrics => {
- adapters.forEach((adapter, index) => {
- this.adapterMetrics[adapter.elementId] = metrics[index];
- })
- });
- });
- }
+ this.adapterMonitoringService
+ .triggerMonitoringUpdate()
+ .subscribe(() => {
+ zip(...observables).subscribe(metrics => {
+ adapters.forEach((adapter, index) => {
+ this.adapterMetrics[adapter.elementId] = metrics[index];
+ });
+ });
+ });
+ }
- getIconUrl(adapter: AdapterDescriptionUnion) {
- if (adapter.includedAssets.length > 0) {
- return this.adapterService.getAssetUrl(adapter.appId) + '/icon';
- } else {
- return 'assets/img/connect/' + adapter.iconUrl;
+ getIconUrl(adapter: AdapterDescriptionUnion) {
+ if (adapter.includedAssets.length > 0) {
+ return this.adapterService.getAssetUrl(adapter.appId) + '/icon';
+ } else {
+ return 'assets/img/connect/' + adapter.iconUrl;
+ }
}
- }
showPermissionsDialog(adapter: AdapterDescriptionUnion) {
const dialogRef = this.dialogService.open(
@@ -200,18 +207,14 @@ export class ExistingAdaptersComponent implements OnInit {
)
.subscribe(effectedPipelines => {
if (effectedPipelines.length > 0) {
- this.dialogService.open(
- CanNotEditAdapterDialog,
- {
- panelType: PanelType.STANDARD_PANEL,
- title: 'No edit possible',
- width: '50vw',
- data: {
- pipelines: effectedPipelines
- },
+ this.dialogService.open(CanNotEditAdapterDialog, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: 'No edit possible',
+ width: '50vw',
+ data: {
+ pipelines: effectedPipelines,
},
- );
-
+ });
} else {
this.router.navigate([
'connect',
@@ -223,16 +226,15 @@ export class ExistingAdaptersComponent implements OnInit {
}
deleteAdapter(adapter: AdapterDescriptionUnion): void {
- const dialogRef: DialogRef<
- DeleteAdapterDialogComponent
- > = this.dialogService.open(DeleteAdapterDialogComponent, {
- panelType: PanelType.STANDARD_PANEL,
- title: 'Delete Adapter',
- width: '70vw',
- data: {
- adapter: adapter,
- },
- });
+ const dialogRef: DialogRef<DeleteAdapterDialogComponent> =
+ this.dialogService.open(DeleteAdapterDialogComponent, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: 'Delete Adapter',
+ width: '70vw',
+ data: {
+ adapter: adapter,
+ },
+ });
dialogRef.afterClosed().subscribe(data => {
if (data) {
@@ -260,19 +262,22 @@ export class ExistingAdaptersComponent implements OnInit {
});
}
- getAdaptersRunning(): void {
- this.adapterService.getAdapters().subscribe(adapters => {
- this.existingAdapters = adapters;
- this.existingAdapters.sort((a, b) => a.name.localeCompare(b.name));
- this.filteredAdapters = this.adapterFilter.transform(this.existingAdapters, this.currentFilter);
- this.dataSource = new MatTableDataSource(this.filteredAdapters);
- this.getMonitoringInfos(adapters);
- setTimeout(() => {
- this.dataSource.paginator = this.paginator;
- this.dataSource.sort = this.sort;
- });
- });
- }
+ getAdaptersRunning(): void {
+ this.adapterService.getAdapters().subscribe(adapters => {
+ this.existingAdapters = adapters;
+ this.existingAdapters.sort((a, b) => a.name.localeCompare(b.name));
+ this.filteredAdapters = this.adapterFilter.transform(
+ this.existingAdapters,
+ this.currentFilter,
+ );
+ this.dataSource = new MatTableDataSource(this.filteredAdapters);
+ this.getMonitoringInfos(adapters);
+ setTimeout(() => {
+ this.dataSource.paginator = this.paginator;
+ this.dataSource.sort = this.sort;
+ });
+ });
+ }
createNewAdapter(): void {
this.router.navigate(['connect', 'create']);
diff --git a/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.html b/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.html
index d6fc0b5a5..ecb2b1812 100644
--- a/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.html
+++ b/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.html
@@ -17,29 +17,45 @@
-->
<div fxLayout="row" fxFlex="100">
-
- <div class="data-marketplace-options-item pl-5 form-style" fxLayoutAlign="start center"
- fxLayout="row">
+ <div
+ class="data-marketplace-options-item pl-5 form-style"
+ fxLayoutAlign="start center"
+ fxLayout="row"
+ >
<mat-icon color="accent">search</mat-icon>
<mat-form-field class="form-style" color="accent" floatLabel="never">
- <input matInput placeholder="Find Element" value="" (input)="updateFilterTerm($event.target.value)"
- name="something">
+ <input
+ matInput
+ placeholder="Find Element"
+ value=""
+ (input)="updateFilterTerm($event.target.value)"
+ name="something"
+ />
</mat-form-field>
</div>
<div class="data-marketplace-options-item">
<mat-form-field color="accent">
- <mat-select [(value)]="currentFilter.selectedType" (selectionChange)="filterAdapter($event)">
+ <mat-select
+ [(value)]="currentFilter.selectedType"
+ (selectionChange)="filterAdapter($event)"
+ >
<mat-option *ngFor="let type of adapterTypes" [value]="type">
- {{type}}
+ {{ type }}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="data-marketplace-options-item">
<mat-form-field color="accent">
- <mat-select [(value)]="currentFilter.selectedCategory" (selectionChange)="filterAdapter($event)">
- <mat-option *ngFor="let category of adapterCategories" [value]="category.code">
- {{category.label}}
+ <mat-select
+ [(value)]="currentFilter.selectedCategory"
+ (selectionChange)="filterAdapter($event)"
+ >
+ <mat-option
+ *ngFor="let category of adapterCategories"
+ [value]="category.code"
+ >
+ {{ category.label }}
</mat-option>
</mat-select>
</mat-form-field>
diff --git a/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.scss b/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.scss
index c239b471b..43d6109a4 100644
--- a/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.scss
+++ b/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.scss
@@ -17,32 +17,33 @@
*/
::ng-deep .mat-select-panel {
- background: #fff;
+ background: #fff;
}
-::ng-deep .mat-select-panel:not([class*=mat-elevation-z]) {
- box-shadow: 0 2px 4px -1px rgba(0,0,0,.2), 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12);
+::ng-deep .mat-select-panel:not([class*='mat-elevation-z']) {
+ box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2),
+ 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);
}
#categoryFilter {
- margin-top: 20px;
+ margin-top: 20px;
}
.data-marketplace-options {
- padding:0px;
- background-color: var(--color-bg-1);
- border-bottom: 1px solid var(--color-bg-3);
+ padding: 0px;
+ background-color: var(--color-bg-1);
+ border-bottom: 1px solid var(--color-bg-3);
}
.data-marketplace-options-item {
- display: inline;
- margin-right: 10px;
+ display: inline;
+ margin-right: 10px;
}
.form-style {
- margin: 0px 5px 0px 0px;
+ margin: 0px 5px 0px 0px;
}
.fixed-height {
- height: 50px;
+ height: 50px;
}
diff --git a/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.ts b/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.ts
index 7e67e7ddc..c4d9068ec 100644
--- a/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.ts
+++ b/ui/src/app/connect/components/filter-toolbar/filter-toolbar.component.ts
@@ -22,44 +22,48 @@ import { MatSelectChange } from '@angular/material/select';
import { AdapterFilterSettingsModel } from '../../model/adapter-filter-settings.model';
@Component({
- selector: 'sp-connect-filter-toolbar',
- templateUrl: './filter-toolbar.component.html',
- styleUrls: ['./filter-toolbar.component.scss']
+ selector: 'sp-connect-filter-toolbar',
+ templateUrl: './filter-toolbar.component.html',
+ styleUrls: ['./filter-toolbar.component.scss'],
})
export class SpConnectFilterToolbarComponent implements OnInit {
+ @Output()
+ filterChangedEmitter: EventEmitter<AdapterFilterSettingsModel> =
+ new EventEmitter<AdapterFilterSettingsModel>();
- @Output()
- filterChangedEmitter: EventEmitter<AdapterFilterSettingsModel> = new EventEmitter<AdapterFilterSettingsModel>();
+ adapterTypes: string[] = ['All types', 'Data Set', 'Data Stream'];
+ adapterCategories: any;
- adapterTypes: string[] = ['All types', 'Data Set', 'Data Stream'];
- adapterCategories: any;
+ currentFilter: AdapterFilterSettingsModel = {
+ textFilter: '',
+ selectedCategory: 'All',
+ selectedType: 'All types',
+ };
- currentFilter: AdapterFilterSettingsModel = {textFilter: '', selectedCategory: 'All', selectedType: 'All types'};
+ constructor(private dataMarketplaceService: AdapterService) {}
- constructor(private dataMarketplaceService: AdapterService) {
+ ngOnInit(): void {
+ this.loadAvailableTypeCategories();
+ }
- }
-
- ngOnInit(): void {
- this.loadAvailableTypeCategories();
- }
-
- loadAvailableTypeCategories() {
- this.dataMarketplaceService.getAdapterCategories().subscribe(res => {
- this.adapterCategories = res;
- this.adapterCategories.unshift({ label: 'All categories', description: '', code: 'All' });
- this.filterChangedEmitter.emit(this.currentFilter);
- });
- }
-
- filterAdapter(event: MatSelectChange) {
- this.filterChangedEmitter.emit(this.currentFilter);
- }
-
- updateFilterTerm(event: string) {
- this.currentFilter.textFilter = event;
- this.filterChangedEmitter.emit(this.currentFilter);
- }
+ loadAvailableTypeCategories() {
+ this.dataMarketplaceService.getAdapterCategories().subscribe(res => {
+ this.adapterCategories = res;
+ this.adapterCategories.unshift({
+ label: 'All categories',
+ description: '',
+ code: 'All',
+ });
+ this.filterChangedEmitter.emit(this.currentFilter);
+ });
+ }
+ filterAdapter(event: MatSelectChange) {
+ this.filterChangedEmitter.emit(this.currentFilter);
+ }
+ updateFilterTerm(event: string) {
+ this.currentFilter.textFilter = event;
+ this.filterChangedEmitter.emit(this.currentFilter);
+ }
}
diff --git a/ui/src/app/connect/components/new-adapter/new-adapter.component.html b/ui/src/app/connect/components/new-adapter/new-adapter.component.html
index cb4d6e78f..715eb3912 100644
--- a/ui/src/app/connect/components/new-adapter/new-adapter.component.html
+++ b/ui/src/app/connect/components/new-adapter/new-adapter.component.html
@@ -16,7 +16,9 @@
~
-->
-<sp-adapter-configuration *ngIf="initialized"
- [displayName]="adapterTypeName"
- [adapter]="adapter"
- [isEditMode]="false"></sp-adapter-configuration>
+<sp-adapter-configuration
+ *ngIf="initialized"
+ [displayName]="adapterTypeName"
+ [adapter]="adapter"
+ [isEditMode]="false"
+></sp-adapter-configuration>
diff --git a/ui/src/app/connect/components/new-adapter/new-adapter.component.ts b/ui/src/app/connect/components/new-adapter/new-adapter.component.ts
index 05683d056..6dec049db 100644
--- a/ui/src/app/connect/components/new-adapter/new-adapter.component.ts
+++ b/ui/src/app/connect/components/new-adapter/new-adapter.component.ts
@@ -17,40 +17,49 @@
*/
import { Component, OnInit } from '@angular/core';
-import { AdapterDescriptionUnion, AdapterService } from '@streampipes/platform-services';
+import {
+ AdapterDescriptionUnion,
+ AdapterService,
+} from '@streampipes/platform-services';
import { ActivatedRoute } from '@angular/router';
import { ConnectService } from '../../services/connect.service';
import { SpConnectRoutes } from '../../connect.routes';
import { SpBreadcrumbService } from '@streampipes/shared-ui';
@Component({
- selector: 'sp-new-adapter',
- templateUrl: './new-adapter.component.html',
- styleUrls: ['./new-adapter.component.scss']
+ selector: 'sp-new-adapter',
+ templateUrl: './new-adapter.component.html',
+ styleUrls: ['./new-adapter.component.scss'],
})
export class NewAdapterComponent implements OnInit {
+ initialized = false;
+ adapterTypeName = '';
+ adapter: AdapterDescriptionUnion = undefined;
- initialized = false;
- adapterTypeName = '';
- adapter: AdapterDescriptionUnion = undefined;
+ constructor(
+ private breadcrumbService: SpBreadcrumbService,
+ private connectService: ConnectService,
+ private adapterService: AdapterService,
+ private route: ActivatedRoute,
+ ) {}
- constructor(private breadcrumbService: SpBreadcrumbService,
- private connectService: ConnectService,
- private adapterService: AdapterService,
- private route: ActivatedRoute) { }
+ ngOnInit(): void {
+ this.adapterService.getAdapterDescriptions().subscribe(adapters => {
+ const adapter = adapters.find(
+ a => a.appId === this.route.snapshot.params.appId,
+ );
+ this.adapterTypeName = adapter.name;
+ this.adapter = this.connectService.cloneAdapterDescription(adapter);
- ngOnInit(): void {
-
- this.adapterService.getAdapterDescriptions().subscribe(adapters => {
- const adapter = adapters.find(a => a.appId === this.route.snapshot.params.appId);
- this.adapterTypeName = adapter.name;
- this.adapter = this.connectService.cloneAdapterDescription(adapter);
-
- this.breadcrumbService.updateBreadcrumb(this.breadcrumbService
- .makeRoute([SpConnectRoutes.BASE, SpConnectRoutes.CREATE], this.adapterTypeName));
- this.adapter.name = '';
- this.adapter.description = '';
- this.initialized = true;
- });
- }
+ this.breadcrumbService.updateBreadcrumb(
+ this.breadcrumbService.makeRoute(
+ [SpConnectRoutes.BASE, SpConnectRoutes.CREATE],
+ this.adapterTypeName,
+ ),
+ );
+ this.adapter.name = '';
+ this.adapter.description = '';
+ this.initialized = true;
+ });
+ }
}
diff --git a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html
index 2e0e3ab9d..4ce67a519 100644
--- a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html
+++ b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html
@@ -18,8 +18,14 @@
<div *ngIf="!runtimeData && !runtimeDataError">
<div fxLayout="column">
- <div fxLayoutAlign="center" >
- <mat-spinner [diameter]="40" fxLayoutAlign="center" style="margin: 10px 0 5px 0" color="accent">Loading</mat-spinner>
+ <div fxLayoutAlign="center">
+ <mat-spinner
+ [diameter]="40"
+ fxLayoutAlign="center"
+ style="margin: 10px 0 5px 0"
+ color="accent"
+ >Loading</mat-spinner
+ >
</div>
<div fxLayoutAlign="center">
<h3>Gathering data for live preview...</h3>
@@ -30,18 +36,38 @@
<p>Here is a preview of your data:</p>
<table class="dataTable row-border hover">
<thead>
- <tr>
- <th>Runtime Name</th>
- <th>Value</th>
- </tr>
+ <tr>
+ <th>Runtime Name</th>
+ <th>Value</th>
+ </tr>
</thead>
<tbody id="preview-data-rows-id">
- <tr *ngFor="let property of streamDescription.eventSchema.eventProperties" class="preview-row">
- <td>{{property.runtimeName}}</td>
- <td *ngIf="isImage(property)"> <img src="data:image/png;base64,{{runtimeData[property.runtimeName]}}" style="max-width: 150px;" /> </td>
- <td *ngIf="isTimestamp(property)">{{runtimeData[property.runtimeName] | date:'yyyy-MM-dd HH:mm:ss '}}</td>
- <td *ngIf="hasNoDomainProperty(property)">{{runtimeData[property.runtimeName]}}</td>
- </tr>
+ <tr
+ *ngFor="
+ let property of streamDescription.eventSchema
+ .eventProperties
+ "
+ class="preview-row"
+ >
+ <td>{{ property.runtimeName }}</td>
+ <td *ngIf="isImage(property)">
+ <img
+ src="data:image/png;base64,{{
+ runtimeData[property.runtimeName]
+ }}"
+ style="max-width: 150px"
+ />
+ </td>
+ <td *ngIf="isTimestamp(property)">
+ {{
+ runtimeData[property.runtimeName]
+ | date : 'yyyy-MM-dd HH:mm:ss '
+ }}
+ </td>
+ <td *ngIf="hasNoDomainProperty(property)">
+ {{ runtimeData[property.runtimeName] }}
+ </td>
+ </tr>
</tbody>
</table>
</div>
diff --git a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.scss b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.scss
index 56e3a59dd..442ccb57a 100644
--- a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.scss
+++ b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.scss
@@ -16,11 +16,11 @@
*
*/
-.preview-row, .preview-table {
- background: var(--color-bg-dialog);
+.preview-row,
+.preview-table {
+ background: var(--color-bg-dialog);
}
.dataTable tbody tr:hover {
- background: var(--color-bg-1);
+ background: var(--color-bg-1);
}
-
diff --git a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts
index a00e7b698..01e07422b 100644
--- a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts
+++ b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts
@@ -17,91 +17,101 @@
*/
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
-import { EventPropertyUnion, SpDataStream } from '@streampipes/platform-services';
+import {
+ EventPropertyUnion,
+ SpDataStream,
+} from '@streampipes/platform-services';
import { RestService } from '../../services/rest.service';
@Component({
- selector: 'pipeline-element-runtime-info',
- templateUrl: './pipeline-element-runtime-info.component.html',
- styleUrls: ['./pipeline-element-runtime-info.component.scss'],
+ selector: 'sp-pipeline-element-runtime-info',
+ templateUrl: './pipeline-element-runtime-info.component.html',
+ styleUrls: ['./pipeline-element-runtime-info.component.scss'],
})
export class PipelineElementRuntimeInfoComponent implements OnInit, OnDestroy {
+ @Input()
+ streamDescription: SpDataStream;
- @Input()
- streamDescription: SpDataStream;
+ _pollingActive: boolean;
- _pollingActive: boolean;
+ runtimeData: any;
+ timer: any;
+ runtimeDataError = false;
- runtimeData: any;
- timer: any;
- runtimeDataError = false;
+ constructor(private restService: RestService) {}
- constructor(private restService: RestService) {
+ ngOnInit(): void {
+ this.checkPollingStart();
+ }
+
+ checkPollingStart() {
+ if (this._pollingActive) {
+ this.getLatestRuntimeInfo();
+ }
+ }
+
+ getLatestRuntimeInfo() {
+ this.restService
+ .getRuntimeInfo(this.streamDescription)
+ .subscribe(data => {
+ if (data) {
+ this.runtimeDataError = false;
+ if (
+ !(
+ Object.keys(data).length === 0 &&
+ data.constructor === Object
+ )
+ ) {
+ this.runtimeData = data;
+ }
+
+ if (this._pollingActive) {
+ this.timer = setTimeout(() => {
+ this.getLatestRuntimeInfo();
+ }, 1000);
+ }
+ } else {
+ this.runtimeDataError = true;
+ }
+ });
+ }
+
+ isPropertyType(property: EventPropertyUnion, type) {
+ return (
+ property.domainProperties !== undefined &&
+ property.domainProperties.length === 1 &&
+ property.domainProperties[0] === type
+ );
+ }
- }
+ isImage(property) {
+ return this.isPropertyType(property, 'https://image.com');
+ }
+
+ isTimestamp(property) {
+ return this.isPropertyType(property, 'http://schema.org/DateTime');
+ }
- ngOnInit(): void {
- this.checkPollingStart();
- }
+ hasNoDomainProperty(property) {
+ if (this.isTimestamp(property) || this.isImage(property)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
- checkPollingStart() {
- if (this._pollingActive) {
- this.getLatestRuntimeInfo();
+ @Input()
+ set pollingActive(pollingActive: boolean) {
+ this._pollingActive = pollingActive;
+ this.checkPollingStart();
}
- }
-
- getLatestRuntimeInfo() {
- this.restService.getRuntimeInfo(this.streamDescription).subscribe(data => {
- if (data) {
- this.runtimeDataError = false;
- if (!(Object.keys(data).length === 0 && data.constructor === Object)) {
- this.runtimeData = data;
- }
-
- if (this._pollingActive) {
- this.timer = setTimeout(() => {
- this.getLatestRuntimeInfo();
- }, 1000);
- }
- } else {
- this.runtimeDataError = true;
- }
- });
- }
-
- isPropertyType(property: EventPropertyUnion, type) {
- return property.domainProperties !== undefined && property.domainProperties.length === 1 &&
- property.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;
+
+ get pollingActive(): boolean {
+ return this._pollingActive;
+ }
+
+ ngOnDestroy(): void {
+ this.pollingActive = false;
+ clearTimeout(this.timer);
}
- }
-
- @Input()
- set pollingActive(pollingActive: boolean) {
- this._pollingActive = pollingActive;
- this.checkPollingStart();
- }
-
- get pollingActive(): boolean {
- return this._pollingActive;
- }
-
- ngOnDestroy(): void {
- this.pollingActive = false;
- clearTimeout(this.timer);
- }
}
diff --git a/ui/src/app/connect/connect.routes.ts b/ui/src/app/connect/connect.routes.ts
index 95a2c8e7c..83c3f4d7f 100644
--- a/ui/src/app/connect/connect.routes.ts
+++ b/ui/src/app/connect/connect.routes.ts
@@ -16,12 +16,16 @@
*
*/
-import { SpBreadcrumbItem, } from '@streampipes/shared-ui';
+import { SpBreadcrumbItem } from '@streampipes/shared-ui';
export class SpConnectRoutes {
-
- static BASE: SpBreadcrumbItem = {label: 'Connect', link: ['connect']};
- static CREATE: SpBreadcrumbItem = {label: 'New Adapter', link: ['connect', 'create']};
- static EDIT: SpBreadcrumbItem = {label: 'Edit Adapter', link: ['connect', 'edit']};
-
+ static BASE: SpBreadcrumbItem = { label: 'Connect', link: ['connect'] };
+ static CREATE: SpBreadcrumbItem = {
+ label: 'New Adapter',
+ link: ['connect', 'create'],
+ };
+ static EDIT: SpBreadcrumbItem = {
+ label: 'Edit Adapter',
+ link: ['connect', 'edit'],
+ };
}
diff --git a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.html b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.html
index 67dc3581c..4d969d9ab 100644
--- a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.html
+++ b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.html
@@ -21,61 +21,116 @@
<div fxLayout="column" fxLayoutAlign="center center" fxFlex="100">
<div fxLayout="column" *ngIf="!adapterInstalled">
<div fxLayoutAlign="center">
- <mat-spinner [diameter]="50" fxLayoutAlign="center" style="margin: 10px 0 5px 0" color="accent">Loading
+ <mat-spinner
+ [diameter]="50"
+ fxLayoutAlign="center"
+ style="margin: 10px 0 5px 0"
+ color="accent"
+ >Loading
</mat-spinner>
</div>
<div fxLayoutAlign="center">
- <h3>Please wait while your new adapter is being generated...</h3>
+ <h3>
+ Please wait while your new adapter is being generated...
+ </h3>
</div>
</div>
<div fxLayout="column" *ngIf="adapterInstalled && editMode">
- <div data-cy="info-adapter-successfully-updated"
- fxLayoutAlign="center">
+ <div
+ data-cy="info-adapter-successfully-updated"
+ fxLayoutAlign="center"
+ >
<h3>Adapter successfully updated</h3>
</div>
</div>
- <div fxLayout="column" fxLayoutAlign="center center" fxFlex="100" *ngIf="adapterInstalled && !editMode" class="w-100">
- <div fxLayout="column" fxLayoutAlign="center center" fxFlex="100" *ngIf="pipelineOperationStatus">
+ <div
+ fxLayout="column"
+ fxLayoutAlign="center center"
+ fxFlex="100"
+ *ngIf="adapterInstalled && !editMode"
+ class="w-100"
+ >
+ <div
+ fxLayout="column"
+ fxLayoutAlign="center center"
+ fxFlex="100"
+ *ngIf="pipelineOperationStatus"
+ >
<sp-pipeline-started-status
- [pipelineOperationStatus]="pipelineOperationStatus">
+ [pipelineOperationStatus]="pipelineOperationStatus"
+ >
</sp-pipeline-started-status>
<mat-divider fxFlex="100"></mat-divider>
</div>
- <div *ngIf="adapterStatus.success" fxFlex="100" fxLayout="column" class="w-100">
+ <div
+ *ngIf="adapterStatus.success"
+ fxFlex="100"
+ fxLayout="column"
+ class="w-100"
+ >
<div *ngIf="!isSetAdapter">
- <div class="success-message" fxFlex="100" fxLayoutAlign="center center" fxLayout="row">
+ <div
+ class="success-message"
+ fxFlex="100"
+ fxLayoutAlign="center center"
+ fxLayout="row"
+ >
<i class="material-icons">done</i>
- <span> Your new data stream is now available in the pipeline editor.</span>
+ <span
+ > Your new data stream is now available in
+ the pipeline editor.</span
+ >
</div>
</div>
<div *ngIf="isSetAdapter">
- <div class="success-message" fxFlex="100" fxLayoutAlign="center center" fxLayout="row"
- data-cy="sp-connect-adapter-set-success">
+ <div
+ class="success-message"
+ fxFlex="100"
+ fxLayoutAlign="center center"
+ fxLayout="row"
+ data-cy="sp-connect-adapter-set-success"
+ >
<i class="material-icons">done</i>
- <span> Your new data set is now available in the pipeline editor.</span>
+ <span
+ > Your new data set is now available in the
+ pipeline editor.</span
+ >
</div>
</div>
<div *ngIf="!isSetAdapter" fxFlex="100">
- <pipeline-element-runtime-info [streamDescription]="streamDescription"
- [pollingActive]="pollingActive"></pipeline-element-runtime-info>
+ <sp-pipeline-element-runtime-info
+ [streamDescription]="streamDescription"
+ [pollingActive]="pollingActive"
+ ></sp-pipeline-element-runtime-info>
</div>
-
</div>
<div *ngIf="!adapterStatus.success">
- <div class="success-message" fxFlex="100" fxLayoutAlign="center center" fxLayout="row">
+ <div
+ class="success-message"
+ fxFlex="100"
+ fxLayoutAlign="center center"
+ fxLayout="row"
+ >
<i class="material-icons">error</i>
- <span>Something went wrong during the adapter installation.</span>
+ <span
+ >Something went wrong during the adapter
+ installation.</span
+ >
</div>
</div>
</div>
-
-
</div>
</div>
<mat-divider></mat-divider>
<div class="sp-dialog-actions actions-align-right">
- <button id="confirm_adapter_started_button" class="mat-basic" mat-raised-button (click)="onCloseConfirm()">Close
+ <button
+ id="confirm_adapter_started_button"
+ class="mat-basic"
+ mat-raised-button
+ (click)="onCloseConfirm()"
+ >
+ Close
</button>
</div>
</div>
diff --git a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.scss b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.scss
index f9f664a9a..91de402c9 100644
--- a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.scss
+++ b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.scss
@@ -19,8 +19,8 @@
@import 'src/scss/sp/sp-dialog';
.success-message {
- text-align: center;
- font-size: 14pt;
- margin-top: 20px;
- margin-bottom: 20px;
+ text-align: center;
+ font-size: 14pt;
+ margin-top: 20px;
+ margin-bottom: 20px;
}
diff --git a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
index e07db10d4..aaa4941cf 100644
--- a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
+++ b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
@@ -20,137 +20,144 @@ import { Component, Input, OnInit } from '@angular/core';
import { ShepherdService } from '../../../services/tour/shepherd.service';
import { RestService } from '../../services/rest.service';
import {
- AdapterDescriptionUnion,
- GenericAdapterSetDescription,
- Message,
- PipelineOperationStatus,
- PipelineTemplateService,
- SpDataStream,
- SpecificAdapterSetDescription,
+ AdapterDescriptionUnion,
+ GenericAdapterSetDescription,
+ Message,
+ PipelineOperationStatus,
+ PipelineTemplateService,
+ SpDataStream,
+ SpecificAdapterSetDescription,
} from '@streampipes/platform-services';
import { DialogRef } from '@streampipes/shared-ui';
import { PipelineInvocationBuilder } from '../../../core-services/template/PipelineInvocationBuilder';
import { AdapterService } from '../../../../../projects/streampipes/platform-services/src/lib/apis/adapter.service';
-
@Component({
- selector: 'sp-dialog-adapter-started-dialog',
- templateUrl: './adapter-started-dialog.component.html',
- styleUrls: ['./adapter-started-dialog.component.scss']
+ selector: 'sp-dialog-adapter-started-dialog',
+ templateUrl: './adapter-started-dialog.component.html',
+ styleUrls: ['./adapter-started-dialog.component.scss'],
})
export class AdapterStartedDialog implements OnInit {
-
- adapterInstalled = false;
- public adapterStatus: Message;
- public streamDescription: SpDataStream;
- pollingActive = false;
- public isSetAdapter = false;
- public pipelineOperationStatus: PipelineOperationStatus;
-
- adapterSuccessfullyEdited = false;
-
- /**
- * AdapterDescriptionUnion that should be persisted and started
- */
- @Input() adapter: AdapterDescriptionUnion;
-
- /**
- * Indicates if a pipeline to store the adapter events should be started
- */
- @Input() saveInDataLake: boolean;
-
- /**
- * Timestamp field of event. Required when storing events in the data lake.
- */
- @Input() dataLakeTimestampField: string;
-
- /**
- * When true a user edited an existing AdapterDescriptionUnion
- */
- @Input() editMode = false;
-
-
- constructor(
- public dialogRef: DialogRef<AdapterStartedDialog>,
- private adapterService: AdapterService,
- private restService: RestService,
- private shepherdService: ShepherdService,
- private pipelineTemplateService: PipelineTemplateService) {
- }
-
- ngOnInit() {
- if (this.editMode) {
- this.editAdapter();
- } else {
- this.startAdapter();
+ adapterInstalled = false;
+ public adapterStatus: Message;
+ public streamDescription: SpDataStream;
+ pollingActive = false;
+ public isSetAdapter = false;
+ public pipelineOperationStatus: PipelineOperationStatus;
+
+ adapterSuccessfullyEdited = false;
+
+ /**
+ * AdapterDescriptionUnion that should be persisted and started
+ */
+ @Input() adapter: AdapterDescriptionUnion;
+
+ /**
+ * Indicates if a pipeline to store the adapter events should be started
+ */
+ @Input() saveInDataLake: boolean;
+
+ /**
+ * Timestamp field of event. Required when storing events in the data lake.
+ */
+ @Input() dataLakeTimestampField: string;
+
+ /**
+ * When true a user edited an existing AdapterDescriptionUnion
+ */
+ @Input() editMode = false;
+
+ constructor(
+ public dialogRef: DialogRef<AdapterStartedDialog>,
+ private adapterService: AdapterService,
+ private restService: RestService,
+ private shepherdService: ShepherdService,
+ private pipelineTemplateService: PipelineTemplateService,
+ ) {}
+
+ ngOnInit() {
+ if (this.editMode) {
+ this.editAdapter();
+ } else {
+ this.startAdapter();
+ }
}
- }
-
- editAdapter() {
- this.adapterService.updateAdapter(this.adapter).subscribe(status => {
- this.adapterStatus = status;
- this.adapterInstalled = true;
- });
- }
+ editAdapter() {
+ this.adapterService.updateAdapter(this.adapter).subscribe(status => {
+ this.adapterStatus = status;
+ this.adapterInstalled = true;
+ });
+ }
- startAdapter() {
- // const newAdapter = this.adapter;
- this.adapterService.addAdapter(this.adapter).subscribe(status => {
- this.adapterStatus = status;
- if (status.success) {
+ startAdapter() {
+ // const newAdapter = this.adapter;
+ this.adapterService.addAdapter(this.adapter).subscribe(status => {
+ this.adapterStatus = status;
+ if (status.success) {
+ // Start preview on streams and message for sets
+ if (
+ this.adapter instanceof GenericAdapterSetDescription ||
+ this.adapter instanceof SpecificAdapterSetDescription
+ ) {
+ this.isSetAdapter = true;
+ } else {
+ this.getLiveViewPreview(status);
+ }
+
+ if (this.saveInDataLake) {
+ this.startSaveInDataLakePipeline(status);
+ } else {
+ this.adapterInstalled = true;
+ }
+ }
+ });
+ }
- // Start preview on streams and message for sets
- if (this.adapter instanceof GenericAdapterSetDescription || this.adapter instanceof SpecificAdapterSetDescription) {
- this.isSetAdapter = true;
- } else {
- this.getLiveViewPreview(status);
- }
+ onCloseConfirm() {
+ this.pollingActive = false;
+ this.dialogRef.close('Confirm');
+ this.shepherdService.trigger('confirm_adapter_started_button');
+ }
- if (this.saveInDataLake) {
- this.startSaveInDataLakePipeline(status);
- } else {
- this.adapterInstalled = true;
- }
- }
- });
- }
-
- onCloseConfirm() {
- this.pollingActive = false;
- this.dialogRef.close('Confirm');
- this.shepherdService.trigger('confirm_adapter_started_button');
- }
-
- private getLiveViewPreview(status: Message) {
- this.restService.getSourceDetails(status.notifications[0].title).subscribe(st => {
- this.streamDescription = st;
- this.pollingActive = true;
- });
- }
-
- private startSaveInDataLakePipeline(status: Message) {
- const pipelineId = 'org.apache.streampipes.manager.template.instances.DataLakePipelineTemplate';
- this.pipelineTemplateService.getPipelineTemplateInvocation(status.notifications[0].title, pipelineId)
- .subscribe(res => {
-
- const pipelineName = 'Persist ' + this.adapter.name;
-
- const indexName = this.adapter.name;
-
- const pipelineInvocation = PipelineInvocationBuilder
- .create(res)
- .setName(pipelineName)
- .setTemplateId(pipelineId)
- .setFreeTextStaticProperty('db_measurement', indexName)
- .setMappingPropertyUnary('timestamp_mapping', 's0::' + this.dataLakeTimestampField)
- .build();
-
- this.pipelineTemplateService.createPipelineTemplateInvocation(pipelineInvocation).subscribe(pipelineOperationStatus => {
- this.pipelineOperationStatus = pipelineOperationStatus;
- this.adapterInstalled = true;
- });
- });
- }
+ private getLiveViewPreview(status: Message) {
+ this.restService
+ .getSourceDetails(status.notifications[0].title)
+ .subscribe(st => {
+ this.streamDescription = st;
+ this.pollingActive = true;
+ });
+ }
+ private startSaveInDataLakePipeline(status: Message) {
+ const pipelineId =
+ 'org.apache.streampipes.manager.template.instances.DataLakePipelineTemplate';
+ this.pipelineTemplateService
+ .getPipelineTemplateInvocation(
+ status.notifications[0].title,
+ pipelineId,
+ )
+ .subscribe(res => {
+ const pipelineName = 'Persist ' + this.adapter.name;
+
+ const indexName = this.adapter.name;
+
+ const pipelineInvocation = PipelineInvocationBuilder.create(res)
+ .setName(pipelineName)
+ .setTemplateId(pipelineId)
+ .setFreeTextStaticProperty('db_measurement', indexName)
+ .setMappingPropertyUnary(
+ 'timestamp_mapping',
+ 's0::' + this.dataLakeTimestampField,
+ )
+ .build();
+
+ this.pipelineTemplateService
+ .createPipelineTemplateInvocation(pipelineInvocation)
+ .subscribe(pipelineOperationStatus => {
+ this.pipelineOperationStatus = pipelineOperationStatus;
+ this.adapterInstalled = true;
+ });
+ });
+ }
}
diff --git a/ui/src/app/connect/dialog/adapter-template/adapter-template-dialog.component.html b/ui/src/app/connect/dialog/adapter-template/adapter-template-dialog.component.html
index 7d395344f..45bf0333a 100644
--- a/ui/src/app/connect/dialog/adapter-template/adapter-template-dialog.component.html
+++ b/ui/src/app/connect/dialog/adapter-template/adapter-template-dialog.component.html
@@ -18,22 +18,34 @@
<div class="sp-dialog-container">
<div class="sp-dialog-content p-15">
- <div fxFlex="100"
- fxLayout="column">
- <pipeline-element-template-config [staticProperties]="configs"
- [template]="template"
- [templateConfigs]="templateConfigs"
- [appId]="appId">
+ <div fxFlex="100" fxLayout="column">
+ <pipeline-element-template-config
+ [staticProperties]="configs"
+ [template]="template"
+ [templateConfigs]="templateConfigs"
+ [appId]="appId"
+ >
</pipeline-element-template-config>
</div>
</div>
<mat-divider></mat-divider>
<div class="sp-dialog-actions">
- <button mat-button mat-raised-button color="accent"
- (click)="saveTemplate()"
- style="margin-right: 10px;">
+ <button
+ mat-button
+ mat-raised-button
+ color="accent"
+ (click)="saveTemplate()"
+ style="margin-right: 10px"
+ >
Create template
</button>
- <button mat-button mat-raised-button class="mat-basic" (click)="dialogRef.close()">Close</button>
+ <button
+ mat-button
+ mat-raised-button
+ class="mat-basic"
+ (click)="dialogRef.close()"
+ >
+ Close
+ </button>
</div>
</div>
diff --git a/ui/src/app/connect/dialog/adapter-template/adapter-template-dialog.component.ts b/ui/src/app/connect/dialog/adapter-template/adapter-template-dialog.component.ts
index 76f3ce757..2d04328a5 100644
--- a/ui/src/app/connect/dialog/adapter-template/adapter-template-dialog.component.ts
+++ b/ui/src/app/connect/dialog/adapter-template/adapter-template-dialog.component.ts
@@ -18,54 +18,54 @@
import { Component, Input, OnInit } from '@angular/core';
import {
- PipelineElementTemplate,
- PipelineElementTemplateConfig,
- PipelineElementTemplateService,
- StaticPropertyUnion
+ PipelineElementTemplate,
+ PipelineElementTemplateConfig,
+ PipelineElementTemplateService,
+ StaticPropertyUnion,
} from '@streampipes/platform-services';
import { DialogRef } from '@streampipes/shared-ui';
@Component({
- selector: 'sp-adapter-template-dialog',
- templateUrl: './adapter-template-dialog.component.html',
- styleUrls: ['./adapter-template-dialog.component.scss']
+ selector: 'sp-adapter-template-dialog',
+ templateUrl: './adapter-template-dialog.component.html',
+ styleUrls: ['./adapter-template-dialog.component.scss'],
})
export class SpAdapterTemplateDialogComponent implements OnInit {
+ @Input()
+ configs: StaticPropertyUnion[];
- @Input()
- configs: StaticPropertyUnion[];
+ @Input()
+ appId: string;
- @Input()
- appId: string;
+ template: PipelineElementTemplate;
+ templateConfigs: Map<string, any> = new Map();
- template: PipelineElementTemplate;
- templateConfigs: Map<string, any> = new Map();
+ constructor(
+ public dialogRef: DialogRef<SpAdapterTemplateDialogComponent>,
+ private pipelineElementTemplateService: PipelineElementTemplateService,
+ ) {}
- constructor(public dialogRef: DialogRef<SpAdapterTemplateDialogComponent>,
- private pipelineElementTemplateService: PipelineElementTemplateService) {
+ ngOnInit(): void {
+ this.template = new PipelineElementTemplate();
+ }
- }
-
- ngOnInit(): void {
- this.template = new PipelineElementTemplate();
- }
-
- saveTemplate() {
- this.template.templateConfigs = this.convert(this.templateConfigs);
- this.pipelineElementTemplateService.storePipelineElementTemplate(this.template).subscribe(result => {
- this.dialogRef.close(true);
- });
- }
-
- convert(templateConfigs: Map<string, any>): any {
- const configs: { [index: string]: PipelineElementTemplateConfig } = {};
- templateConfigs.forEach((value, key) => {
- configs[key] = new PipelineElementTemplateConfig();
- configs[key].editable = value.editable;
- configs[key].displayed = value.displayed;
- configs[key].value = value.value;
- });
- return configs;
- }
+ saveTemplate() {
+ this.template.templateConfigs = this.convert(this.templateConfigs);
+ this.pipelineElementTemplateService
+ .storePipelineElementTemplate(this.template)
+ .subscribe(result => {
+ this.dialogRef.close(true);
+ });
+ }
+ convert(templateConfigs: Map<string, any>): any {
+ const configs: { [index: string]: PipelineElementTemplateConfig } = {};
+ templateConfigs.forEach((value, key) => {
+ configs[key] = new PipelineElementTemplateConfig();
+ configs[key].editable = value.editable;
+ configs[key].displayed = value.displayed;
+ configs[key].value = value.value;
+ });
+ return configs;
+ }
}
diff --git a/ui/src/app/connect/dialog/can-not-edit-adapter-dialog/can-not-edit-adapter-dialog.component.cy.ts b/ui/src/app/connect/dialog/can-not-edit-adapter-dialog/can-not-edit-adapter-dialog.component.cy.ts
index 6d29ecd5a..6dde0ca82 100644
--- a/ui/src/app/connect/dialog/can-not-edit-adapter-dialog/can-not-edit-adapter-dialog.component.cy.ts
+++ b/ui/src/app/connect/dialog/can-not-edit-adapter-dialog/can-not-edit-adapter-dialog.component.cy.ts
@@ -21,28 +21,28 @@ import { DialogRef } from '@streampipes/shared-ui';
import { Pipeline } from '@streampipes/platform-services';
describe('CanNotEditAdapterDialog', () => {
+ it('Show error message and containing pipelines', () => {
+ const expectedPipelineName = 'Demo pipeline';
+ const pipeline = new Pipeline();
+ pipeline.name = expectedPipelineName;
- it('Show error message and containing pipelines', () => {
- const expectedPipelineName = 'Demo pipeline';
- const pipeline = new Pipeline();
- pipeline.name = expectedPipelineName;
-
- mount(`<sp-can-not-edit-adapter-dialog
+ mount(
+ `<sp-can-not-edit-adapter-dialog
[pipelines]="pipelines">
</sp-can-not-edit-adapter-dialog>`,
- {'pipelines': [pipeline]});
-
- cy.dataCy('can-not-edit-adapter-dialog-warning').should('be.visible');
- cy.dataCy('adapter-in-pipeline').should('have.length', 1);
- cy.dataCy('adapter-in-pipeline').contains(expectedPipelineName);
- });
+ { pipelines: [pipeline] },
+ );
-
- const mount = (template: string, cp?) => {
- cy.mount(template, {
- declarations: [CanNotEditAdapterDialog],
- providers: [{ provide: DialogRef, useValue: {}}],
- componentProperties: cp
+ cy.dataCy('can-not-edit-adapter-dialog-warning').should('be.visible');
+ cy.dataCy('adapter-in-pipeline').should('have.length', 1);
+ cy.dataCy('adapter-in-pipeline').contains(expectedPipelineName);
});
- };
+
+ const mount = (template: string, cp?) => {
+ cy.mount(template, {
+ declarations: [CanNotEditAdapterDialog],
+ providers: [{ provide: DialogRef, useValue: {} }],
+ componentProperties: cp,
+ });
+ };
});
diff --git a/ui/src/app/connect/dialog/can-not-edit-adapter-dialog/can-not-edit-adapter-dialog.component.html b/ui/src/app/connect/dialog/can-not-edit-adapter-dialog/can-not-edit-adapter-dialog.component.html
index 6eb30a2b3..35bb5c8b7 100644
--- a/ui/src/app/connect/dialog/can-not-edit-adapter-dialog/can-not-edit-adapter-dialog.component.html
+++ b/ui/src/app/connect/dialog/can-not-edit-adapter-dialog/can-not-edit-adapter-dialog.component.html
@@ -20,20 +20,26 @@
<div class="sp-dialog-content p-15">
<div fxLayout="column">
<div fxLayout="column">
- <div fxFlex="100"
- fxLayoutAlign="center center"
- fxLayout="column"
- data-cy="can-not-edit-adapter-dialog-warning">
+ <div
+ fxFlex="100"
+ fxLayoutAlign="center center"
+ fxLayout="column"
+ data-cy="can-not-edit-adapter-dialog-warning"
+ >
<b><h4>This adapter can not be edited.</h4></b>
<h5>It is used in the following pipelines:</h5>
</div>
</div>
<div fxFlex="100" fxLayout="column" class="w-100">
- <div fxFlex="100" fxLayout="column" class="mat-elevation-z1 mt-10"
- *ngFor="let pipeline of pipelines"
- data-cy="adapter-in-pipeline">
+ <div
+ fxFlex="100"
+ fxLayout="column"
+ class="mat-elevation-z1 mt-10"
+ *ngFor="let pipeline of pipelines"
+ data-cy="adapter-in-pipeline"
+ >
<div fxFlex="100" fxLayout="column" class="p-15">
- {{pipeline.name}}
+ {{ pipeline.name }}
</div>
</div>
</div>
@@ -41,11 +47,13 @@
</div>
<mat-divider></mat-divider>
<div class="sp-dialog-actions actions-align-right">
- <button mat-button
- mat-raised-button
- class="mat-basic"
- (click)="close()"
- data-cy="can-not-edit-adapter-dialog-close">
+ <button
+ mat-button
+ mat-raised-button
+ class="mat-basic"
+ (click)="close()"
+ data-cy="can-not-edit-adapter-dialog-close"
+ >
Close
</button>
</div>
diff --git a/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.html b/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.html
index 72ca41f8e..d77e1bcda 100644
--- a/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.html
+++ b/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.html
@@ -20,34 +20,68 @@
<div class="sp-dialog-content p-15">
<div *ngIf="!isInProgress && adapterUsedByPipeline" fxLayout="column">
<div fxFlex="100" fxLayoutAlign="center center" fxLayout="column">
- <b><h4>This adapter is currently used by {{numberOfPipelinesWithAdapter}} pipeline{{numberOfPipelinesWithAdapter === 1 ? '' : 's'}}.</h4></b>
- <h5>Delete these pipelines first before deleting the adapter.</h5>
+ <b
+ ><h4>
+ This adapter is currently used by
+ {{ numberOfPipelinesWithAdapter }} pipeline{{
+ numberOfPipelinesWithAdapter === 1 ? '' : 's'
+ }}.
+ </h4></b
+ >
+ <h5>
+ Delete these pipelines first before deleting the adapter.
+ </h5>
</div>
</div>
<div *ngIf="!isInProgress && !adapterUsedByPipeline" fxLayout="column">
<div fxFlex="100" fxLayoutAlign="center center" fxLayout="column">
- <b><h4>Do you really want to delete adapter {{adapter.name}}?</h4></b>
+ <b
+ ><h4>
+ Do you really want to delete adapter {{ adapter.name }}?
+ </h4></b
+ >
<b><h5>This operation cannot be undone.</h5></b>
</div>
<div fxFlex="100" fxLayoutAlign="center center" fxLayout="column">
- <button mat-button mat-raised-button color="accent"
- (click)="deleteAdapter()"
- data-cy="delete-adapter-confirmation">Delete
- adapter
+ <button
+ mat-button
+ mat-raised-button
+ color="accent"
+ (click)="deleteAdapter()"
+ data-cy="delete-adapter-confirmation"
+ >
+ Delete adapter
</button>
</div>
</div>
- <div fxFlex="100" fxLayoutAlign="center center" fxLayout="column" *ngIf="isInProgress" data-cy="adapter-deletion-in-progress">
+ <div
+ fxFlex="100"
+ fxLayoutAlign="center center"
+ fxLayout="column"
+ *ngIf="isInProgress"
+ data-cy="adapter-deletion-in-progress"
+ >
<div fxLayout="row" fxLayoutAlign="space-around">
- <mat-spinner [diameter]="50" [mode]="'indeterminate'" color="accent"></mat-spinner>
+ <mat-spinner
+ [diameter]="50"
+ [mode]="'indeterminate'"
+ color="accent"
+ ></mat-spinner>
</div>
- <b><h4>{{currentStatus}}</h4></b>
+ <b
+ ><h4>{{ currentStatus }}</h4></b
+ >
</div>
</div>
<mat-divider></mat-divider>
<div class="sp-dialog-actions actions-align-right">
- <button mat-button mat-raised-button class="mat-basic" (click)="close(false)">
+ <button
+ mat-button
+ mat-raised-button
+ class="mat-basic"
+ (click)="close(false)"
+ >
Close
</button>
</div>
diff --git a/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.scss b/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.scss
index 0a776e5ff..fddade7bf 100644
--- a/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.scss
+++ b/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.scss
@@ -16,4 +16,4 @@
*
*/
-@import '../../../../scss/sp/sp-dialog.scss';
\ No newline at end of file
+@import '../../../../scss/sp/sp-dialog.scss';
diff --git a/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.ts b/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.ts
index dc61d383b..68ecd9c75 100644
--- a/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.ts
+++ b/ui/src/app/connect/dialog/delete-adapter-dialog/delete-adapter-dialog.component.ts
@@ -17,16 +17,18 @@
*/
import { Component, Input } from '@angular/core';
-import { AdapterDescriptionUnion, AdapterService } from '@streampipes/platform-services';
+import {
+ AdapterDescriptionUnion,
+ AdapterService,
+} from '@streampipes/platform-services';
import { DialogRef } from '@streampipes/shared-ui';
@Component({
selector: 'sp-delete-adapter-dialog',
templateUrl: './delete-adapter-dialog.component.html',
- styleUrls: ['./delete-adapter-dialog.component.scss']
+ styleUrls: ['./delete-adapter-dialog.component.scss'],
})
export class DeleteAdapterDialogComponent {
-
@Input()
adapter: AdapterDescriptionUnion;
@@ -35,9 +37,10 @@ export class DeleteAdapterDialogComponent {
adapterUsedByPipeline = false;
numberOfPipelinesWithAdapter = 0;
- constructor(private dialogRef: DialogRef<DeleteAdapterDialogComponent>,
- private dataMarketplaceService: AdapterService) {
- }
+ constructor(
+ private dialogRef: DialogRef<DeleteAdapterDialogComponent>,
+ private dataMarketplaceService: AdapterService,
+ ) {}
close(refreshAdapters: boolean) {
this.dialogRef.close(refreshAdapters);
@@ -47,15 +50,17 @@ export class DeleteAdapterDialogComponent {
this.isInProgress = true;
this.currentStatus = 'Deleting adapter...';
- this.dataMarketplaceService.deleteAdapter(this.adapter).subscribe(data => {
- this.close(true);
- }, error => {
- if (error.status === 409) {
- this.numberOfPipelinesWithAdapter = error.error.length;
- this.adapterUsedByPipeline = true;
- this.isInProgress = false;
- }
- });
+ this.dataMarketplaceService.deleteAdapter(this.adapter).subscribe(
+ data => {
+ this.close(true);
+ },
+ error => {
+ if (error.status === 409) {
+ this.numberOfPipelinesWithAdapter = error.error.length;
+ this.adapterUsedByPipeline = true;
+ this.isInProgress = false;
+ }
+ },
+ );
}
-
}
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-data-type/edit-data-type.component.html b/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-data-type/edit-data-type.component.html
index 05ed0e3f8..8ffaba560 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-data-type/edit-data-type.component.html
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-data-type/edit-data-type.component.html
@@ -18,12 +18,16 @@
<mat-form-field class="w-100" color="accent" fxFlex="100">
<mat-label>Field data type</mat-label>
- <mat-select placeholder="Data Type"
- [(ngModel)]="cachedProperty.runtimeType"
- (selectionChange)="valueChanged()"
- data-cy="connect-change-runtime-type">
- <mat-option *ngFor="let dataType of runtimeDataTypes"
- [value]="dataType.url">
+ <mat-select
+ placeholder="Data Type"
+ [(ngModel)]="cachedProperty.runtimeType"
+ (selectionChange)="valueChanged()"
+ data-cy="connect-change-runtime-type"
+ >
+ <mat-option
+ *ngFor="let dataType of runtimeDataTypes"
+ [value]="dataType.url"
+ >
{{ dataType.label }}
</mat-option>
</mat-select>
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-data-type/edit-data-type.component.ts b/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-data-type/edit-data-type.component.ts
index b303e8c06..8343d260f 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-data-type/edit-data-type.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-data-type/edit-data-type.component.ts
@@ -20,24 +20,22 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { DataTypesService } from '../../../../../services/data-type.service';
@Component({
- selector: 'sp-edit-data-type',
- templateUrl: './edit-data-type.component.html',
- styleUrls: ['./edit-data-type.component.scss']
+ selector: 'sp-edit-data-type',
+ templateUrl: './edit-data-type.component.html',
+ styleUrls: ['./edit-data-type.component.scss'],
})
export class EditDataTypeComponent implements OnInit {
+ @Input() cachedProperty: any;
+ @Output() dataTypeChanged = new EventEmitter<boolean>();
- @Input() cachedProperty: any;
- @Output() dataTypeChanged = new EventEmitter<boolean>();
+ runtimeDataTypes;
+ constructor(private dataTypeService: DataTypesService) {}
- runtimeDataTypes;
- constructor(private dataTypeService: DataTypesService) { }
-
- ngOnInit() {
- this.runtimeDataTypes = this.dataTypeService.getDataTypes();
- }
-
- valueChanged() {
- this.dataTypeChanged.emit(true);
- }
+ ngOnInit() {
+ this.runtimeDataTypes = this.dataTypeService.getDataTypes();
+ }
+ valueChanged() {
+ this.dataTypeChanged.emit(true);
+ }
}
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-schema-transformation.component.html b/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-schema-transformation.component.html
index 98cc26fd1..ceb076543 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-schema-transformation.component.html
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-schema-transformation.component.html
@@ -18,63 +18,82 @@
<div class="general-options-panel" fxLayout="column">
<div class="general-options-header"><span>Schema</span></div>
- <sp-ep-settings-section sectionTitle="Field runtime name"
- sectionDescription="Identifies the field in the underlying runtime format">
- <div attr.id="input-runtime-name-{{cachedProperty.label}}"
- fxFlex="100">
+ <sp-ep-settings-section
+ sectionTitle="Field runtime name"
+ sectionDescription="Identifies the field in the underlying runtime format"
+ >
+ <div
+ attr.id="input-runtime-name-{{ cachedProperty.label }}"
+ fxFlex="100"
+ >
<mat-form-field class="w-100" color="accent">
<mat-label>Field runtime name</mat-label>
- <input matInput
- placeholder="RuntimeName"
- name="runtimename"
- id="runtimename"
- data-cy="connect-edit-field-runtime-name"
- [(ngModel)]="cachedProperty.runtimeName">
+ <input
+ matInput
+ placeholder="RuntimeName"
+ name="runtimename"
+ id="runtimename"
+ data-cy="connect-edit-field-runtime-name"
+ [(ngModel)]="cachedProperty.runtimeName"
+ />
</mat-form-field>
</div>
</sp-ep-settings-section>
- <sp-ep-settings-section sectionTitle="Field semantic type"
- sectionDescription="Identifies field semantics, e.g., oil temperature"
- fxLayout="column"
- fxFlex="100"
- *ngIf="isPrimitiveProperty">
- <div fxFlex="100" fxLayout="column" style="margin-bottom: 5px;">
- <mat-checkbox name="timestampCheckbox"
- (change)="editTimestampDomainProperty($event.checked)"
- [checked]="isTimestampProperty"
- color="accent"
- data-cy="sp-mark-as-timestamp">
+ <sp-ep-settings-section
+ sectionTitle="Field semantic type"
+ sectionDescription="Identifies field semantics, e.g., oil temperature"
+ fxLayout="column"
+ fxFlex="100"
+ *ngIf="isPrimitiveProperty"
+ >
+ <div fxFlex="100" fxLayout="column" style="margin-bottom: 5px">
+ <mat-checkbox
+ name="timestampCheckbox"
+ (change)="editTimestampDomainProperty($event.checked)"
+ [checked]="isTimestampProperty"
+ color="accent"
+ data-cy="sp-mark-as-timestamp"
+ >
Mark as timestamp
</mat-checkbox>
</div>
<div *ngIf="isPrimitiveProperty" fxFlex="100" fxLayout="column">
<mat-form-field class="w-100" color="accent" fxFlex="100">
- <input matInput placeholder="Semantic Type"
- class="dmainProperty"
- name="domainproperty"
- id="domainproperty"
- [(ngModel)]="cachedProperty.domainProperties[0]"
- [matAutocomplete]="st"
- [disabled]="isTimestampProperty"
- [matAutocompleteDisabled]="isTimestampProperty"
- [formControl]="domainPropertyControl">
+ <input
+ matInput
+ placeholder="Semantic Type"
+ class="dmainProperty"
+ name="domainproperty"
+ id="domainproperty"
+ [(ngModel)]="cachedProperty.domainProperties[0]"
+ [matAutocomplete]="st"
+ [disabled]="isTimestampProperty"
+ [matAutocompleteDisabled]="isTimestampProperty"
+ [formControl]="domainPropertyControl"
+ />
<mat-autocomplete #st="matAutocomplete" [panelWidth]="'300px'">
- <mat-option *ngFor="let semanticType of semanticTypes | async" [value]="semanticType"
- style="font-size: 10pt;">
- {{semanticType}}
+ <mat-option
+ *ngFor="let semanticType of semanticTypes | async"
+ [value]="semanticType"
+ style="font-size: 10pt"
+ >
+ {{ semanticType }}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</div>
</sp-ep-settings-section>
- <sp-ep-settings-section sectionTitle="Field data type"
- sectionDescription="The data type of the field values"
- *ngIf="!isTimestampProperty">
+ <sp-ep-settings-section
+ sectionTitle="Field data type"
+ sectionDescription="The data type of the field values"
+ *ngIf="!isTimestampProperty"
+ >
<sp-edit-data-type
- [cachedProperty]="cachedProperty"
- (dataTypeChanged)="dataTypeChanged.emit($event)">
+ [cachedProperty]="cachedProperty"
+ (dataTypeChanged)="dataTypeChanged.emit($event)"
+ >
</sp-edit-data-type>
</sp-ep-settings-section>
</div>
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-schema-transformation.component.ts b/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-schema-transformation.component.ts
index 1cb3fb3d8..3cf76411f 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-schema-transformation.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-schema-transformation/edit-schema-transformation.component.ts
@@ -17,62 +17,68 @@
*/
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
-import { EventPropertyUnion, SemanticTypesService } from '@streampipes/platform-services';
-import { debounceTime, distinctUntilChanged, startWith, switchMap } from 'rxjs/operators';
+import {
+ EventPropertyUnion,
+ SemanticTypesService,
+} from '@streampipes/platform-services';
+import {
+ debounceTime,
+ distinctUntilChanged,
+ startWith,
+ switchMap,
+} from 'rxjs/operators';
import { UntypedFormControl } from '@angular/forms';
import { Observable } from 'rxjs';
@Component({
- selector: 'sp-edit-schema-transformation',
- templateUrl: './edit-schema-transformation.component.html',
- styleUrls: ['./edit-schema-transformation.component.scss']
+ selector: 'sp-edit-schema-transformation',
+ templateUrl: './edit-schema-transformation.component.html',
+ styleUrls: ['./edit-schema-transformation.component.scss'],
})
export class EditSchemaTransformationComponent implements OnInit {
+ soTimestamp = 'http://schema.org/DateTime';
- soTimestamp = 'http://schema.org/DateTime';
+ @Input()
+ cachedProperty: any;
- @Input()
- cachedProperty: any;
+ @Input() isTimestampProperty: boolean;
+ @Input() isNestedProperty: boolean;
+ @Input() isListProperty: boolean;
+ @Input() isPrimitiveProperty: boolean;
- @Input() isTimestampProperty: boolean;
- @Input() isNestedProperty: boolean;
- @Input() isListProperty: boolean;
- @Input() isPrimitiveProperty: boolean;
+ @Output() dataTypeChanged = new EventEmitter<boolean>();
+ @Output() timestampSemanticsChanged = new EventEmitter<boolean>();
- @Output() dataTypeChanged = new EventEmitter<boolean>();
- @Output() timestampSemanticsChanged = new EventEmitter<boolean>();
+ domainPropertyControl = new UntypedFormControl();
+ semanticTypes: Observable<string[]>;
- domainPropertyControl = new UntypedFormControl();
- semanticTypes: Observable<string[]>;
+ constructor(private semanticTypesService: SemanticTypesService) {}
- constructor(private semanticTypesService: SemanticTypesService) {
-
- }
-
- ngOnInit(): void {
- this.semanticTypes = this.domainPropertyControl.valueChanges
- .pipe(
- startWith(''),
- debounceTime(400),
- distinctUntilChanged(),
- switchMap(val => {
- return val ? this.semanticTypesService.getSemanticTypes(val) : [];
- })
- );
- }
-
- editTimestampDomainProperty(checked: boolean) {
- if (checked) {
- this.isTimestampProperty = true;
- this.cachedProperty.domainProperties = [this.soTimestamp];
- this.cachedProperty.propertyScope = 'HEADER_PROPERTY';
- this.cachedProperty.runtimeType = 'http://www.w3.org/2001/XMLSchema#long';
- } else {
- this.cachedProperty.domainProperties = [];
- this.cachedProperty.propertyScope = 'MEASUREMENT_PROPERTY';
- this.isTimestampProperty = false;
+ ngOnInit(): void {
+ this.semanticTypes = this.domainPropertyControl.valueChanges.pipe(
+ startWith(''),
+ debounceTime(400),
+ distinctUntilChanged(),
+ switchMap(val => {
+ return val
+ ? this.semanticTypesService.getSemanticTypes(val)
+ : [];
+ }),
+ );
}
- this.timestampSemanticsChanged.emit(this.isTimestampProperty);
- }
+ editTimestampDomainProperty(checked: boolean) {
+ if (checked) {
+ this.isTimestampProperty = true;
+ this.cachedProperty.domainProperties = [this.soTimestamp];
+ this.cachedProperty.propertyScope = 'HEADER_PROPERTY';
+ this.cachedProperty.runtimeType =
+ 'http://www.w3.org/2001/XMLSchema#long';
+ } else {
+ this.cachedProperty.domainProperties = [];
+ this.cachedProperty.propertyScope = 'MEASUREMENT_PROPERTY';
+ this.isTimestampProperty = false;
+ }
+ this.timestampSemanticsChanged.emit(this.isTimestampProperty);
+ }
}
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.html b/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.html
index 2d2562160..ba0b0cb63 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.html
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.html
@@ -19,62 +19,97 @@
<div class="general-options-panel" fxLayout="column">
<span class="general-options-header">Unit Transformation</span>
- <sp-ep-settings-section sectionTitle="Unit conversion"
- sectionDescription="Converts the field value from the given measurement unit to the provided target unit"
- fxFlex="100"
- *ngIf="isPrimitiveProperty && !isTimestampProperty && isNumericProperty">
+ <sp-ep-settings-section
+ sectionTitle="Unit conversion"
+ sectionDescription="Converts the field value from the given measurement unit to the provided target unit"
+ fxFlex="100"
+ *ngIf="isPrimitiveProperty && !isTimestampProperty && isNumericProperty"
+ >
<div fxLayout="row">
<div class="w-100" fxLayoutAlign="start center" fxFlex="45">
- <mat-form-field *ngIf="!hadMeasurementUnit" class="w-100" color="accent" fxFlex="100">
- <input matInput
- placeholder="Unit"
- [matAutocomplete]="auto"
- [formControl]="stateCtrl"
- [attr.disabled]="transformUnitEnable ? '' : null"
- data-cy="connect-schema-unit-from-dropdown">
- <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn" [panelWidth]="'300px'">
+ <mat-form-field
+ *ngIf="!hadMeasurementUnit"
+ class="w-100"
+ color="accent"
+ fxFlex="100"
+ >
+ <input
+ matInput
+ placeholder="Unit"
+ [matAutocomplete]="auto"
+ [formControl]="stateCtrl"
+ [attr.disabled]="transformUnitEnable ? '' : null"
+ data-cy="connect-schema-unit-from-dropdown"
+ />
+ <mat-autocomplete
+ #auto="matAutocomplete"
+ [displayWith]="displayFn"
+ [panelWidth]="'300px'"
+ >
<mat-option
- *ngFor="let unit of filteredUnits | async"
- [value]="unit.label"
- [attr.data-cy]="unit.resource">
- {{unit.label}}
+ *ngFor="let unit of filteredUnits | async"
+ [value]="unit.label"
+ [attr.data-cy]="unit.resource"
+ >
+ {{ unit.label }}
</mat-option>
</mat-autocomplete>
</mat-form-field>
- <mat-form-field *ngIf="hadMeasurementUnit"
- class="example-full-width"
- style="width: 155px"
- color="accent">
- <input matInput
- placeholder="Unit"
- disabled
- [(ngModel)]="oldMeasurementUnitDipsplay"
- data-cy="connect-schema-unit-from-input">
+ <mat-form-field
+ *ngIf="hadMeasurementUnit"
+ class="example-full-width"
+ style="width: 155px"
+ color="accent"
+ >
+ <input
+ matInput
+ placeholder="Unit"
+ disabled
+ [(ngModel)]="oldMeasurementUnitDipsplay"
+ data-cy="connect-schema-unit-from-input"
+ />
</mat-form-field>
-
</div>
<div fxFlex="10" fxLayoutAlign="center center">
- <button mat-button
- (click)="transformUnit()"
- color="accent"
- class="form-group"
- fxFlexAlign="center"
- style="min-width: 60px; max-width: 60px"
- data-cy="connect-schema-unit-transform-btn">
- <mat-icon *ngIf="!transformUnitEnable">arrow_forward</mat-icon>
- <mat-icon *ngIf="transformUnitEnable" style="transform: rotate(180deg)">arrow_forward</mat-icon>
+ <button
+ mat-button
+ (click)="transformUnit()"
+ color="accent"
+ class="form-group"
+ fxFlexAlign="center"
+ style="min-width: 60px; max-width: 60px"
+ data-cy="connect-schema-unit-transform-btn"
+ >
+ <mat-icon *ngIf="!transformUnitEnable"
+ >arrow_forward</mat-icon
+ >
+ <mat-icon
+ *ngIf="transformUnitEnable"
+ style="transform: rotate(180deg)"
+ >arrow_forward</mat-icon
+ >
</button>
</div>
<div fxFlex="45" fxLayoutAlign="start center">
- <mat-form-field class="w-100" *ngIf="transformUnitEnable" color="accent" fxFlex="100">
- <mat-select placeholder="New Unit"
- [(ngModel)]="selectUnit"
- [formControl]="newUnitStateCtrl"
- [compareWith]="compareFn"
- data-cy="connect-schema-unit-to-dropdown">
- <mat-option *ngFor="let unit of possibleUnitTransformations" [value]="unit"
- (click)="changeTargetUnit(unit)">
- {{unit.label}}
+ <mat-form-field
+ class="w-100"
+ *ngIf="transformUnitEnable"
+ color="accent"
+ fxFlex="100"
+ >
+ <mat-select
+ placeholder="New Unit"
+ [(ngModel)]="selectUnit"
+ [formControl]="newUnitStateCtrl"
+ [compareWith]="compareFn"
+ data-cy="connect-schema-unit-to-dropdown"
+ >
+ <mat-option
+ *ngFor="let unit of possibleUnitTransformations"
+ [value]="unit"
+ (click)="changeTargetUnit(unit)"
+ >
+ {{ unit.label }}
</mat-option>
</mat-select>
</mat-form-field>
@@ -82,4 +117,3 @@
</div>
</sp-ep-settings-section>
</div>
-
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.scss b/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.scss
index 980cced2d..96cbc9802 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.scss
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.scss
@@ -17,24 +17,24 @@
*/
.header {
- border-left: thin;
+ border-left: thin;
}
.container {
- border: dotted;
+ border: dotted;
}
.doubleWidth {
- width: 370px !important;
+ width: 370px !important;
}
.divBorder {
- /* margin: auto; */
- width: 380px;
- /* border: solid #ccc 2px;
+ /* margin: auto; */
+ width: 380px;
+ /* border: solid #ccc 2px;
border-radius: 5px; */
}
.aThirdWidth {
- width: 120px !important;
+ width: 120px !important;
}
.onhover:hover {
- background-color: darkgrey;
+ background-color: darkgrey;
}
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.ts b/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.ts
index 4eb0ae7f1..50e4456f7 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component.ts
@@ -25,131 +25,154 @@ import { RestService } from '../../../../services/rest.service';
import { UnitProviderService } from '../../../../services/unit-provider.service';
@Component({
- selector: 'sp-edit-unit-transformation',
- templateUrl: './edit-unit-transformation.component.html',
- styleUrls: ['./edit-unit-transformation.component.scss']
+ selector: 'sp-edit-unit-transformation',
+ templateUrl: './edit-unit-transformation.component.html',
+ styleUrls: ['./edit-unit-transformation.component.scss'],
})
export class EditUnitTransformationComponent implements OnInit {
+ @Input() cachedProperty: any;
+
+ @Input() isTimestampProperty: boolean;
+ @Input() isNestedProperty: boolean;
+ @Input() isListProperty: boolean;
+ @Input() isPrimitiveProperty: boolean;
+ @Input() isNumericProperty: boolean;
+
+ @Input() showUnitTransformation: boolean;
+
+ private transformUnitEnable = false;
+ private possibleUnitTransformations: UnitDescription[] = [];
+ private selectUnit: UnitDescription;
+ private allUnits: UnitDescription[];
+ private stateCtrl = new UntypedFormControl();
+
+ private newUnitStateCtrl = new UntypedFormControl();
+ private filteredUnits: Observable<UnitDescription[]>;
+ public hadMeasurementUnit = false;
+ private oldMeasurementUnitDipsplay;
+
+ constructor(
+ private formBuilder: UntypedFormBuilder,
+ private restService: RestService,
+ private unitProviderService: UnitProviderService,
+ ) {
+ this.allUnits = this.unitProviderService.getUnits();
+ this.filteredUnits = this.stateCtrl.valueChanges.pipe(
+ startWith(''),
+ map(unit =>
+ unit ? this._filteredUnits(unit) : this.allUnits.slice(),
+ ),
+ );
+ }
- @Input() cachedProperty: any;
-
- @Input() isTimestampProperty: boolean;
- @Input() isNestedProperty: boolean;
- @Input() isListProperty: boolean;
- @Input() isPrimitiveProperty: boolean;
- @Input() isNumericProperty: boolean;
-
- @Input() showUnitTransformation: boolean;
-
- private transformUnitEnable = false;
- private possibleUnitTransformations: UnitDescription[] = [];
- private selectUnit: UnitDescription;
- private allUnits: UnitDescription[];
- private stateCtrl = new UntypedFormControl();
-
- private newUnitStateCtrl = new UntypedFormControl();
- private filteredUnits: Observable<UnitDescription[]>;
- public hadMeasurementUnit = false;
- private oldMeasurementUnitDipsplay;
-
- constructor(private formBuilder: UntypedFormBuilder,
- private restService: RestService,
- private unitProviderService: UnitProviderService) {
-
- this.allUnits = this.unitProviderService.getUnits();
- this.filteredUnits = this.stateCtrl.valueChanges
- .pipe(
- startWith(''),
- map(unit => unit ? this._filteredUnits(unit) : this.allUnits.slice())
- );
- }
-
- protected open = false;
-
-
- ngOnInit() {
- // this.cachedProperty.propertyNumber = this.index;
- if ((this.cachedProperty as any).measurementUnitTmp !== undefined) {
- (this.cachedProperty as any).oldMeasurementUnit = (this.cachedProperty as any).oldMeasurementUnit;
- // TODO: use if backend deserialize URI correct
- (this.cachedProperty as any).measurementUnitTmp = (this.cachedProperty as any).measurementUnitTmp;
- this.hadMeasurementUnit = (this.cachedProperty as any).hadMeasarumentUnit;
- this.transformUnitEnable = (this.cachedProperty as any).hadMeasarumentUnit;
- const unit = this.allUnits.find(unitTmp => unitTmp.resource === (this.cachedProperty as any).oldMeasurementUnit);
- this.oldMeasurementUnitDipsplay = unit.label;
- this.stateCtrl.setValue(unit.label);
-
- this.restService.getFittingUnits(unit).subscribe(result => {
- this.possibleUnitTransformations = result;
- // this.selectUnit = this.possibleUnitTransformations[0];
- this.selectUnit = this.allUnits.find(unitTmp => unitTmp.resource === (this.cachedProperty as any).measurementUnitTmp);
- // this.transformUnitEnable = true;
- this.changeTargetUnit(this.selectUnit);
- });
+ protected open = false;
+
+ ngOnInit() {
+ // this.cachedProperty.propertyNumber = this.index;
+ if ((this.cachedProperty as any).measurementUnitTmp !== undefined) {
+ (this.cachedProperty as any).oldMeasurementUnit = (
+ this.cachedProperty as any
+ ).oldMeasurementUnit;
+ // TODO: use if backend deserialize URI correct
+ (this.cachedProperty as any).measurementUnitTmp = (
+ this.cachedProperty as any
+ ).measurementUnitTmp;
+ this.hadMeasurementUnit = (
+ this.cachedProperty as any
+ ).hadMeasarumentUnit;
+ this.transformUnitEnable = (
+ this.cachedProperty as any
+ ).hadMeasarumentUnit;
+ const unit = this.allUnits.find(
+ unitTmp =>
+ unitTmp.resource ===
+ (this.cachedProperty as any).oldMeasurementUnit,
+ );
+ this.oldMeasurementUnitDipsplay = unit.label;
+ this.stateCtrl.setValue(unit.label);
+
+ this.restService.getFittingUnits(unit).subscribe(result => {
+ this.possibleUnitTransformations = result;
+ // this.selectUnit = this.possibleUnitTransformations[0];
+ this.selectUnit = this.allUnits.find(
+ unitTmp =>
+ unitTmp.resource ===
+ (this.cachedProperty as any).measurementUnitTmp,
+ );
+ // this.transformUnitEnable = true;
+ this.changeTargetUnit(this.selectUnit);
+ });
+ }
}
- }
-
- compareFn(c1: any, c2: any): boolean {
- return c1 && c2 ? c1.resource === c2.resource : c1 === c2;
- }
-
- private transformUnit() {
- if (this.transformUnitEnable) {
- this.transformUnitEnable = false;
- // TODO: use if backend deserialize URI correct
- // this.cachedProperty.measurementUnit = this.cachedProperty.oldMeasurementUnit;
- (this.cachedProperty as any).measurementUnitTmp = (this.cachedProperty as any).oldMeasurementUnit;
- (this.cachedProperty as any).hadMeasarumentUnit = false;
- } else {
- const unit = this.allUnits.find(unitTmp => unitTmp.label === this.stateCtrl.value);
- (this.cachedProperty as any).hadMeasarumentUnit = true;
- if (!unit) {
- return;
- }
-
- this.restService.getFittingUnits(unit).subscribe(result => {
- this.possibleUnitTransformations = result;
- this.selectUnit = this.possibleUnitTransformations[0];
- this.transformUnitEnable = true;
- this.changeTargetUnit(this.selectUnit);
- });
+
+ compareFn(c1: any, c2: any): boolean {
+ return c1 && c2 ? c1.resource === c2.resource : c1 === c2;
}
- }
-
- private _filteredUnits(value: string): UnitDescription[] {
- const filterValue = value.toLowerCase();
- const units: UnitDescription[] = this.allUnits.filter(unit => unit.label.toLowerCase().indexOf(filterValue) === 0);
- const unit: UnitDescription = this.allUnits.filter(unit => unit.label.toLocaleLowerCase() === filterValue)[0];
- if (unit !== undefined) {
- (this.cachedProperty as any).oldMeasurementUnit = unit.resource;
- (this.cachedProperty as any).measurementUnitTmp = unit.resource;
- // TODO: use if backend deserialize URI correct
- // this.cachedProperty.measurementUnit = units.resource;
- } else {
- (this.cachedProperty as any).oldMeasurementUnit = undefined;
- (this.cachedProperty as any).measurementUnitTmp = undefined;
- // TODO: use if backend deserialize URI correct
- // this.cachedProperty.measurementUnit = undefined;
+
+ private transformUnit() {
+ if (this.transformUnitEnable) {
+ this.transformUnitEnable = false;
+ // TODO: use if backend deserialize URI correct
+ // this.cachedProperty.measurementUnit = this.cachedProperty.oldMeasurementUnit;
+ (this.cachedProperty as any).measurementUnitTmp = (
+ this.cachedProperty as any
+ ).oldMeasurementUnit;
+ (this.cachedProperty as any).hadMeasarumentUnit = false;
+ } else {
+ const unit = this.allUnits.find(
+ unitTmp => unitTmp.label === this.stateCtrl.value,
+ );
+ (this.cachedProperty as any).hadMeasarumentUnit = true;
+ if (!unit) {
+ return;
+ }
+
+ this.restService.getFittingUnits(unit).subscribe(result => {
+ this.possibleUnitTransformations = result;
+ this.selectUnit = this.possibleUnitTransformations[0];
+ this.transformUnitEnable = true;
+ this.changeTargetUnit(this.selectUnit);
+ });
+ }
}
- return units;
- }
-
- changeTargetUnit(unit: UnitDescription) {
- // TODO: use if backend deserialize URI correct
- // this.cachedProperty.measurementUnit = unit.resource;
- (this.cachedProperty as any).measurementUnitTmp = unit.resource;
- this.newUnitStateCtrl.setValue(unit);
- }
-
- // setShowUnitTransformation() {
- // this.hideUnitTransformation = this.isTimestampProperty ||
- // !this.dataTypesService.isNumeric(this.cachedProperty.runtimeType);
- //
- // if (this.dataTypesService.isNumeric(this.cachedProperty.runtimeType)) {
- // this.isNumericDataType.emit(true);
- // } else {
- // this.isNumericDataType.emit(false);
- // }
- // }
-}
+ private _filteredUnits(value: string): UnitDescription[] {
+ const filterValue = value.toLowerCase();
+ const units: UnitDescription[] = this.allUnits.filter(
+ unit => unit.label.toLowerCase().indexOf(filterValue) === 0,
+ );
+ const unit: UnitDescription = this.allUnits.filter(
+ unit => unit.label.toLocaleLowerCase() === filterValue,
+ )[0];
+ if (unit !== undefined) {
+ (this.cachedProperty as any).oldMeasurementUnit = unit.resource;
+ (this.cachedProperty as any).measurementUnitTmp = unit.resource;
+ // TODO: use if backend deserialize URI correct
+ // this.cachedProperty.measurementUnit = units.resource;
+ } else {
+ (this.cachedProperty as any).oldMeasurementUnit = undefined;
+ (this.cachedProperty as any).measurementUnitTmp = undefined;
+ // TODO: use if backend deserialize URI correct
+ // this.cachedProperty.measurementUnit = undefined;
+ }
+ return units;
+ }
+
+ changeTargetUnit(unit: UnitDescription) {
+ // TODO: use if backend deserialize URI correct
+ // this.cachedProperty.measurementUnit = unit.resource;
+ (this.cachedProperty as any).measurementUnitTmp = unit.resource;
+ this.newUnitStateCtrl.setValue(unit);
+ }
+
+ // setShowUnitTransformation() {
+ // this.hideUnitTransformation = this.isTimestampProperty ||
+ // !this.dataTypesService.isNumeric(this.cachedProperty.runtimeType);
+ //
+ // if (this.dataTypesService.isNumeric(this.cachedProperty.runtimeType)) {
+ // this.isNumericDataType.emit(true);
+ // } else {
+ // this.isNumericDataType.emit(false);
+ // }
+ // }
+}
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.html b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.html
index c09542ba5..9738b3485 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.html
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.html
@@ -19,23 +19,26 @@
<div fxLayout="row" fxLayoutAlign="start">
<div fxFlex="70" fxLayoutAlign="start center">
<mat-form-field class="w-100" style="margin-right: 10px" color="accent">
- <input matInput
- name="correction"
- placeholder="Correction Value"
- [(ngModel)]="cachedProperty.correctionValue"
- (change)="valueChanged()"
- data-cy="connect-schema-correction-value">
+ <input
+ matInput
+ name="correction"
+ placeholder="Correction Value"
+ [(ngModel)]="cachedProperty.correctionValue"
+ (change)="valueChanged()"
+ data-cy="connect-schema-correction-value"
+ />
</mat-form-field>
</div>
<div fxFlex="30" fxLayoutAlign="start center">
<mat-form-field class="w-100" color="accent">
<mat-select
- required
- placeholder="Math Operator"
- [(ngModel)]="cachedProperty.operator"
- (selectionChange)="valueChanged()"
- [disabled]="!cachedProperty.correctionValue"
- data-cy="connect-schema-correction-operator">
+ required
+ placeholder="Math Operator"
+ [(ngModel)]="cachedProperty.operator"
+ (selectionChange)="valueChanged()"
+ [disabled]="!cachedProperty.correctionValue"
+ data-cy="connect-schema-correction-operator"
+ >
<mat-option [value]="op.value" *ngFor="let op of operators">
{{ op.viewValue }}
</mat-option>
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.scss b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.scss
index 41ecef044..13cbc4aac 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.scss
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.scss
@@ -14,4 +14,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- */
\ No newline at end of file
+ */
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.ts b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.ts
index ed52644c0..90e17883c 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-correction-value/edit-correction-value.component.ts
@@ -16,40 +16,35 @@
*
*/
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
+import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
- selector: 'sp-edit-correction-value',
- templateUrl: './edit-correction-value.component.html',
- styleUrls: ['./edit-correction-value.component.scss']
+ selector: 'sp-edit-correction-value',
+ templateUrl: './edit-correction-value.component.html',
+ styleUrls: ['./edit-correction-value.component.scss'],
})
-export class EditCorrectionValueComponent implements OnInit {
-
- @Input() cachedProperty: any;
- @Output() correctionValueChanged = new EventEmitter<boolean>();
-
- operators = [
- {value: 'MULTIPLY', viewValue: 'Multiply'},
- {value: 'ADD', viewValue: 'Add'},
- {value: 'SUBSTRACT', viewValue: 'Substract'}
- ];
-
- constructor() { }
-
- ngOnInit(): void {
- }
-
- valueChanged() {
- if (this.cachedProperty.correctionValue) {
- if (!this.cachedProperty.operator) {
- this.correctionValueChanged.emit(true);
- } else {
- this.correctionValueChanged.emit(false);
- }
- } else {
- this.correctionValueChanged.emit(false);
- this.cachedProperty.operator = undefined;
+export class EditCorrectionValueComponent {
+ @Input() cachedProperty: any;
+ @Output() correctionValueChanged = new EventEmitter<boolean>();
+
+ operators = [
+ { value: 'MULTIPLY', viewValue: 'Multiply' },
+ { value: 'ADD', viewValue: 'Add' },
+ { value: 'SUBSTRACT', viewValue: 'Substract' },
+ ];
+
+ constructor() {}
+
+ valueChanged() {
+ if (this.cachedProperty.correctionValue) {
+ if (!this.cachedProperty.operator) {
+ this.correctionValueChanged.emit(true);
+ } else {
+ this.correctionValueChanged.emit(false);
+ }
+ } else {
+ this.correctionValueChanged.emit(false);
+ this.cachedProperty.operator = undefined;
+ }
}
- }
-
}
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.html b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.html
index 12c9ea6e1..dbb399c9b 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.html
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.html
@@ -18,9 +18,11 @@
<div fxLayout="row" fxLayoutAlign="start">
<mat-form-field class="w-100" color="accent" fxFlex="100">
- <mat-select placeholder="Timestamp converter (unix timestamp)"
- [(value)]="cachedProperty.timestampTransformationMode"
- data-cy="connect-timestamp-converter">
+ <mat-select
+ placeholder="Timestamp converter (unix timestamp)"
+ [(value)]="cachedProperty.timestampTransformationMode"
+ data-cy="connect-timestamp-converter"
+ >
<mat-option value="none">None</mat-option>
<mat-option value="formatString">Date String</mat-option>
<mat-option value="timeUnit">Date Number</mat-option>
@@ -28,27 +30,48 @@
</mat-form-field>
</div>
-
<div fxLayout="row" fxLayoutAlign="start">
<div class="form-group" fxFlexAlign="center" fxFlex="100">
- <mat-form-field class="w-100"
- *ngIf="cachedProperty.timestampTransformationMode === 'formatString'"
- color="accent"
- fxFlex="100">
- <input class="w-100" matInput
- placeholder="E.g. yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
- data-cy="connect-timestamp-string-regex"
- [(ngModel)]="cachedProperty.timestampTransformationFormatString">
+ <mat-form-field
+ class="w-100"
+ *ngIf="
+ cachedProperty.timestampTransformationMode === 'formatString'
+ "
+ color="accent"
+ fxFlex="100"
+ >
+ <input
+ class="w-100"
+ matInput
+ placeholder="E.g. yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
+ data-cy="connect-timestamp-string-regex"
+ [(ngModel)]="cachedProperty.timestampTransformationFormatString"
+ />
</mat-form-field>
- <mat-form-field class="w-100"
- *ngIf="cachedProperty.timestampTransformationMode === 'timeUnit'"
- color="accent"
- fxFlex="100">
- <mat-select placeholder="Current time unit" [(value)]="selectedTimeMultiplier">
- <mat-option value="milliseconds" (click)="cachedProperty.timestampTransformationMultiplier = 0">
+ <mat-form-field
+ class="w-100"
+ *ngIf="cachedProperty.timestampTransformationMode === 'timeUnit'"
+ color="accent"
+ fxFlex="100"
+ >
+ <mat-select
+ placeholder="Current time unit"
+ [(value)]="selectedTimeMultiplier"
+ >
+ <mat-option
+ value="milliseconds"
+ (click)="
+ cachedProperty.timestampTransformationMultiplier = 0
+ "
+ >
Milliseconds
</mat-option>
- <mat-option value="second" (click)="cachedProperty.timestampTransformationMultiplier = 1000">Seconds
+ <mat-option
+ value="second"
+ (click)="
+ cachedProperty.timestampTransformationMultiplier = 1000
+ "
+ >Seconds
</mat-option>
</mat-select>
</mat-form-field>
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.scss b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.scss
index a35e1300a..a23154ce4 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.scss
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.scss
@@ -17,7 +17,6 @@
*/
.doubleWidth {
- margin-right: 10px;
- width: 370px !important;
+ margin-right: 10px;
+ width: 370px !important;
}
-
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.ts b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.ts
index 8bd9ec4a4..4c02c8a1b 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component.ts
@@ -19,20 +19,18 @@
import { Component, Input } from '@angular/core';
@Component({
- selector: 'sp-edit-timestamp-property',
- templateUrl: './edit-timestamp-property.component.html',
- styleUrls: ['./edit-timestamp-property.component.scss']
+ selector: 'sp-edit-timestamp-property',
+ templateUrl: './edit-timestamp-property.component.html',
+ styleUrls: ['./edit-timestamp-property.component.scss'],
})
export class EditTimestampPropertyComponent {
+ @Input() cachedProperty: any;
+ @Input() showEditTimestampProperty: boolean;
- @Input() cachedProperty: any;
- @Input() showEditTimestampProperty: boolean;
-
- private selectedTimeMultiplier;
-
- constructor() {
- // Set preselected value
- this.selectedTimeMultiplier = 'second';
- }
+ private selectedTimeMultiplier;
+ constructor() {
+ // Set preselected value
+ this.selectedTimeMultiplier = 'second';
+ }
}
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-value-transformation.component.html b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-value-transformation.component.html
index 9703ccfd2..0567d2b21 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-value-transformation.component.html
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-value-transformation.component.html
@@ -18,38 +18,46 @@
<div class="general-options-panel" fxLayout="column">
<span class="general-options-header">Value Transformation</span>
- <sp-ep-settings-section sectionTitle="Timestamp conversion"
- sectionDescription="Formula to convert the field value to a UNIX timestamp in milliseconds"
- fxLayout="column"
- fxFlex="100"
- *ngIf="isTimestampProperty">
+ <sp-ep-settings-section
+ sectionTitle="Timestamp conversion"
+ sectionDescription="Formula to convert the field value to a UNIX timestamp in milliseconds"
+ fxLayout="column"
+ fxFlex="100"
+ *ngIf="isTimestampProperty"
+ >
<sp-edit-timestamp-property
- [cachedProperty]="cachedProperty"
- showEditTimestampProperty="!isTimestampProperty">
+ [cachedProperty]="cachedProperty"
+ showEditTimestampProperty="!isTimestampProperty"
+ >
</sp-edit-timestamp-property>
</sp-ep-settings-section>
- <sp-ep-settings-section sectionTitle="Value conversion"
- sectionDescription="Converts the original field values using the provided formula"
- fxLayout="column"
- fxFlex="100"
- *ngIf="isNumericProperty && !isTimestampProperty">
- <sp-edit-correction-value
- [cachedProperty]="cachedProperty">
+ <sp-ep-settings-section
+ sectionTitle="Value conversion"
+ sectionDescription="Converts the original field values using the provided formula"
+ fxLayout="column"
+ fxFlex="100"
+ *ngIf="isNumericProperty && !isTimestampProperty"
+ >
+ <sp-edit-correction-value [cachedProperty]="cachedProperty">
<!--(correctionValueChanged)="enableSaveBtn($event)"-->
</sp-edit-correction-value>
</sp-ep-settings-section>
- <sp-ep-settings-section sectionTitle="Static value assignment"
- sectionDescription="Assigns a static value to each incoming event"
- fxLayout="column"
- fxFlex="100"
- *ngIf="addedByUser">
+ <sp-ep-settings-section
+ sectionTitle="Static value assignment"
+ sectionDescription="Assigns a static value to each incoming event"
+ fxLayout="column"
+ fxFlex="100"
+ *ngIf="addedByUser"
+ >
<mat-form-field class="w-100" fxFlex="100">
- <input matInput
- placeholder="Static Value"
- name="static_value"
- id="static_value"
- data-cy="connect-edit-field-static-value"
- [(ngModel)]="cachedProperty.staticValue">
+ <input
+ matInput
+ placeholder="Static Value"
+ name="static_value"
+ id="static_value"
+ data-cy="connect-edit-field-static-value"
+ [(ngModel)]="cachedProperty.staticValue"
+ />
</mat-form-field>
</sp-ep-settings-section>
</div>
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-value-transformation.component.ts b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-value-transformation.component.ts
index ec035d921..962a0a579 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-value-transformation.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-value-transformation/edit-value-transformation.component.ts
@@ -19,32 +19,32 @@
import { Component, Input, OnInit } from '@angular/core';
@Component({
- selector: 'sp-edit-value-transformation',
- templateUrl: './edit-value-transformation.component.html',
- styleUrls: ['./edit-value-transformation.component.scss']
+ selector: 'sp-edit-value-transformation',
+ templateUrl: './edit-value-transformation.component.html',
+ styleUrls: ['./edit-value-transformation.component.scss'],
})
export class EditValueTransformationComponent implements OnInit {
-
- @Input()
- cachedProperty: any;
-
- @Input() isTimestampProperty: boolean;
- @Input() isNestedProperty: boolean;
- @Input() isListProperty: boolean;
- @Input() isPrimitiveProperty: boolean;
- @Input() isNumericProperty: boolean;
-
- addedByUser: boolean;
-
- ngOnInit(): void {
- this.addedByUser = this.staticValueAddedByUser();
- if (!this.cachedProperty.staticValue) {
- this.cachedProperty.staticValue = '';
+ @Input()
+ cachedProperty: any;
+
+ @Input() isTimestampProperty: boolean;
+ @Input() isNestedProperty: boolean;
+ @Input() isListProperty: boolean;
+ @Input() isPrimitiveProperty: boolean;
+ @Input() isNumericProperty: boolean;
+
+ addedByUser: boolean;
+
+ ngOnInit(): void {
+ this.addedByUser = this.staticValueAddedByUser();
+ if (!this.cachedProperty.staticValue) {
+ this.cachedProperty.staticValue = '';
+ }
}
- }
-
- staticValueAddedByUser() {
- return this.cachedProperty.elementId.startsWith('http://eventProperty.de/staticValue/');
- }
+ staticValueAddedByUser() {
+ return this.cachedProperty.elementId.startsWith(
+ 'http://eventProperty.de/staticValue/',
+ );
+ }
}
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.html b/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.html
index be870a1a3..4a6cda621 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.html
+++ b/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.html
@@ -16,16 +16,22 @@
~
-->
<div fxLayout="column" fxFlex="100">
- <div fxLayout="row" fxFlex="100" class="ep-settings-section ep-settings-section-border">
- <div fxFlex="30" style="margin-right: 10px;">
+ <div
+ fxLayout="row"
+ fxFlex="100"
+ class="ep-settings-section ep-settings-section-border"
+ >
+ <div fxFlex="30" style="margin-right: 10px">
<div fxLayout="column" fxFlex="100">
- <b>{{sectionTitle}}</b>
- <mat-hint class="description">{{sectionDescription}}</mat-hint>
+ <b>{{ sectionTitle }}</b>
+ <mat-hint class="description">{{
+ sectionDescription
+ }}</mat-hint>
</div>
</div>
<div fxFlex fxLayout="column">
<ng-content fxLayout="column" fxFlex="100"></ng-content>
</div>
</div>
-<!-- <mat-divider></mat-divider>-->
+ <!-- <mat-divider></mat-divider>-->
</div>
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.scss b/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.scss
index 5074a34ae..19258723e 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.scss
+++ b/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.scss
@@ -17,16 +17,16 @@
*/
.ep-settings-section {
- padding-left: 10px;
- margin-bottom: 10px;
- margin-top: 10px;
- margin-right: 5px;
+ padding-left: 10px;
+ margin-bottom: 10px;
+ margin-top: 10px;
+ margin-right: 5px;
}
.ep-settings-section-border {
- border-left:5px solid gray;
+ border-left: 5px solid gray;
}
.description {
- font-size: 10px;
+ font-size: 10px;
}
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.ts b/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.ts
index 7700e3e6e..c4824c53b 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/components/ep-settings-section/ep-settings-section.component.ts
@@ -16,24 +16,17 @@
*
*/
-
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, Input } from '@angular/core';
@Component({
- selector: 'sp-ep-settings-section',
- templateUrl: './ep-settings-section.component.html',
- styleUrls: ['./ep-settings-section.component.scss']
+ selector: 'sp-ep-settings-section',
+ templateUrl: './ep-settings-section.component.html',
+ styleUrls: ['./ep-settings-section.component.scss'],
})
-export class SpEpSettingsSectionComponent implements OnInit {
-
- @Input()
- sectionTitle: string;
-
- @Input()
- sectionDescription: string;
-
- ngOnInit(): void {
- }
-
+export class SpEpSettingsSectionComponent {
+ @Input()
+ sectionTitle: string;
+ @Input()
+ sectionDescription: string;
}
diff --git a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.html b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.html
index 132efac8b..ef04b6f68 100644
--- a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.html
+++ b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.html
@@ -18,77 +18,85 @@
<div class="sp-dialog-container">
<div class="sp-dialog-content p-15">
- <div fxFlex="100"
- fxLayout="column">
- <form #propertyForm="ngForm"
- fxLayout="column">
- <div fxLayout="column"
- fxLayoutAlign="start"
- fxFlex="100">
- <div class="general-options-panel"
- fxLayout="column"
- fxFlex="100">
+ <div fxFlex="100" fxLayout="column">
+ <form #propertyForm="ngForm" fxLayout="column">
+ <div fxLayout="column" fxLayoutAlign="start" fxFlex="100">
+ <div
+ class="general-options-panel"
+ fxLayout="column"
+ fxFlex="100"
+ >
<span class="general-options-header">Basics</span>
- <sp-ep-settings-section sectionTitle="Field label"
- sectionDescription="A label for better readability">
- <mat-form-field class="w-100"
- color="accent">
- <input matInput
- placeholder="Label"
- name="label"
- id="label"
- [(ngModel)]="cachedProperty.label">
+ <sp-ep-settings-section
+ sectionTitle="Field label"
+ sectionDescription="A label for better readability"
+ >
+ <mat-form-field class="w-100" color="accent">
+ <input
+ matInput
+ placeholder="Label"
+ name="label"
+ id="label"
+ [(ngModel)]="cachedProperty.label"
+ />
</mat-form-field>
</sp-ep-settings-section>
- <sp-ep-settings-section sectionTitle="Field description"
- sectionDescription="A description for better readability">
- <mat-form-field class="full-width"
- color="accent">
- <textarea matInput
- name="description"
- placeholder="Description"
- id="description"
- [(ngModel)]="cachedProperty.description" cols="20" rows="2">
+ <sp-ep-settings-section
+ sectionTitle="Field description"
+ sectionDescription="A description for better readability"
+ >
+ <mat-form-field class="full-width" color="accent">
+ <textarea
+ matInput
+ name="description"
+ placeholder="Description"
+ id="description"
+ [(ngModel)]="cachedProperty.description"
+ cols="20"
+ rows="2"
+ >
</textarea>
</mat-form-field>
</sp-ep-settings-section>
</div>
-
- <sp-edit-schema-transformation [cachedProperty]="cachedProperty"
- [isTimestampProperty]="isTimestampProperty"
- [isNestedProperty]="isEventPropertyNested"
- [isListProperty]="isEventPropertyList"
- [isPrimitiveProperty]="isEventPropertyPrimitive"
- *ngIf="!isEventPropertyNested"
- (dataTypeChanged)="handleDataTypeChange($event)"
- (timestampSemanticsChanged)="handleTimestampChange($event)"
- #schemaTransformationComponent>
-
+ <sp-edit-schema-transformation
+ [cachedProperty]="cachedProperty"
+ [isTimestampProperty]="isTimestampProperty"
+ [isNestedProperty]="isEventPropertyNested"
+ [isListProperty]="isEventPropertyList"
+ [isPrimitiveProperty]="isEventPropertyPrimitive"
+ *ngIf="!isEventPropertyNested"
+ (dataTypeChanged)="handleDataTypeChange($event)"
+ (timestampSemanticsChanged)="
+ handleTimestampChange($event)
+ "
+ #schemaTransformationComponent
+ >
</sp-edit-schema-transformation>
- <sp-edit-value-transformation [cachedProperty]="cachedProperty"
- *ngIf="isEventPropertyPrimitive"
- [isTimestampProperty]="isTimestampProperty"
- [isNumericProperty]="isNumericProperty"
- [isNestedProperty]="isEventPropertyNested"
- [isListProperty]="isEventPropertyList"
- [isPrimitiveProperty]="isEventPropertyPrimitive"
- #valueTransformationComponent>
+ <sp-edit-value-transformation
+ [cachedProperty]="cachedProperty"
+ *ngIf="isEventPropertyPrimitive"
+ [isTimestampProperty]="isTimestampProperty"
+ [isNumericProperty]="isNumericProperty"
+ [isNestedProperty]="isEventPropertyNested"
+ [isListProperty]="isEventPropertyList"
+ [isPrimitiveProperty]="isEventPropertyPrimitive"
+ #valueTransformationComponent
+ >
</sp-edit-value-transformation>
- <sp-edit-unit-transformation *ngIf="!isTimestampProperty && isEventPropertyPrimitive"
- [cachedProperty]="cachedProperty"
- [isTimestampProperty]="isTimestampProperty"
- [isNumericProperty]="isNumericProperty"
- [isPrimitiveProperty]="isEventPropertyPrimitive"
- #unitTransformationComponent>
+ <sp-edit-unit-transformation
+ *ngIf="!isTimestampProperty && isEventPropertyPrimitive"
+ [cachedProperty]="cachedProperty"
+ [isTimestampProperty]="isTimestampProperty"
+ [isNumericProperty]="isNumericProperty"
+ [isPrimitiveProperty]="isEventPropertyPrimitive"
+ #unitTransformationComponent
+ >
</sp-edit-unit-transformation>
-
-
</div>
-
-
</form>
<!-- <sp-edit-event-property-primitive-->
@@ -105,14 +113,24 @@
</div>
<mat-divider></mat-divider>
<div class="sp-dialog-actions">
- <button mat-button mat-raised-button color="accent"
- [disabled]="isSaveBtnEnabled"
- (click)="save();
- isSaveBtnEnabled = false"
- style="margin-right: 10px;"
- data-cy="sp-save-edit-property">
+ <button
+ mat-button
+ mat-raised-button
+ color="accent"
+ [disabled]="isSaveBtnEnabled"
+ (click)="save(); isSaveBtnEnabled = false"
+ style="margin-right: 10px"
+ data-cy="sp-save-edit-property"
+ >
Save
</button>
- <button mat-button mat-raised-button class="mat-basic" (click)="dialogRef.close()">Close</button>
+ <button
+ mat-button
+ mat-raised-button
+ class="mat-basic"
+ (click)="dialogRef.close()"
+ >
+ Close
+ </button>
</div>
</div>
diff --git a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.scss b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.scss
index 85d8c6aa3..b92834fe6 100644
--- a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.scss
+++ b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.scss
@@ -29,4 +29,3 @@
.full-width {
width: 100%;
}
-
diff --git a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
index f8b1e74ec..df8839db8 100644
--- a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
@@ -16,14 +16,25 @@
*
*/
-import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
-import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import {
- EventPropertyList,
- EventPropertyNested,
- EventPropertyPrimitive,
- EventPropertyUnion,
- SemanticTypesService
+ Component,
+ EventEmitter,
+ Input,
+ OnInit,
+ Output,
+ ViewChild,
+} from '@angular/core';
+import {
+ UntypedFormBuilder,
+ UntypedFormGroup,
+ Validators,
+} from '@angular/forms';
+import {
+ EventPropertyList,
+ EventPropertyNested,
+ EventPropertyPrimitive,
+ EventPropertyUnion,
+ SemanticTypesService,
} from '@streampipes/platform-services';
import { SemanticTypeUtilsService } from '../../../core-services/semantic-type/semantic-type-utils.service';
import { DataTypesService } from '../../services/data-type.service';
@@ -33,159 +44,208 @@ import { EditValueTransformationComponent } from './components/edit-value-transf
import { EditUnitTransformationComponent } from './components/edit-unit-transformation/edit-unit-transformation.component';
@Component({
- selector: 'sp-edit-event-property',
- templateUrl: './edit-event-property.component.html',
- styleUrls: ['./edit-event-property.component.scss']
+ selector: 'sp-edit-event-property',
+ templateUrl: './edit-event-property.component.html',
+ styleUrls: ['./edit-event-property.component.scss'],
})
export class EditEventPropertyComponent implements OnInit {
-
- @Input() property: EventPropertyUnion;
- @Input() isEditable: boolean;
-
- @Output() propertyChange = new EventEmitter<EventPropertyUnion>();
-
- schemaTransformationComponent: EditSchemaTransformationComponent;
- valueTransformationComponent: EditValueTransformationComponent;
- unitTransformationComponent: EditUnitTransformationComponent;
-
- cachedProperty: any;
-
- isTimestampProperty = false;
- isEventPropertyPrimitive: boolean;
- isEventPropertyNested: boolean;
- isEventPropertyList: boolean;
- isNumericProperty: boolean;
- isSaveBtnEnabled: boolean;
-
- private propertyForm: UntypedFormGroup;
-
- private runtimeDataTypes;
-
- constructor(public dialogRef: DialogRef<EditEventPropertyComponent>,
- private formBuilder: UntypedFormBuilder,
- private dataTypeService: DataTypesService,
- private semanticTypeUtilsService: SemanticTypeUtilsService,
- private semanticTypesService: SemanticTypesService) {
- }
-
- ngOnInit(): void {
- this.cachedProperty = this.copyEp(this.property);
- this.runtimeDataTypes = this.dataTypeService.getDataTypes();
- this.isTimestampProperty = this.semanticTypeUtilsService.isTimestamp(this.cachedProperty);
- this.isEventPropertyList = this.property instanceof EventPropertyList;
- this.isEventPropertyPrimitive = this.property instanceof EventPropertyPrimitive;
- this.isEventPropertyNested = this.property instanceof EventPropertyNested;
- this.isNumericProperty = this.semanticTypeUtilsService.isNumeric(this.cachedProperty) ||
- this.dataTypeService.isNumeric(this.cachedProperty.runtimeType);
- this.createForm();
-
- }
-
- copyEp(ep: EventPropertyUnion) {
- if (ep instanceof EventPropertyPrimitive) {
- const result = EventPropertyPrimitive.fromData(ep as EventPropertyPrimitive, new EventPropertyPrimitive());
-
- result.measurementUnit = (ep as EventPropertyPrimitive).measurementUnit;
- (result as any).measurementUnitTmp = (ep as any).measurementUnitTmp;
- (result as any).oldMeasurementUnit = (ep as any).oldMeasurementUnit;
- (result as any).hadMeasarumentUnit = (ep as any).hadMeasarumentUnit;
-
- (result as any).timestampTransformationMode = (ep as any).timestampTransformationMode;
- (result as any).timestampTransformationFormatString = (ep as any).timestampTransformationFormatString;
- (result as any).timestampTransformationMultiplier = (ep as any).timestampTransformationMultiplier;
-
- (result as any).staticValue = (ep as any).staticValue;
-
- (result as any).correctionValue = (ep as any).correctionValue;
- (result as any).operator = (ep as any).operator;
-
- return result;
- } else if (ep instanceof EventPropertyNested) {
- return EventPropertyNested.fromData(ep as EventPropertyNested, new EventPropertyNested());
- } else {
- return EventPropertyList.fromData(ep as EventPropertyList, new EventPropertyList());
- }
- }
-
- private createForm() {
- this.propertyForm = this.formBuilder.group({
- label: [this.property.label, Validators.required],
- runtimeName: [this.property.runtimeName, Validators.required],
- description: [this.property.description, Validators.required],
- domainProperty: ['', Validators.required],
- dataType: ['', Validators.required]
- });
- }
-
- staticValueAddedByUser() {
- return (this.property.elementId.startsWith('http://eventProperty.de/staticValue/'));
- }
-
- save(): void {
- this.property.label = this.cachedProperty.label;
- this.property.description = this.cachedProperty.description;
-
- // remove undefined from domain properies array
- this.property.domainProperties = this.cachedProperty.domainProperties.filter(n => n);
- this.property.runtimeName = this.cachedProperty.runtimeName;
- this.property.propertyScope = this.cachedProperty.propertyScope;
-
- if (this.property instanceof EventPropertyList) {
- // @ts-ignore
- this.property.eventProperty.runtimeType = (this.cachedProperty as EventPropertyList).eventProperty.runtimeType;
+ @Input() property: EventPropertyUnion;
+ @Input() isEditable: boolean;
+
+ @Output() propertyChange = new EventEmitter<EventPropertyUnion>();
+
+ schemaTransformationComponent: EditSchemaTransformationComponent;
+ valueTransformationComponent: EditValueTransformationComponent;
+ unitTransformationComponent: EditUnitTransformationComponent;
+
+ cachedProperty: any;
+
+ isTimestampProperty = false;
+ isEventPropertyPrimitive: boolean;
+ isEventPropertyNested: boolean;
+ isEventPropertyList: boolean;
+ isNumericProperty: boolean;
+ isSaveBtnEnabled: boolean;
+
+ private propertyForm: UntypedFormGroup;
+
+ private runtimeDataTypes;
+
+ constructor(
+ public dialogRef: DialogRef<EditEventPropertyComponent>,
+ private formBuilder: UntypedFormBuilder,
+ private dataTypeService: DataTypesService,
+ private semanticTypeUtilsService: SemanticTypeUtilsService,
+ private semanticTypesService: SemanticTypesService,
+ ) {}
+
+ ngOnInit(): void {
+ this.cachedProperty = this.copyEp(this.property);
+ this.runtimeDataTypes = this.dataTypeService.getDataTypes();
+ this.isTimestampProperty = this.semanticTypeUtilsService.isTimestamp(
+ this.cachedProperty,
+ );
+ this.isEventPropertyList = this.property instanceof EventPropertyList;
+ this.isEventPropertyPrimitive =
+ this.property instanceof EventPropertyPrimitive;
+ this.isEventPropertyNested =
+ this.property instanceof EventPropertyNested;
... 5857 lines suppressed ...