-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Feature: My Jetpack Welcome Flow (#38534)
* Set WelcomeFlow structure and update WelcomeBanner (async site-only connection) (#37715) * Enhance TermsOfService component * Update MyJetpack connection hook and its usage * Update WelcomeBanner text and add async site registration on click * changelog * Add events and banner dismissal upon connection success * Update versions * Add WelcomeFlow (separate code) structure * Revert WelcomeBanner code * Update banner * Update versions * Hide notices when welcome banner is active * Code improvements * Prevent reloading on site connection * Introduce Notice templating (unify Notices) * Improve displaying notices when welcome banner is active * Improve styling of disabled 'x' button * Add evaluation form to Welcome Flow (#37790) * Enhance TermsOfService component * Update MyJetpack connection hook and its usage * Update WelcomeBanner text and add async site registration on click * changelog * Add events and banner dismissal upon connection success * Update versions * Add WelcomeFlow (separate code) structure * Revert WelcomeBanner code * Update banner * Update versions * Add evaluation form step * Add evaluation processing step and styles * Add evaluation steps to welcome flow * Replace classnames with clsx * Update image filename * Hide notices when welcome banner is active * Code improvements * Prevent reloading on site connection * Introduce Notice templating (unify Notices) * Add 'currentStep' prop to dismiss Tracks event * Add more info to dismiss Tracks event * Code improvements * Add /recommendations/evaluation endpoint handling (#38011) * Enhance TermsOfService component * Update MyJetpack connection hook and its usage * Update WelcomeBanner text and add async site registration on click * changelog * Add events and banner dismissal upon connection success * Update versions * Add WelcomeFlow (separate code) structure * Revert WelcomeBanner code * Update banner * Update versions * Add evaluation form step * Add evaluation processing step and styles * Add evaluation steps to welcome flow * Replace classnames with clsx * Update image filename * Hide notices when welcome banner is active * Code improvements * Prevent reloading on site connection * Introduce Notice templating (unify Notices) * Add 'currentStep' prop to dismiss Tracks event * Add more info to dismiss Tracks event * Code improvements * Improve mutation hook code * Add recommendations evaluation endpoint handling * Implement saving evaluation recommendations * Delete remaining reference * Code improvements and analytics * Fix code review comments * Fix phan * Fix phan 2 * Surpress other parameters * Fix phan completely * Improve Tracks events * Add Evaluation Recommendations logic (#38171) * Add ValueStore logic * Add Evaluation Recommendations logic * changelog * Fix refactor leftover * Improve querying evaluation endpoints * Code review improvements * Extend ProductCard component and create recommendations UI (#38319) * Refactor ProductCard to ts, add 'recommendation' property * Add price component and purchase button * Refactor and cleanup code * Fix backup card * Revert to short descriptions * Improve recommendation button names * Fix additional actions typing * Fix determining state of the recommended product * Fix literal translation handling (transpilation bug) * Fix checkout link redirect * Fix purchase button * Minor code review improvements * Improve handling checkout urls * Fix nitpicks * Improve handling free offerings and upgrade urls * Don't make admin flag required (as it's not required in every case now) * Fix code splitting issue * Activate plugins on 'start for free' action * Add Evaluation Recommendations context menu (#38378) * Refactor ProductCard to ts, add 'recommendation' property * Add price component and purchase button * Refactor and cleanup code * Fix backup card * Revert to short descriptions * Improve recommendation button names * Fix additional actions typing * Fix determining state of the recommended product * Fix literal translation handling (transpilation bug) * Fix boost card popover * Add delete endpoint, unify with others * Extend functionality of Welcome Banner and Evaluation Recommendations hooks * Add context menu to view layer * Fix checkout link redirect * Fix purchase button * Minor code review improvements * Improve handling checkout urls * Code review improvements * Fix nitpicks * Improve handling free offerings and upgrade urls * Don't make admin flag required (as it's not required in every case now) * Fix code splitting issue * Add recommendations initializer tweaks (#38452) * Refactor ProductCard to ts, add 'recommendation' property * Add price component and purchase button * Refactor and cleanup code * Fix backup card * Revert to short descriptions * Improve recommendation button names * Fix additional actions typing * Fix determining state of the recommended product * Fix literal translation handling (transpilation bug) * Fix boost card popover * Add delete endpoint, unify with others * Extend functionality of Welcome Banner and Evaluation Recommendations hooks * Add context menu to view layer * Add silent redBubble alerts - don't show in menu * Hide recommendations when user purchases the product * Fix checkout link redirect * Fix purchase button * Minor code review improvements * Improve handling checkout urls * Code review improvements * Fix nitpicks * Improve handling free offerings and upgrade urls * Don't make admin flag required (as it's not required in every case now) * Fix code splitting issue * Leftover after merge conflict resolution * Welcome Flow: Various tweaks and fixes (#38536) * Various tweaks and fixes * Improve layout of product card, hide boost tooltip on click * Fix Protect tooltips dependency * Display notices when in survey step * Remove red dot on survey step, don't show survey step when user is not new * Fix condition, and add comment * Improve 'start for free' actions and small fixes * Dismiss recommendations instead of deleting them * Fix condition * Redoing recommendations only happens locally * Limit recommendations to 3 * Code review fixes and disabling 'start for free' functionality * Change placement of Boost tooltip and revert click functionality * Welcome Flow: fixes and improvements pt. 2 (#38589) * Apply min-width 300px to cards * Set loading state of site connection button * Fix parsing active modules array * Update changelogger * Fix Tracks events code * Update projects/packages/my-jetpack/_inc/components/product-card/index.tsx Co-authored-by: Ian Ramos <[email protected]> --------- Co-authored-by: jboland88 <[email protected]> Co-authored-by: Ian Ramos <[email protected]>
- Loading branch information
1 parent
f46c1aa
commit 13650c1
Showing
63 changed files
with
1,758 additions
and
416 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
projects/js-packages/components/changelog/update-welcome-banner-connect
This file contains 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: added | ||
|
||
Update Welcome Banner and set async site-only connection |
This file contains 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 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 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/connection/changelog/add-evaluation-recommendations-logic
This file contains 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: added | ||
|
||
Added support for 'recommendations_evaluation' Jetpack option" |
This file contains 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 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 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 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
79 changes: 79 additions & 0 deletions
79
projects/packages/my-jetpack/_inc/components/evaluation-recommendations/index.tsx
This file contains 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,79 @@ | ||
import { Container, Col, Text } from '@automattic/jetpack-components'; | ||
import { DropdownMenu } from '@wordpress/components'; | ||
import { Flex } from '@wordpress/components'; | ||
import { FlexItem } from '@wordpress/components'; | ||
import { __, _n } from '@wordpress/i18n'; | ||
import { moreHorizontalMobile } from '@wordpress/icons'; | ||
import useEvaluationRecommendations from '../../data/evaluation-recommendations/use-evaluation-recommendations'; | ||
import { JetpackModuleToProductCard } from '../product-cards-section/all'; | ||
import styles from './style.module.scss'; | ||
|
||
const EvaluationRecommendations: React.FC = () => { | ||
const { recommendedModules, redoEvaluation, removeEvaluationResult } = | ||
useEvaluationRecommendations(); | ||
|
||
return ( | ||
<Container horizontalGap={ 2 } horizontalSpacing={ 6 }> | ||
<Col> | ||
<Flex> | ||
<FlexItem> | ||
<Text variant="headline-small" className={ styles.title }> | ||
{ _n( | ||
'Our recommendation for you', | ||
'Our recommendations for you', | ||
recommendedModules.length, | ||
'jetpack-my-jetpack' | ||
) } | ||
</Text> | ||
<Text> | ||
{ __( | ||
'Here are the features that will best help you with your site:', | ||
'jetpack-my-jetpack' | ||
) } | ||
</Text> | ||
</FlexItem> | ||
<FlexItem> | ||
<DropdownMenu | ||
menuProps={ { className: styles[ 'dropdown-menu' ] } } | ||
popoverProps={ { position: 'bottom left' } } | ||
icon={ moreHorizontalMobile } | ||
label={ __( 'Recommendations menu', 'jetpack-my-jetpack' ) } | ||
controls={ [ | ||
{ | ||
title: __( 'Redo', 'jetpack-my-jetpack' ), | ||
onClick: redoEvaluation, | ||
}, | ||
{ | ||
title: __( 'Dismiss', 'jetpack-my-jetpack' ), | ||
onClick: removeEvaluationResult, | ||
}, | ||
] } | ||
/> | ||
</FlexItem> | ||
</Flex> | ||
</Col> | ||
<Col> | ||
<Container | ||
tagName="ul" | ||
className={ styles[ 'recommendations-list' ] } | ||
horizontalGap={ 4 } | ||
horizontalSpacing={ 2 } | ||
fluid | ||
> | ||
{ recommendedModules.map( module => { | ||
const Card = JetpackModuleToProductCard[ module ]; | ||
return ( | ||
Card && ( | ||
<Col tagName="li" key={ module } lg={ 4 }> | ||
<Card recommendation /> | ||
</Col> | ||
) | ||
); | ||
} ) } | ||
</Container> | ||
</Col> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default EvaluationRecommendations; |
17 changes: 17 additions & 0 deletions
17
projects/packages/my-jetpack/_inc/components/evaluation-recommendations/style.module.scss
This file contains 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,17 @@ | ||
.title { | ||
margin-bottom: 0.75rem; | ||
} | ||
|
||
.dropdown-menu { | ||
width: 200px; | ||
} | ||
|
||
// Setting min-width of recommendation (product) cards to 300px; see: /components/product-cards-section/style.module.scss:62 | ||
@media screen and (min-width: 599px) and (max-width: 1290px) { | ||
ul.recommendations-list { | ||
grid-template-columns: repeat( auto-fill, minmax( 300px, 1fr ) ); | ||
> li { | ||
grid-column-end: auto; | ||
} | ||
} | ||
} |
This file contains 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
Oops, something went wrong.