Skip to content
Snippets Groups Projects
Unverified Commit e1f0dc73 authored by gabriellsh's avatar gabriellsh Committed by GitHub
Browse files

[FIX] Missing Privacy Terms Cloud Register warning (#18383)

parent b9e47ac4
No related branches found
No related tags found
No related merge requests found
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({
......@@ -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);
......@@ -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>;
}
......
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment