Skip to content

Commit

Permalink
Merge pull request #3088 from ONSdigital/fix-for-destination-picker
Browse files Browse the repository at this point in the history
fix for destination picker with LC
  • Loading branch information
martyncolmer authored Jan 5, 2024
2 parents 5e08c9b + 9212544 commit 8176a2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions eq-author/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,4 @@ theme colours and action names.
`yarn storybook` Start the local server.

`yarn build-storybook -o ../docs` deploy updates to static site (run from eq-author folder).

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useMemo } from "react";
import PropTypes from "prop-types";
import { takeRightWhile } from "lodash";
import { takeRightWhile, reject } from "lodash";

import {
ContentSelectButton,
Expand Down Expand Up @@ -42,12 +42,19 @@ export const generateAvailableRoutingDestinations = (
const currentSectionPages = currentSection.folders.flatMap(
({ pages }) => pages
);
const routablePages = takeRightWhile(
let routablePages = takeRightWhile(
currentSectionPages,
({ id }) => id !== pageId
);
routablePages.forEach((page) => (page.section = currentSection));

routablePages = reject(routablePages, {
pageType: "ListCollectorAddItemPage",
});
routablePages = reject(routablePages, {
pageType: "ListCollectorConfirmationPage",
});

return {
pages: routablePages || [],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const DESTINATION_TYPE = {
Section: "Section",
QuestionPage: "QuestionPage",
CalculatedSummaryPage: "CalculatedSummaryPage",
ListCollectorPage: "ListCollectorPage",
ListCollectorPage: "ListCollectorQualifierPage",
};

const RoutingRuleResult = styled.div`
Expand Down

0 comments on commit 8176a2c

Please sign in to comment.