Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugins/plugin-client-common): FancyPipeline errors out when rerunning snapshot blocks saved before pipestage was introduced #7663

Merged
merged 1 commit into from
Jun 18, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,6 @@ export function isWithCompleteEvent(block: BlockModel): block is CompleteBlock {
return (isOk(block) || isOops(block) || isEmpty(block)) && block.completeEvent !== undefined
}

/** @return whether the block has pipeStages information; older snapshots may not */
export function hasPipeStages(block: BlockModel) {
return (
(hasStartEvent(block) && block.startEvent.pipeStages !== undefined) ||
(isWithCompleteEvent(block) && block.completeEvent.pipeStages !== undefined)
)
}

/** @return whether the block is from replay */
export function isReplay(block: BlockModel): boolean {
return (isProcessing(block) || isWithCompleteEvent(block)) && block.isReplay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
isFinished,
hasCommand,
isEmpty,
hasPipeStages,
hasStartEvent,
isWithCompleteEvent,
isReplay,
Expand Down Expand Up @@ -678,9 +677,9 @@ export default class Input extends InputProvider {
*
*/
private fancyValue(value: string) {
if (isWithCompleteEvent(this.props.model) && hasPipeStages(this.props.model)) {
if (isWithCompleteEvent(this.props.model) && this.props.model.completeEvent.pipeStages !== undefined) {
return <FancyPipeline REPL={this.props.tab.REPL} {...this.props.model.completeEvent.pipeStages} />
} else if (hasStartEvent(this.props.model) && hasPipeStages(this.props.model)) {
} else if (hasStartEvent(this.props.model) && this.props.model.startEvent.pipeStages !== undefined) {
return <FancyPipeline REPL={this.props.tab.REPL} {...this.props.model.startEvent.pipeStages} />
} else {
return <span className="repl-input-element flex-fill">{value}</span>
Expand Down