From e700de82ebe75ab40e15a449becff89b053247ea Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Tue, 13 Oct 2020 14:47:41 +0200 Subject: [PATCH] FIx : setupSubscription & OrganizationForm --- client/src/containers/Setup/SetupOrganizationForm.js | 3 --- client/src/containers/Setup/SetupSubscriptionForm.js | 11 +++++++---- client/src/lang/en/index.js | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client/src/containers/Setup/SetupOrganizationForm.js b/client/src/containers/Setup/SetupOrganizationForm.js index 596d9b037..d865fffa0 100644 --- a/client/src/containers/Setup/SetupOrganizationForm.js +++ b/client/src/containers/Setup/SetupOrganizationForm.js @@ -17,7 +17,6 @@ import { TimezonePicker } from '@blueprintjs/timezone'; import { FormattedMessage as T, useIntl } from 'react-intl'; import { DateInput } from '@blueprintjs/datetime'; import { momentFormatter, tansformDateValue } from 'utils'; -import AppToaster from 'components/AppToaster'; import { ListSelect, ErrorMessage, FieldRequiredHint } from 'components'; import { useHistory } from 'react-router-dom'; @@ -29,7 +28,6 @@ import { compose, optionsMapToArray } from 'utils'; function SetupOrganizationForm({ requestSubmitOptions, requestSeedTenant }) { const { formatMessage } = useIntl(); const [selected, setSelected] = useState(); - const history = useHistory(); const baseCurrency = [ { id: 0, name: 'LYD - Libyan Dinar', value: 'LYD' }, @@ -177,7 +175,6 @@ function SetupOrganizationForm({ requestSubmitOptions, requestSeedTenant }) { const options = optionsMapToArray(values).map((option) => { return { key: option.key, ...option, group: 'organization' }; }); - console.log(options, 'Op'); requestSubmitOptions({ options }) .then((response) => { setSubmitting(false); diff --git a/client/src/containers/Setup/SetupSubscriptionForm.js b/client/src/containers/Setup/SetupSubscriptionForm.js index 9f29d5f01..c3bc5424e 100644 --- a/client/src/containers/Setup/SetupSubscriptionForm.js +++ b/client/src/containers/Setup/SetupSubscriptionForm.js @@ -23,7 +23,12 @@ function SetupSubscriptionForm({ plan_slug: Yup.string() .required() .label(formatMessage({ id: 'plan_slug' })), - license_code: Yup.string().trim(), + license_code: Yup.string() + .min(7) + .max(7) + .required() + .label(formatMessage({ id: 'license_code_' })) + .trim(), }); const initialValues = useMemo( @@ -70,6 +75,4 @@ function SetupSubscriptionForm({ ); } -export default compose( - withBillingActions, -)(SetupSubscriptionForm); +export default compose(withBillingActions)(SetupSubscriptionForm); diff --git a/client/src/lang/en/index.js b/client/src/lang/en/index.js index d9ab0fe28..a96b2d503 100644 --- a/client/src/lang/en/index.js +++ b/client/src/lang/en/index.js @@ -704,7 +704,7 @@ export default { pro: 'PRO', monthly: 'Monthly', yearly: 'Yearly', - license_code: 'License code', + license_code: 'License Code', year: 'Year', please_enter_your_preferred_payment_method: 'Please enter your preferred payment method below. You can use a credit / debit card or prepay through PayPal. ', @@ -764,4 +764,5 @@ export default { date_start_: 'Date start', something_wentwrong: 'Something went wrong.', new_password: 'New password', + license_code_: 'License code', };