Skip to content

Commit 9ed7ed0

Browse files
p-jacksonmatticbot
authored andcommitted
Remove the launchpad's updated_write_tasklist param (#42560)
* Remove the launchpad's updated_write_tasklist param The publish a blog project changes have deployed in Calypso, and the updated_write_tasklist param is now always set to true. This means we can clean up this temporary flag from Jetpack. * changelog Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/13960445895 Upstream-Ref: Automattic/jetpack@1794810
1 parent 9a695d7 commit 9ed7ed0

5 files changed

+12
-88
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ This is an alpha version! The changes listed here are not final.
8181
- Launchpad: Replace newsletter preview task with launch task
8282
- Launchpad: show site title task in updated write launchpad
8383
- Launchpad: update copy for adding subscribers to a site
84+
- Launchpad: updated_write_tasklist param no longer needed
8485
- Launchpad: Update select a design step allowing user to interact with it
8586
- Launchpad: Update tasks so sites created through onboarding have different design task links
8687
- Launchpad: verify email task uses heuristic for visibility, regardless of experiment cohort

src/features/launchpad/class-launchpad-task-lists.php

+4-7
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,10 @@ public function get_all_tasks() {
375375
*
376376
* @param string $id Task list id.
377377
* @param string|null $launchpad_context Optional. Screen in which launchpad is loading.
378-
* @param bool $updated_write_tasklist Optional. Whether we're using the updated `write` task list.
379378
*
380379
* @return Task[] Collection of tasks associated with a task list.
381380
*/
382-
public function build( $id, $launchpad_context = null, $updated_write_tasklist = false ) {
381+
public function build( $id, $launchpad_context = null ) {
383382
$task_list = $this->get_task_list( $id );
384383
$tasks_for_task_list = array();
385384

@@ -396,7 +395,7 @@ public function build( $id, $launchpad_context = null, $updated_write_tasklist =
396395
$task_definition = $this->get_task( $task_id );
397396

398397
// if task can't be found don't add anything
399-
if ( $this->is_visible( $task_definition, $launchpad_context, $updated_write_tasklist ) ) {
398+
if ( $this->is_visible( $task_definition, $launchpad_context ) ) {
400399
$tasks_for_task_list[] = $this->build_task( $task_definition, $launchpad_context );
401400
}
402401
}
@@ -410,17 +409,15 @@ public function build( $id, $launchpad_context = null, $updated_write_tasklist =
410409
*
411410
* @param Task $task_definition A task definition.
412411
* @param string|null $launchpad_context Optional. Screen in which launchpad is loading.
413-
* @param bool $updated_write_tasklist Optional. Whether we're using the updated `write` task list.
414412
* @return boolean True if task is visible, false if not.
415413
*/
416-
protected function is_visible( $task_definition, $launchpad_context = null, $updated_write_tasklist = false ) {
414+
protected function is_visible( $task_definition, $launchpad_context = null ) {
417415
if ( empty( $task_definition ) ) {
418416
return false;
419417
}
420418

421419
$data = array(
422-
'launchpad_context' => $launchpad_context,
423-
'updated_write_tasklist' => $updated_write_tasklist,
420+
'launchpad_context' => $launchpad_context,
424421
);
425422

426423
return $this->load_value_from_callback( $task_definition, 'is_visible_callback', true, $data );

src/features/launchpad/launchpad-task-definitions.php

+2-46
Original file line numberDiff line numberDiff line change
@@ -380,15 +380,6 @@ function wpcom_launchpad_get_task_definitions() {
380380
},
381381
),
382382

383-
// Write tasks.
384-
'setup_write' => array(
385-
'get_title' => function () {
386-
return __( 'Set up your site', 'jetpack-mu-wpcom' );
387-
},
388-
'is_complete_callback' => '__return_true',
389-
'is_disabled_callback' => '__return_true',
390-
),
391-
392383
// Publish a Blog tasks.
393384
'complete_profile' => array(
394385
'get_title' => function () {
@@ -680,18 +671,6 @@ function wpcom_launchpad_get_task_definitions() {
680671
return '/subscribers/' . $data['site_slug_encoded'] . '#add-subscribers';
681672
},
682673
),
683-
'add_first_subscribers' => array(
684-
// We do not want this mapped to the 'subscribers_added' task, since this task supports
685-
// being marked as complete in situations where subscribers are not added.
686-
'get_title' => function () {
687-
return __( 'Add subscribers', 'jetpack-mu-wpcom' );
688-
},
689-
'is_complete_callback' => 'wpcom_launchpad_is_add_first_subscribers_completed',
690-
'is_visible_callback' => '__return_true',
691-
'get_calypso_path' => function ( $task, $default, $data ) {
692-
return '/subscribers/' . $data['site_slug_encoded'] . '#add-subscribers';
693-
},
694-
),
695674
'add_subscribe_block' => array(
696675
'get_title' => function () {
697676
return __( 'Add the Subscribe Block to your site', 'jetpack-mu-wpcom' );
@@ -2414,16 +2393,12 @@ function wpcom_launchpad_is_front_page_updated_visible() {
24142393
/**
24152394
* Determine `site_title` task visibility. The task is not visible if the name was already set.
24162395
*
2417-
* @param Task $task The task data.
2418-
* @param bool $is_visible Whether the task is currently visible.
2419-
* @param array $data Metadata about the launchpad.
2420-
*
24212396
* @return bool True if we should show the task, false otherwise.
24222397
*/
2423-
function wpcom_launchpad_is_site_title_task_visible( $task, $is_visible, $data ) {
2398+
function wpcom_launchpad_is_site_title_task_visible() {
24242399
// Hide the task if it's already completed on write intent
24252400
if (
2426-
( 'launched' === get_option( 'launch-status' ) || ! $data['updated_write_tasklist'] ) &&
2401+
( 'launched' === get_option( 'launch-status' ) ) &&
24272402
get_option( 'site_intent' ) === 'write' &&
24282403
wpcom_launchpad_is_task_option_completed( array( 'id' => 'site_title' ) )
24292404
) {
@@ -2800,25 +2775,6 @@ function wpcom_launchpad_is_domain_customize_completed( $task, $default ) {
28002775
return $default;
28012776
}
28022777

2803-
/**
2804-
* Determines whether the add_first_subscribers task is complete by checking both the task option
2805-
* and related tasks like subscribers_added and import_subscribers.
2806-
*
2807-
* This exists because we need a 1-way relationship between these tasks: completion of other
2808-
* subscriber tasks implies add_first_subscribers is completed, but completion of
2809-
* add_first_subscribers does not imply completion of other subscriber tasks. This is because
2810-
* add_first_subscribers is allowed to be marked complete at times when no subscribers are actually
2811-
* added, and why using id_map here will not work since it creates a 2-way relationship.
2812-
*
2813-
* @param Task $task The Task object.
2814-
* @return bool True if either condition is met.
2815-
*/
2816-
function wpcom_launchpad_is_add_first_subscribers_completed( $task ) {
2817-
return wpcom_launchpad_is_task_option_completed( $task )
2818-
|| wpcom_is_checklist_task_complete( 'subscribers_added' )
2819-
|| wpcom_is_checklist_task_complete( 'import_subscribers' );
2820-
}
2821-
28222778
/**
28232779
* Mark `domain_claim`, `domain_upsell`, and `domain_upsell_deferred` tasks complete
28242780
* when a domain product is activated.

src/features/launchpad/launchpad.php

+2-18
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,6 @@ function wpcom_launchpad_get_task_list_definitions() {
139139
'is_enabled_callback' => 'wpcom_launchpad_get_fullscreen_enabled',
140140
),
141141
'write' => array(
142-
'get_title' => function () {
143-
return __( 'Next steps for your site', 'jetpack-mu-wpcom' );
144-
},
145-
'task_ids' => array(
146-
'setup_write',
147-
'design_completed',
148-
'plan_selected',
149-
'verify_email',
150-
'add_first_subscribers',
151-
'first_post_published',
152-
'site_launched',
153-
),
154-
'is_enabled_callback' => 'wpcom_launchpad_get_fullscreen_enabled',
155-
),
156-
'updated-write-tasklist' => array(
157142
'get_title' => function () {
158143
return __( 'Next steps for your site', 'jetpack-mu-wpcom' );
159144
},
@@ -504,16 +489,15 @@ function wpcom_is_checklist_task_complete( $task_id ) {
504489
*
505490
* @param string $checklist_slug Checklist slug.
506491
* @param string|null $launchpad_context Optional. Screen where Launchpad is loading.
507-
* @param bool $updated_write_tasklist Optional. Whether we're using the updated `write` task list.
508492
*
509493
* @return Task[] Collection of tasks for a given checklist
510494
*/
511-
function wpcom_get_launchpad_checklist_by_checklist_slug( $checklist_slug, $launchpad_context = null, $updated_write_tasklist = false ) {
495+
function wpcom_get_launchpad_checklist_by_checklist_slug( $checklist_slug, $launchpad_context = null ) {
512496
if ( ! $checklist_slug ) {
513497
return array();
514498
}
515499

516-
return wpcom_launchpad_checklists()->build( $checklist_slug, $launchpad_context, $updated_write_tasklist );
500+
return wpcom_launchpad_checklists()->build( $checklist_slug, $launchpad_context );
517501
}
518502

519503
// TODO: Write code p2 post or dotcom post

src/features/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-launchpad.php

+3-17
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ public function register_routes() {
6262
'required' => false,
6363
'default' => array(),
6464
),
65-
'updated_write_tasklist' => array(
66-
'description' => 'Enable the updated write tasklist, for testing purposes',
67-
'type' => 'boolean',
68-
'required' => false,
69-
'default' => false,
70-
),
7165
),
7266
),
7367
array(
@@ -179,21 +173,13 @@ public function get_data( $request ) {
179173
$switched_locale = switch_to_locale( $locale );
180174
}
181175

182-
$checklist_slug = isset( $request['checklist_slug'] ) ? $request['checklist_slug'] : get_option( 'site_intent' );
183-
$use_goals = isset( $request['use_goals'] ) ? $request['use_goals'] : false;
184-
$updated_write_tasklist = isset( $request['updated_write_tasklist'] ) ? $request['updated_write_tasklist'] : false;
176+
$checklist_slug = isset( $request['checklist_slug'] ) ? $request['checklist_slug'] : get_option( 'site_intent' );
177+
$use_goals = isset( $request['use_goals'] ) ? $request['use_goals'] : false;
185178

186179
$launchpad_context = isset( $request['launchpad_context'] )
187180
? $request['launchpad_context']
188181
: null;
189182

190-
if ( $updated_write_tasklist && $checklist_slug === 'write' ) {
191-
// The updated_write_tasklist param facilitates a call-for-testing where we want
192-
// to try out changes to the write tasks. The intention is that `updated-write-tasklist`
193-
// will replace `write`, at which point updated_write_tasklist should be removed.
194-
$checklist_slug = 'updated-write-tasklist';
195-
}
196-
197183
if ( $use_goals ) {
198184
// The user must be part of a cohort which should deterine which checklist to show soley on
199185
// goal selection, not the "intent".
@@ -205,7 +191,7 @@ public function get_data( $request ) {
205191
'site_intent' => get_option( 'site_intent' ),
206192
'launchpad_screen' => get_option( 'launchpad_screen' ),
207193
'checklist_statuses' => get_option( 'launchpad_checklist_tasks_statuses', array() ),
208-
'checklist' => wpcom_get_launchpad_checklist_by_checklist_slug( $checklist_slug, $launchpad_context, $updated_write_tasklist ),
194+
'checklist' => wpcom_get_launchpad_checklist_by_checklist_slug( $checklist_slug, $launchpad_context ),
209195
'is_enabled' => wpcom_get_launchpad_task_list_is_enabled( $checklist_slug ),
210196
'is_dismissed' => wpcom_launchpad_is_task_list_dismissed( $checklist_slug ),
211197
'is_dismissible' => wpcom_launchpad_is_task_list_dismissible( $checklist_slug ),

0 commit comments

Comments
 (0)