Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 9 additions & 2 deletions client/admin/cloud/ConnectToCloudSection.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Box, Button, ButtonGroup, Throbber } from '@rocket.chat/fuselage';
import { Box, Button, ButtonGroup, Throbber, Callout } from '@rocket.chat/fuselage';
import { useSafely } from '@rocket.chat/fuselage-hooks';
import React, { useState } from 'react';

import Subtitle from '../../components/basic/Subtitle';
import { useTranslation } from '../../contexts/TranslationContext';
import { useMethod } from '../../contexts/ServerContext';
import { useSetting } from '../../contexts/SettingsContext';
import { useToastMessageDispatch } from '../../contexts/ToastMessagesContext';

function ConnectToCloudSection({
Expand All @@ -18,6 +19,7 @@ function ConnectToCloudSection({

const registerWorkspace = useMethod('cloud:registerWorkspace');
const syncWorkspace = useMethod('cloud:syncWorkspace');
const hasAcceptedTerms = useSetting('Cloud_Service_Agree_PrivacyTerms');

const handleRegisterButtonClick = async () => {
setConnecting(true);
Expand Down Expand Up @@ -50,10 +52,15 @@ function ConnectToCloudSection({
<p>{t('Cloud_registration_required_description')}</p>
</Box>
<ButtonGroup>
<Button primary disabled={isConnecting} minHeight='x40' onClick={handleRegisterButtonClick}>
<Button primary disabled={isConnecting || !hasAcceptedTerms} minHeight='x40' onClick={handleRegisterButtonClick}>
{isConnecting ? <Throbber is='span' inheritColor /> : t('Cloud_registration_required_link_text')}
</Button>
</ButtonGroup>
{!hasAcceptedTerms && <Box mb='x12'>
<Callout type='warning'>
{t('Cloud_Service_Agree_PrivacyTerms_Login_Disabled_Warning')}
</Callout>
</Box>}
</Box>;
}

Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@
"Cloud_error_code": "Code: __errorCode__",
"Cloud_status_page_description": "If a particular Cloud Service is having issues you can check for known issues on our status page at",
"Cloud_Service_Agree_PrivacyTerms": "Cloud Service Privacy Terms Agreement",
"Cloud_Service_Agree_PrivacyTerms_Login_Disabled_Warning": "You should accept the cloud privacy terms (Setup Wizard > Cloud Info > Cloud Service Privacy Terms Agreement) to connect to your cloud workspace",
"Cloud_Service_Agree_PrivacyTerms_Description": "I agree with the <a href='https://rocket.chat/terms'>Terms</a> & <a href='https://rocket.chat/privacy'>Privacy Policy</a>",
"Cloud_token_instructions": "To Register your workspace go to Cloud Console. Login or Create an account and click register self-managed. Paste the token provided below",
"Cloud_troubleshooting": "Troubleshooting",
Expand Down