Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,13 @@ public Map<String, SpMetricsEntry> getAllMetricsInfos(){
}

private List<String> collectPipelineElementIds(Pipeline pipeline) {
if (pipeline != null){
return Stream.concat(
pipeline.getSepas().stream().map(NamedStreamPipesEntity::getElementId),
pipeline.getActions().stream().map(NamedStreamPipesEntity::getElementId)
).collect(Collectors.toList());
}
return List.of();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ public PipelineCanvasMetadata getPipelineCanvasMetadataForPipeline(String pipeli
.stream()
.filter(p -> p.getPipelineId().equals(pipelineId))
.findFirst()
.orElseThrow(IllegalArgumentException::new);
.orElse(null);
}
}
10 changes: 9 additions & 1 deletion ui/src/app/editor/editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { SpBreadcrumbService } from '@streampipes/shared-ui';
import { ActivatedRoute } from '@angular/router';
import { forkJoin, of, zip } from 'rxjs';
import { SpPipelineRoutes } from '../pipelines/pipelines.routes';
import { catchError } from 'rxjs/operators';
import { catchError, map } from 'rxjs/operators';
import { EditorService } from './services/editor.service';
import { JsplumbService } from './services/jsplumb.service';

Expand Down Expand Up @@ -108,9 +108,17 @@ export class EditorComponent implements OnInit {

loadPipelineToModify(pipelineId: string) {
const pipelineReq = this.pipelineService.getPipelineById(pipelineId);

const canvasMetadataReq = this.pipelineCanvasMetadataService
.getPipelineCanvasMetadata(pipelineId)
.pipe(
map(response => {
if (response === null) {
this.handleCanvasMetadataResponse(undefined);
return undefined;
}
return response;
}),
catchError(() => {
this.handleCanvasMetadataResponse(undefined);
return of(undefined);
Expand Down
33 changes: 24 additions & 9 deletions ui/src/app/pipeline-details/pipeline-details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
import { SpPipelineRoutes } from '../pipelines/pipelines.routes';
import { UserPrivilege } from '../_enums/user-privilege.enum';
import { forkJoin, interval, Observable, of, Subscription } from 'rxjs';
import { catchError, filter, switchMap } from 'rxjs/operators';
import { catchError, filter, map, switchMap } from 'rxjs/operators';
import { PipelinePreviewComponent } from './components/preview/pipeline-preview.component';
import { HttpContext } from '@angular/common/http';
import { NGX_LOADING_BAR_IGNORED } from '@ngx-loading-bar/http-client';
Expand Down Expand Up @@ -98,22 +98,37 @@ export class SpPipelineDetailsComponent implements OnInit, OnDestroy {

loadPipeline(): void {
forkJoin([
this.pipelineService.getPipelineById(this.currentPipelineId),
this.pipelineService.getPipelineById(this.currentPipelineId).pipe(
catchError(error => {
if (error.status === 404) {
this.pipelineNotFound = true;
}
return of(null);
}),
),
this.pipelineCanvasService
.getPipelineCanvasMetadata(this.currentPipelineId)
.pipe(
map(response => {
if (response === null) {
this.pipelineAvailable = false;
return new PipelineCanvasMetadata();
}
return response;
}),
catchError(error => {
this.pipelineAvailable = false;
this.pipelineNotFound = true;

return of(new PipelineCanvasMetadata());
}),
),
]).subscribe(res => {
this.pipeline = res[0];
this.pipelineCanvasMetadata = res[1];
this.pipelineAvailable = true;
this.onPipelineAvailable();
]).subscribe(([pipeline, metadata]) => {
this.pipeline = pipeline;
this.pipelineCanvasMetadata = metadata;

if (pipeline && !this.pipelineNotFound) {
this.pipelineAvailable = true;
this.onPipelineAvailable();
}
});
}

Expand Down
Loading