Skip to content

Commit

Permalink
#2254 setPipelineFlow cannot work when only primary_pipeline changed (#…
Browse files Browse the repository at this point in the history
…2255)

Signed-off-by: CTomlyn <[email protected]>
  • Loading branch information
tomlyn authored Dec 4, 2024
1 parent ed34cb0 commit 580d8e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ export default class CanvasController {
this.editActionHandler(data);
}

// Returns the supernode speified in the bradcrumb provided.
// Returns the supernode speified in the breadcrumb provided.
getSupernodeFromBreadcrumb(breadcrumb) {
if (breadcrumb.supernodeParentPipelineId) {
const apiPipeline = this.objectModel.getAPIPipeline(breadcrumb.supernodeParentPipelineId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ export default class ObjectModel {
this.executeWithSelectionChange(this.store.dispatch, {
type: "SET_CANVAS_INFO",
canvasInfo: canvasInfo,
canvasInfoIdChanged: this.hasCanvasInfoIdChanged(canvasInfo)
canvasInfoIdChanged: this.hasCanvasInfoIdChanged(canvasInfo),
primaryPipelineIdChanged: this.hasPrimaryPipelineIdChanged(canvasInfo)
});
}

Expand Down Expand Up @@ -1047,6 +1048,10 @@ export default class ObjectModel {
return canvasInfo.id !== this.getCanvasInfo().id;
}

hasPrimaryPipelineIdChanged(canvasInfo) {
return canvasInfo.primary_pipeline !== this.getCanvasInfo().primary_pipeline;
}

setSubdueStyle(newStyle) {
this.store.dispatch({ type: "SET_SUBDUE_STYLE", data: { subdueStyle: newStyle } });
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2023 Elyra Authors
* Copyright 2017-2024 Elyra Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,10 +19,11 @@ export default (state = [], action) => {
case "SET_CANVAS_INFO": {
// In some instances, with an external object model, the same canvas may
// be set multiple times. Consequently, we only reset the breadcrumbs if
// we're given a completely new canvas or the current breadcrumb does not
// reference a pipeline Id in the incoming pipelineFlow, which might happen
// if the pipeline has been removed.
// we're given a completely new canvas OR the primary pipeline ID has changed
// OR the current breadcrumb does not reference a pipeline Id in the incoming
// pipelineFlow, which might happen if the pipeline has been removed.
if (action.canvasInfoIdChanged ||
action.primaryPipelineIdChanged ||
!isCurrentBreadcrumbInPipelineFlow(state, action.canvasInfo)) {
return [{ pipelineId: action.canvasInfo.primary_pipeline, pipelineFlowId: action.canvasInfo.id }];
}
Expand Down

0 comments on commit 580d8e4

Please sign in to comment.