-
Notifications
You must be signed in to change notification settings - Fork 262
feat(funnels): enable funnels on onboarding #4489
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
Open
ilasw
wants to merge
97
commits into
main
Choose a base branch
from
MI-890-feat-onboarding-funnel
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
97 commits
Select commit
Hold shift + click to select a range
77f5ba3
feat: refactor cookie handling and add onboarding boot data hook
ilasw 3bb380b
feat: add initial organic registration funnel step and component
ilasw 510da23
feat: add organic registration step to funnel background
ilasw 43d69c8
feat: add storybook stories for FunnelOrganicRegistration component
ilasw 845ef9c
refactor: update onboarding props and Organic signup UI
ilasw 5148a1e
refactor: update return type of withIsActiveGuard
ilasw f938ee8
refactor: replace useFeature with props for AuthOptions
ilasw 5e64be3
feat: add image support and auth options
ilasw 296cbc6
refactor: removed unused components, logic, and dependencies
ilasw 28c98fb
refactor: better mock for useRouter
ilasw c2ba914
feat: removed reorder experiment and unnecessary code dependencies
ilasw 959a8a2
feat: add OnboardingHeader into FunnelOrganicRegistration
ilasw 0c2219d
refactor: remove onboardingVisual feature
ilasw 85ad504
refactor: migrate onboarding auth state to Jotai and make login link …
ilasw cf6bff1
refactor: cleaned unused onboarding logic and improved store update w…
ilasw 6095d12
fix: apply SEO on Page and renamed OnboardingPage to Onboarding
ilasw 83e9c9d
refactor: extracted onboarding auth logic into custom hook
ilasw 2e1278a
refactor: simplified OnboardingHeader component and removed unused On…
ilasw 179945a
refactor: add onComplete function
ilasw fc8a203
refactor: updated funnelStore imports
ilasw 289ad8f
refactor: simplified OnboardingHeader and removed click handle on logo
ilasw 4709629
feat: go back on default on forgot pw is already default display
ilasw 0b4e8cc
refactor: added logging for successful registration debug
ilasw 74fa3b1
feat: added onboarding action handling
ilasw 3e1ec5a
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw 75dffe5
refactor: fixed import path in StepHeadline
ilasw 7c4d073
fix: lint
ilasw 0c95838
feat: trigger profile fetch on register and added onTransition for or…
ilasw 089d61e
feat: add stepper in onboarding page and full-width step support
ilasw da6c7b2
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw de26896
fix: auth state on signup
ilasw b571fb3
fix: return null early if user is logged in or auth is not ready
ilasw 29aa06d
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw c13aeb2
fix: adjusted sign back logic
ilasw 614abb5
refactor: added featureKey parameter to switch between onboarding and…
ilasw 5fbcff4
refactor: updated onboarding containers for desktop
ilasw e2ab8c4
refactor: set user logged in if is logged on onboarding funnel
ilasw 92bbfa9
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw 66de0f3
fix: removed unnecessary placeholder text
ilasw dde01b4
refactor: cleaned code and simplified import paths in onboarding comp…
ilasw 8d6e053
refactor: simplified rendering conditions
ilasw 10d49f1
fix: adjusted container max-width
ilasw eb15ddd
fix: simplified onboarding auth logic and fixed showing login instead…
ilasw 9765c7f
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw 8e8736d
refactor: updated image prop
ilasw 6e34833
refactor: rollback onForgotPasswordBack
ilasw 8c6808c
fix: add default
ilasw e7ce855
feat: updated story
ilasw f91d17c
feat: updated story
ilasw d46e3f8
chore: added dompurify dependency to storybook
ilasw 78feef9
fix: lint
ilasw e54b8e1
test: updated input selectors in RegistrationForm
ilasw 321fce9
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw 42a3793
fix: removed default id from onboarding funnel
ilasw 1d167dd
refactor: removed unnecessary fragment
ilasw 7271a92
refactor: cleaned (won) experiment for onboarding reordering
ilasw 82ea3c0
fix: added footer links in authenticating onboarding screen
ilasw 1d2b62b
refactor: updated useEffect dependencies in onboarding
ilasw 62181a8
chore: removed unused var
ilasw 933bdd2
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw 19f2346
fix: import path
ilasw cdfe238
chore: move PlusCards components
ilasw 0f376ec
feat: added funnel tracking for signup provider buttons
ilasw 376b52a
feat: added funnel tracking for signup provider buttons
ilasw dfb52f2
feat: added funnel tracking attribute to onboarding header logo
ilasw 44b1db0
feat: added funnel tracking attribute to onboarding header logo
ilasw df523d1
feat: added PlusCards step to funnel types
ilasw 1c90606
feat: added FunnelPlusCards step
ilasw 87bb85a
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw de03b8e
fix: lint unused parameter
ilasw 4fcbaf9
fix: updated default featureKey and URL path for onboarding boot API
ilasw 9adfbe3
fix: vertical center for pricing cards
ilasw bd48739
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw cd873c3
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw 1258318
fix: typo in featureKey
ilasw 60cf684
fix: add initialStepId on load
ilasw d66f8c6
chore: add test console.log
ilasw 205c14e
feat: implement onboarding completion redirect logic
ilasw 280a7e8
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw d8781d3
refactor: added isOnboardingActionsReady check
ilasw c2a7f8c
refactor: added withIsActiveGuard to FunnelPlusCards component
ilasw a535eb6
refactor: updated onboarding social auth flow
ilasw 7254e1d
refactor: removed id and stepId params from onboarding redirects
ilasw 1551ae1
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw 43c3595
feat: added selected tags on funnel step transition
ilasw f646d02
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw 1e191b2
chore: added log
ilasw 70506ab
fix: update boot default featureKey
ilasw 23591ff
Merge branch 'main' of https://github.com/dailydotdev/apps into MI-89…
ilasw 3de8c02
fix: disable funnel pricing when pricing step is not available
ilasw 6fedd5a
feat: updated onboarding flow to handle action completion
ilasw ec11b1a
feat: updated onboarding redirection
ilasw e769a5a
fix: nothing show
ilasw b3ec982
fix: isOnboardingActionsReady is always false for guest users
ilasw 2ae5ce3
fix: funnelPricing is array, useProductPricing will never be enabled
ilasw 6f2b14a
fix: plus cards as full-width step
ilasw 7168f68
fix: plus cards not centered
ilasw 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,6 @@ import { labels } from '../../lib'; | |
import usePersistentState from '../../hooks/usePersistentState'; | ||
import { IconSize } from '../Icon'; | ||
import { MailIcon } from '../icons'; | ||
import { useFeature } from '../GrowthBookProvider'; | ||
import { featureOnboardingReorder } from '../../lib/featureManagement'; | ||
import { usePixelsContext } from '../../contexts/PixelsContext'; | ||
import { useAuthData } from '../../contexts/AuthDataContext'; | ||
|
||
|
@@ -61,12 +59,6 @@ const OnboardingRegistrationForm = dynamic(() => | |
).then((mod) => mod.OnboardingRegistrationForm), | ||
); | ||
|
||
const OnboardingRegistrationFormExperiment = dynamic(() => | ||
import( | ||
/* webpackChunkName: "onboardingRegistrationFormExperiment" */ './OnboardingRegistrationForm' | ||
).then((mod) => mod.OnboardingRegistrationFormExperiment), | ||
); | ||
|
||
const AuthSignBack = dynamic(() => | ||
import(/* webpackChunkName: "authSignBack" */ './AuthSignBack').then( | ||
(mod) => mod.AuthSignBack, | ||
|
@@ -130,8 +122,8 @@ function AuthOptionsInner({ | |
); | ||
const { refetchBoot, user, isFunnel } = useAuthContext(); | ||
const router = useRouter(); | ||
const isOnboardingPage = !!router?.pathname?.startsWith('/onboarding'); | ||
const isReorderExperiment = useFeature(featureOnboardingReorder); | ||
const isOnboardingOrFunnel = | ||
!!router?.pathname?.startsWith('/onboarding') || isFunnel; | ||
const [flow, setFlow] = useState(''); | ||
const [activeDisplay, setActiveDisplay] = useState(() => | ||
storage.getItem(SIGNIN_METHOD_KEY) && !forceDefaultDisplay | ||
|
@@ -206,7 +198,7 @@ function AuthOptionsInner({ | |
onRedirect: (redirect) => { | ||
windowPopup.current.location.href = redirect; | ||
}, | ||
keepSession: isFunnel, | ||
keepSession: isOnboardingOrFunnel, | ||
}); | ||
|
||
const { | ||
|
@@ -223,12 +215,14 @@ function AuthOptionsInner({ | |
return displayToast(labels.auth.error.generic); | ||
}, | ||
}); | ||
const onProfileSuccess = async (options: { redirect?: string } = {}) => { | ||
const onProfileSuccess = async ( | ||
options: { redirect?: string; setSignBack?: boolean } = {}, | ||
) => { | ||
Comment on lines
+218
to
+220
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm now using this |
||
setIsRegistration(true); | ||
const { redirect } = options; | ||
const { redirect, setSignBack = true } = options; | ||
const { data } = await refetchBoot(); | ||
|
||
if (data.user) { | ||
if (data.user && setSignBack) { | ||
const provider = chosenProvider || 'password'; | ||
onSignBackLogin(data.user as LoggedUser, provider as SignBackProvider); | ||
} | ||
|
@@ -268,7 +262,7 @@ function AuthOptionsInner({ | |
if (!isNativeAuthSupported(provider)) { | ||
windowPopup.current = window.open(); | ||
} | ||
setChosenProvider(provider); | ||
await setChosenProvider(provider); | ||
await onSocialRegistration(provider); | ||
onAuthStateUpdate?.({ isLoading: true }); | ||
}; | ||
|
@@ -345,6 +339,7 @@ function AuthOptionsInner({ | |
return onSuccessfulLogin?.(); | ||
} | ||
|
||
onAuthStateUpdate({ defaultDisplay: AuthDisplay.SocialRegistration }); | ||
return onSetActiveDisplay(AuthDisplay.SocialRegistration); | ||
}; | ||
|
||
|
@@ -363,11 +358,12 @@ function AuthOptionsInner({ | |
await syncSettings(); | ||
}; | ||
|
||
const onRegister = (params: RegistrationFormValues) => { | ||
validateRegistration({ | ||
const onRegister = async (params: RegistrationFormValues) => { | ||
await validateRegistration({ | ||
...params, | ||
method: 'password', | ||
}); | ||
await onProfileSuccess({ setSignBack: false }); | ||
}; | ||
|
||
const onForgotPassword = (withEmail?: string) => { | ||
|
@@ -389,11 +385,6 @@ function AuthOptionsInner({ | |
onPasswordLogin(params); | ||
}; | ||
|
||
const RegistrationFormComponent = | ||
isReorderExperiment && isOnboardingPage | ||
? OnboardingRegistrationFormExperiment | ||
: OnboardingRegistrationForm; | ||
|
||
return ( | ||
<div | ||
className={classNames( | ||
|
@@ -477,7 +468,7 @@ function AuthOptionsInner({ | |
/> | ||
</Tab> | ||
<Tab label={AuthDisplay.OnboardingSignup}> | ||
<RegistrationFormComponent | ||
<OnboardingRegistrationForm | ||
onContinueWithEmail={() => { | ||
onAuthStateUpdate({ | ||
isAuthenticating: 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe put this condition within the context itself so everything that uses this will get the same values.