Skip to content

Commit

Permalink
Tweak: Remove unnecessary consent checkbox [TMZ-236] (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuritsha authored Dec 9, 2024
1 parent 697d76d commit 93cc273
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 31 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ assets/js/*.js
**/vendor/**
build/**
hello-plus/**
.github/**
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import Typography from '@elementor/ui/Typography';
import Alert from '@elementor/ui/Alert';
import Box from '@elementor/ui/Box';
import Button from '@elementor/ui/Button';
import Checkbox from '@elementor/ui/Checkbox';
import Link from '@elementor/ui/Link';
import { __ } from '@wordpress/i18n';

export const GetStarted = ( { message, buttonText, onClick, severity, allowTracking, setAllowTracking } ) => {
export const GetStarted = ( { message, buttonText, onClick, severity } ) => {
return (
<>
<Stack direction="column" alignItems="center" justifyContent="center">
Expand All @@ -34,24 +33,13 @@ export const GetStarted = ( { message, buttonText, onClick, severity, allowTrack
</Stack>
</Stack>
<Stack direction="column" alignItems="center" justifyContent="center" sx={ { marginTop: 'auto', pb: 4 } }>
<Stack sx={ { maxWidth: 'fit-content' } } alignItems="center" justifyContent="center">
<Stack direction="row" alignItems="center" justifyContent="center" >
<Checkbox sx={ { p: 0.5 } } size="small" checked={ allowTracking } onClick={ () => setAllowTracking( ! allowTracking ) } color="default" />
<Typography variant="body1" align="center" color="text.tertiary">
{ __( 'Become a super contributor by sharing non-sensitive plugin data to help us improve the tools you use every day.', 'hello-plus' ) }
</Typography>
<Link variant="body1" color="info.main" ml={ 1 } underline="hover" target="_blank" href="https://elementor.com/help/share-usage-data/">
{ __( 'Learn more', 'hello-plus' ) }
</Link>
</Stack>
<Stack direction="row" alignItems="center" justifyContent="center" >
<Typography color="text.tertiary" variant="body1" align="center">
{ __( 'By clicking "Start building my website", I agree to install & activate the Elementor plugin. I accept the Elementor.', 'hello-plus' ) }
</Typography>
<Link variant="body1" color="info.main" ml={ 1 } underline="hover" target="_blank" href="https://elementor.com/terms/">
{ __( 'Terms and Conditions', 'hello-plus' ) }
</Link>
</Stack>
<Stack direction="row" sx={ { maxWidth: 'fit-content' } } alignItems="center" justifyContent="center">
<Typography color="text.tertiary" variant="body2" align="center">
{ __( 'By clicking "Start building my website", I agree to install & activate the Elementor plugin. I accept the Elementor', 'hello-plus' ) }
</Typography>
<Link variant="body2" color="info.main" ml={ 1 } underline="hover" target="_blank" href="https://elementor.com/terms/">
{ __( 'Terms and Conditions', 'hello-plus' ) }
</Link>
</Stack>
</Stack>
</>
Expand Down
6 changes: 2 additions & 4 deletions modules/admin/assets/js/pages/onboarding-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const OnboardingPage = () => {
const [ message, setMessage ] = useState( '' );
const [ severity, setSeverity ] = useState( 'info' );
const [ previewKit, setPreviewKit ] = useState( null );
const [ allowTracking, setAllowTracking ] = useState( true );

const {
isLoading,
Expand All @@ -35,7 +34,6 @@ export const OnboardingPage = () => {
step: stepAction,
_wpnonce: nonce,
slug: 'elementor',
allowTracking,
};

setIsLoading( true );
Expand Down Expand Up @@ -74,7 +72,7 @@ export const OnboardingPage = () => {
} finally {
setIsLoading( false );
}
}, [ allowTracking, nonce, setIsLoading, stepAction ] );
}, [ nonce, setIsLoading, stepAction ] );

const onClose = () => {
window.location.href = modalCloseRedirectUrl;
Expand All @@ -96,7 +94,7 @@ export const OnboardingPage = () => {
} }>
{ ! previewKit && ( <TopBarContent onClose={ onClose } sx={ { borderBottom: '1px solid var(--divider-divider, rgba(0, 0, 0, 0.12))', mb: 4 } } iconSize="small" /> ) }
{ 0 === step && ! isLoading && ! previewKit && (
<GetStarted allowTracking={ allowTracking } setAllowTracking={ setAllowTracking } severity={ severity } message={ message } buttonText={ buttonText } onClick={ onClick } />
<GetStarted severity={ severity } message={ message } buttonText={ buttonText } onClick={ onClick } />
) }
{ 1 === step && ! isLoading && ! previewKit && ( <InstallKit setPreviewKit={ setPreviewKit } severity={ severity } message={ message } onClick={ onClick } kits={ kits } /> ) }
{ 2 === step && ! isLoading && ! previewKit && ( <ReadyToGo modalCloseRedirectUrl={ modalCloseRedirectUrl } /> ) }
Expand Down
7 changes: 0 additions & 7 deletions modules/admin/classes/ajax/setup-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ public function ajax_setup_wizard() {
check_ajax_referer( 'updates', 'nonce' );

$step = filter_input( INPUT_POST, 'step', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
$allow_tracking = filter_input( INPUT_POST, 'allowTracking', FILTER_VALIDATE_BOOLEAN );

if ( $allow_tracking ) {
update_option( 'elementor_allow_tracking', true );
} else {
delete_option( 'elementor_allow_tracking' );
}

$campaign_data = [
'source' => 'ecore-ehp-install',
Expand Down

0 comments on commit 93cc273

Please sign in to comment.