-
Notifications
You must be signed in to change notification settings - Fork 823
My Jetpack | Enable access to My Jetpack on WP multisite #44260
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
63625bc
My Jetpack | Enable access to My Jetpack on WP multisite
manzoorwanijk d0c1a09
Show warning for products and modules not available for multisite.
manzoorwanijk e755850
Fix unit test for plugin action links
manzoorwanijk fb643d6
Merge branch 'trunk' into fix/my-jetpack/multisite-access
manzoorwanijk 7427266
Use full words
manzoorwanijk 5d7521e
Merge branch 'trunk' into fix/my-jetpack/multisite-access
manzoorwanijk 8159e19
Use early return
manzoorwanijk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
projects/packages/my-jetpack/_inc/components/modules-list/utils.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { getScriptData } from '@automattic/jetpack-script-data'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { MyJetpackModule } from '../types'; | ||
|
||
export const JETPACK_MODULES_NOT_FOR_MULTISITE = [ 'waf', 'wordads' ]; | ||
|
||
/** | ||
* Check if a module is supported on the current site. | ||
* | ||
* @param {MyJetpackModule} $module - The module to check. | ||
* | ||
* @return True if the module is supported, false otherwise. | ||
*/ | ||
export function getModuleStatus( $module: MyJetpackModule ) { | ||
// If the module is not supported on multisite, we set the availability to false and provide a reason. | ||
if ( getScriptData().site.is_multisite ) { | ||
if ( ! JETPACK_MODULES_NOT_FOR_MULTISITE.includes( $module.module ) ) { | ||
return { | ||
isAvailable: false, | ||
reason: __( 'Not available on multisite', 'jetpack-my-jetpack' ), | ||
}; | ||
} | ||
} | ||
|
||
return { isAvailable: true }; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
projects/packages/my-jetpack/changelog/fix-my-jetpack-multisite-access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: changed | ||
|
||
Enabled My Jetpack access on WP Multisite. |
4 changes: 4 additions & 0 deletions
4
projects/packages/my-jetpack/changelog/show-warning-for-products-unavailable-for-multisite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: changed | ||
|
||
Show warning for products and modules not available for multisite. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
projects/plugins/backup/changelog/fix-my-jetpack-multisite-access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: changed | ||
|
||
My Jetpack: Enabled access to My Jetpack on WP Multisite. |
4 changes: 4 additions & 0 deletions
4
projects/plugins/boost/changelog/fix-my-jetpack-multisite-access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: changed | ||
|
||
My Jetpack: Enabled access to My Jetpack on WP Multisite. |
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/fix-my-jetpack-multisite-access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: enhancement | ||
manzoorwanijk marked this conversation as resolved.
Show resolved
Hide resolved
manzoorwanijk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
My Jetpack: Enabled access to My Jetpack on WP Multisite. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
projects/plugins/protect/changelog/fix-my-jetpack-multisite-access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: changed | ||
|
||
My Jetpack: Enabled access to My Jetpack on WP Multisite. |
4 changes: 4 additions & 0 deletions
4
projects/plugins/search/changelog/fix-my-jetpack-multisite-access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: changed | ||
|
||
My Jetpack: Enabled access to My Jetpack on WP Multisite. |
4 changes: 4 additions & 0 deletions
4
projects/plugins/social/changelog/fix-my-jetpack-multisite-access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: changed | ||
|
||
My Jetpack: Enabled access to My Jetpack on WP Multisite. |
4 changes: 4 additions & 0 deletions
4
projects/plugins/starter-plugin/changelog/fix-my-jetpack-multisite-access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: changed | ||
|
||
My Jetpack: Enabled access to My Jetpack on WP Multisite. |
4 changes: 4 additions & 0 deletions
4
projects/plugins/videopress/changelog/fix-my-jetpack-multisite-access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: changed | ||
|
||
My Jetpack: Enabled access to My Jetpack on WP Multisite. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.