This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch 2929-remove-borken-quick-edit-functionality
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to
refs/heads/2929-remove-borken-quick-edit-functionality by this push:
new ddcade4b31 refactor: Remove old quick edit view from pipeline-details
module
ddcade4b31 is described below
commit ddcade4b318b4e6d4d3c7cd80a9b043cd14c2758
Author: Philipp Zehnder <[email protected]>
AuthorDate: Fri Jun 14 18:01:47 2024 +0200
refactor: Remove old quick edit view from pipeline-details module
---
.../components/edit/quickedit.component.html | 93 -----------
.../components/edit/quickedit.component.ts | 181 ---------------------
.../app/pipeline-details/pipeline-details-tabs.ts | 5 -
ui/src/app/pipelines/pipelines.module.ts | 5 -
4 files changed, 284 deletions(-)
diff --git
a/ui/src/app/pipeline-details/components/edit/quickedit.component.html
b/ui/src/app/pipeline-details/components/edit/quickedit.component.html
deleted file mode 100644
index b26dfcfb04..0000000000
--- a/ui/src/app/pipeline-details/components/edit/quickedit.component.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!--
- ~ 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.
- ~
- -->
-
-<sp-basic-nav-tabs
- [spNavigationItems]="tabs"
- [activeLink]="'quick-edit'"
- [showBackLink]="true"
- [backLinkTarget]="['pipelines']"
->
- <div fxLayout="column" class="page-container-padding" *ngIf="pipeline">
- <sp-pipeline-preview
- [jspcanvas]="'assembly-preview'"
- [pipeline]="pipeline"
- (selectedElementEmitter)="selectElement($event)"
- style="margin-bottom: 15px"
- class="md-padding"
- *ngIf="pipelineAvailable"
- ></sp-pipeline-preview>
-
- <sp-basic-inner-panel panelTitle="Edit Configuration">
- <div header fxLayoutAlign="end center" fxFlex="100" fxLayout="row">
- <button
- color="accent"
- mat-button
- mat-raised-button
- matTooltip="Save Pipeline"
- matTooltipPosition="above"
- style="display: flex; align-items: center"
- class="settings-bar-icon-button"
- [disabled]="!formValid || pipelineUpdating"
- (click)="updatePipeline()"
- >
- <mat-icon>save</mat-icon>
- <span> Update pipeline</span>
- </button>
- </div>
- <div fxFlex="100" fxLayout="column">
- <div *ngIf="selectedElement">
- <div
- fxLayout="column"
- style="padding: 5px; padding-left: 10px"
- >
- <sp-pipeline-elements-row
- [pipeline]="pipeline"
- [element]="selectedElement"
- ></sp-pipeline-elements-row>
-
- <div fxFlex="100" fxLayout="column"
*ngIf="isInvocable">
- <form [formGroup]="parentForm" fxFlex="100">
- <sp-app-static-property
- *ngFor="
- let config of
_selectedElement.staticProperties
- "
- [staticProperty]="config"
- [displayRecommended]="true"
- [staticProperties]="
- _selectedElement.staticProperties
- "
- [eventSchemas]="eventSchemas"
- [parentForm]="parentForm"
- [fieldName]="config.internalName"
- >
- </sp-app-static-property>
- </form>
- </div>
- </div>
- </div>
- <div
- fxLayout="column"
- fxLayoutAlign="center center"
- *ngIf="!selectedElement"
- >
- (select an element in the preview window to modify it)
- </div>
- </div>
- </sp-basic-inner-panel>
- </div>
-</sp-basic-nav-tabs>
diff --git a/ui/src/app/pipeline-details/components/edit/quickedit.component.ts
b/ui/src/app/pipeline-details/components/edit/quickedit.component.ts
deleted file mode 100644
index df4cf5642d..0000000000
--- a/ui/src/app/pipeline-details/components/edit/quickedit.component.ts
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * 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 {
- AfterViewInit,
- ChangeDetectorRef,
- Component,
- Input,
- OnInit,
-} from '@angular/core';
-import {
- DataProcessorInvocation,
- DataSinkInvocation,
- EventSchema,
- PipelineService,
-} from '@streampipes/platform-services';
-import { PipelineElementUnion } from '../../../editor/model/editor.model';
-import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
-import { SpPipelineDetailsDirective } from '../sp-pipeline-details.directive';
-import { ActivatedRoute } from '@angular/router';
-import { AuthService } from '../../../services/auth.service';
-import {
- CurrentUserService,
- SpBreadcrumbService,
-} from '@streampipes/shared-ui';
-import { SpPipelineRoutes } from '../../../pipelines/pipelines.routes';
-
-@Component({
- selector: 'sp-quick-edit',
- templateUrl: './quickedit.component.html',
-})
-export class QuickEditComponent
- extends SpPipelineDetailsDirective
- implements OnInit, AfterViewInit
-{
- _selectedElement: PipelineElementUnion;
-
- eventSchemas: EventSchema[];
-
- parentForm: UntypedFormGroup;
- formValid: boolean;
- viewInitialized = false;
-
- isInvocable = false;
- isDataProcessor = false;
-
- pipelineUpdating = false;
-
- constructor(
- activatedRoute: ActivatedRoute,
- pipelineService: PipelineService,
- authService: AuthService,
- currentUserService: CurrentUserService,
- private fb: UntypedFormBuilder,
- private changeDetectorRef: ChangeDetectorRef,
- breadcrumbService: SpBreadcrumbService,
- ) {
- super(
- activatedRoute,
- pipelineService,
- authService,
- currentUserService,
- breadcrumbService,
- );
- }
-
- ngOnInit() {
- super.onInit();
- this.parentForm = this.fb.group({});
-
- this.parentForm.statusChanges.subscribe(status => {
- this.formValid = this.viewInitialized && this.parentForm.valid;
- });
- }
-
- ngAfterViewInit(): void {
- this.viewInitialized = true;
- this.formValid = this.viewInitialized && this.parentForm.valid;
- this.changeDetectorRef.detectChanges();
- }
-
- updatePipeline() {
- this.pipelineUpdating = true;
- this.updatePipelineElement();
- this.pipelineService.updatePipeline(this.pipeline).subscribe(data => {
- this.loadPipeline();
- this.pipelineUpdating = false;
- });
- }
-
- updatePipelineElement() {
- if (this._selectedElement instanceof DataProcessorInvocation) {
- this.updateDataProcessor();
- } else if (this._selectedElement instanceof DataSinkInvocation) {
- this.updateDataSink();
- }
- }
-
- updateDataProcessor() {
- const dataProcessors: DataProcessorInvocation[] = [];
- this.pipeline.sepas.forEach(p => {
- if (p.dom === this._selectedElement.dom) {
- dataProcessors.push(
- this._selectedElement as DataProcessorInvocation,
- );
- } else {
- dataProcessors.push(p);
- }
- });
- this.pipeline.sepas = dataProcessors;
- }
-
- updateDataSink() {
- const dataSinks: DataSinkInvocation[] = [];
- this.pipeline.actions.forEach(p => {
- if (p.dom === this._selectedElement.dom) {
- dataSinks.push(this._selectedElement as DataSinkInvocation);
- } else {
- dataSinks.push(p);
- }
- });
- this.pipeline.actions = dataSinks;
- }
-
- get selectedElement() {
- return this._selectedElement;
- }
-
- @Input()
- set selectedElement(selectedElement: PipelineElementUnion) {
- if (this._selectedElement) {
- this.updatePipelineElement();
- }
- this._selectedElement = selectedElement;
- this.eventSchemas = [];
- if (
- this._selectedElement instanceof DataProcessorInvocation ||
- this._selectedElement instanceof DataSinkInvocation
- ) {
- (this._selectedElement as any).inputStreams.forEach(is => {
- this.eventSchemas = this.eventSchemas.concat(is.eventSchema);
- });
- }
- this.updateTypeInfo();
- }
-
- updateTypeInfo() {
- this.isDataProcessor =
- this._selectedElement instanceof DataProcessorInvocation;
- this.isInvocable =
- this._selectedElement instanceof DataProcessorInvocation ||
- this._selectedElement instanceof DataSinkInvocation;
- }
-
- selectElement(element: PipelineElementUnion) {
- this.selectedElement = element;
- }
-
- onPipelineAvailable(): void {
- this.breadcrumbService.updateBreadcrumb([
- SpPipelineRoutes.BASE,
- { label: this.pipeline.name },
- { label: 'Quick Edit' },
- ]);
- }
-}
diff --git a/ui/src/app/pipeline-details/pipeline-details-tabs.ts
b/ui/src/app/pipeline-details/pipeline-details-tabs.ts
index 42fc0362d7..8cde55cbec 100644
--- a/ui/src/app/pipeline-details/pipeline-details-tabs.ts
+++ b/ui/src/app/pipeline-details/pipeline-details-tabs.ts
@@ -36,11 +36,6 @@ export class SpPipelineDetailsTabs {
itemTitle: 'Logs',
itemLink: ['pipelines', 'details', pipelineId, 'logs'],
},
- {
- itemId: 'quick-edit',
- itemTitle: 'Quick Edit',
- itemLink: ['pipelines', 'details', pipelineId, 'quick-edit'],
- },
];
}
}
diff --git a/ui/src/app/pipelines/pipelines.module.ts
b/ui/src/app/pipelines/pipelines.module.ts
index 6d969cd1c7..74f209e7e8 100644
--- a/ui/src/app/pipelines/pipelines.module.ts
+++ b/ui/src/app/pipelines/pipelines.module.ts
@@ -40,7 +40,6 @@ import { RouterModule } from '@angular/router';
import { EditorComponent } from '../editor/editor.component';
import { SpPipelineDetailsOverviewComponent } from
'../pipeline-details/components/overview/pipeline-details-overview.component';
import { PipelineMonitoringComponent } from
'../pipeline-details/components/monitoring/pipeline-monitoring.component';
-import { QuickEditComponent } from
'../pipeline-details/components/edit/quickedit.component';
import { PipelineLogsComponent } from
'../pipeline-details/components/pipeline-logs/pipeline-logs.component';
import { FunctionsOverviewComponent } from
'./components/functions-overview/functions-overview.component';
import { SpFunctionsMetricsComponent } from
'./components/functions-overview/functions-metrics/functions-metrics.component';
@@ -105,10 +104,6 @@ import { MatIconModule } from '@angular/material/icon';
path: 'logs',
component: PipelineLogsComponent,
},
- {
- path: 'quick-edit',
- component: QuickEditComponent,
- },
],
},
{