From 1f834cad0f42070398f51dc5e9f906b11eefadb6 Mon Sep 17 00:00:00 2001 From: Dylan Munson <65001528+CodeyGuyDylan@users.noreply.github.com> Date: Thu, 29 Sep 2022 15:51:13 -0600 Subject: [PATCH] [not verified] Update site type question on wp admin home (#26540) * Update site type question on banner * Update site-type banner question * changelog --- .../client/state/recommendations/reducer.js | 2 +- .../_inc/jetpack-recommendations-banner.js | 6 ++---- ...update-site-type-question-on-wp-admin-home | 4 ++++ .../class-jetpack-recommendations-banner.php | 19 +++++++++---------- .../scss/jetpack-recommendations-banner.scss | 16 ++++++---------- 5 files changed, 22 insertions(+), 25 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/update-site-type-question-on-wp-admin-home diff --git a/projects/plugins/jetpack/_inc/client/state/recommendations/reducer.js b/projects/plugins/jetpack/_inc/client/state/recommendations/reducer.js index 8428422874877..b6b4e22c3870c 100644 --- a/projects/plugins/jetpack/_inc/client/state/recommendations/reducer.js +++ b/projects/plugins/jetpack/_inc/client/state/recommendations/reducer.js @@ -296,7 +296,7 @@ export const getDataByKey = ( state, key ) => { const stepToNextStep = { 'setup-wizard-completed': 'summary', - 'banner-completed': 'woocommerce', + 'banner-completed': 'agency', 'not-started': 'site-type-question', 'site-type-question': 'agency', agency: 'woocommerce', diff --git a/projects/plugins/jetpack/_inc/jetpack-recommendations-banner.js b/projects/plugins/jetpack/_inc/jetpack-recommendations-banner.js index 142789f09a3bd..5ef6f32b83bb4 100644 --- a/projects/plugins/jetpack/_inc/jetpack-recommendations-banner.js +++ b/projects/plugins/jetpack/_inc/jetpack-recommendations-banner.js @@ -22,21 +22,19 @@ } ); recommendationsBannerContinue.on( 'click', function () { - var fieldNames = [ 'personal', 'business', 'store', 'other' ]; + var fieldNames = [ 'builder', 'store', 'personal' ]; var formData = {}; fieldNames.forEach( function ( name ) { formData[ name ] = $( "input[name='" + name + "']" ).prop( 'checked' ); } ); - $.post( jp_banner.ajax_url, { action: 'jetpack_recommendations_banner', nonce: jp_banner.nonce, personal: formData.personal, - business: formData.business, + builder: formData.builder, store: formData.store, - other: formData.other, }, function ( response ) { if ( true === response.success ) { diff --git a/projects/plugins/jetpack/changelog/update-site-type-question-on-wp-admin-home b/projects/plugins/jetpack/changelog/update-site-type-question-on-wp-admin-home new file mode 100644 index 0000000000000..1a7ce216052e4 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-site-type-question-on-wp-admin-home @@ -0,0 +1,4 @@ +Significance: minor +Type: enhancement + +Update site-type question on wp-admin banner diff --git a/projects/plugins/jetpack/class-jetpack-recommendations-banner.php b/projects/plugins/jetpack/class-jetpack-recommendations-banner.php index 0d0aa6d1e2e04..782e0efce4f9a 100644 --- a/projects/plugins/jetpack/class-jetpack-recommendations-banner.php +++ b/projects/plugins/jetpack/class-jetpack-recommendations-banner.php @@ -129,10 +129,10 @@ public static function ajax_callback() { $tracking_answers['personal'] = $value; } - if ( isset( $_REQUEST['agency'] ) && is_string( $_REQUEST['agency'] ) ) { - $value = 'true' === $_REQUEST['agency'] ? true : false; - $data['site-type-agency'] = $value; - $tracking_answers['agency'] = $value; + if ( isset( $_REQUEST['builder'] ) && is_string( $_REQUEST['builder'] ) ) { + $value = 'true' === $_REQUEST['builder'] ? true : false; + $data['site-type-agency'] = $value; + $tracking_answers['builder'] = $value; } if ( isset( $_REQUEST['store'] ) && is_string( $_REQUEST['store'] ) ) { @@ -208,19 +208,18 @@ public function render_banner() {

- +

diff --git a/projects/plugins/jetpack/scss/jetpack-recommendations-banner.scss b/projects/plugins/jetpack/scss/jetpack-recommendations-banner.scss index 3f3f891d4ce0b..022730618f988 100644 --- a/projects/plugins/jetpack/scss/jetpack-recommendations-banner.scss +++ b/projects/plugins/jetpack/scss/jetpack-recommendations-banner.scss @@ -75,7 +75,7 @@ color: var( --jp-gray-100 ); font-size: 1rem; - + @media (min-width: $jp-banner-md-breakpoint) { max-width: 600px; } @@ -100,15 +100,10 @@ } .jp-recommendations-banner__checkboxes { - display: grid; - gap: 1rem; - grid-template-rows: auto auto; - grid-template-columns: auto auto; + display: flex; + flex-direction: column; - @include breakpoint( '<480px' ) { - grid-template-rows: auto auto auto auto; - grid-template-columns: auto; - } + text-align: left; } .jp-recommendations-answer__checkbox-label { @@ -119,6 +114,7 @@ border-radius: 2px; cursor: pointer; background: $studio-white; + margin-bottom: 1rem; &.checked { background: $studio-gray-0; @@ -223,7 +219,7 @@ @include breakpoint( "<480px" ) { margin-top: 0; } - + &:hover, &:active { color: $studio-gray-100;