diff --git a/package.json b/package.json index c9ee7c71a..bf1117604 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "dependencies": { "@analytics/google-tag-manager": "^0.6.0", "@appquality/languages": "1.4.3", - "@appquality/unguess-design-system": "4.0.50--canary.549.d20012e.0", + "@appquality/unguess-design-system": "4.0.50", "@atlaskit/pragmatic-drag-and-drop": "^1.7.4", "@atlaskit/pragmatic-drag-and-drop-flourish": "^2.0.3", "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0", diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 1c37460e4..affefa462 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -976,10 +976,10 @@ "__PLAN_PAGE_MODULE_OTHER_INTERNET_HOME_TEXTAREA_PLACEHOLDER": "Insert any additional internet home providers that are not listed above", "__PLAN_PAGE_MODULE_OTHER_INTERNET_MOBILE_LABEL_HINT": "Specify additional internet mobile providers for participants", "__PLAN_PAGE_MODULE_OTHER_INTERNET_MOBILE_TEXTAREA_PLACEHOLDER": "Insert any additional internet mobile providers that are not listed above", + "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_EMPTY": "No specified out of scope sections", "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_HINT": "Write here", "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_INFO": "Enter description (max 512 characters)", "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_LABEL": "Specify areas that should be excluded from testing ", - "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_EMPTY": "No specified out of scope sections", "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_PLACEHOLDER": "Insert any sections that do not fit within the perimeter of the test.", "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_REMOVE_TOOLTIP_BUTTON": "Delete", "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_TITLE": "Out of scope", @@ -1110,6 +1110,7 @@ "__PLAN_PAGE_MODULE_TOUCHPOINTS_TOUCHPOINT_WEB_LINK_LABEL": "Test link", "__PLAN_PAGE_MODULE_TOUCHPOINTS_TOUCHPOINT_WEB_LINK_PLACEHOLDER": "https://example.com", "__PLAN_PAGE_NAV_GENERIC_MODULE_ERROR": "This item has some errors", + "__PLAN_PAGE_PAYMENT_FAILED_TOAST_MESSAGE": "Activity returned to draft. Submit your request again to proceed with payment.", "__PLAN_PAGE_PURCHASE_SUCCESS": "Purchase successfully completed", "__PLAN_PAGE_SAVE_AS_TEMPLATE_MODAL_BUTTON_CANCEL": "Cancel", "__PLAN_PAGE_SAVE_AS_TEMPLATE_MODAL_BUTTON_CONFIRM": "Save template", @@ -1141,6 +1142,7 @@ "__PLAN_PAGE_SUMMARY_TAB_ACTIVITY_INFO_PRICE_PREFIX": "From", "__PLAN_PAGE_SUMMARY_TAB_ACTIVITY_INFO_SUBMITTED_DESCRIPTION": "The activity is currently being processed. Some details may vary or need confirmation", "__PLAN_PAGE_SUMMARY_TAB_ACTIVITY_INFO_TITLE": "Activity info", + "__PLAN_PAGE_SUMMARY_TAB_CANCEL_PAYMENT_CARD_ADDITIONAL_INFO": "Your payment is processing on another page. Going back will cancel it and require revalidation.", "__PLAN_PAGE_SUMMARY_TAB_CONFIRMATION_CARD_CANCEL_PLAN_CTA": "Return to draft", "__PLAN_PAGE_SUMMARY_TAB_CONFIRMATION_CARD_CONFIRM_CTA": "Confirm Activity", "__PLAN_PAGE_SUMMARY_TAB_CONFIRMATION_CARD_CONFIRM_CTA_INFO_MESSAGE": "Once confirmed, your activity will begin on the scheduled date", diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json index 5f24e4ced..c41de16f3 100644 --- a/src/locales/it/translation.json +++ b/src/locales/it/translation.json @@ -1009,6 +1009,7 @@ "__PLAN_PAGE_MODULE_OTHER_INTERNET_HOME_TEXTAREA_PLACEHOLDER": "", "__PLAN_PAGE_MODULE_OTHER_INTERNET_MOBILE_LABEL_HINT": "", "__PLAN_PAGE_MODULE_OTHER_INTERNET_MOBILE_TEXTAREA_PLACEHOLDER": "", + "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_EMPTY": "", "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_HINT": "", "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_INFO": "", "__PLAN_PAGE_MODULE_OUT_OF_SCOPE_LABEL": "", @@ -1142,6 +1143,7 @@ "__PLAN_PAGE_MODULE_TOUCHPOINTS_TOUCHPOINT_WEB_LINK_LABEL": "", "__PLAN_PAGE_MODULE_TOUCHPOINTS_TOUCHPOINT_WEB_LINK_PLACEHOLDER": "", "__PLAN_PAGE_NAV_GENERIC_MODULE_ERROR": "", + "__PLAN_PAGE_PAYMENT_FAILED_TOAST_MESSAGE": "", "__PLAN_PAGE_PURCHASE_SUCCESS": "", "__PLAN_PAGE_SAVE_AS_TEMPLATE_MODAL_BUTTON_CANCEL": "", "__PLAN_PAGE_SAVE_AS_TEMPLATE_MODAL_BUTTON_CONFIRM": "", @@ -1173,6 +1175,7 @@ "__PLAN_PAGE_SUMMARY_TAB_ACTIVITY_INFO_PRICE_PREFIX": "", "__PLAN_PAGE_SUMMARY_TAB_ACTIVITY_INFO_SUBMITTED_DESCRIPTION": "", "__PLAN_PAGE_SUMMARY_TAB_ACTIVITY_INFO_TITLE": "", + "__PLAN_PAGE_SUMMARY_TAB_CANCEL_PAYMENT_CARD_ADDITIONAL_INFO": "", "__PLAN_PAGE_SUMMARY_TAB_CONFIRMATION_CARD_CANCEL_PLAN_CTA": "", "__PLAN_PAGE_SUMMARY_TAB_CONFIRMATION_CARD_CONFIRM_CTA": "", "__PLAN_PAGE_SUMMARY_TAB_CONFIRMATION_CARD_CONFIRM_CTA_INFO_MESSAGE": "", diff --git a/src/pages/Plan/summary/components/DetailsCard.tsx b/src/pages/Plan/summary/components/DetailsCard.tsx index 2526333c4..86b4dca0b 100644 --- a/src/pages/Plan/summary/components/DetailsCard.tsx +++ b/src/pages/Plan/summary/components/DetailsCard.tsx @@ -210,7 +210,19 @@ export const DetailsCard = () => { return ; } if (planComposedStatus === 'Paying') { - return ; + return ( + <> + + + {t('__PLAN_PAGE_SUMMARY_TAB_CANCEL_PAYMENT_CARD_ADDITIONAL_INFO')} + + + ); } return ( <> diff --git a/src/pages/Plan/summary/components/PlanInfo.tsx b/src/pages/Plan/summary/components/PlanInfo.tsx index 94578d4e1..dccd0c99d 100644 --- a/src/pages/Plan/summary/components/PlanInfo.tsx +++ b/src/pages/Plan/summary/components/PlanInfo.tsx @@ -29,14 +29,18 @@ export const PlanInfo = () => { const { planId } = useParams(); const { t } = useTranslation(); - const { plan } = usePlan(planId); + const { plan, planComposedStatus } = usePlan(planId); if (!plan) return null; if (!plan.price || !plan.from_template) { return null; } - + if ( + planComposedStatus !== 'PrequotedDraft' && + planComposedStatus !== 'PurchasableDraft' + ) + return null; return ( { }, [location.search, planId]); const notFoundRoute = useLocalizeRoute('oops'); const [patchStatus, { isLoading }] = usePatchPlansByPidStatusMutation(); + const { addToast } = useToast(); + const { t } = useTranslation(); useEffect(() => { const run = () => { @@ -37,6 +41,18 @@ export const useSetDraftOnFailed = () => { return next; }); navigate(location.pathname, { replace: true }); + addToast( + ({ close }) => ( + + ), + { placement: 'top' } + ); }) .catch((err) => { console.error( diff --git a/tests/e2e/plan/draft_plan_info_card.spec.ts b/tests/e2e/plan/draft_plan_info_card.spec.ts index 053b3e706..0c140f415 100644 --- a/tests/e2e/plan/draft_plan_info_card.spec.ts +++ b/tests/e2e/plan/draft_plan_info_card.spec.ts @@ -85,25 +85,6 @@ test.describe('A plan with template and price', () => { await planPage.open(); }); - test('shows the info plan card with template title and price', async () => { - await expect(planPage.elements().draftPlanCardInfo().title()).toBeVisible(); - await expect( - planPage.elements().draftPlanCardInfo().templateType() - ).toBeVisible(); - await expect( - planPage.elements().draftPlanCardInfo().startingPrice() - ).toBeVisible(); - await expect( - planPage.elements().draftPlanCardInfo().priceWarning() - ).toBeVisible(); - await expect( - planPage.elements().draftPlanCardInfo().templateTypeValue() - ).toHaveText('Professional template'); - await expect( - planPage.elements().draftPlanCardInfo().startingPriceValue() - ).toHaveText('100 €'); - }); - test("it's possible to add a module, and remove and still see the plan card info", async () => { await touchpointsModule.addModule(); await expect(touchpointsModule.elements().module()).toBeVisible(); diff --git a/yarn.lock b/yarn.lock index 244b532e6..b5a1be27e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -117,10 +117,10 @@ dependencies: hls.js "^1.4.8" -"@appquality/unguess-design-system@4.0.50--canary.549.d20012e.0": - version "4.0.50--canary.549.d20012e.0" - resolved "https://registry.yarnpkg.com/@appquality/unguess-design-system/-/unguess-design-system-4.0.50--canary.549.d20012e.0.tgz#2937ea0b3ac71259f2fb66cba781c8fe1ef99abf" - integrity sha512-YQKZDnDi0+6IidyQPw00/x2OKnAIBzg6Ua/4n/PjjQpUIcaOu46o87sjWEQDj1gDqTT+zUgTOGpNtpCCHRTdLw== +"@appquality/unguess-design-system@4.0.50": + version "4.0.50" + resolved "https://registry.yarnpkg.com/@appquality/unguess-design-system/-/unguess-design-system-4.0.50.tgz#1080f1963fc7430848d50f964a76c8fa903d0105" + integrity sha512-bfQnSWAHQyuDroaCRcpvmXn0V2Jtp2N15ukTuYiVAa7Z0g9tOsFskWsiR8IzLoinsEQ0qam0ySqIN6TCcnUbdQ== dependencies: "@appquality/stream-player" "1.0.6" "@nivo/bar" "^0.87.0"