Skip to content

Commit

Permalink
chore: remove Hyve promos
Browse files Browse the repository at this point in the history
  • Loading branch information
HardeepAsrani committed Dec 3, 2024
1 parent 2028aa7 commit 2c501c1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 156 deletions.
79 changes: 3 additions & 76 deletions assets/src/Components/ImportModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const ImportModal = ( {
widgets: true,
cleanup: false,
performanceAddon: true,
hyveLite: true,
theme_install: themeData !== false,
} );
const site = tiobDash.onboarding.homeUrl || '';
Expand All @@ -62,7 +61,6 @@ const ImportModal = ( {
const [ performanceAddonProgress, setPerformanceAddonProgress ] = useState(
false
);
const [ hyveLiteProgress, setHyveLiteProgress ] = useState( false );
const [ cleanupProgress, setCleanupProgress ] = useState( false );
const [ pluginsProgress, setPluginsProgress ] = useState( false );
const [ contentProgress, setContentProgress ] = useState( false );
Expand Down Expand Up @@ -261,44 +259,6 @@ const ImportModal = ( {
}
),
},
hyveLite: {
title: __( 'AI Chatbot', 'templates-patterns-collection' ),
icon: 'admin-comments',
tooltip: createInterpolateElement(
sprintf(
// translators: %s is Hyve plugin name.
__(
'Hyve is an AI-powered chatbot that transforms your WordPress content into engaging conversations. %sHyve%s',
'templates-patterns-collection'
),
'<a><span>',
'</span><icon/></a>'
),
{
a: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a
href="https://wordpress.org/plugins/hyve-lite/"
target={ '_blank' }
rel="external noreferrer noopener"
style={ {
textDecoration: 'none',
display: 'inline-flex',
alignItems: 'center',
} }
/>
),
icon: (
<Icon
size={ 10 }
icon="external"
style={ { marginLeft: 0 } }
/>
),
span: <div />,
}
),
},
};

