Skip to content

Commit

Permalink
fix(plugins/plugin-client-common): FancyPipeline errors out when reru…
Browse files Browse the repository at this point in the history
…nning snapshot blocks saved before pipestage was introduced
  • Loading branch information
myan9 committed Jun 18, 2021
1 parent 55d90e0 commit f813ee6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
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
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

0 comments on commit f813ee6

Please sign in to comment.