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 @@ - - - -
- - - -
- -
-
-
-
- - -
-
- - -
-
-
-
-
- (select an element in the preview window to modify it) -
-
-
-
-
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/pipeline-details/pipeline-details.module.ts b/ui/src/app/pipeline-details/pipeline-details.module.ts index 0da4e9843f..5fde41afec 100644 --- a/ui/src/app/pipeline-details/pipeline-details.module.ts +++ b/ui/src/app/pipeline-details/pipeline-details.module.ts @@ -29,7 +29,6 @@ import { PipelineActionsComponent } from './components/actions/pipeline-actions. import { PipelineStatusComponent } from './components/status/pipeline-status.component'; import { PipelineElementsComponent } from './components/elements/pipeline-elements.component'; import { PipelineElementsRowComponent } from './components/elements/pipeline-elements-row.component'; -import { QuickEditComponent } from './components/edit/quickedit.component'; import { CoreUiModule } from '../core-ui/core-ui.module'; import { PipelineMonitoringComponent } from './components/monitoring/pipeline-monitoring.component'; import { PipelineElementStatisticsComponent } from './components/monitoring/statistics/pipeline-element-statistics.component'; @@ -67,7 +66,6 @@ import { MatIconModule } from '@angular/material/icon'; PipelineMonitoringComponent, PipelineStatusComponent, PipelinePreviewComponent, - QuickEditComponent, BarchartWidgetComponent, SpPipelineDetailsOverviewComponent, ], 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, - }, ], }, {