Skip to content

Commit

Permalink
Generate query string for the JITM request (#31809)
Browse files Browse the repository at this point in the history
* [not verified] use query string for JITM request

* changelog

* add the search term to the query parameter

* bump package version

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/5552718007
  • Loading branch information
gcsecsey authored and matticbot committed Jul 14, 2023
1 parent a98c519 commit c4d0f70
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 60 deletions.
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-jitm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.13-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Generate query string when using the WPCOM API to fetch JITMs

## [2.3.12] - 2023-07-11
### Changed
- Updated package dependencies. [#31785]
Expand Down Expand Up @@ -597,6 +604,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Update Jetpack to use new JITM package

[2.3.13-alpha]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.12...v2.3.13-alpha
[2.3.12]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.11...v2.3.12
[2.3.11]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.10...v2.3.11
[2.3.10]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.9...v2.3.10
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class JITM {

const PACKAGE_VERSION = '2.3.12';
const PACKAGE_VERSION = '2.3.13-alpha';

/**
* The configuration method that is called from the jetpack-config package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public function get_messages( $message_path, $query, $full_jp_logo_exists ) {
array(
'external_user_id' => urlencode_deep( $user->ID ),
'user_roles' => urlencode_deep( $user_roles ),
'query_string' => urlencode_deep( $query ),
'query_string' => urlencode_deep( build_query( $query ) ),
'mobile_browser' => Device_Detection::is_smartphone() ? 1 : 0,
'_locale' => get_user_locale(),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ public static function get_jitm_message( $request ) {
return array();
}

return $jitm->get_messages( $request['message_path'], urldecode_deep( $request['query'] ), 'true' === $request['full_jp_logo_exists'] ? true : false );
// add the search term to the query params if it exists
$query = $request['query'];
if ( ! empty( $request['s'] ) ) {
$query['s'] = $request['s'];
}

return $jitm->get_messages( $request['message_path'], urldecode_deep( $query ), 'true' === $request['full_jp_logo_exists'] ? true : false );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"automattic/jetpack-admin-ui": "^0.2.20",
"automattic/jetpack-assets": "^1.18.7",
"automattic/jetpack-connection": "^1.54.0-alpha",
"automattic/jetpack-jitm": "^2.3.12",
"automattic/jetpack-jitm": "^2.3.13-alpha",
"automattic/jetpack-licensing": "^1.8.2",
"automattic/jetpack-plugins-installer": "^0.2.4",
"automattic/jetpack-redirect": "^1.7.25",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
),
'jetpack-jitm' => array(
'path' => 'jetpack_vendor/automattic/jetpack-jitm',
'ver' => '2.3.12',
'ver' => '2.3.13-alpha1689327552',
),
'jetpack-licensing' => array(
'path' => 'jetpack_vendor/automattic/jetpack-licensing',
Expand Down
52 changes: 26 additions & 26 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
"reference": "003239c395ac3c3ed445c440c7a2af169a8fe0ef"
"reference": "f1f65860e2f21b59320d3f14627b0ec396ec5d71"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.7-alpha",
Expand Down Expand Up @@ -57,7 +57,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
"reference": "0337417cdf7256047e8e4bc462fc38e8bdad8043"
"reference": "a0af393536fac3f5876a2f67ef49d9ceee5377aa"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.7-alpha",
Expand Down Expand Up @@ -119,7 +119,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
"reference": "5c689f7ede9d23543c0871b7d75f2599d340e201"
"reference": "d961853faaeca1d60495762e249ed66c636f53f2"
},
"require": {
"automattic/jetpack-constants": "^1.6.22"
Expand Down Expand Up @@ -187,7 +187,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-autoloader",
"reference": "15ad5fd2d49e04c7568248fd7e0b2f7637a4f211"
"reference": "dff45816956d9d8e03f607fb17990a6e9e098afb"
},
"require": {
"composer-plugin-api": "^1.1 || ^2.0"
Expand Down Expand Up @@ -249,7 +249,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-backup",
"reference": "06a500b1b22edb9fea9d3e5406892521c3abdef9"
"reference": "c3f0eb12517ac959b3d236b35b126c27405529b3"
},
"require": {
"automattic/jetpack-admin-ui": "^0.2.20",
Expand Down Expand Up @@ -337,7 +337,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin",
"reference": "07c5e74d02d9a5aea7c39f4ef0e99a58673ef211"
"reference": "3be90a0f7b8d5b09b6c66ca142e7e7be32edfbaa"
},
"require": {
"composer-plugin-api": "^2.1.0"
Expand Down Expand Up @@ -396,7 +396,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
"reference": "14bf95598093b35703be93176416ec8696d78fb2"
"reference": "ce9e8b2c2ad150e8309eec1e644ffd8e4d728c4b"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.7-alpha"
Expand Down Expand Up @@ -438,7 +438,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
"reference": "0e2d2ea517717218705452ea185f0346e0741be2"
"reference": "44145c761c824061093ff510d94c35a70367a427"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^1.4.20",
Expand Down Expand Up @@ -516,7 +516,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
"reference": "ff447b1efbfc9ec5925461610b7f8de75338437f"
"reference": "6317e88225a721e26de7dcc530edf1f8d88c8587"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.7-alpha",
Expand Down Expand Up @@ -567,7 +567,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
"reference": "80494c9d9359e40111383e45aacd9d9247194168"
"reference": "6cde7bfb902d86c2427203c9f93d62c039645801"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.7-alpha",
Expand Down Expand Up @@ -617,7 +617,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-identity-crisis",
"reference": "d55d1e78fd176df1c7cefe8704f376755141940f"
"reference": "4b83ec0139686629e5ab26280663e5ab21aaf43a"
},
"require": {
"automattic/jetpack-assets": "^1.18.7",
Expand Down Expand Up @@ -695,7 +695,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
"reference": "edf4b3949a59e5c5354cb5ff12f1aa84dba2679e"
"reference": "19654c8571e8f9869dd5f53c085a4376749a5836"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.7-alpha",
Expand Down Expand Up @@ -745,12 +745,12 @@
},
{
"name": "automattic/jetpack-jitm",
"version": "2.3.12",
"version_normalized": "2.3.12.0",
"version": "2.3.13-alpha.1689327552",
"version_normalized": "2.3.13.0-alpha1689327552",
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
"reference": "49b2b57bf2941b1e2d9ca3d592326adc7e00796c"
"reference": "ac1612d6af7787249c62e326c7d1af1f98baada5"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^1.4.20",
Expand Down Expand Up @@ -825,7 +825,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-licensing",
"reference": "f09de48e1cbb7ecdd7ae0c7df217f5e108f9f5a7"
"reference": "4adffd3e2d9e342286f8c706543391dc4172fd8a"
},
"require": {
"automattic/jetpack-connection": "^1.54.0-alpha"
Expand Down Expand Up @@ -886,7 +886,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
"reference": "52c53c9cccf195a68732f2514b92f51af707c64e"
"reference": "32fa68fb68f779dd4dad3212420e16296a370b2e"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.7-alpha",
Expand Down Expand Up @@ -936,14 +936,14 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-my-jetpack",
"reference": "44e9945a41b7a15850aea45772592121d068ae3c"
"reference": "82c6b46ea3168ea3f22aa3d01ff3899e8f413d66"
},
"require": {
"automattic/jetpack-admin-ui": "^0.2.20",
"automattic/jetpack-assets": "^1.18.7",
"automattic/jetpack-connection": "^1.54.0-alpha",
"automattic/jetpack-constants": "^1.6.22",
"automattic/jetpack-jitm": "^2.3.12",
"automattic/jetpack-jitm": "^2.3.13-alpha",
"automattic/jetpack-licensing": "^1.8.2",
"automattic/jetpack-plugins-installer": "^0.2.4",
"automattic/jetpack-redirect": "^1.7.25"
Expand Down Expand Up @@ -1026,7 +1026,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-partner",
"reference": "20bf54146a748aff111a442c5963a9d32b90e4bc"
"reference": "c6508afa824e9bd7bd0b551444ad549fbe996b4a"
},
"require": {
"automattic/jetpack-connection": "^1.54.0-alpha",
Expand Down Expand Up @@ -1088,7 +1088,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
"reference": "0ba7d06c441eb59f1b5d6a58d576b94e6577d213"
"reference": "f58983bf331d56b7162d0dd3d69793db64caf239"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.7-alpha",
Expand Down Expand Up @@ -1146,7 +1146,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plugins-installer",
"reference": "bbc5892c8a0194fab4ee3da8605b61d792b2e001"
"reference": "e65c3b689f056d23531d679b61194a8039c72be5"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^1.4.20"
Expand Down Expand Up @@ -1200,7 +1200,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
"reference": "723f617c18ef57a91577046bd3b914ce9b7a0195"
"reference": "fb58153c9d57a5365d3227120f7a470a831b1d7f"
},
"require": {
"automattic/jetpack-status": "^1.17.2"
Expand Down Expand Up @@ -1254,7 +1254,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
"reference": "61ebccdcd256d8bb96a6e0d1456178efde24d439"
"reference": "958e997c18dde43edafcd45014ab6afc8f295590"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.7-alpha",
Expand Down Expand Up @@ -1305,7 +1305,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
"reference": "af2bb80389e5ad705d9454aa7dce6d9f48f0e9e2"
"reference": "6b79e1fbe74b304dcf74938716a4f916640b7319"
},
"require": {
"automattic/jetpack-constants": "^1.6.22"
Expand Down Expand Up @@ -1360,7 +1360,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
"reference": "dc078a8286e859cebf65b75acaeea71ca4460f21"
"reference": "08d36fea7ef6b9d27f18ff1ceff6cd553f86f3ca"
},
"require": {
"automattic/jetpack-connection": "^1.54.0-alpha",
Expand Down
Loading

0 comments on commit c4d0f70

Please sign in to comment.