Skip to content

Commit ab29a66

Browse files
committed
feat: add plan card labels for confirmation, finalization, and viewing activities
1 parent b6fba69 commit ab29a66

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

src/locales/en/translation.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,9 @@
13781378
"_CAMPAIGN_WIDGET_UX_USER_ANALYSIS_DESCRIPTION_HEADER": "There are observations on",
13791379
"_CAMPAIGN_WIDGET_UX_USER_ANALYSIS_HEADER": "Analyzed User Contributions",
13801380
"_PAGE_PROFILE_HEADER_TEXT": "Manage your profile anytime: check and update your personal information whenever you need.",
1381+
"_PLAN_CARD_LABEL_CONFIRM": "Confirm & Launch",
1382+
"_PLAN_CARD_LABEL_FINALIZE": "Finalize Activity",
1383+
"_PLAN_CARD_LABEL_LOOK": "Take a look",
13811384
"_PLAN_PAGE_MODULE_LANGUAGE_DESCRIPTION": "You’ll receive feedback in the language you’re selecting",
13821385
"_PLAN_PAGE_MODULE_LANGUAGE_SUBTITLE": "Select participants' preferred language",
13831386
"_PROJECT_PAGE_PLANS_GROUP_SEE_ALL": "View more",

src/locales/it/translation.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,9 @@
14201420
"_CAMPAIGN_WIDGET_UX_USER_ANALYSIS_DESCRIPTION_HEADER": "Hai aggiunto osservazioni su",
14211421
"_CAMPAIGN_WIDGET_UX_USER_ANALYSIS_HEADER": "Contributi utente analizzati",
14221422
"_PAGE_PROFILE_HEADER_TEXT": "",
1423+
"_PLAN_CARD_LABEL_CONFIRM": "",
1424+
"_PLAN_CARD_LABEL_FINALIZE": "",
1425+
"_PLAN_CARD_LABEL_LOOK": "",
14231426
"_PLAN_PAGE_MODULE_LANGUAGE_DESCRIPTION": "",
14241427
"_PLAN_PAGE_MODULE_LANGUAGE_SUBTITLE": "",
14251428
"_PROJECT_PAGE_PLANS_GROUP_SEE_ALL": "Vedi tutti",

src/pages/Dashboard/PlanCard.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
11
import { PlanCard as UGPlanCard } from '@appquality/unguess-design-system';
2+
import { get } from 'http';
3+
import { useTranslation } from 'react-i18next';
24
import { useNavigate } from 'react-router-dom';
35
import { GetWorkspacesByWidPlansApiResponse } from 'src/features/api';
46
import { usePlan } from 'src/hooks/usePlan';
57
import { usePlanStatusLabel } from 'src/hooks/usePlanStatusLabel';
8+
import { PlanComposedStatusType } from 'src/types';
69

710
export const PlanCard = ({
811
plan,
912
}: {
1013
plan: GetWorkspacesByWidPlansApiResponse[number];
1114
}) => {
1215
const { planComposedStatus } = usePlan(plan.id.toString());
16+
const { t } = useTranslation();
1317
const statusLabel = usePlanStatusLabel({ planStatus: planComposedStatus });
1418
const navigate = useNavigate();
1519
const navigateToPlan = () => {
1620
navigate(`/plans/${plan.id}`);
1721
};
22+
23+
const getPlanLabel = (planStatus?: PlanComposedStatusType) => {
24+
switch (planStatus) {
25+
case 'PurchasableDraft':
26+
case 'UnquotedDraft':
27+
case 'PrequotedDraft':
28+
return t('_PLAN_CARD_LABEL_FINALIZE');
29+
case 'Submitted':
30+
case 'OpsCheck':
31+
case 'Paying':
32+
return t('_PLAN_CARD_LABEL_LOOK');
33+
case 'AwaitingPayment':
34+
case 'AwaitingApproval':
35+
return t('_PLAN_CARD_LABEL_CONFIRM');
36+
default:
37+
return '';
38+
}
39+
};
1840
return (
1941
<UGPlanCard
2042
status={planComposedStatus}
21-
i18n={{ statusLabel }}
43+
i18n={{ statusLabel, planLabel: getPlanLabel(planComposedStatus) }}
2244
onClick={navigateToPlan}
2345
>
2446
<UGPlanCard.ProjectLabel>{plan.project.title}</UGPlanCard.ProjectLabel>

0 commit comments

Comments
 (0)