Remove options to re-enable setup task list after completion (#52146)

* Remove re-eanble setup tasklist option

* Add changelog

* Remove re-eanble setup tasklist option from settings when setup task has previously completed

* Use is_complete check instead
This commit is contained in:
Chi-Hsuan Huang 2024-10-21 12:05:18 +08:00 committed by GitHub
parent ebc486103c
commit 9c5e7beb71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 25 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Remove re-eanble setup tasklist option

View File

@ -26,7 +26,6 @@ import HeaderImage from '../assets/completed-celebration-header.svg';
type TaskListCompletedHeaderProps = { type TaskListCompletedHeaderProps = {
hideTasks: () => void; hideTasks: () => void;
keepTasks: () => void;
customerEffortScore: boolean; customerEffortScore: boolean;
}; };
@ -47,7 +46,7 @@ function getStoreAgeInWeeks( adminInstallTimestamp: number ) {
export const TaskListCompletedHeader: React.FC< export const TaskListCompletedHeader: React.FC<
TaskListCompletedHeaderProps TaskListCompletedHeaderProps
> = ( { hideTasks, keepTasks, customerEffortScore } ) => { > = ( { hideTasks, customerEffortScore } ) => {
const { updateOptions } = useDispatch( OPTIONS_STORE_NAME ); const { updateOptions } = useDispatch( OPTIONS_STORE_NAME );
const [ showCesModal, setShowCesModal ] = useState( false ); const [ showCesModal, setShowCesModal ] = useState( false );
const [ hasSubmittedScore, setHasSubmittedScore ] = useState( false ); const [ hasSubmittedScore, setHasSubmittedScore ] = useState( false );
@ -190,14 +189,6 @@ export const TaskListCompletedHeader: React.FC<
) } ) }
renderContent={ () => ( renderContent={ () => (
<div className="woocommerce-task-card__section-controls"> <div className="woocommerce-task-card__section-controls">
<Button
onClick={ () => keepTasks() }
>
{ __(
'Show setup task list',
'woocommerce'
) }
</Button>
<Button <Button
onClick={ () => hideTasks() } onClick={ () => hideTasks() }
> >

View File

@ -12,10 +12,8 @@ import HeaderImage from '../assets/task-list-completed.svg';
export const TaskListCompleted = ( { export const TaskListCompleted = ( {
hideTasks, hideTasks,
keepTasks,
}: { }: {
hideTasks: () => void; hideTasks: () => void;
keepTasks: () => void;
} ) => { } ) => {
return ( return (
<> <>
@ -37,10 +35,7 @@ export const TaskListCompleted = ( {
'woocommerce' 'woocommerce'
) } ) }
</h2> </h2>
<Button isSecondary onClick={ keepTasks }> <Button variant="primary" onClick={ hideTasks }>
{ __( 'Keep list', 'woocommerce' ) }
</Button>
<Button isPrimary onClick={ hideTasks }>
{ __( 'Hide this list', 'woocommerce' ) } { __( 'Hide this list', 'woocommerce' ) }
</Button> </Button>
</div> </div>

View File

@ -273,14 +273,10 @@ export const SetupTaskList: React.FC< TaskListProps > = ( {
{ cesHeader ? ( { cesHeader ? (
<TaskListCompletedHeader <TaskListCompletedHeader
hideTasks={ hideTasks } hideTasks={ hideTasks }
keepTasks={ keepTasks }
customerEffortScore={ true } customerEffortScore={ true }
/> />
) : ( ) : (
<TaskListCompleted <TaskListCompleted hideTasks={ hideTasks } />
hideTasks={ hideTasks }
keepTasks={ keepTasks }
/>
) } ) }
</> </>
); );

View File

@ -83,6 +83,7 @@ class OnboardingHelper {
$help_tab['content'] .= '<p>' . __( 'If you need to access the setup wizard again, please click on the button below.', 'woocommerce' ) . '</p>' . $help_tab['content'] .= '<p>' . __( 'If you need to access the setup wizard again, please click on the button below.', 'woocommerce' ) . '</p>' .
'<p><a href="' . wc_admin_url( '&path=/setup-wizard' ) . '" class="button button-primary">' . __( 'Setup wizard', 'woocommerce' ) . '</a></p>'; '<p><a href="' . wc_admin_url( '&path=/setup-wizard' ) . '" class="button button-primary">' . __( 'Setup wizard', 'woocommerce' ) . '</a></p>';
if ( ! $setup_list->is_complete() ) {
$help_tab['content'] .= '<h3>' . __( 'Task List', 'woocommerce' ) . '</h3>'; $help_tab['content'] .= '<h3>' . __( 'Task List', 'woocommerce' ) . '</h3>';
$help_tab['content'] .= '<p>' . __( 'If you need to enable or disable the task lists, please click on the button below.', 'woocommerce' ) . '</p>' . $help_tab['content'] .= '<p>' . __( 'If you need to enable or disable the task lists, please click on the button below.', 'woocommerce' ) . '</p>' .
( $setup_list->is_hidden() ( $setup_list->is_hidden()
@ -90,6 +91,7 @@ class OnboardingHelper {
: '<p><a href="' . wc_admin_url( '&reset_task_list=0' ) . '" class="button button-primary">' . __( 'Disable', 'woocommerce' ) . '</a></p>' : '<p><a href="' . wc_admin_url( '&reset_task_list=0' ) . '" class="button button-primary">' . __( 'Disable', 'woocommerce' ) . '</a></p>'
); );
} }
}
if ( $extended_list ) { if ( $extended_list ) {
$help_tab['content'] .= '<h3>' . __( 'Extended task List', 'woocommerce' ) . '</h3>'; $help_tab['content'] .= '<h3>' . __( 'Extended task List', 'woocommerce' ) . '</h3>';