This is an automated email from the ASF dual-hosted git repository. riemer pushed a commit to branch extend-shared-ui-module in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit 0ebdec39b056414c52c13c8398ed103643d32ffe Author: Dominik Riemer <[email protected]> AuthorDate: Sun May 11 15:27:47 2025 +0200 chore: Move several shared components to shared-ui module --- ui/deployment/app.module.mst | 2 + .../streampipes/platform-services/package.json | 2 + .../lib/apis/pipeline-element-asset.service.ts} | 26 +++++++----- .../apis/pipeline-element-runtime-info.service.ts | 47 ++++++++++++++++++++++ .../src/lib}/services/live-preview.service.ts | 0 .../pipeline-element-icon-text.service.ts} | 2 +- .../platform-services/src/public-api.ts | 4 ++ .../input-schema-panel.component.html | 11 ++--- .../input-schema-panel.component.scss | 10 +++++ .../input-schema-panel.component.ts | 7 +--- .../input-schema-property.component.html | 0 .../input-schema-property.component.ts | 2 +- .../pipeline-element-documentation.component.html | 0 .../pipeline-element-documentation.component.scss | 0 .../pipeline-element-documentation.component.ts | 0 .../live-preview-error.component.html | 0 .../live-preview-error.component.scss | 0 .../live-preview-error.component.ts | 0 .../live-preview-loading.component.html | 0 .../live-preview-loading.component.scss | 0 .../live-preview-loading.component.ts | 0 .../live-preview-table.component.html | 0 .../live-preview-table.component.scss | 0 .../live-preview-table.component.ts | 6 +-- .../pipeline-element-runtime-info.component.html | 0 .../pipeline-element-runtime-info.component.scss | 0 .../pipeline-element-runtime-info.component.ts | 13 ++---- .../pipeline-element-runtime-info.model.ts | 0 .../pipeline-element.component.html | 0 .../pipeline-element.component.scss | 0 .../pipeline-element/pipeline-element.component.ts | 42 +++++++++++++------ .../pipeline-element-help.component.html} | 0 .../pipeline-element-help.component.scss} | 2 +- .../pipeline-element-help.component.ts} | 27 ++++++++----- .../src/lib}/pipes/sort-by-runtime-name.pipe.ts | 0 .../services}/pipeline-element-schema.service.ts | 0 .../shared-ui/src/lib/shared-ui.module.ts | 37 ++++++++++++++++- .../streampipes/shared-ui/src/public-api.ts | 6 +++ .../asset-link-item/asset-link-item.component.ts | 5 +-- .../shared/configuration.service.spec.ts | 2 +- .../adapter-description.component.ts | 13 ++++-- .../existing-adapters.component.ts | 9 +++-- .../adapter-started-dialog.component.ts | 2 +- ui/src/app/connect/services/rest.service.ts | 15 ------- ui/src/app/core-ui/core-ui.module.ts | 18 +-------- .../pipeline-assembly-drawing-area.component.ts | 2 +- .../pipeline-element-preview.component.ts | 6 ++- .../dialog/customize/customize.component.html | 4 +- ui/src/app/editor/editor.module.ts | 13 ++---- ui/src/app/editor/services/editor.service.ts | 9 +++-- .../app/notifications/notifications.component.ts | 4 +- ui/src/app/services/rest-api.service.ts | 4 -- ui/src/federation.config.js | 2 + 53 files changed, 225 insertions(+), 129 deletions(-) diff --git a/ui/deployment/app.module.mst b/ui/deployment/app.module.mst index 7000c91d39..9edae1af7f 100644 --- a/ui/deployment/app.module.mst +++ b/ui/deployment/app.module.mst @@ -58,6 +58,7 @@ import { ValueDistributionTransform } from './core-ui/echarts-transform/value-di import { HistogramTransform } from './core-ui/echarts-transform/histogram.transform'; import { RoundValuesTransform} from './core-ui/echarts-transform/round-values.transform'; import { MapTransform } from './core-ui/echarts-transform/map.transform'; +import { MarkdownModule } from 'ngx-markdown'; import * as echarts from 'echarts'; import * as transform from 'echarts-simple-transform'; @@ -98,6 +99,7 @@ export function HttpLoaderFactory(http: HttpClient) { PipelineDetailsModule, ServicesModule, ProfileModule, + MarkdownModule.forRoot(), TranslateModule.forRoot({ loader: { provide: TranslateLoader, diff --git a/ui/projects/streampipes/platform-services/package.json b/ui/projects/streampipes/platform-services/package.json index 47ce56f110..ff587daf5a 100644 --- a/ui/projects/streampipes/platform-services/package.json +++ b/ui/projects/streampipes/platform-services/package.json @@ -4,6 +4,8 @@ "peerDependencies": { "@angular/common": "^18.2.13", "@angular/core": "^18.2.13", + "@angular/platform-browser": "^18.2.13", + "@ngx-loading-bar/http-client": "6.0.2", "rxjs": "^7.8.0", "angular-gridster2": "^18.0.1" }, diff --git a/ui/src/app/editor/pipes/sort-by-runtime-name.pipe.ts b/ui/projects/streampipes/platform-services/src/lib/apis/pipeline-element-asset.service.ts similarity index 60% copy from ui/src/app/editor/pipes/sort-by-runtime-name.pipe.ts copy to ui/projects/streampipes/platform-services/src/lib/apis/pipeline-element-asset.service.ts index 25cdb90529..cc2d6794dc 100644 --- a/ui/src/app/editor/pipes/sort-by-runtime-name.pipe.ts +++ b/ui/projects/streampipes/platform-services/src/lib/apis/pipeline-element-asset.service.ts @@ -16,17 +16,23 @@ * */ -import { Pipe, PipeTransform } from '@angular/core'; -import { EventPropertyUnion } from '@streampipes/platform-services'; +import { inject, Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { PlatformServicesCommons } from './commons.service'; -@Pipe({ - name: 'sortByRuntimeName', +@Injectable({ + providedIn: 'root', }) -export class SortByRuntimeNamePipe implements PipeTransform { - transform(value: EventPropertyUnion[]): any[] { - if (!Array.isArray(value)) { - return value; - } - return value.sort((a, b) => a.runtimeName.localeCompare(b.runtimeName)); +export class PipelineElementAssetService { + private http = inject(HttpClient); + private platformServicesCommons = inject(PlatformServicesCommons); + + getAssetUrl(appId) { + return ( + this.platformServicesCommons.apiBasePath + + '/pe/' + + appId + + '/assets' + ); } } diff --git a/ui/projects/streampipes/platform-services/src/lib/apis/pipeline-element-runtime-info.service.ts b/ui/projects/streampipes/platform-services/src/lib/apis/pipeline-element-runtime-info.service.ts new file mode 100644 index 0000000000..e9d53b8c3b --- /dev/null +++ b/ui/projects/streampipes/platform-services/src/lib/apis/pipeline-element-runtime-info.service.ts @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import { Observable } from 'rxjs'; +import { HttpClient, HttpContext, HttpEvent } from '@angular/common/http'; +import { NGX_LOADING_BAR_IGNORED } from '@ngx-loading-bar/http-client'; +import { inject, Injectable } from '@angular/core'; +import { PlatformServicesCommons } from './commons.service'; +import { SpDataStream } from '../model/gen/streampipes-model'; + +@Injectable({ + providedIn: 'root', +}) +export class PipelineElementRuntimeInfoService { + private http = inject(HttpClient); + private platformServicesCommons = inject(PlatformServicesCommons); + + getRuntimeInfo( + sourceDescription: SpDataStream, + ): Observable<HttpEvent<string>> { + return this.http.post( + `${this.platformServicesCommons.apiBasePath}/pipeline-element/runtime`, + sourceDescription, + { + responseType: 'text', + observe: 'events', + reportProgress: true, + context: new HttpContext().set(NGX_LOADING_BAR_IGNORED, true), + }, + ); + } +} diff --git a/ui/src/app/services/live-preview.service.ts b/ui/projects/streampipes/platform-services/src/lib/services/live-preview.service.ts similarity index 100% rename from ui/src/app/services/live-preview.service.ts rename to ui/projects/streampipes/platform-services/src/lib/services/live-preview.service.ts diff --git a/ui/src/app/services/get-element-icon-text.service.ts b/ui/projects/streampipes/platform-services/src/lib/services/pipeline-element-icon-text.service.ts similarity index 96% rename from ui/src/app/services/get-element-icon-text.service.ts rename to ui/projects/streampipes/platform-services/src/lib/services/pipeline-element-icon-text.service.ts index e0fe9419e9..215e504128 100644 --- a/ui/src/app/services/get-element-icon-text.service.ts +++ b/ui/projects/streampipes/platform-services/src/lib/services/pipeline-element-icon-text.service.ts @@ -19,7 +19,7 @@ import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) -export class ElementIconText { +export class PipelineElementIconTextService { constructor() {} getElementIconText(s) { diff --git a/ui/projects/streampipes/platform-services/src/public-api.ts b/ui/projects/streampipes/platform-services/src/public-api.ts index 52ebb2b8c1..d27b0e0b8f 100644 --- a/ui/projects/streampipes/platform-services/src/public-api.ts +++ b/ui/projects/streampipes/platform-services/src/public-api.ts @@ -54,6 +54,8 @@ export * from './lib/apis/user.service'; export * from './lib/apis/user-admin.service'; export * from './lib/apis/user-group.service'; export * from './lib/apis/shared-dashboard.service'; +export * from './lib/apis/pipeline-element-runtime-info.service'; +export * from './lib/apis/pipeline-element-asset.service'; export * from './lib/model/datalake/DateRange'; export * from './lib/model/datalake/DatalakeQueryParameters'; @@ -79,3 +81,5 @@ export * from './lib/model/types/data-type'; export * from './lib/model/types/semantic-type'; export * from './lib/services/isa95-type.service'; +export * from './lib/services/live-preview.service'; +export * from './lib/services/pipeline-element-icon-text.service'; diff --git a/ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-panel.component.html similarity index 86% rename from ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.component.html rename to ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-panel.component.html index 9625b5d9ce..e6ed4c98b3 100644 --- a/ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.component.html +++ b/ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-panel.component.html @@ -25,12 +25,13 @@ ><b> Show input fields</b></mat-panel-title > </mat-expansion-panel-header> - @for ( - inputStream of pipelineElement.inputStreams; - track pipelineElement.elementId - ) { + @for (inputStream of inputStreams; track $index) { <div fxLayout="column"> - <b>{{ inputStream.name }}</b> + <div class="input-stream-name-outer"> + <span class="input-stream-name">{{ + inputStream.name + }}</span> + </div> @for ( property of inputStream.eventSchema.eventProperties | sortByRuntimeName; diff --git a/ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.component.scss b/ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-panel.component.scss similarity index 87% rename from ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.component.scss rename to ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-panel.component.scss index 2cf8883b62..a9fbf4fefe 100644 --- a/ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.component.scss +++ b/ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-panel.component.scss @@ -29,3 +29,13 @@ .property-row:nth-child(even) { background-color: var(--color-bg-2); } + +.input-stream-name-outer { + background: var(--color-accent); + padding: 5px; + width: 100%; +} + +.input-stream-name { + color: var(--color-bg-0); +} diff --git a/ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.component.ts b/ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-panel.component.ts similarity index 86% rename from ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.component.ts rename to ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-panel.component.ts index 4ae5cf9e15..0d2ab109f6 100644 --- a/ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.component.ts +++ b/ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-panel.component.ts @@ -17,10 +17,7 @@ */ import { Component, Input } from '@angular/core'; -import { - DataProcessorInvocation, - DataSinkInvocation, -} from '@streampipes/platform-services'; +import { SpDataStream } from '@streampipes/platform-services'; @Component({ selector: 'sp-input-schema-panel', @@ -29,5 +26,5 @@ import { }) export class InputSchemaPanelComponent { @Input() - pipelineElement: DataProcessorInvocation | DataSinkInvocation; + inputStreams: SpDataStream[] = []; } diff --git a/ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-property/input-schema-property.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-property/input-schema-property.component.html similarity index 100% rename from ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-property/input-schema-property.component.html rename to ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-property/input-schema-property.component.html diff --git a/ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-property/input-schema-property.component.ts b/ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-property/input-schema-property.component.ts similarity index 91% rename from ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-property/input-schema-property.component.ts rename to ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-property/input-schema-property.component.ts index 4f25a53293..d600a28d6a 100644 --- a/ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-property/input-schema-property.component.ts +++ b/ui/projects/streampipes/shared-ui/src/lib/components/input-schema-panel/input-schema-property/input-schema-property.component.ts @@ -18,7 +18,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { EventPropertyUnion } from '@streampipes/platform-services'; -import { PipelineElementSchemaService } from '../../../../../core-ui/pipeline-element-runtime-info/pipeline-element-schema.service'; +import { PipelineElementSchemaService } from '../../../services/pipeline-element-schema.service'; @Component({ selector: 'sp-input-schema-property', diff --git a/ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-documentation/pipeline-element-documentation.component.html similarity index 100% rename from ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.html rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-documentation/pipeline-element-documentation.component.html diff --git a/ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.scss b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-documentation/pipeline-element-documentation.component.scss similarity index 100% rename from ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.scss rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-documentation/pipeline-element-documentation.component.scss diff --git a/ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.ts b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-documentation/pipeline-element-documentation.component.ts similarity index 100% rename from ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.ts rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-documentation/pipeline-element-documentation.component.ts diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.html similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.html rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.html diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.scss b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.scss similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.scss rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.scss diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.ts b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.ts similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.ts rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-error/live-preview-error.component.ts diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.html similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.html rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.html diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.scss b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.scss similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.scss rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.scss diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.ts b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.ts similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.ts rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component.ts diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.html similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.html rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.html diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.scss b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.scss similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.scss rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.scss diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.ts b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.ts similarity index 93% rename from ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.ts rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.ts index 5366c28677..fff18f325f 100644 --- a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.ts +++ b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.ts @@ -17,11 +17,7 @@ */ import { Component, Input } from '@angular/core'; -import { - DataType, - EventSchema, - SemanticType, -} from '@streampipes/platform-services'; +import { EventSchema } from '@streampipes/platform-services'; import { RuntimeInfo } from '../pipeline-element-runtime-info.model'; @Component({ diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.component.html similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.html rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.component.html diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.scss b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.component.scss similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.scss rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.component.scss diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.ts b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.component.ts similarity index 92% rename from ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.ts rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.component.ts index e5b5e264e7..0316ac20bd 100644 --- a/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.ts +++ b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.component.ts @@ -24,19 +24,14 @@ import { OnInit, } from '@angular/core'; import { - DataType, - EventPropertyList, - EventPropertyPrimitive, - EventPropertyUnion, - SemanticType, + LivePreviewService, + PipelineElementRuntimeInfoService, SpDataStream, } from '@streampipes/platform-services'; -import { RestService } from '../../connect/services/rest.service'; import { Subscription } from 'rxjs'; import { HttpDownloadProgressEvent, HttpEventType } from '@angular/common/http'; -import { LivePreviewService } from '../../services/live-preview.service'; import { RuntimeInfo } from './pipeline-element-runtime-info.model'; -import { PipelineElementSchemaService } from './pipeline-element-schema.service'; +import { PipelineElementSchemaService } from '../../services/pipeline-element-schema.service'; @Component({ selector: 'sp-pipeline-element-runtime-info', @@ -57,7 +52,7 @@ export class PipelineElementRuntimeInfoComponent implements OnInit, OnDestroy { runtimeSub: Subscription; constructor( - private restService: RestService, + private restService: PipelineElementRuntimeInfoService, private livePreviewService: LivePreviewService, private pipelineELementSchemaService: PipelineElementSchemaService, ) {} diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.model.ts b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.model.ts similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.model.ts rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.model.ts diff --git a/ui/src/app/editor/components/pipeline-element/pipeline-element.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element/pipeline-element.component.html similarity index 100% rename from ui/src/app/editor/components/pipeline-element/pipeline-element.component.html rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element/pipeline-element.component.html diff --git a/ui/src/app/editor/components/pipeline-element/pipeline-element.component.scss b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element/pipeline-element.component.scss similarity index 100% rename from ui/src/app/editor/components/pipeline-element/pipeline-element.component.scss rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element/pipeline-element.component.scss diff --git a/ui/src/app/editor/components/pipeline-element/pipeline-element.component.ts b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element/pipeline-element.component.ts similarity index 68% rename from ui/src/app/editor/components/pipeline-element/pipeline-element.component.ts rename to ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element/pipeline-element.component.ts index f6c9c7c8d7..7d149806b0 100644 --- a/ui/src/app/editor/components/pipeline-element/pipeline-element.component.ts +++ b/ui/projects/streampipes/shared-ui/src/lib/components/pipeline-element/pipeline-element.component.ts @@ -16,11 +16,15 @@ * */ -import { Component, Input } from '@angular/core'; -import { RestApi } from '../../../services/rest-api.service'; -import { ElementIconText } from '../../../services/get-element-icon-text.service'; -import { PipelineElementUnion } from '../../model/editor.model'; +import { Component, inject, Input } from '@angular/core'; import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { + DataProcessorInvocation, + DataSinkInvocation, + PipelineElementAssetService, + PipelineElementIconTextService, + SpDataStream, +} from '@streampipes/platform-services'; @Component({ selector: 'sp-pipeline-element', @@ -31,7 +35,10 @@ export class PipelineElementComponent { showImage: any; iconText: any; - pipelineElement_: PipelineElementUnion; + pipelineElement_: + | SpDataStream + | DataProcessorInvocation + | DataSinkInvocation; @Input() iconSize: any; @@ -42,11 +49,11 @@ export class PipelineElementComponent { iconUrl: any; image: SafeUrl; - constructor( - private restApi: RestApi, - private elementIconText: ElementIconText, - private sanitizer: DomSanitizer, - ) {} + private pipelineElementAssetService = inject(PipelineElementAssetService); + private pipelineElementIconTextService = inject( + PipelineElementIconTextService, + ); + private sanitizer = inject(DomSanitizer); checkImageAvailable() { if ( @@ -63,7 +70,11 @@ export class PipelineElementComponent { } makeAssetIconUrl() { - return this.restApi.getAssetUrl(this.pipelineElement.appId) + '/icon'; + return ( + this.pipelineElementAssetService.getAssetUrl( + this.pipelineElement.appId, + ) + '/icon' + ); } iconSizeCss() { @@ -81,9 +92,14 @@ export class PipelineElementComponent { } @Input() - set pipelineElement(pipelineElement: PipelineElementUnion) { + set pipelineElement( + pipelineElement: + | SpDataStream + | DataProcessorInvocation + | DataSinkInvocation, + ) { this.pipelineElement_ = pipelineElement; - this.iconText = this.elementIconText.getElementIconText( + this.iconText = this.pipelineElementIconTextService.getElementIconText( this.pipelineElement.name, ); this.checkImageAvailable(); diff --git a/ui/src/app/core-ui/help/help.component.html b/ui/projects/streampipes/shared-ui/src/lib/dialog/pipeline-element-help/pipeline-element-help.component.html similarity index 100% rename from ui/src/app/core-ui/help/help.component.html rename to ui/projects/streampipes/shared-ui/src/lib/dialog/pipeline-element-help/pipeline-element-help.component.html diff --git a/ui/src/app/core-ui/help/help.component.scss b/ui/projects/streampipes/shared-ui/src/lib/dialog/pipeline-element-help/pipeline-element-help.component.scss similarity index 94% rename from ui/src/app/core-ui/help/help.component.scss rename to ui/projects/streampipes/shared-ui/src/lib/dialog/pipeline-element-help/pipeline-element-help.component.scss index c077f68f35..1216327000 100644 --- a/ui/src/app/core-ui/help/help.component.scss +++ b/ui/projects/streampipes/shared-ui/src/lib/dialog/pipeline-element-help/pipeline-element-help.component.scss @@ -16,7 +16,7 @@ * */ -@import '../../../scss/sp/sp-dialog.scss'; +@import '../../../../../../../src/scss/sp/sp-dialog'; .element-id { border-radius: 5px; diff --git a/ui/src/app/core-ui/help/help.component.ts b/ui/projects/streampipes/shared-ui/src/lib/dialog/pipeline-element-help/pipeline-element-help.component.ts similarity index 71% rename from ui/src/app/core-ui/help/help.component.ts rename to ui/projects/streampipes/shared-ui/src/lib/dialog/pipeline-element-help/pipeline-element-help.component.ts index e918301fdc..8891adbebf 100644 --- a/ui/src/app/core-ui/help/help.component.ts +++ b/ui/projects/streampipes/shared-ui/src/lib/dialog/pipeline-element-help/pipeline-element-help.component.ts @@ -17,33 +17,40 @@ */ import { Component, Input, OnInit, inject } from '@angular/core'; -import { SpDataStream } from '@streampipes/platform-services'; -import { DialogRef } from '@streampipes/shared-ui'; -import { PipelineElementUnion } from '../../editor/model/editor.model'; +import { + DataProcessorInvocation, + DataSinkInvocation, + SpDataStream, +} from '@streampipes/platform-services'; import { TranslateService } from '@ngx-translate/core'; +import { DialogRef } from '../base-dialog/dialog-ref'; @Component({ selector: 'sp-pipeline-element-help', - templateUrl: './help.component.html', - styleUrls: ['./help.component.scss'], + templateUrl: './pipeline-element-help.component.html', + styleUrls: ['./pipeline-element-help.component.scss'], }) -export class HelpComponent implements OnInit { +export class PipelineElementHelpComponent implements OnInit { selectedTabIndex = 0; translateService = inject(TranslateService); availableTabs = [ - this.translateService.instant('TOPICS'), - this.translateService.instant('CODE'), + this.translateService.instant('Preview'), + this.translateService.instant('Documentation'), ]; tabs: string[] = []; @Input() - pipelineElement: PipelineElementUnion; + pipelineElement: + | SpDataStream + | DataProcessorInvocation + | DataSinkInvocation; + isDataStream: boolean; - constructor(private dialogRef: DialogRef<HelpComponent>) {} + constructor(private dialogRef: DialogRef<PipelineElementHelpComponent>) {} ngOnInit() { if (this.pipelineElement instanceof SpDataStream) { diff --git a/ui/src/app/editor/pipes/sort-by-runtime-name.pipe.ts b/ui/projects/streampipes/shared-ui/src/lib/pipes/sort-by-runtime-name.pipe.ts similarity index 100% rename from ui/src/app/editor/pipes/sort-by-runtime-name.pipe.ts rename to ui/projects/streampipes/shared-ui/src/lib/pipes/sort-by-runtime-name.pipe.ts diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-schema.service.ts b/ui/projects/streampipes/shared-ui/src/lib/services/pipeline-element-schema.service.ts similarity index 100% rename from ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-schema.service.ts rename to ui/projects/streampipes/shared-ui/src/lib/services/pipeline-element-schema.service.ts diff --git a/ui/projects/streampipes/shared-ui/src/lib/shared-ui.module.ts b/ui/projects/streampipes/shared-ui/src/lib/shared-ui.module.ts index e4eeca1d76..394a8caa6c 100644 --- a/ui/projects/streampipes/shared-ui/src/lib/shared-ui.module.ts +++ b/ui/projects/streampipes/shared-ui/src/lib/shared-ui.module.ts @@ -83,6 +83,19 @@ import { DateInputComponent } from './components/date-input/date-input.component import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatInputModule } from '@angular/material/input'; import { TranslateModule } from '@ngx-translate/core'; +import { LivePreviewLoadingComponent } from './components/pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component'; +import { LivePreviewTableComponent } from './components/pipeline-element-runtime-info/live-preview-table/live-preview-table.component'; +import { LivePreviewErrorComponent } from './components/pipeline-element-runtime-info/live-preview-error/live-preview-error.component'; +import { PipelineElementRuntimeInfoComponent } from './components/pipeline-element-runtime-info/pipeline-element-runtime-info.component'; +import { PipelineElementDocumentationComponent } from './components/pipeline-element-documentation/pipeline-element-documentation.component'; +import { MarkdownModule } from 'ngx-markdown'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { PipelineElementHelpComponent } from './dialog/pipeline-element-help/pipeline-element-help.component'; +import { PipelineElementComponent } from './components/pipeline-element/pipeline-element.component'; +import { InputSchemaPanelComponent } from './components/input-schema-panel/input-schema-panel.component'; +import { InputSchemaPropertyComponent } from './components/input-schema-panel/input-schema-property/input-schema-property.component'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { SortByRuntimeNamePipe } from './pipes/sort-by-runtime-name.pipe'; @NgModule({ declarations: [ @@ -123,6 +136,16 @@ import { TranslateModule } from '@ngx-translate/core'; SpConfigurationBoxComponent, SelectDataRangeComponent, SelectDataMissingValuesComponent, + LivePreviewLoadingComponent, + LivePreviewTableComponent, + LivePreviewErrorComponent, + PipelineElementRuntimeInfoComponent, + PipelineElementDocumentationComponent, + PipelineElementHelpComponent, + PipelineElementComponent, + InputSchemaPanelComponent, + InputSchemaPropertyComponent, + SortByRuntimeNamePipe, ], imports: [ CommonModule, @@ -140,6 +163,7 @@ import { TranslateModule } from '@ngx-translate/core'; MatTooltipModule, MatTreeModule, MatDatepickerModule, + MatExpansionModule, MatCardModule, PortalModule, OverlayModule, @@ -148,10 +172,16 @@ import { TranslateModule } from '@ngx-translate/core'; MatTableModule, MatPaginator, MatRadioModule, + MatProgressSpinnerModule, MatSort, TranslateModule.forChild({}), + MarkdownModule.forRoot(), + ], + providers: [ + DefaultMatCalendarRangeStrategy, + MatRangeDateSelectionModel, + SortByRuntimeNamePipe, ], - providers: [DefaultMatCalendarRangeStrategy, MatRangeDateSelectionModel], exports: [ AssetBrowserComponent, ConfirmDialogComponent, @@ -176,6 +206,11 @@ import { TranslateModule } from '@ngx-translate/core'; TimeRangeSelectorComponent, TimeRangeSelectorMenuComponent, DataExplorerRefreshIntervalSettingsComponent, + PipelineElementRuntimeInfoComponent, + PipelineElementDocumentationComponent, + PipelineElementHelpComponent, + PipelineElementComponent, + InputSchemaPanelComponent, ], }) export class SharedUiModule {} diff --git a/ui/projects/streampipes/shared-ui/src/public-api.ts b/ui/projects/streampipes/shared-ui/src/public-api.ts index 233e9d90a7..5eccf65f77 100644 --- a/ui/projects/streampipes/shared-ui/src/public-api.ts +++ b/ui/projects/streampipes/shared-ui/src/public-api.ts @@ -26,6 +26,7 @@ export * from './lib/dialog/data-download-dialog/data-download-dialog.component' export * from './lib/dialog/confirm-dialog/confirm-dialog.component'; export * from './lib/dialog/panel-dialog/panel-dialog.component'; export * from './lib/dialog/standard-dialog/standard-dialog.component'; +export * from './lib/dialog/pipeline-element-help/pipeline-element-help.component'; export * from './lib/components/asset-browser/asset-browser.component'; export * from './lib/components/basic-header-title/header-title.component'; @@ -47,6 +48,10 @@ export * from './lib/components/time-selector/time-range-selector.component'; export * from './lib/components/time-selector/time-selector-menu/time-selector-menu.component'; export * from './lib/components/time-selector/time-selector-menu/custom-time-range-selection/custom-time-range-selection.component'; export * from './lib/components/time-selector/refresh-interval-settings/refresh-interval-settings.component'; +export * from './lib/components/pipeline-element-runtime-info/pipeline-element-runtime-info.component'; +export * from './lib/components/pipeline-element-documentation/pipeline-element-documentation.component'; +export * from './lib/components/pipeline-element/pipeline-element.component'; +export * from './lib/components/input-schema-panel/input-schema-panel.component'; export * from './lib/models/sp-navigation.model'; @@ -58,3 +63,4 @@ export * from './lib/services/colorization.service'; export * from './lib/services/time-selection.service'; export * from './lib/components/asset-browser/asset-browser.service'; export * from './lib/services/date-format.service'; +export * from './lib/services/pipeline-element-schema.service'; diff --git a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-link-section/asset-link-item/asset-link-item.component.ts b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-link-section/asset-link-item/asset-link-item.component.ts index 5a3a0f2ed6..46eda1e238 100644 --- a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-link-section/asset-link-item/asset-link-item.component.ts +++ b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-link-section/asset-link-item/asset-link-item.component.ts @@ -17,10 +17,7 @@ */ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { - AssetLink, - AssetLinkType, -} from '../../../../../../../../../../projects/streampipes/platform-services/src/public-api'; +import { AssetLink, AssetLinkType } from '@streampipes/platform-services'; import { Router } from '@angular/router'; @Component({ diff --git a/ui/src/app/configuration/shared/configuration.service.spec.ts b/ui/src/app/configuration/shared/configuration.service.spec.ts index 6b84895121..5746335eb6 100644 --- a/ui/src/app/configuration/shared/configuration.service.spec.ts +++ b/ui/src/app/configuration/shared/configuration.service.spec.ts @@ -22,7 +22,7 @@ import { provideHttpClientTesting, } from '@angular/common/http/testing'; import { ConfigurationService } from './configuration.service'; -import { SpServiceConfiguration } from '../../../../projects/streampipes/platform-services/src/lib/model/gen/streampipes-model'; +import { SpServiceConfiguration } from '@streampipes/platform-services'; import { provideHttpClient, withInterceptorsFromDi, 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 4b286ffe44..601d6f4ab8 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 @@ -17,8 +17,10 @@ */ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { AdapterDescription } from '@streampipes/platform-services'; -import { RestApi } from '../../../../services/rest-api.service'; +import { + AdapterDescription, + PipelineElementAssetService, +} from '@streampipes/platform-services'; import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; import { DialogService, PanelType } from '@streampipes/shared-ui'; import { SpAdapterDocumentationDialogComponent } from '../../../dialog/adapter-documentation/adapter-documentation-dialog.component'; @@ -37,7 +39,7 @@ export class AdapterDescriptionComponent implements OnInit { iconUrl: SafeUrl; constructor( - private restApi: RestApi, + private pipelineElementAssetService: PipelineElementAssetService, private sanitizer: DomSanitizer, private dialogService: DialogService, ) {} @@ -56,7 +58,10 @@ export class AdapterDescriptionComponent implements OnInit { } makeAssetIconUrl() { - return this.restApi.getAssetUrl(this.adapter.appId) + '/icon'; + return ( + this.pipelineElementAssetService.getAssetUrl(this.adapter.appId) + + '/icon' + ); } openDocumentation(event: MouseEvent): void { 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 7b3521d7bf..ceaf61b021 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 @@ -21,6 +21,7 @@ import { AdapterDescription, AdapterMonitoringService, AdapterService, + PipelineElementAssetService, SpLogMessage, SpMetricsEntry, } from '@streampipes/platform-services'; @@ -43,7 +44,6 @@ import { AdapterFilterSettingsModel } from '../../model/adapter-filter-settings. import { AdapterFilterPipe } from '../../filter/adapter-filter.pipe'; import { SpConnectRoutes } from '../../connect.routes'; import { Subscription, zip } from 'rxjs'; -import { RestApi } from '../../../services/rest-api.service'; import { ShepherdService } from '../../../services/tour/shepherd.service'; @Component({ @@ -94,7 +94,7 @@ export class ExistingAdaptersComponent implements OnInit, OnDestroy { private dialogService: DialogService, private currentUserService: CurrentUserService, private router: Router, - private restApi: RestApi, + private pipelineElementAssetService: PipelineElementAssetService, private adapterFilter: AdapterFilterPipe, private breadcrumbService: SpBreadcrumbService, private adapterMonitoringService: AdapterMonitoringService, @@ -213,7 +213,10 @@ export class ExistingAdaptersComponent implements OnInit, OnDestroy { getIconUrl(adapter: AdapterDescription) { if (adapter.includedAssets.length > 0) { - return this.restApi.getAssetUrl(adapter.appId) + '/icon'; + return ( + this.pipelineElementAssetService.getAssetUrl(adapter.appId) + + '/icon' + ); } } 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 17cc830821..5cd09fd61d 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 @@ -31,7 +31,7 @@ import { SpLogMessage, } from '@streampipes/platform-services'; import { DialogRef } from '@streampipes/shared-ui'; -import { CompactPipelineService } from '../../../../../projects/streampipes/platform-services/src/lib/apis/compact-pipeline.service'; +import { CompactPipelineService } from '@streampipes/platform-services'; @Component({ selector: 'sp-dialog-adapter-started-dialog', diff --git a/ui/src/app/connect/services/rest.service.ts b/ui/src/app/connect/services/rest.service.ts index 04b9f6b0ce..0a181943a0 100644 --- a/ui/src/app/connect/services/rest.service.ts +++ b/ui/src/app/connect/services/rest.service.ts @@ -80,21 +80,6 @@ export class RestService { ); } - getRuntimeInfo( - sourceDescription: SpDataStream, - ): Observable<HttpEvent<string>> { - return this.http.post( - `${this.platformServicesCommons.apiBasePath}/pipeline-element/runtime`, - sourceDescription, - { - responseType: 'text', - observe: 'events', - reportProgress: true, - context: new HttpContext().set(NGX_LOADING_BAR_IGNORED, true), - }, - ); - } - getFittingUnits( unitDescription: UnitDescription, ): Observable<UnitDescription[]> { diff --git a/ui/src/app/core-ui/core-ui.module.ts b/ui/src/app/core-ui/core-ui.module.ts index 24f4519fb8..4f87f26bad 100644 --- a/ui/src/app/core-ui/core-ui.module.ts +++ b/ui/src/app/core-ui/core-ui.module.ts @@ -67,13 +67,7 @@ import { PipelineElementTemplatePipe } from './pipeline-element-template-config/ import { StatusWidgetComponent } from './status/status-widget.component'; import { SpSimpleMetricsComponent } from './monitoring/simple-metrics/simple-metrics.component'; import { SpSimpleLogsComponent } from './monitoring/simple-logs/simple-logs.component'; -import { HelpComponent } from './help/help.component'; -import { PipelineElementRuntimeInfoComponent } from './pipeline-element-runtime-info/pipeline-element-runtime-info.component'; -import { PipelineElementDocumentationComponent } from './pipeline-element-documentation/pipeline-element-documentation.component'; -import { MarkdownModule } from 'ngx-markdown'; -import { LivePreviewLoadingComponent } from './pipeline-element-runtime-info/live-preview-loading/live-preview-loading.component'; -import { LivePreviewTableComponent } from './pipeline-element-runtime-info/live-preview-table/live-preview-table.component'; -import { LivePreviewErrorComponent } from './pipeline-element-runtime-info/live-preview-error/live-preview-error.component'; +//import { HelpComponent } from '../../../projects/streampipes/shared-ui/src/lib/dialog/pipeline-element-help/help.component'; import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; @@ -162,7 +156,6 @@ import { TranslateModule } from '@ngx-translate/core'; OverlayModule, QuillModule.forRoot(), MatTreeModule, - MarkdownModule.forRoot(), TranslateModule.forChild(), LeafletModule, ], @@ -173,9 +166,6 @@ import { TranslateModule } from '@ngx-translate/core'; PipelineElementTemplateConfigComponent, PipelineElementTemplateConfigItemComponent, PipelineElementTemplatePipe, - PipelineElementRuntimeInfoComponent, - PipelineElementDocumentationComponent, - HelpComponent, TopicsComponent, StaticAnyInputComponent, StaticPropertyComponent, @@ -207,9 +197,6 @@ import { TranslateModule } from '@ngx-translate/core'; SpSimpleLogsComponent, SpSimpleMetricsComponent, StatusWidgetComponent, - LivePreviewLoadingComponent, - LivePreviewTableComponent, - LivePreviewErrorComponent, LoadingIndicatorComponent, StatusIndicatorComponent, MultiStepStatusIndicatorComponent, @@ -221,9 +208,6 @@ import { TranslateModule } from '@ngx-translate/core'; exports: [ ConfigurationCodePanelComponent, PipelineElementTemplateConfigComponent, - PipelineElementRuntimeInfoComponent, - PipelineElementDocumentationComponent, - HelpComponent, TopicsComponent, StaticAnyInputComponent, StaticPropertyComponent, diff --git a/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly-drawing-area/pipeline-assembly-drawing-area.component.ts b/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly-drawing-area/pipeline-assembly-drawing-area.component.ts index 8a0d66bc51..c87a72e087 100644 --- a/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly-drawing-area/pipeline-assembly-drawing-area.component.ts +++ b/ui/src/app/editor/components/pipeline-assembly/pipeline-assembly-drawing-area/pipeline-assembly-drawing-area.component.ts @@ -35,6 +35,7 @@ import { import { PipelineAssemblyDrawingAreaPanZoomComponent } from './pipeline-assembly-drawing-area-pan-zoom/pipeline-assembly-drawing-area-pan-zoom.component'; import { PipelineValidationService } from '../../../services/pipeline-validation.service'; import { + LivePreviewService, PipelineCanvasMetadata, PipelinePreviewModel, SpMetricsEntry, @@ -42,7 +43,6 @@ import { import { EditorService } from '../../../services/editor.service'; import { PipelinePositioningService } from '../../../services/pipeline-positioning.service'; import { HttpDownloadProgressEvent } from '@angular/common/http'; -import { LivePreviewService } from '../../../../services/live-preview.service'; import { ObjectProvider } from '../../../services/object-provider.service'; import { Subscription } from 'rxjs'; diff --git a/ui/src/app/editor/components/pipeline-element-preview/pipeline-element-preview.component.ts b/ui/src/app/editor/components/pipeline-element-preview/pipeline-element-preview.component.ts index 821f5b1a7b..ad8b3855b0 100644 --- a/ui/src/app/editor/components/pipeline-element-preview/pipeline-element-preview.component.ts +++ b/ui/src/app/editor/components/pipeline-element-preview/pipeline-element-preview.component.ts @@ -19,8 +19,10 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { Subscription } from 'rxjs'; import { KeyValue } from '@angular/common'; -import { LivePreviewService } from '../../../services/live-preview.service'; -import { PipelinePreviewModel } from '@streampipes/platform-services'; +import { + LivePreviewService, + PipelinePreviewModel, +} from '@streampipes/platform-services'; @Component({ selector: 'sp-pipeline-element-preview', diff --git a/ui/src/app/editor/dialog/customize/customize.component.html b/ui/src/app/editor/dialog/customize/customize.component.html index 4bd6f2936a..41e0276f0f 100644 --- a/ui/src/app/editor/dialog/customize/customize.component.html +++ b/ui/src/app/editor/dialog/customize/customize.component.html @@ -76,7 +76,9 @@ class="customize-section p-15" > <sp-input-schema-panel - [pipelineElement]="cachedPipelineElement" + [inputStreams]=" + cachedPipelineElement.inputStreams + " > </sp-input-schema-panel> <form [formGroup]="parentForm" fxFlex="100"> diff --git a/ui/src/app/editor/editor.module.ts b/ui/src/app/editor/editor.module.ts index c2742c7199..3e5e86eee4 100644 --- a/ui/src/app/editor/editor.module.ts +++ b/ui/src/app/editor/editor.module.ts @@ -25,7 +25,6 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { EditorComponent } from './editor.component'; import { PipelineElementIconStandComponent } from './components/pipeline-element-icon-stand/pipeline-element-icon-stand.component'; import { PipelineAssemblyComponent } from './components/pipeline-assembly/pipeline-assembly.component'; -import { PipelineElementComponent } from './components/pipeline-element/pipeline-element.component'; import { PipelineComponent } from './components/pipeline/pipeline.component'; import { PipelineElementOptionsComponent } from './components/pipeline-element-options/pipeline-element-options.component'; import { CustomizeComponent } from './dialog/customize/customize.component'; @@ -81,11 +80,9 @@ import { PipelineAssemblyOptionsPipelineCacheComponent } from './components/pipe import { PipelineAssemblyDrawingAreaPanZoomComponent } from './components/pipeline-assembly/pipeline-assembly-drawing-area/pipeline-assembly-drawing-area-pan-zoom/pipeline-assembly-drawing-area-pan-zoom.component'; import { PipelineAssemblyDrawingAreaComponent } from './components/pipeline-assembly/pipeline-assembly-drawing-area/pipeline-assembly-drawing-area.component'; import { DroppedPipelineElementComponent } from './components/pipeline/dropped-pipeline-element/dropped-pipeline-element.component'; -import { InputSchemaPanelComponent } from './dialog/customize/input-schema-panel/input-schema-panel.component'; -import { InputSchemaPropertyComponent } from './dialog/customize/input-schema-panel/input-schema-property/input-schema-property.component'; -import { SortByRuntimeNamePipe } from './pipes/sort-by-runtime-name.pipe'; import { AddTemplateDialogComponent } from './dialog/add-template-dialog/add-template-dialog.component'; import { TemplateSelectionComponent } from './dialog/add-template-dialog/template-selection/template-selection.component'; +import { SharedUiModule } from '@streampipes/shared-ui'; @NgModule({ imports: [ @@ -125,6 +122,7 @@ import { TemplateSelectionComponent } from './dialog/add-template-dialog/templat MatProgressSpinnerModule, ReactiveFormsModule, PlatformServicesModule, + SharedUiModule, ], declarations: [ AddTemplateDialogComponent, @@ -134,8 +132,6 @@ import { TemplateSelectionComponent } from './dialog/add-template-dialog/templat DroppedPipelineElementComponent, EditorComponent, EnabledPipelineElementFilter, - InputSchemaPanelComponent, - InputSchemaPropertyComponent, MatchingErrorComponent, MissingElementsForTutorialComponent, OutputStrategyComponent, @@ -145,7 +141,6 @@ import { TemplateSelectionComponent } from './dialog/add-template-dialog/templat PipelineAssemblyDrawingAreaPanZoomComponent, PipelineAssemblyOptionsComponent, PipelineAssemblyOptionsPipelineCacheComponent, - PipelineElementComponent, PipelineElementDiscoveryComponent, PipelineElementIconStandComponent, PipelineElementIconStandRowComponent, @@ -161,14 +156,12 @@ import { TemplateSelectionComponent } from './dialog/add-template-dialog/templat TemplateSelectionComponent, SavePipelineComponent, SavePipelineSettingsComponent, - SortByRuntimeNamePipe, SafeCss, ], - providers: [SafeCss, SortByRuntimeNamePipe], + providers: [SafeCss], exports: [ EditorComponent, PipelineComponent, - PipelineElementComponent, PipelineAssemblyDrawingAreaComponent, ], }) diff --git a/ui/src/app/editor/services/editor.service.ts b/ui/src/app/editor/services/editor.service.ts index 0e0f19954b..75c8362058 100644 --- a/ui/src/app/editor/services/editor.service.ts +++ b/ui/src/app/editor/services/editor.service.ts @@ -36,10 +36,13 @@ import { PipelineElementConfig, PipelineElementUnion, } from '../model/editor.model'; -import { DialogService, PanelType } from '@streampipes/shared-ui'; +import { + DialogService, + PanelType, + PipelineElementHelpComponent, +} from '@streampipes/shared-ui'; import { map } from 'rxjs/operators'; import { NGX_LOADING_BAR_IGNORED } from '@ngx-loading-bar/http-client'; -import { HelpComponent } from '../../core-ui/help/help.component'; import { TopicsComponent } from 'src/app/core-ui/topics/topics.component'; @Injectable({ providedIn: 'root' }) @@ -166,7 +169,7 @@ export class EditorService { } openHelpDialog(pipelineElement: PipelineElementUnion) { - this.dialogService.open(HelpComponent, { + this.dialogService.open(PipelineElementHelpComponent, { panelType: PanelType.STANDARD_PANEL, title: pipelineElement.name, width: '70vw', diff --git a/ui/src/app/notifications/notifications.component.ts b/ui/src/app/notifications/notifications.component.ts index e7d02be342..51b4018bda 100644 --- a/ui/src/app/notifications/notifications.component.ts +++ b/ui/src/app/notifications/notifications.component.ts @@ -27,7 +27,6 @@ import { ExistingNotification, NotificationItem, } from './model/notifications.model'; -import { ElementIconText } from '../services/get-element-icon-text.service'; import { NotificationsService } from './service/notifications.service'; import { Subscription, timer } from 'rxjs'; import { NotificationUtils } from './utils/notifications.utils'; @@ -35,6 +34,7 @@ import { NotificationCountService } from '../services/notification-count-service import { FreeTextStaticProperty, Pipeline, + PipelineElementIconTextService, PipelineService, } from '@streampipes/platform-services'; import { AuthService } from '../services/auth.service'; @@ -77,7 +77,7 @@ export class NotificationsComponent implements OnInit, OnDestroy { constructor( private authService: AuthService, private pipelineService: PipelineService, - public elementIconText: ElementIconText, + public elementIconText: PipelineElementIconTextService, private notificationService: NotificationsService, private notificationCountService: NotificationCountService, private breadcrumbService: SpBreadcrumbService, diff --git a/ui/src/app/services/rest-api.service.ts b/ui/src/app/services/rest-api.service.ts index 1c4de79f75..4df0f1c33f 100644 --- a/ui/src/app/services/rest-api.service.ts +++ b/ui/src/app/services/rest-api.service.ts @@ -37,10 +37,6 @@ export class RestApi { return this.platformServicesCommons.apiBasePath; } - getAssetUrl(appId) { - return this.getServerUrl() + '/pe/' + appId + '/assets'; - } - configured(): Observable<any> { return this.$http.get(this.getServerUrl() + '/setup/configured', { context: new HttpContext().set(NGX_LOADING_BAR_IGNORED, true), diff --git a/ui/src/federation.config.js b/ui/src/federation.config.js index 22de884c1e..4e5ae10693 100644 --- a/ui/src/federation.config.js +++ b/ui/src/federation.config.js @@ -34,6 +34,8 @@ module.exports = withNativeFederation({ '@angular/platform-browser-dynamic', '@angular/router', '@angular/cdk', + '@ngx-loading-bar/core', + '@ngx-loading-bar/http-client', '@angular/material', 'echarts', 'ngx-echarts',
