-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RDV: Use the tour only on a subset of the pages #40687
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fixed | ||
|
||
Enable the tour only on a subset of the Removed duplicate views screens. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,16 +116,19 @@ | |
} | ||
add_filter( 'pre_update_option_wpcom_admin_interface', 'wpcom_admin_interface_pre_update_option', 10, 2 ); | ||
|
||
const WPCOM_DUPLICATED_VIEW = array( | ||
const WPCOM_DUPLICATE_VIEW_WITH_TOUR = array( | ||
'edit.php', | ||
'admin.php?page=stats', | ||
'tools.php?page=advertising', | ||
'edit.php?post_type=jetpack-portfolio', | ||
'edit.php?post_type=jetpack-testimonial', | ||
'edit-comments.php', | ||
'edit-tags.php?taxonomy=category', | ||
'edit-tags.php?taxonomy=post_tag', | ||
); | ||
const WPCOM_DUPLICATED_VIEW = array( | ||
Check warning on line 127 in projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-interface/wpcom-admin-interface.php GitHub Actions / PHP Code Sniffer (non-excluded files only)
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like we're going to need to duplicate the previous array |
||
...WPCOM_DUPLICATE_VIEW_WITH_TOUR, | ||
Check failure on line 128 in projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-interface/wpcom-admin-interface.php GitHub Actions / dev branch for PHP 8.0
Check failure on line 128 in projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-interface/wpcom-admin-interface.php GitHub Actions / PHP Compatibility
|
||
'admin.php?page=stats', | ||
'tools.php?page=advertising', | ||
); | ||
|
||
/** | ||
* Get the current screen section. | ||
|
@@ -462,7 +465,7 @@ | |
|
||
$current_screen = wpcom_admin_get_current_screen(); | ||
|
||
if ( ! in_array( $current_screen, WPCOM_DUPLICATED_VIEW, true ) ) { | ||
if ( ! in_array( $current_screen, WPCOM_DUPLICATE_VIEW_WITH_TOUR, true ) ) { | ||
return; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the tour is the differentiating factor here. The "View" switcher is also hidden on all these screens, and it should remain visible on screens like
admin.php?page=stats
ortools.php?page=advertising
.Actually, I think adding
admin.php?page=stats
andtools.php?page=advertising
to they array of duplicate views was a mistake, because we are not removing the duplicate Calypso screens for those (which is why we don't show the tour and why we don't hide the switcher).Due to that, I think it'd be less confusing if we have these two arrays:
WPCOM_DUPLICATE_VIEW
: Lists of WP Admin paths whose Calypso counterpart has been removed, and therefore we need to:WPCOM_CLASSIC_INTERFACE_PATHS
: List of WP Admin paths not enabled for the Default admin interface (e.g. Jetpack Stats, Advertising Tools) that can be accessed from a enforced WP Admin viewThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmtr this PR it's now redundant and replaced by #40690.
I should've closed it yesterday, but forgot. Sorry!