diff --git a/ui/src/app/connect/components/adapter-code-panel/adapter-code-panel.component.html b/ui/src/app/connect/components/adapter-code-panel/adapter-code-panel.component.html index 8a05afabd3..6f553c63e3 100644 --- a/ui/src/app/connect/components/adapter-code-panel/adapter-code-panel.component.html +++ b/ui/src/app/connect/components/adapter-code-panel/adapter-code-panel.component.html @@ -18,6 +18,7 @@
diff --git a/ui/src/app/core-ui/configuration-code-panel/configuration-code-panel.component.html b/ui/src/app/core-ui/configuration-code-panel/configuration-code-panel.component.html index a6590ce049..7e232c3089 100644 --- a/ui/src/app/core-ui/configuration-code-panel/configuration-code-panel.component.html +++ b/ui/src/app/core-ui/configuration-code-panel/configuration-code-panel.component.html @@ -16,8 +16,23 @@ ~ --> - + +
+
+ +
+

     
+
+
+ +
+
+
+
+
+
+
+

{{ pipelineElement?.name }}

+ {{ pipelineElement?.description }} +
+
+ ID  + {{ + isDataStream + ? pipelineElement?.elementId + : pipelineElement?.appId + }} +
+
+ + + + + +
+ + + + + + + + +
+ Output Topics + +
+ {{ + element?.topicDefinition?.actualTopicName + }} + +
+
+
+ + + + + + + + + +
+ Input Topics + +
+ {{ + element?.eventGrounding + ?.transportProtocols?.[0] + ?.topicDefinition?.actualTopicName + }} + +
+
+ + + + + + + + +
+ Output Topics + +
+ {{ + element?.topicDefinition?.actualTopicName + }} + +
+
+
+ + + + + + + + + +
+ Input Topics + +
+ {{ + element?.eventGrounding + ?.transportProtocols?.[0] + ?.topicDefinition?.actualTopicName + }} + +
+
+
+
+
+ + + +
+ +
+
diff --git a/ui/src/app/core-ui/topics/topics.component.scss b/ui/src/app/core-ui/topics/topics.component.scss new file mode 100644 index 0000000000..c077f68f35 --- /dev/null +++ b/ui/src/app/core-ui/topics/topics.component.scss @@ -0,0 +1,29 @@ +/* + * 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 '../../../scss/sp/sp-dialog.scss'; + +.element-id { + border-radius: 5px; + margin-right: 10px; + margin-top: 5px; + margin-bottom: 5px; + font-size: small; + display: inline-block; + padding: 5px; +} diff --git a/ui/src/app/core-ui/topics/topics.component.ts b/ui/src/app/core-ui/topics/topics.component.ts new file mode 100644 index 0000000000..2ce28d6dc7 --- /dev/null +++ b/ui/src/app/core-ui/topics/topics.component.ts @@ -0,0 +1,77 @@ +/* + * 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 { Component, Input, OnInit } from '@angular/core'; +import { + DataProcessorInvocation, + DataSinkInvocation, + SpDataStream, +} from '@streampipes/platform-services'; +import { DialogRef } from '@streampipes/shared-ui'; +import { PipelineElementUnion } from '../../editor/model/editor.model'; + +@Component({ + selector: 'sp-pipeline-element-topics', + templateUrl: './topics.component.html', + styleUrls: ['./topics.component.scss'], +}) +export class TopicsComponent implements OnInit { + selectedTabIndex = 0; + + availableTabs = ['Topics', 'Code']; + tabs: string[] = []; + + @Input() + pipelineElement: PipelineElementUnion; + isDataStream: boolean; + + constructor(private dialogRef: DialogRef) {} + + ngOnInit() { + if ( + this.pipelineElement instanceof SpDataStream || + this.pipelineElement instanceof DataProcessorInvocation || + this.pipelineElement instanceof DataSinkInvocation + ) { + this.tabs = this.availableTabs; + } else { + this.tabs = [this.availableTabs[1]]; + this.selectedTabIndex = 1; + } + } + + isSpDataStream(): boolean { + return this.pipelineElement instanceof SpDataStream; + } + + isDataProcessorInvocation(): boolean { + return this.pipelineElement instanceof DataProcessorInvocation; + } + + isDataSinkInvocation(): boolean { + return this.pipelineElement instanceof DataSinkInvocation; + } + + close() { + setTimeout(() => { + this.dialogRef.close(); + }); + } + + protected readonly SpDataStream = SpDataStream; +} diff --git a/ui/src/app/editor/components/pipeline/pipeline.component.html b/ui/src/app/editor/components/pipeline/pipeline.component.html index 20b984a570..8b77b5b017 100644 --- a/ui/src/app/editor/components/pipeline/pipeline.component.html +++ b/ui/src/app/editor/components/pipeline/pipeline.component.html @@ -26,6 +26,7 @@ *ngFor=" let pipelineElementConfig of rawPipelineModel | enabledPipelineElement " + style="position: relative" > +
+ +
diff --git a/ui/src/app/editor/components/pipeline/pipeline.component.scss b/ui/src/app/editor/components/pipeline/pipeline.component.scss new file mode 100644 index 0000000000..4d3c139be2 --- /dev/null +++ b/ui/src/app/editor/components/pipeline/pipeline.component.scss @@ -0,0 +1,43 @@ +/* + * 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. + * + */ + +.topics-button { + cursor: pointer; + width: 30px; + height: 30px; + border-radius: 20%; + box-shadow: 0 0 3px var(--color-accent); + background-color: var(--color-accent); + color: rgba(255, 255, 255, 0.75); + position: absolute; + left: 35%; + top: 75%; + z-index: 50; + margin-top: 5px; +} + +.topics-icon-button { + width: 100%; + height: 100%; + padding: 0; +} + +.topics-icon-size { + font-size: 16px; + color: white; +} diff --git a/ui/src/app/editor/components/pipeline/pipeline.component.ts b/ui/src/app/editor/components/pipeline/pipeline.component.ts index 71843f0692..7ff4bc3007 100644 --- a/ui/src/app/editor/components/pipeline/pipeline.component.ts +++ b/ui/src/app/editor/components/pipeline/pipeline.component.ts @@ -73,6 +73,7 @@ import { IdGeneratorService } from '../../../core-services/id-generator/id-gener @Component({ selector: 'sp-pipeline', templateUrl: './pipeline.component.html', + styleUrls: ['./pipeline.component.scss'], }) export class PipelineComponent implements OnInit, OnDestroy { @Input() @@ -81,6 +82,9 @@ export class PipelineComponent implements OnInit, OnDestroy { @Input() rawPipelineModel: PipelineElementConfig[]; + @Input() + pipelineElement: PipelineElementConfig; + @Input() allElements: PipelineElementUnion[]; @@ -586,4 +590,8 @@ export class PipelineComponent implements OnInit, OnDestroy { ); }); } + + openTopicsDialog(pipelineElementConfig: PipelineElementConfig) { + this.editorService.openTopicsDialog(pipelineElementConfig); + } } diff --git a/ui/src/app/editor/dialog/save-pipeline/save-pipeline-settings/save-pipeline-settings.component.html b/ui/src/app/editor/dialog/save-pipeline/save-pipeline-settings/save-pipeline-settings.component.html index 18f221cbfc..482d98e358 100644 --- a/ui/src/app/editor/dialog/save-pipeline/save-pipeline-settings/save-pipeline-settings.component.html +++ b/ui/src/app/editor/dialog/save-pipeline/save-pipeline-settings/save-pipeline-settings.component.html @@ -95,6 +95,7 @@ >Show pipeline configuration as code diff --git a/ui/src/app/editor/services/editor.service.ts b/ui/src/app/editor/services/editor.service.ts index 45ba82218d..0e0f19954b 100644 --- a/ui/src/app/editor/services/editor.service.ts +++ b/ui/src/app/editor/services/editor.service.ts @@ -40,6 +40,7 @@ import { DialogService, PanelType } 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' }) export class EditorService { @@ -175,6 +176,17 @@ export class EditorService { }); } + openTopicsDialog(pipelineElementConfig: PipelineElementConfig) { + this.dialogService.open(TopicsComponent, { + panelType: PanelType.STANDARD_PANEL, + title: 'View Topics of ' + pipelineElementConfig.payload.name, + width: '70vw', + data: { + pipelineElement: pipelineElementConfig.payload, + }, + }); + } + initiatePipelinePreview( pipeline: Pipeline, ): Observable { diff --git a/ui/src/app/pipeline-details/dialogs/pipeline-code/pipeline-code-dialog.component.html b/ui/src/app/pipeline-details/dialogs/pipeline-code/pipeline-code-dialog.component.html index 2b89fa567e..9e17a966ea 100644 --- a/ui/src/app/pipeline-details/dialogs/pipeline-code/pipeline-code-dialog.component.html +++ b/ui/src/app/pipeline-details/dialogs/pipeline-code/pipeline-code-dialog.component.html @@ -20,6 +20,7 @@
diff --git a/ui/src/app/pipeline-details/pipeline-details.module.ts b/ui/src/app/pipeline-details/pipeline-details.module.ts index f05009a578..6eb5f6fb11 100644 --- a/ui/src/app/pipeline-details/pipeline-details.module.ts +++ b/ui/src/app/pipeline-details/pipeline-details.module.ts @@ -22,6 +22,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatTabsModule } from '@angular/material/tabs'; import { MatButtonModule } from '@angular/material/button'; import { CommonModule } from '@angular/common'; +import { ClipboardModule } from '@angular/cdk/clipboard'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { PipelinePreviewComponent } from './components/preview/pipeline-preview.component'; import { EditorModule } from '../editor/editor.module'; @@ -62,6 +63,7 @@ import { PipelineCodeDialogComponent } from './dialogs/pipeline-code/pipeline-co MatExpansionModule, MatSlideToggleModule, MatDivider, + ClipboardModule, ], declarations: [ PipelineActionsComponent,