Skip to content

Commit

Permalink
Merge pull request #3103 from ONSdigital/revert-3098-EAR-2291-Update-…
Browse files Browse the repository at this point in the history
…content-for-calculated-summary-questions

Revert "EAR 2291 update content for calculated summary questions"
  • Loading branch information
martyncolmer authored Feb 29, 2024
2 parents 1277eb2 + b95cc18 commit 9be1d5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { propType } from "graphql-anywhere";
import { get, flowRight, some } from "lodash";
import styled from "styled-components";
import gql from "graphql-tag";
import DescribedText from "components/DescribedText";

import { richTextEditorErrors } from "constants/validationMessages";
import { colors } from "constants/theme";
Expand Down Expand Up @@ -203,11 +202,7 @@ export const CalculatedSummaryPageEditor = (props) => {
<RichTextEditor
id="summary-title"
name="title"
label={
<DescribedText description='The question "Is this correct?" will be added to the end of the calculated summary title.'>
Calculated summary title
</DescribedText>
}
label="Calculated summary title"
placeholder=""
value={page.title}
onUpdate={onChangeUpdate}
Expand All @@ -222,7 +217,6 @@ export const CalculatedSummaryPageEditor = (props) => {
autoFocus={!page.title}
pageType={page.pageType}
/>

<HorizontalRule />
<PageTitleContainer
pageDescription={page.pageDescription}
Expand Down
35 changes: 5 additions & 30 deletions eq-author/src/App/page/Preview/CalculatedSummaryPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { propType } from "graphql-anywhere";
import styled from "styled-components";
import Error from "components/preview/Error";
import PageTitle from "components/preview/elements/PageTitle";
import Info from "components/preview/elements/Info";

import EditorLayout from "components/EditorLayout";
import Panel from "components/Panel";
Expand All @@ -15,20 +16,6 @@ import { colors } from "constants/theme";
import CalculatedSummaryPageEditor from "../Design/CalculatedSummaryPageEditor";
import { useSetNavigationCallbacksForPage } from "components/NavigationCallbacks";

const Button = styled.div`
color: white;
background-color: ${colors.positive};
border: 2px solid ${colors.positive};
padding: 0.75rem 1rem;
margin: 0;
font-size: 1rem;
font-weight: 600;
border-radius: 3px;
display: inline-block;
text-rendering: optimizeLegibility;
margin-bottom: 2em;
`;

const Container = styled.div`
padding: 2em;
font-size: 1.1em;
Expand Down Expand Up @@ -57,9 +44,7 @@ const Summary = styled.div`
`;

const SummaryItem = styled.div`
&:not(:first-of-type) {
border-top: 1px solid #999;
}
border-top: 1px solid #999;
border-radius: 0;
position: relative;
padding: 1rem 0;
Expand Down Expand Up @@ -104,17 +89,6 @@ const CalculatedSummaryPagePreview = ({ page }) => {
section: page?.section,
});

const addConfirmationToTitle = () => {
if (page.title) {
const titleWithoutClosingParagraphTag = page.title.replace(/<\/p>$/, "");
if (titleWithoutClosingParagraphTag.endsWith(".")) {
return `${page.title} Is this correct?`;
} else {
return `${page.title}. Is this correct?`;
}
}
};

return (
<EditorLayout
title={page.displayName}
Expand All @@ -128,7 +102,9 @@ const CalculatedSummaryPagePreview = ({ page }) => {
>
<Panel data-test="calSum test page">
<Container>
<PageTitle title={addConfirmationToTitle()} />
<PageTitle title={page.title} />
<Info>Please review your answers and confirm these are correct.</Info>

{page.summaryAnswers.length > 0 ? (
<Summary>
{page.summaryAnswers.map((answer) => (
Expand Down Expand Up @@ -174,7 +150,6 @@ const CalculatedSummaryPagePreview = ({ page }) => {
No answers selected
</Error>
)}
<Button>Yes, I confirm this is correct</Button>
</Container>
</Panel>
</EditorLayout>
Expand Down

0 comments on commit 9be1d5e

Please sign in to comment.