feat: authentication & setuptInitializing lang.

This commit is contained in:
elforjani3
2021-06-12 22:02:55 +02:00
parent 27a7f613be
commit ebd64a95c6
6 changed files with 60 additions and 41 deletions

View File

@@ -1,14 +1,19 @@
import React from 'react';
import Icon from 'components/Icon';
import moment from 'moment';
import intl from 'react-intl-universal';
export default function AuthCopyright() {
return (
<div class="auth-copyright">
<div class="auth-copyright__text">
© 20012020 All Rights Reserved.
{intl.get('all_rights_reserved', {
pre: moment().subtract(1, 'years').year(),
current: moment().get('year'),
})}
</div>
<Icon width={122} height={22} icon={'bigcapital'} />
</div>
</div>
);
}
}

View File

@@ -13,15 +13,10 @@ import InviteAcceptFormContent from './InviteAcceptFormContent';
export default function InviteAcceptForm() {
const history = useHistory();
// Invite accept context.
const {
inviteAcceptMutate,
inviteMeta,
token,
} = useInviteAcceptContext();
const { inviteAcceptMutate, inviteMeta, token } = useInviteAcceptContext();
// Invite value.
const inviteValue = {
organization_name: '',
@@ -39,8 +34,13 @@ export default function InviteAcceptForm() {
inviteAcceptMutate([values, token])
.then((response) => {
AppToaster.show({
message: `Congrats! Your account has been created and invited to
<strong>${inviteValue.organization_name}</strong> organization successfully.`,
message: intl.getHTML(
'congrats_your_account_has_been_created_and_invited',
{
organization_name: inviteValue.organization_name,
},
),
intent: Intent.SUCCESS,
});
history.push('/auth/login');
@@ -67,7 +67,7 @@ export default function InviteAcceptForm() {
}
if (errors.find((e) => e.type === 'INVITE.TOKEN.NOT.FOUND')) {
AppToaster.show({
message: 'An unexpected error occurred',
message: intl.get('an_unexpected_error_occurred'),
intent: Intent.DANGER,
position: Position.BOTTOM,
});

View File

@@ -36,7 +36,7 @@ export default function InviteUserFormContent() {
<FastField name={'first_name'}>
{({ form, field, meta: { error, touched } }) => (
<FormGroup
label={<T id={'First Name'} />}
label={<T id={'first_name'} />}
className={'form-group--first_name'}
intent={inputIntent({ error, touched })}
helperText={<ErrorMessage name={'first_name'} />}
@@ -54,7 +54,7 @@ export default function InviteUserFormContent() {
<FastField name={'last_name'}>
{({ form, field, meta: { error, touched } }) => (
<FormGroup
label={<T id={'Last Name'} />}
label={<T id={'last_name'} />}
className={'form-group--last_name'}
intent={inputIntent({ error, touched })}
helperText={<ErrorMessage name={'last_name'} />}
@@ -72,7 +72,7 @@ export default function InviteUserFormContent() {
<FastField name={'phone_number'}>
{({ form, field, meta: { error, touched } }) => (
<FormGroup
label={<T id={'Phone Number'} />}
label={<T id={'phone_number'} />}
className={'form-group--phone_number'}
intent={inputIntent({ error, touched })}
helperText={<ErrorMessage name={'phone_number'} />}
@@ -105,7 +105,7 @@ export default function InviteUserFormContent() {
<div className={'invite-form__statement-section'}>
<p>
<T id={'You email address is'} /> <b>{inviteMeta.email},</b> <br />
<T id={'you_email_address_is'} /> <b>{inviteMeta.email},</b> <br />
<T id={'you_will_use_this_address_to_sign_in_to_bigcapital'} />
</p>
<p>

View File

@@ -1,10 +1,5 @@
import React from 'react';
import {
Button,
InputGroup,
Intent,
FormGroup,
} from '@blueprintjs/core';
import { Button, InputGroup, Intent, FormGroup } from '@blueprintjs/core';
import { Form, ErrorMessage, FastField } from 'formik';
import { FormattedMessage as T } from 'components';
import { inputIntent } from 'utils';
@@ -12,15 +7,13 @@ import { inputIntent } from 'utils';
/**
* Send reset password form.
*/
export default function SendResetPasswordForm({
isSubmitting
}) {
export default function SendResetPasswordForm({ isSubmitting }) {
return (
<Form className={'send-reset-password'}>
<FastField name={'crediential'}>
{({ form, field, meta: { error, touched } }) => (
<FormGroup
label={'Email or Phone Number'}
label={<T id={'email_or_phone_number'} />}
intent={inputIntent({ error, touched })}
helperText={<ErrorMessage name={'crediential'} />}
className={'form-group--crediential'}

View File

@@ -1,6 +1,7 @@
import React, { useEffect } from 'react';
import { ProgressBar, Intent } from '@blueprintjs/core';
import { useBuildTenant } from 'hooks/query';
import { FormattedMessage as T } from 'components';
import 'style/pages/Setup/Initializing.scss';
@@ -25,22 +26,34 @@ export default function SetupInitializingForm() {
<div className={'setup-initializing-form__title'}>
{isLoading ? (
<>
<h1>It's time to make your accounting really simple!</h1>
<h1>
<T id={'it_s_time_to_make_your_accounting_really_simple'} />
</h1>
<p className={'paragraph'}>
while we set up your account, please remember to verify your
account by clicking on the link we sent to yout registered email
address
<T
id={
'while_we_set_up_your_account_please_remember_to_verify_your_account'
}
/>
</p>
</>
) : isError ? (
<>
<h1>Something went wrong!</h1>
<p class="paragraph">Please refresh the page</p>
<h1>
<T id={'something_went_wrong'} />
</h1>
<p class="paragraph">
<T id={'please_refresh_the_page'} />
</p>
</>
) : (
<>
<h1>Waiting to redirect</h1>
<p class="paragraph">Refresh the page if redirect not worked.</p>
<h1>
<T id={'waiting_to_redirect'} />
</h1>
<p class="paragraph">
<T id={'refresh_the_page_if_redirect_not_worked'} />
</p>
</>
)}
</div>

View File

@@ -348,7 +348,7 @@
"session_expired": "Session Expired!",
"this_report_does_not_contain_any_data_between_date_period": "This report does not contain any data between date period.",
"welcome_organization_account_has_been_created": "👋 Welcome, You organization account has been created, Sign in now!",
"the_phone_number_already_used_in_another_account": "he phone number is already used in another account",
"the_phone_number_already_used_in_another_account": "the phone number is already used in another account",
"the_email_already_used_in_another_account": "The email is already used in another account",
"hide_filter": "Hide filter",
"show_filter": "Show filter",
@@ -1102,9 +1102,17 @@
"mm_dd_yy_": "MM-DD-YY",
"dd_mm_yy_": "DD-MM-YY",
"yy_mm_dd_": "YY-MM-DD",
"plan_radio_name":"{name}",
"there_were_no_purchases_during_the_selected_date_range":"There were no purchases during the selected date range.",
"there_were_no_sales_during_the_selected_date_range":"There were no sales during the selected date range.",
"there_were_no_inventory_transactions_during_the_selected_date_range":"There were no inventory transactions during the selected date range.",
"filter_":"Filter..."
"plan_radio_name": "{name}",
"there_were_no_purchases_during_the_selected_date_range": "There were no purchases during the selected date range.",
"there_were_no_sales_during_the_selected_date_range": "There were no sales during the selected date range.",
"there_were_no_inventory_transactions_during_the_selected_date_range": "There were no inventory transactions during the selected date range.",
"filter_": "Filter...",
"all_rights_reserved": "© {pre}-{current} All Rights Reserved.",
"congrats_your_account_has_been_created_and_invited": "Congrats! Your account has been created and invited to <strong>{organization_name} </strong> organization successfully.",
"it_s_time_to_make_your_accounting_really_simple": "It's time to make your accounting really simple!",
"while_we_set_up_your_account_please_remember_to_verify_your_account": "while we set up your account, please remember to verify your account by clicking on the link we sent to your registered email address",
"something_went_wrong": "Something went wrong!",
"please_refresh_the_page": "Please refresh the page",
"waiting_to_redirect": "Waiting to redirect",
"refresh_the_page_if_redirect_not_worked": "Refresh the page if redirect not worked."
}