From 6a4e6ad82ddc5cf47ba811ebe97d50aa89cecb99 Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Wed, 31 Jan 2024 14:57:48 +0000 Subject: [PATCH 01/11] Remove the banner in the preview page and added button in preview of calculated summary --- .../page/Preview/CalculatedSummaryPreview.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index 83d22d0977..ad1cb2e471 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -16,6 +16,20 @@ 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; @@ -103,8 +117,6 @@ const CalculatedSummaryPagePreview = ({ page }) => { - Please review your answers and confirm these are correct. - {page.summaryAnswers.length > 0 ? ( {page.summaryAnswers.map((answer) => ( @@ -151,6 +163,7 @@ const CalculatedSummaryPagePreview = ({ page }) => { No answers selected )} + From 837b75fea40a7bcd9db1e621f115bed6d4cb2a62 Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Thu, 1 Feb 2024 14:44:39 +0000 Subject: [PATCH 02/11] added description text under the title and added "Is this correct" to the preview --- .../App/page/Design/CalculatedSummaryPageEditor/index.js | 8 +++++++- .../src/App/page/Preview/CalculatedSummaryPreview.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eq-author/src/App/page/Design/CalculatedSummaryPageEditor/index.js b/eq-author/src/App/page/Design/CalculatedSummaryPageEditor/index.js index da49dbf9e8..1e7204e065 100644 --- a/eq-author/src/App/page/Design/CalculatedSummaryPageEditor/index.js +++ b/eq-author/src/App/page/Design/CalculatedSummaryPageEditor/index.js @@ -4,6 +4,7 @@ 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"; @@ -202,7 +203,11 @@ export const CalculatedSummaryPageEditor = (props) => { + Calculated summary title + + } placeholder="" value={page.title} onUpdate={onChangeUpdate} @@ -217,6 +222,7 @@ export const CalculatedSummaryPageEditor = (props) => { autoFocus={!page.title} pageType={page.pageType} /> + { > - + {page.summaryAnswers.length > 0 ? ( {page.summaryAnswers.map((answer) => ( From 94f59bc9fd7989fd41a3db8dde9dae62abc5eddb Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Fri, 2 Feb 2024 12:43:36 +0000 Subject: [PATCH 03/11] added function to remove html paragraph tags and check ends with full stop --- .../App/page/Preview/CalculatedSummaryPreview.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index 0c9bba443e..282b224fe5 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -5,7 +5,6 @@ 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"; @@ -103,6 +102,11 @@ const CalculatedSummaryPagePreview = ({ page }) => { section: page?.section, }); + const endsWithFullStop = (string) => { + const stringWithoutClosingParagraphTag = string.replace(/<\/p>$/, ""); + return stringWithoutClosingParagraphTag.endsWith("."); + }; + return ( { > - + + {/* {`${page.title} Is this correct?`} */} {page.summaryAnswers.length > 0 ? ( {page.summaryAnswers.map((answer) => ( From 54362d843f82b9922c56cd259d4aef79e9fe3982 Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Mon, 5 Feb 2024 14:13:22 +0000 Subject: [PATCH 04/11] added question mark --- eq-author/src/App/page/Preview/CalculatedSummaryPreview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index 282b224fe5..9b6260896c 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -124,7 +124,7 @@ const CalculatedSummaryPagePreview = ({ page }) => { title={ endsWithFullStop(page.title) ? `${page.title} Is this correct?` - : `${page.title}. Is this correct` + : `${page.title}. Is this correct?` } /> {/* {`${page.title} Is this correct?`} */} From ba0ede75687be36be8df2da2bebc2f593e648725 Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Fri, 9 Feb 2024 10:32:13 +0000 Subject: [PATCH 05/11] added full stop in the description --- .../src/App/page/Design/CalculatedSummaryPageEditor/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eq-author/src/App/page/Design/CalculatedSummaryPageEditor/index.js b/eq-author/src/App/page/Design/CalculatedSummaryPageEditor/index.js index 1e7204e065..1b01e98ec8 100644 --- a/eq-author/src/App/page/Design/CalculatedSummaryPageEditor/index.js +++ b/eq-author/src/App/page/Design/CalculatedSummaryPageEditor/index.js @@ -204,7 +204,7 @@ export const CalculatedSummaryPageEditor = (props) => { id="summary-title" name="title" label={ - + Calculated summary title } From 04e43b9a36bb7eae58a0936dd16f3990357295ce Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Fri, 9 Feb 2024 13:03:07 +0000 Subject: [PATCH 06/11] Removed comment --- eq-author/src/App/page/Preview/CalculatedSummaryPreview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index 9b6260896c..8da66f8576 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -127,7 +127,7 @@ const CalculatedSummaryPagePreview = ({ page }) => { : `${page.title}. Is this correct?` } /> - {/* {`${page.title} Is this correct?`} */} + {page.summaryAnswers.length > 0 ? ( {page.summaryAnswers.map((answer) => ( From a5d56e65d24f834b72748f597c90dc0ed5aaca86 Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Fri, 9 Feb 2024 13:04:31 +0000 Subject: [PATCH 07/11] Removed comment --- eq-author/src/App/page/Preview/CalculatedSummaryPreview.js | 1 - 1 file changed, 1 deletion(-) diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index 8da66f8576..f0ea95713b 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -127,7 +127,6 @@ const CalculatedSummaryPagePreview = ({ page }) => { : `${page.title}. Is this correct?` } /> - {page.summaryAnswers.length > 0 ? ( {page.summaryAnswers.map((answer) => ( From 24929b4b501d625f6cf0a7dd93f6ad9299288c96 Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Thu, 15 Feb 2024 15:22:18 +0000 Subject: [PATCH 08/11] updated the function for addConfirmationToTitle --- .../page/Preview/CalculatedSummaryPreview.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index f0ea95713b..df945e3fb1 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -102,9 +102,15 @@ const CalculatedSummaryPagePreview = ({ page }) => { section: page?.section, }); - const endsWithFullStop = (string) => { - const stringWithoutClosingParagraphTag = string.replace(/<\/p>$/, ""); - return stringWithoutClosingParagraphTag.endsWith("."); + 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 ( @@ -120,13 +126,7 @@ const CalculatedSummaryPagePreview = ({ page }) => { > - + {page.summaryAnswers.length > 0 ? ( {page.summaryAnswers.map((answer) => ( From 25cb25f2355e6fefa735c92b0c2311aa53dd3d0e Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Thu, 15 Feb 2024 15:45:01 +0000 Subject: [PATCH 09/11] edited the line in summary item to not show on top of the values --- eq-author/src/App/page/Preview/CalculatedSummaryPreview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index df945e3fb1..7d140b59dd 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -57,7 +57,9 @@ const Summary = styled.div` `; const SummaryItem = styled.div` - border-top: 1px solid #999; + &:not(:first-of-type) { + border-top: 1px solid #999; + } border-radius: 0; position: relative; padding: 1rem 0; From 7eb248c61129094d49120bf6068f7f08a25ad09c Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Thu, 15 Feb 2024 16:01:15 +0000 Subject: [PATCH 10/11] changed the styling of the button to match EQ --- eq-author/src/App/page/Preview/CalculatedSummaryPreview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index 7d140b59dd..e072536c42 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -1,6 +1,7 @@ /* eslint-disable react/no-danger */ import React from "react"; import { propType } from "graphql-anywhere"; +import { darken } from "polished"; import styled from "styled-components"; import Error from "components/preview/Error"; @@ -22,11 +23,12 @@ const Button = styled.div` padding: 0.75rem 1rem; margin: 0; font-size: 1rem; - font-weight: 600; + font-weight: bold; border-radius: 3px; display: inline-block; text-rendering: optimizeLegibility; margin-bottom: 2em; + box-shadow: 0 3px ${({ theme }) => darken(0.15, theme.colors.primary)}; `; const Container = styled.div` From 294f6544dfb2606a38820d7b399894c7f683c3d0 Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Fri, 16 Feb 2024 09:48:04 +0000 Subject: [PATCH 11/11] revert button styling --- eq-author/src/App/page/Preview/CalculatedSummaryPreview.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index e072536c42..7d140b59dd 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -1,7 +1,6 @@ /* eslint-disable react/no-danger */ import React from "react"; import { propType } from "graphql-anywhere"; -import { darken } from "polished"; import styled from "styled-components"; import Error from "components/preview/Error"; @@ -23,12 +22,11 @@ const Button = styled.div` padding: 0.75rem 1rem; margin: 0; font-size: 1rem; - font-weight: bold; + font-weight: 600; border-radius: 3px; display: inline-block; text-rendering: optimizeLegibility; margin-bottom: 2em; - box-shadow: 0 3px ${({ theme }) => darken(0.15, theme.colors.primary)}; `; const Container = styled.div`