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

View File

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

View File

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

View File

@ -83,12 +83,14 @@ class OnboardingHelper {
$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>';
$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>' .
( $setup_list->is_hidden()
if ( ! $setup_list->is_complete() ) {
$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>' .
( $setup_list->is_hidden()
? '<p><a href="' . wc_admin_url( '&reset_task_list=1' ) . '" class="button button-primary">' . __( 'Enable', 'woocommerce' ) . '</a></p>'
: '<p><a href="' . wc_admin_url( '&reset_task_list=0' ) . '" class="button button-primary">' . __( 'Disable', 'woocommerce' ) . '</a></p>'
);
);
}
}
if ( $extended_list ) {