if ( isCleanupAllowed === 'yes' ) {
Expand Down Expand Up @@ -546,8 +506,7 @@ const ImportModal = ( {
// console.clear();
if (
! pluginOptions &&
! general.performanceAddon &&
! general.hyveLite
! general.performanceAddon
) {
console.log( '[S] Plugins.' );
runImportContent();
Expand Down Expand Up @@ -656,7 +615,7 @@ const ImportModal = ( {
function runPerformanceAddonInstall() {
if ( ! general.performanceAddon ) {
console.log( '[S] Performance Addon.' );
runHyveLiteInstall();
importDone();
return false;
}
setCurrentStep( 'performanceAddon' );
Expand All @@ -670,34 +629,10 @@ const ImportModal = ( {
}
console.log( '[D] Performance Addon.' );
setPerformanceAddonProgress( 'done' );
runHyveLiteInstall();
} )
.catch( ( incomingError ) =>
handleError( incomingError, 'performanceAddon' )
);
}

function runHyveLiteInstall() {
if ( ! general.hyveLite ) {
console.log( '[S] Hyve Lite.' );
importDone();
return false;
}
setCurrentStep( 'hyveLite' );
console.log( '[P] Hyve Lite.' );

installPlugins( { 'hyve-lite': true } )
.then( ( response ) => {
if ( ! response.success ) {
handleError( response, 'hyveLite' );
return false;
}
console.log( '[D] Hyve Lite.' );
setHyveLiteProgress( 'done' );
importDone();
} )
.catch( ( incomingError ) =>
handleError( incomingError, 'hyveLite' )
handleError( incomingError, 'performanceAddon' )
);
}

Expand Down Expand Up @@ -749,10 +684,6 @@ const ImportModal = ( {
'Something went wrong while installing the performance addon.',
'templates-patterns-collection'
),
hyveLite: __(
'Something went wrong while installing the Hyve Lite plugin.',
'templates-patterns-collection'
),
};

switch ( step ) {
Expand All @@ -774,9 +705,6 @@ const ImportModal = ( {
case 'performanceAddon':
setPerformanceAddonProgress( 'error' );
break;
case 'hyveLite':
setHyveLiteProgress( 'error' );
break;
}
setError(
incomingError.data
Expand Down Expand Up @@ -959,7 +887,6 @@ const ImportModal = ( {
customizer: customizerProgress,
widgets: widgetsProgress,
performanceAddon: performanceAddonProgress,
hyveLite: hyveLiteProgress,
} }
currentStep={ currentStep }
willDo={ general }
Expand Down
8 changes: 0 additions & 8 deletions assets/src/Components/ImportStepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ const ImportStepper = ( { currentStep, progress, willDo } ) => {
status: progress.performanceAddon,
willDo: willDo.performanceAddon,
},
hyveLite: {
label: __(
'Installing Hyve Lite Plugin',
'templates-patterns-collection'
),
status: progress.hyveLite,
willDo: willDo.hyveLite,
},
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,44 +113,6 @@ const ImportOptionsControl = ( {
}
),
},
hyveLite: {
title: __( 'AI Chatbot', 'templates-patterns-collection' ),
icon: 'admin-comments',
tooltip: createInterpolateElement(
sprintf(
// translators: %1$s is the opening tag for the link %2$s is the closing tag for the link.
__(
'Hyve is an AI-powered chatbot that transforms your WordPress content into engaging conversations. %1$sHyve%2$s',
'templates-patterns-collection'
),
'<a><span>',
'</span><icon/></a>'
),
{
a: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a
href="https://wordpress.org/plugins/hyve-lite/"
target={ '_blank' }
rel="external noreferrer noopener"
style={ {
textDecoration: 'none',
display: 'inline-flex',
alignItems: 'center',
} }
/>
),
icon: (
<Icon
size={ 10 }
icon="external"
style={ { marginLeft: 0 } }
/>
),
span: <div />,
}
),
},
};

if ( cleanupAllowed === 'yes' ) {
Expand Down
1 change: 0 additions & 1 deletion onboarding/src/Components/ImportProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const ImportProgress = ( { currentStep, actionsNb, actionsDone } ) => {
'Installing Performance Features',
'templates-patterns-collection'
),
hyveLite: __( 'Installing Chatbot', 'templates-patterns-collection' ),
};

const increaseAmount = 100 / ( actionsNb + 1 );
Expand Down
1 change: 0 additions & 1 deletion onboarding/src/Components/Onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const Onboarding = ( { step, themeData } ) => {
widgets: true,
cleanup: false,
performanceAddon: true,
hyveLite: true,
theme_install: themeData !== false,
} );
const [ importing, setImporting ] = useState( false );
Expand Down
35 changes: 3 additions & 32 deletions onboarding/src/Components/Steps/Import.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ const Import = ( {
function runImportPlugins() {
if (
! pluginOptions &&
! general.performanceAddon &&
! general.hyveLite
! general.performanceAddon
) {
console.log( '[S] Plugins.' );
runImportContent();
Expand Down Expand Up @@ -231,7 +230,7 @@ const Import = ( {
function runPerformanceAddonInstall() {
if ( ! general.performanceAddon ) {
console.log( '[S] Performance Addon.' );
runHyveLiteInstall();
importDone();
return false;
}
setCurrentStep( 'performanceAddon' );
Expand All @@ -245,37 +244,13 @@ const Import = ( {
}
console.log( '[D] Performance Addon.' );
setActionsDone( ( prevActionsDone ) => prevActionsDone + 1 );
runHyveLiteInstall();
importDone();
} )
.catch( ( incomingError ) =>
handleError( incomingError, 'performanceAddon' )
);
}

function runHyveLiteInstall() {
if ( ! general.hyveLite ) {
console.log( '[S] Hyve Lite.' );
importDone();
return false;
}
setCurrentStep( 'hyveLite' );
console.log( '[P] Hyve Lite.' );

installPlugins( { 'hyve-lite': true } )
.then( ( response ) => {
if ( ! response.success ) {
handleError( response, 'hyveLite' );
return false;
}
console.log( '[D] Hyve Lite.' );
setActionsDone( ( prevActionsDone ) => prevActionsDone + 1 );
setTimeout( importDone, 2000 );
} )
.catch( ( incomingError ) =>
handleError( incomingError, 'hyveLite' )
);
}

function importDone() {
setCurrentStep( 'done' );
tiobDash.cleanupAllowed = 'yes';
Expand Down Expand Up @@ -311,10 +286,6 @@ const Import = ( {
'Something went wrong while installing the performance addon.',
'templates-patterns-collection'
),
hyveLite: __(
'Something went wrong while installing the Hyve Lite theme.',
'templates-patterns-collection'
),
};

setError(
Expand Down

0 comments on commit 2c501c1

Please sign in to comment.