From: Grégoire Aubert Date: Mon, 26 Nov 2018 16:34:27 +0000 (+0100) Subject: SONARCLOUD-175 Update paid plan promotion box and billing form X-Git-Tag: 7.5~44 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dd75a693f2c7160957eeed54be9151a04a75d0c4;p=sonarqube.git SONARCLOUD-175 Update paid plan promotion box and billing form --- diff --git a/server/sonar-web/src/main/js/apps/create/components/CardPlan.tsx b/server/sonar-web/src/main/js/apps/create/components/CardPlan.tsx index 937d470a2d8..372e64bc526 100644 --- a/server/sonar-web/src/main/js/apps/create/components/CardPlan.tsx +++ b/server/sonar-web/src/main/js/apps/create/components/CardPlan.tsx @@ -24,8 +24,8 @@ import { Link } from 'react-router'; import CheckIcon from '../../../components/icons-components/CheckIcon'; import RecommendedIcon from '../../../components/icons-components/RecommendedIcon'; import { Alert } from '../../../components/ui/Alert'; -import { formatPrice } from '../organization/utils'; -import { translate } from '../../../helpers/l10n'; +import { formatPrice, TRIAL_DURATION_DAYS } from '../organization/utils'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import * as theme from '../../../app/theme'; import './CardPlan.css'; @@ -139,7 +139,9 @@ export function PaidCardPlan({ isRecommended, ...props }: PaidProps) { translate('billing.upgrade_box.unlimited_private_projects'), translate('billing.upgrade_box.strict_control_private_data'), translate('billing.upgrade_box.cancel_anytime'), - translate('billing.upgrade_box.free_trial') + + {translateWithParameters('billing.upgrade_box.free_trial_x', TRIAL_DURATION_DAYS)} + ]; return ( @@ -151,14 +153,14 @@ export function PaidCardPlan({ isRecommended, ...props }: PaidProps) {
- {translate('learn_more')} + {translate('billing.pricing.learn_more')}
diff --git a/server/sonar-web/src/main/js/apps/create/components/__tests__/__snapshots__/CardPlan-test.tsx.snap b/server/sonar-web/src/main/js/apps/create/components/__tests__/__snapshots__/CardPlan-test.tsx.snap index 8de24b338b4..028ea133bbe 100644 --- a/server/sonar-web/src/main/js/apps/create/components/__tests__/__snapshots__/CardPlan-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/create/components/__tests__/__snapshots__/CardPlan-test.tsx.snap @@ -94,7 +94,7 @@ exports[`#PaidCardPlan should render correctly 1`] = ` > billing.upgrade_box.unlimited_private_projects @@ -104,7 +104,7 @@ exports[`#PaidCardPlan should render correctly 1`] = ` > billing.upgrade_box.strict_control_private_data @@ -114,7 +114,7 @@ exports[`#PaidCardPlan should render correctly 1`] = ` > billing.upgrade_box.cancel_anytime @@ -124,9 +124,13 @@ exports[`#PaidCardPlan should render correctly 1`] = ` > - billing.upgrade_box.free_trial + + billing.upgrade_box.free_trial_x.14 +
- learn_more + billing.pricing.learn_more
diff --git a/server/sonar-web/src/main/js/apps/create/organization/utils.ts b/server/sonar-web/src/main/js/apps/create/organization/utils.ts index bc2688be093..4d5d72200f2 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/utils.ts +++ b/server/sonar-web/src/main/js/apps/create/organization/utils.ts @@ -35,6 +35,8 @@ export const ORGANIZATION_IMPORT_BINDING_IN_PROGRESS_TIMESTAMP = export const ORGANIZATION_IMPORT_REDIRECT_TO_PROJECT_TIMESTAMP = 'sonarcloud.import_org.redirect_to_projects'; +export const TRIAL_DURATION_DAYS = 14; + export enum Step { OrganizationDetails, Plan diff --git a/server/sonar-web/src/main/js/components/common/UpgradeOrganizationBox.tsx b/server/sonar-web/src/main/js/components/common/UpgradeOrganizationBox.tsx index baeb9ad0dba..1d6254b8a37 100644 --- a/server/sonar-web/src/main/js/components/common/UpgradeOrganizationBox.tsx +++ b/server/sonar-web/src/main/js/components/common/UpgradeOrganizationBox.tsx @@ -27,24 +27,23 @@ interface Props { } export default function UpgradeOrganizationBox({ organization }: Props) { + if (!hasMessage('billing.upgrade_box.button')) { + return null; + } return (

{translate('billing.upgrade_box.header')}

-

{translate('billing.upgrade_box.text')}

- - {hasMessage('billing.upgrade_box.button') && ( -
- - {translate('billing.upgrade_box.button')} - -
- )} +
+ + {translate('billing.upgrade_box.button')} + +
); }