Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #347 from riccardo-forina/fix-displayed-connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-bot[bot] authored May 23, 2019
2 parents 60825c3 + 1f7817a commit 2025b97
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,19 @@ export function mergeConnectionsSources(
* Filters connections based on the supplied position in the step array
* @param steps
* @param position
* @param atStart
* @param atEnd
*/
export function filterStepsByPosition(steps: StepKind[], position: number) {
export function filterStepsByPosition(
steps: StepKind[],
position: number,
atStart: boolean,
atEnd: boolean
) {
if (typeof position === 'undefined' || !steps) {
// safety net
return steps;
}
const atStart = position === 0;
const atEnd = getStepsLastPosition(steps) === position;
return steps.filter(step => {
// Hide steps that are marked as such, and specifically the log connection
if (
Expand Down Expand Up @@ -399,7 +404,12 @@ export function visibleStepsByPosition(
) {
const previousSteps = flowSteps.slice(0, position);
const subsequentSteps = flowSteps.slice(position + 1);
return filterStepsByPosition(steps, position).filter(s => {
return filterStepsByPosition(
steps,
position,
position === 0,
getStepsLastPosition(flowSteps) === position
).filter(s => {
if (typeof s.visible === 'function') {
return s.visible(position, previousSteps, subsequentSteps);
}
Expand Down

0 comments on commit 2025b97

Please sign in to comment.