Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Box, Button, ButtonGroup, Modal } from '@rocket.chat/fuselage';
import { ExternalLink } from '@rocket.chat/ui-client';
import { useSetModal, useTranslation } from '@rocket.chat/ui-contexts';
import React from 'react';

Expand All @@ -12,6 +13,8 @@ type RegisterWorkspaceModalProps = {
isConnectedToCloud?: boolean | string;
};

const documentationLink = 'https://go.rocket.chat/i/register-info-collected';

const RegisterWorkspaceModal = ({ onClose, onStatusChange, isConnectedToCloud = false, ...props }: RegisterWorkspaceModalProps) => {
const setModal = useSetModal();
const bulletFeatures = useFeatureBullets();
Expand Down Expand Up @@ -59,9 +62,7 @@ const RegisterWorkspaceModal = ({ onClose, onStatusChange, isConnectedToCloud =
</Modal.Content>
<Modal.Footer>
<Box is='div' display='flex' justifyContent='space-between' alignItems='center' w='full'>
<a href={'https://cloud.rocket.chat'} target='_blank' rel='noopener noreferrer'>
{t('Learn_more')}
</a>
<ExternalLink to={documentationLink}>{t('Learn_more')}</ExternalLink>
<ButtonGroup align='end'>
<Button onClick={handleTokenModal}>{t('Use_token')}</Button>
<Button primary onClick={handleSetupModal}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Modal, Box, Field, TextInput, CheckBox, ButtonGroup, Button } from '@rocket.chat/fuselage';
import { ExternalLink } from '@rocket.chat/ui-client';
import { useEndpoint, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts';
import React from 'react';
import { Trans } from 'react-i18next';
Expand Down Expand Up @@ -90,14 +91,9 @@ const RegisterWorkspaceSetupStepOneModal = ({
<CheckBox checked={terms} onChange={() => setTerms(!terms)} />
<Box is='p' fontSize='c1' pis={8}>
<Trans i18nKey='RegisterWorkspace_Setup_Terms_Privacy'>
I agree with
<Box is='a' href='https://rocket.chat/terms' target='_blank' rel='noopener noreferrer' pi={4}>
Terms and Conditions
</Box>
and
<Box is='a' href='https://rocket.chat/privacy' target='_blank' rel='noopener noreferrer' pi={4}>
Privacy Policy
</Box>
I agree with <ExternalLink to='https://rocket.chat/terms'>Terms and Conditions </ExternalLink>
and {''}
<ExternalLink to='https://rocket.chat/privacy'>Privacy Policy</ExternalLink>
</Trans>
</Box>
</Box>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Modal, Box, Field, TextInput } from '@rocket.chat/fuselage';
import { useEndpoint, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts';
import React, { useCallback, useEffect } from 'react';
import { Trans } from 'react-i18next';

type Props = {
email: string;
Expand Down Expand Up @@ -29,6 +30,7 @@ const RegisterWorkspaceSetupStepTwoModal = ({ email, step, setStep, onClose, int
const handleResendRegistrationEmail = async () => {
try {
await createRegistrationIntent({ resend: true, email });
dispatchToastMessage({ type: 'success', message: t('Email_sent') });
} catch (error: unknown) {
dispatchToastMessage({ type: 'error', message: error });
}
Expand Down Expand Up @@ -66,7 +68,17 @@ const RegisterWorkspaceSetupStepTwoModal = ({ email, step, setStep, onClose, int
</Modal.Header>
<Modal.Content>
<Box fontSize='p2'>
<Box is='p'>{t('RegisterWorkspace_Setup_Email_Confirmation', { email })}</Box>
<Box>
<Trans i18nKey='RegisterWorkspace_Setup_Email_Confirmation'>
<Box is='p'>
Email sent to{' '}
<Box is='span' fontScale='p2b'>
{email}
</Box>
with a confirmation link.{' '}
</Box>
</Trans>
</Box>
<Box is='p'>{t('RegisterWorkspace_Setup_Email_Verification')}</Box>
<Field pbs={10}>
<Field.Label>{t('Security_code')}</Field.Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const RegisterWorkspaceTokenModal = ({ onClose, onStatusChange, isConnectedToClo

const [token, setToken] = useState('');
const [processing, setProcessing] = useState(false);
const [error, setError] = useState(false);

const handleBackAction = (): void => {
const handleModalClose = (): void => setModal(null);
Expand All @@ -34,6 +35,7 @@ const RegisterWorkspaceTokenModal = ({ onClose, onStatusChange, isConnectedToClo

const handleConnectButtonClick = async () => {
setProcessing(true);
setError(false);

try {
const isConnected = await connectWorkspace(token);
Expand All @@ -47,6 +49,7 @@ const RegisterWorkspaceTokenModal = ({ onClose, onStatusChange, isConnectedToClo
dispatchToastMessage({ type: 'success', message: t('Connected') });
} catch (error) {
dispatchToastMessage({ type: 'error', message: error });
setError(true);
} finally {
await (onStatusChange && onStatusChange());
setProcessing(false);
Expand Down Expand Up @@ -81,6 +84,7 @@ const RegisterWorkspaceTokenModal = ({ onClose, onStatusChange, isConnectedToClo
<Field.Row>
<TextInput onChange={handleTokenChange} value={token} />
</Field.Row>
{error && <Field.Error>{t('Token_Not_Recognized')}</Field.Error>}
</Field>
</Modal.Content>
<Modal.Footer>
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5527,6 +5527,7 @@
"ConnectWorkspace_Button": "Connect workspace",
"Workspace_registered": "Workspace registered",
"Workspace_not_connected": "Workspace not connected",
"Token_Not_Recognized": "Token not recognized",
"RegisterWorkspace_Registered_Description": "These services are available",
"RegisterWorkspace_Registered_Subtitle": "Because this workspace is registered the following is available",
"RegisterWorkspace_Registered_Benefits": "Registration allows automatic license updates, notifications of critical vulnerabilities and access to Rocket.Chat Cloud services. No sensitive workspace data is shared with Rocket.Chat.",
Expand Down Expand Up @@ -5559,7 +5560,7 @@
"RegisterWorkspace_Setup_Have_Account_Subtitle": "Enter your Cloud account email to associate this workspace with your account.",
"RegisterWorkspace_Setup_No_Account_Title": "Don't have an account?",
"RegisterWorkspace_Setup_No_Account_Subtitle": "Enter your email to create a new Cloud account and associate this workspace.",
"RegisterWorkspace_Setup_Email_Confirmation": "Email sent to <strong>__email__</strong> with a confirmation link.",
"cloud.RegisterWorkspace_Setup_Email_Confirmation": "Email sent to <1>email</1> with a confirmation link.",
"RegisterWorkspace_Setup_Email_Verification": "Please verify that the security code below matches the one in the email.",
"RegisterWorkspace_Syncing_Error": "An error occured syncing your workspace",
"RegisterWorkspace_Syncing_Complete": "Sync Complete",
Expand Down