Skip to content
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

Sensei Tailored Flow #71406

Merged
merged 182 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
c0b703a
Create VideoPress Onboarding v2 stepper structure. (#67454)
pgk Sep 8, 2022
3bd4ee6
VideoPress site options step (WIP) (#67501)
thedebian Sep 12, 2022
a61b5c1
VideoPress Onboarding v2: Account Step (#67552)
pgk Sep 12, 2022
e23b7a9
Videopress onboarding v2: domain selection (#67596)
thedebian Sep 13, 2022
91473b6
Videopress onboarding: plan selection (#67643)
thedebian Sep 13, 2022
bc3b533
Videopress onboarding v2 global style (#67736)
thedebian Sep 15, 2022
8836f41
VideoPress Onboarding v2: Site options refined (#67790)
thedebian Sep 16, 2022
72791ac
VideoPress onboarding v2 : choose a domain step refined (#67857)
thedebian Sep 16, 2022
5d3dbb7
Add classname to body so we can target VideoPress stepper specificall…
thedebian Sep 16, 2022
e2e84b3
Actually create a site on VideoPress Onboarding flow v2. (#67912)
pgk Sep 16, 2022
a31e088
VideoPress Onboarding V2: Intro View (#67613)
roundhill Sep 22, 2022
f476842
Videopress onboarding v2 : plan selection refined (#67916)
thedebian Sep 22, 2022
4e09fdc
VP Onboarding: clear onboarding site options on flow start and flow c…
jgcaruso Sep 26, 2022
58f0a2c
Update/videopress onboarding v2 site creation (#68196)
thedebian Sep 29, 2022
c7677f0
VideoPress onboarding v2 : steps validation (#68280)
thedebian Sep 29, 2022
9bf615e
VideoPress onboarding v2 : buttons feedback (#68336)
thedebian Sep 29, 2022
7f48892
Update/videopress onboarding v2 processing step (#68349)
thedebian Sep 29, 2022
a4970d6
Use plan product for checkout URL instead of periodAgnosticSlug (#68438)
thedebian Sep 30, 2022
089c1ed
Adding new launchpad flow for VideoPress! (#67692)
roundhill Oct 5, 2022
4f22fb4
Videomaker Onboarding: Add theme selection step (#68721)
roundhill Oct 11, 2022
8e9f00a
Add transitions to the VideoPress flow (#68913)
thedebian Oct 12, 2022
1cd2ff4
Fix launchpad to use actionDispatch and not immediately redirect
thedebian Oct 12, 2022
1783a1c
Adding changes from #68787 due to merge conflict mess.
roundhill Oct 12, 2022
7e31900
Code style fixes.
roundhill Oct 12, 2022
1e36a8f
Handling currentUser in case of null.
roundhill Oct 12, 2022
31d2abe
Disabling typescript "any" warnings.
roundhill Oct 12, 2022
316b93a
More eslint "any" disables for code not changed in this PR.
roundhill Oct 12, 2022
506cba9
Style lint fixes.
roundhill Oct 12, 2022
3e08282
Merge branch 'trunk' into add/videopress-onboarding-v2
roundhill Oct 13, 2022
8de742e
Add skip action to "already own a domain"
thedebian Oct 14, 2022
86eeb59
VideoPress Onboarding intro: Display first video frame while video is…
thedebian Oct 17, 2022
1681c6f
Merge branch 'trunk' into add/videopress-onboarding-v2
roundhill Oct 17, 2022
18d5f31
Fixed issue where site options were not being set which caused the la…
roundhill Oct 17, 2022
259e39c
Unintentionally removed an import line.
roundhill Oct 17, 2022
80a9589
Addressing design feedback for intro page.
roundhill Oct 18, 2022
5ded45d
Style adjustments
thedebian Oct 19, 2022
6fd92c1
Style adjustments for theme picker
thedebian Oct 19, 2022
e456950
Revert powered by videopress absolute position
thedebian Oct 19, 2022
2b0db8b
Header margin adjustments
thedebian Oct 19, 2022
f492ad6
Customize processing step page
thedebian Oct 19, 2022
488d0d5
Launchpad, use computer as default preview device if window width >= …
thedebian Oct 19, 2022
dc7ed35
Launchpad, yellowize the thing
thedebian Oct 19, 2022
3ab71c8
Powered by VideoPress always at bottom.
pgk Oct 19, 2022
d5de5a6
Goto /start/videopress-account/user for account creation.
pgk Oct 19, 2022
4eaf9ff
Show the progress bar on the VideoPress user account view.
roundhill Oct 19, 2022
5e757a6
VideoPress Launchpad: enable preview interactions.
pgk Oct 20, 2022
8bba159
Fixed stacked theme buttons when screen was medium to large size.
roundhill Oct 24, 2022
6e39fc2
Merge branch 'trunk' into add/videopress-onboarding-v2
roundhill Oct 24, 2022
e77ae52
Substract 10px to 100vh to compute the stepper min height
thedebian Oct 26, 2022
f16056d
Sensei Onboarding - Implement senseiSetup step.
dadish Oct 28, 2022
529bffb
Sensei Onboarding - Implement senseiPlan step.
dadish Oct 28, 2022
85eed8b
Sensei Onboarding - Implement senseiLaunch step.
dadish Oct 31, 2022
d1d64d5
Sensei Onboarding - Refactor SenseiStepContent into SenseiStepContainer.
dadish Nov 1, 2022
a438a5f
Create VideoPress Onboarding v2 stepper structure. (#67454)
pgk Sep 8, 2022
a614f3e
VideoPress site options step (WIP) (#67501)
thedebian Sep 12, 2022
c5d2776
VideoPress Onboarding v2: Account Step (#67552)
pgk Sep 12, 2022
0488990
Videopress onboarding v2: domain selection (#67596)
thedebian Sep 13, 2022
be43190
Videopress onboarding: plan selection (#67643)
thedebian Sep 13, 2022
379e200
Videopress onboarding v2 global style (#67736)
thedebian Sep 15, 2022
c3c3652
VideoPress Onboarding v2: Site options refined (#67790)
thedebian Sep 16, 2022
ea5d90b
VideoPress onboarding v2 : choose a domain step refined (#67857)
thedebian Sep 16, 2022
fe95821
Add classname to body so we can target VideoPress stepper specificall…
thedebian Sep 16, 2022
1dd7d9a
Actually create a site on VideoPress Onboarding flow v2. (#67912)
pgk Sep 16, 2022
71ef106
VideoPress Onboarding V2: Intro View (#67613)
roundhill Sep 22, 2022
4f2bbc0
Videopress onboarding v2 : plan selection refined (#67916)
thedebian Sep 22, 2022
21fdbc4
VP Onboarding: clear onboarding site options on flow start and flow c…
jgcaruso Sep 26, 2022
99e765d
Update/videopress onboarding v2 site creation (#68196)
thedebian Sep 29, 2022
532f5de
VideoPress onboarding v2 : steps validation (#68280)
thedebian Sep 29, 2022
463c71b
VideoPress onboarding v2 : buttons feedback (#68336)
thedebian Sep 29, 2022
83a0bd8
Update/videopress onboarding v2 processing step (#68349)
thedebian Sep 29, 2022
3623a21
Use plan product for checkout URL instead of periodAgnosticSlug (#68438)
thedebian Sep 30, 2022
e48d8c8
Adding new launchpad flow for VideoPress! (#67692)
roundhill Oct 5, 2022
eb7f9b6
Videomaker Onboarding: Add theme selection step (#68721)
roundhill Oct 11, 2022
f724053
Add transitions to the VideoPress flow (#68913)
thedebian Oct 12, 2022
6fc9328
Fix launchpad to use actionDispatch and not immediately redirect
thedebian Oct 12, 2022
7967ec2
Adding changes from #68787 due to merge conflict mess.
roundhill Oct 12, 2022
48373ac
Code style fixes.
roundhill Oct 12, 2022
0538bbe
Handling currentUser in case of null.
roundhill Oct 12, 2022
41d5de0
Disabling typescript "any" warnings.
roundhill Oct 12, 2022
4b60904
More eslint "any" disables for code not changed in this PR.
roundhill Oct 12, 2022
654e394
Style lint fixes.
roundhill Oct 12, 2022
216acea
Add skip action to "already own a domain"
thedebian Oct 14, 2022
21445cd
VideoPress Onboarding intro: Display first video frame while video is…
thedebian Oct 17, 2022
1e47595
Fixed issue where site options were not being set which caused the la…
roundhill Oct 17, 2022
6fd30e9
Unintentionally removed an import line.
roundhill Oct 17, 2022
4d21f66
Addressing design feedback for intro page.
roundhill Oct 18, 2022
13e04b2
Style adjustments
thedebian Oct 19, 2022
d8b498d
Style adjustments for theme picker
thedebian Oct 19, 2022
ffa8cab
Revert powered by videopress absolute position
thedebian Oct 19, 2022
37d332f
Header margin adjustments
thedebian Oct 19, 2022
c221545
Customize processing step page
thedebian Oct 19, 2022
6408628
Launchpad, use computer as default preview device if window width >= …
thedebian Oct 19, 2022
6b3964b
Launchpad, yellowize the thing
thedebian Oct 19, 2022
50668cb
Powered by VideoPress always at bottom.
pgk Oct 19, 2022
90b1674
Goto /start/videopress-account/user for account creation.
pgk Oct 19, 2022
8895a8d
Show the progress bar on the VideoPress user account view.
roundhill Oct 19, 2022
385712e
VideoPress Launchpad: enable preview interactions.
pgk Oct 20, 2022
a1d9e44
Fixed stacked theme buttons when screen was medium to large size.
roundhill Oct 24, 2022
bfcfd9c
Substract 10px to 100vh to compute the stepper min height
thedebian Oct 26, 2022
7529411
Video Onboarding: Add video upload celebration modal 🎉 (#69394)
roundhill Oct 27, 2022
35ae766
Fix errors introduced from upstream.
roundhill Nov 1, 2022
6f15b4c
Update packages/data-stores/src/onboard/actions.ts
roundhill Nov 1, 2022
3b5b88c
Removing unused i18n import.
roundhill Nov 1, 2022
aad30d6
Merge branch 'add/videopress-onboarding-v2' of github.com:Automattic/…
roundhill Nov 1, 2022
f63aa78
Adding config for VideoPress flow. Enabled for dev, horizon, staging …
roundhill Nov 1, 2022
cc99ab1
Fixing styles for `is-primary` button.
roundhill Nov 1, 2022
905a1ff
Update and style sensei domain select step
mikeyarce Nov 3, 2022
49d7a37
Fix style issues
mikeyarce Nov 3, 2022
6fe8c42
Update client/landing/stepper/declarative-flow/internals/videopress.scss
roundhill Nov 7, 2022
53730c7
Merge branch "trunk" into add/videopress-onboarding-v2
roundhill Nov 7, 2022
37f6853
Style lint fix.
roundhill Nov 7, 2022
61f4b62
Add type cast to help with tests.
roundhill Nov 7, 2022
7fede56
Fix redirect urls to use new path structure instead of using the `flo…
roundhill Nov 8, 2022
46e61ce
Style the new email activation banner to fit with the VideoPress onbo…
roundhill Nov 8, 2022
a138225
Merge branch 'add/videopress-onboarding-v2' into add/sensei-onboarding
dadish Nov 9, 2022
d6cf075
Merge branch 'trunk' into add/sensei-onboarding-updated
dadish Nov 11, 2022
86cea4a
Sensei Domain onboarding screen (#69836)
mikeyarce Nov 11, 2022
7a832b4
Add Sensei title and style onboarding screen (#69835)
mikeyarce Nov 11, 2022
d8ee2b5
Merge branch 'trunk' into add/sensei-onboarding
dadish Nov 14, 2022
e98711d
Update sensei onboarding responsive styles and images (#69971)
mikeyarce Nov 15, 2022
a6061b2
Merge branch 'trunk' into add/sensei-onboarding
dadish Nov 16, 2022
0502ddd
Add “sensei” vendor for custom domain suggestions
mikeyarce Nov 17, 2022
742bdc1
Sensei Onboarding - Introduce SenseiStepProgress component. (#69657)
dadish Nov 21, 2022
cb78dfb
Merge branch 'trunk' into add/sensei-onboarding
dadish Nov 21, 2022
0225048
Add/plan selection design (#69741)
dadish Nov 22, 2022
db7232d
Merge branch 'trunk' into add/sensei-onboarding
dadish Nov 22, 2022
3809c7a
Merge branch 'trunk' into add/sensei-onboarding
dadish Nov 22, 2022
c369cb8
Add/sensei launchpad (#70066)
dadish Nov 25, 2022
dcb0886
Update colors to be consistent with designs (#70451)
mikeyarce Nov 28, 2022
c158ec7
Add progress bar animations (#70411)
gikaragia Nov 29, 2022
5d80f63
Merge branch 'trunk' into add/sensei-onboarding
dadish Nov 29, 2022
7e2a757
Merge branch 'trunk' into add/sensei-onboarding
dadish Nov 29, 2022
8ff1071
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 1, 2022
bc4e539
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 5, 2022
c059909
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 6, 2022
7c9aebb
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 6, 2022
3a8589a
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 7, 2022
50879ee
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 8, 2022
824394d
Add animation to theme style previews (#70581)
yscik Dec 8, 2022
4e78102
Sensei Onboarding - Fix the Sensei Bundle price. (#70772)
dadish Dec 9, 2022
34d5663
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 9, 2022
ed4d25a
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 13, 2022
269790c
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 19, 2022
8f8cb25
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 20, 2022
6478ca3
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 20, 2022
d48077a
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 21, 2022
b697308
Sensei Onboarding - Wire up Course Theme style variations with Sensei…
dadish Dec 21, 2022
9cb826f
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 21, 2022
81b433b
Merge branch 'trunk' into add/sensei-onboarding
dadish Dec 22, 2022
1783b4c
Add fallback fonts
gikaragia Jan 12, 2023
0cd1756
Move scss file outside internals directory
gikaragia Jan 12, 2023
e92d551
Add sensei css variables file
gikaragia Jan 12, 2023
280af0f
Move launchpad styles to own dir
gikaragia Jan 12, 2023
2b105cd
Move rule to common css file
gikaragia Jan 12, 2023
a965d60
Change hosted wording
gikaragia Jan 12, 2023
2706444
Remove extra target
gikaragia Jan 13, 2023
e2c3807
Add Sensei feature flag
gikaragia Jan 13, 2023
d31a0e0
Move universal selectors to component
gikaragia Jan 13, 2023
ca87db2
Merge branch 'trunk' into add/sensei-onboarding
gikaragia Jan 16, 2023
0f0c192
Add site_intent to Sensei onboarding flow (#72129)
mikeyarce Jan 17, 2023
f845dc5
Remove unused variable
gikaragia Jan 19, 2023
de3b8fb
Merge branch 'trunk' into add/sensei-onboarding
gikaragia Jan 20, 2023
887f9df
Add domain type
gikaragia Jan 24, 2023
01bc742
Simplify domainSuggestion assignment
gikaragia Jan 24, 2023
10e90bf
Resolve promises in parallel
gikaragia Jan 24, 2023
3bd4789
Mark the Sensei task as disabled
gikaragia Jan 24, 2023
4ed524a
Merge branch 'trunk' into add/sensei-onboarding
gikaragia Jan 24, 2023
f2da75f
Remove deprated goNext, goToStep, goBack
gikaragia Jan 24, 2023
7e64b31
Fix createSite return type
gikaragia Jan 25, 2023
b9dce19
Resolve promises in parallel
gikaragia Jan 25, 2023
3d1308e
Remove not needed NaN check
gikaragia Jan 25, 2023
7a18d0d
Add explicit return
gikaragia Jan 25, 2023
98c14ca
Move constants to a separate file
gikaragia Jan 25, 2023
56d5254
Add retries to dependency list
gikaragia Jan 25, 2023
095f8dc
Stop using wpcomProxyRequest
gikaragia Jan 25, 2023
667560b
Do not save settings in launchpad task
gikaragia Jan 25, 2023
c7b5645
Merge branch 'trunk' into add/sensei-onboarding
gikaragia Jan 26, 2023
b656077
Make publish_first_course optional
gikaragia Jan 27, 2023
a03be43
Move sensei.scss to internals directory
gikaragia Jan 27, 2023
f3631ed
Translate flow title
gikaragia Jan 27, 2023
25f5d95
Move SenseiStepContainer in client
gikaragia Jan 27, 2023
a01f070
Merge branch 'trunk' into add/sensei-onboarding
gikaragia Jan 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions client/landing/stepper/declarative-flow/internals/sensei.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$sensei-mobile-layout-width: 1200px;
$sensei-color: #43af99;

.sensei .progress-bar__progress {
background-color: $sensei-color;
}
gikaragia marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import styled from '@emotion/styled';

export const Container = styled.div`
position: relative;
height: 100vh;
width: 100%;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
padding-top: 10px;
overflow-y: auto;
box-sizing: border-box;

* {
box-sizing: border-box;
}
`;

export const TitleContainer = styled.div`
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
margin: 32px auto 0 24px;
z-index: 1000;
`;

export const Title = styled.h1`
margin-left: 8px;
font-size: 18px;
line-height: 24px;
font-family: Recoleta, sans-serif;
`;

export const Footer = styled.div`
margin-top: auto;
padding: 56px 0;
`;

export const FooterText = styled.p`
font-size: 13px;
line-height: 20px;
color: #3c434a;
text-align: center;
&:not( :last-of-type ) {
margin-bottom: 6px;
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { SENSEI_FLOW, StepContainer } from '@automattic/onboarding';
import { ExternalLink } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { Icon, wordpress } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import React from 'react';
import { Container, TitleContainer, Title, Footer, FooterText } from './components';
import './styles.scss';

interface SenseiStepContainerProps {
stepName: string;
recordTracksEvent: ( eventName: string, eventProperties: object ) => void;
children: React.ReactNode;
}

export const SenseiStepContainer: React.FC< SenseiStepContainerProps > = ( {
children,
...props
} ) => {
const { __ } = useI18n();
return (
<StepContainer
flowName={ SENSEI_FLOW }
isWideLayout
hideFormattedHeader
shouldHideNavButtons
{ ...props }
stepContent={
<Container>
<TitleContainer>
<Icon icon={ wordpress } />
<Title>{ __( 'Course Creator' ) }</Title>
</TitleContainer>
{ children }
<Footer>
<FooterText>
{ createInterpolateElement( __( 'Hosted by <a>WordPress.com</a>' ), {
a: <ExternalLink href="https://wordpress.com" />,
} ) }
</FooterText>
<FooterText>{ __( 'Course creation and LMS tools powered by SenseiLMS' ) }</FooterText>
</Footer>
</Container>
}
/>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.sensei {
.signup-header {
display: none;
}

.step-container {
max-width: 100%;
}

.progress-bar {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 10px;
z-index: 10;
border-radius: 0;

&__progress {
border-radius: 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { FEATURE_VIDEO_UPLOADS, planHasFeature } from '@automattic/calypso-products';
import { DEVICE_TYPES } from '@automattic/components';
import { FREE_FLOW, NEWSLETTER_FLOW, BUILD_FLOW, WRITE_FLOW } from '@automattic/onboarding';
import {
FREE_FLOW,
NEWSLETTER_FLOW,
BUILD_FLOW,
WRITE_FLOW,
SENSEI_FLOW,
} from '@automattic/onboarding';
import { addQueryArgs } from '@wordpress/url';
import { useTranslate } from 'i18n-calypso';
import WebPreview from 'calypso/components/web-preview/component';
Expand All @@ -22,6 +28,7 @@ const LaunchpadSitePreview = ( {
const { globalStylesInUse, shouldLimitGlobalStyles } = usePremiumGlobalStyles();
const site = useSite();
const isInVideoPressFlow = isVideoPressFlow( flow );
const isSenseiFlow = SENSEI_FLOW === flow;

let previewUrl = siteSlug ? 'https://' + siteSlug : null;
const devicesToShow: Device[] = [ DEVICE_TYPES.COMPUTER, DEVICE_TYPES.PHONE ];
Expand All @@ -30,7 +37,7 @@ const LaunchpadSitePreview = ( {
components: { strong: <strong /> },
} );

if ( isInVideoPressFlow ) {
if ( isInVideoPressFlow || isSenseiFlow ) {
const windowWidth = window.innerWidth;
defaultDevice = windowWidth >= 1000 ? DEVICE_TYPES.COMPUTER : DEVICE_TYPES.PHONE;
const productSlug = site?.plan?.product_slug;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,23 @@ export function getEnhancedTasks(
},
};
break;
case 'sensei_setup':
taskData = {
title: translate( 'Set up Course Site' ),
completed: true,
};
break;
case 'sensei_publish_first_course':
taskData = {
title: translate( 'Publish your first Course' ),
completed:
site?.options?.launchpad_checklist_tasks_statuses?.publish_first_course || false,
gikaragia marked this conversation as resolved.
Show resolved Hide resolved
actionDispatch: () => {
recordTaskClickTracksEvent( flow, task.completed, task.id );
window.location.assign( `${ site?.URL }/wp-admin/post-new.php?post_type=course` );
},
};
break;
}
enhancedTaskList.push( { ...task, ...taskData } );
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ export const tasks: Task[] = [
taskType: 'blog',
disabled: true,
},
{
id: 'sensei_setup',
completed: true,
taskType: 'blog',
disabled: true,
},
{
id: 'sensei_publish_first_course',
completed: false,
taskType: 'blog',
disabled: false,
},
{
id: 'setup_free',
completed: true,
Expand Down Expand Up @@ -134,4 +146,5 @@ export const launchpadFlowTasks: LaunchpadFlowTaskList = {
'site_launched',
],
videopress: [ 'videopress_setup', 'plan_selected', 'videopress_upload', 'videopress_launched' ],
sensei: [ 'sensei_setup', 'plan_selected', 'sensei_publish_first_course' ],
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
LINK_IN_BIO_TLD_FLOW,
NEWSLETTER_FLOW,
VIDEOPRESS_FLOW,
SENSEI_FLOW,
FREE_FLOW,
} from '@automattic/onboarding';
import { translate } from 'i18n-calypso';
Expand Down Expand Up @@ -43,6 +44,11 @@ export function getLaunchpadTranslations( flow: string | null ): TranslatedLaunc
translatedStrings.title = translate( 'Your site is almost ready!' );
translatedStrings.launchTitle = translate( 'Your site is almost ready!' );
break;
case SENSEI_FLOW:
translatedStrings.flowName = translate( 'Sensei' );
translatedStrings.title = translate( 'Your Course Site is ready to launch!' );
translatedStrings.launchTitle = translate( 'Your Course Site is ready to launch!' );
break;
}

return translatedStrings;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* eslint-disable wpcalypso/jsx-classname-namespace */
import { useSelect, useDispatch } from '@wordpress/data';
import { useI18n } from '@wordpress/react-i18n';
import RegisterDomainStep from 'calypso/components/domains/register-domain-step';
import ReskinSideExplainer from 'calypso/components/domains/reskin-side-explainer';
import FormattedHeader from 'calypso/components/formatted-header';
import { ONBOARD_STORE, PRODUCTS_LIST_STORE } from 'calypso/landing/stepper/stores';
import { recordTracksEvent } from 'calypso/lib/analytics/tracks';
import CalypsoShoppingCartProvider from 'calypso/my-sites/checkout/calypso-shopping-cart-provider';
import { SenseiStepContainer } from '../components/sensei-step-container';
import type { Step } from '../../types';

import './style.scss';

const SenseiDomain: Step = ( { navigation } ) => {
const { submit } = navigation;
const { __ } = useI18n();
const [ siteTitle, domain, productsList ] = useSelect( ( select ) => {
return [
select( ONBOARD_STORE ).getSelectedSiteTitle(),
select( ONBOARD_STORE ).getSelectedDomain(),
select( PRODUCTS_LIST_STORE ).getProductsList(),
];
} );
const { setDomain } = useDispatch( ONBOARD_STORE );

const onSkip = () => {
setDomain( domain );
submit?.( { domain: domain } );
};

const onAddDomain = ( selectedDomain: typeof domain ) => {
setDomain( selectedDomain );
submit?.( { domain: selectedDomain } );
};

const domainSuggestion = domain?.domain_name ?? siteTitle;

return (
<SenseiStepContainer stepName="senseiDomain" recordTracksEvent={ recordTracksEvent }>
<CalypsoShoppingCartProvider>
<FormattedHeader
id="choose-a-domain-header"
headerText="Choose a domain"
subHeaderText={
<>
{ __( 'Make your course site shine with a custom domain. Not sure yet ?' ) }
<button
className="button navigation-link step-container__navigation-link has-underline is-borderless"
onClick={ onSkip }
>
{ __( 'Decide later.' ) }
</button>
</>
}
align="center"
/>
<div className="container domains__step-content domains__step-content-domain-step">
<RegisterDomainStep
vendor="sensei"
key="domainForm"
suggestion={ domainSuggestion }
domainsWithPlansOnly={ true }
isSignupStep={ true }
includeWordPressDotCom
onAddDomain={ onAddDomain }
onSkip={ onSkip }
products={ productsList }
useProvidedProductsList
align="left"
isWideLayout={ true }
basePath=""
/>
<div className="domains__domain-side-content-container">
<div className="domains__domain-side-content domains__free-domain">
<ReskinSideExplainer onClick={ onSkip } type="free-domain-explainer" />
</div>
<div className="domains__domain-side-content">
<ReskinSideExplainer onClick={ onSkip } type="use-your-domain" />
</div>
</div>
</div>
</CalypsoShoppingCartProvider>
</SenseiStepContainer>
);
};

export default SenseiDomain;