Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down
14 changes: 13 additions & 1 deletion src/pages/Plan/summary/components/DetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,19 @@ export const DetailsCard = () => {
return <GoToCampaignButton />;
}
if (planComposedStatus === 'Paying') {
return <CancelPlanButton />;
return (
<>
<CancelPlanButton />
<SM
style={{
marginTop: appTheme.space.md,
color: appTheme.palette.grey[600],
}}
>
{t('__PLAN_PAGE_SUMMARY_TAB_CANCEL_PAYMENT_CARD_ADDITIONAL_INFO')}
</SM>
</>
);
}
return (
<>
Expand Down
8 changes: 6 additions & 2 deletions src/pages/Plan/summary/components/PlanInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<WidgetSpecialCard style={{ height: 'auto' }}>
<MD
Expand Down
16 changes: 16 additions & 0 deletions src/pages/Plan/useSetDraftOnFailed.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Notification, useToast } from '@appquality/unguess-design-system';
import { useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import {
useLocation,
useNavigate,
Expand All @@ -20,6 +22,8 @@
}, [location.search, planId]);
const notFoundRoute = useLocalizeRoute('oops');
const [patchStatus, { isLoading }] = usePatchPlansByPidStatusMutation();
const { addToast } = useToast();
const { t } = useTranslation();

useEffect(() => {
const run = () => {
Expand All @@ -37,9 +41,21 @@
return next;
});
navigate(location.pathname, { replace: true });
addToast(
({ close }) => (
<Notification
onClose={close}
type="info"
message={t('__PLAN_PAGE_PAYMENT_FAILED_TOAST_MESSAGE')}
closeText={t('__TOAST_CLOSE_TEXT')}
isPrimary
/>
),
{ placement: 'top' }
);
})
.catch((err) => {
console.error(

Check warning on line 58 in src/pages/Plan/useSetDraftOnFailed.tsx

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement

Check warning on line 58 in src/pages/Plan/useSetDraftOnFailed.tsx

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement
'Error updating plan status after payment failure',
err
);
Expand Down
19 changes: 0 additions & 19 deletions tests/e2e/plan/draft_plan_info_card.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading