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

Release v4.9.1 #4870

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ 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).

## [4.9.1] - 2023-09-14

### Changed

- Removed YPP email pre-population
- Minor text changes in signup modal

### Fixed

- Fixed bug with missing anonymousId on signup

## [4.9.0] - 2023-09-08

### Added
Expand Down
4 changes: 2 additions & 2 deletions packages/atlas/atlas.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ features:
landingPageOgImgPath: null # Path to the open graph image for the YPP landing page - if not set, the default image will be used
googleConsoleClientId: '$VITE_GOOGLE_CONSOLE_CLIENT_ID'
youtubeSyncApiUrl: '$VITE_YOUTUBE_SYNC_API_URL'
suspensionReasonsLink: https://www.notion.so/joystream/YouTube-Partner-Program-Outline-d492c2eb88ff4ace955b5f2902ec21fb?pvs=4#e03bb48ed7f7480c8896a908f63f2594 # Link with explanation what might be the reason of ypp channel suspension
suspensionReasonsLink: https://joystream.notion.site/My-channel-is-suspended-what-to-do-86a3df16c55c434ab2184d61dfcfc41b # Link with explanation what might be the reason of ypp channel suspension
suspendedSupportLink: https://discord.com/channels/811216481340751934/1053294778529353788 # Link that will be displayed for users suspended in YPP
suspendedLinkText: '#ypp-support channel on our Discord server'
youtubeCollaboratorMemberId: '$VITE_YOUTUBE_COLLABORATOR_MEMBER_ID'
enrollmentReward: 5000 # Amount for successful enrollment in YPP in joystream.tokenTicker units.
enrollmentUsdReward: 20 # Amount for successful enrollment in YPP in USD.
enrollmentUsdReward: 5 # Amount for successful enrollment in YPP in USD.
referralBaseReward: 2.5 # Self-explanatory, it should match `baseUsdAmount.min` value in last `rewards` entry
tiersDefinition: # Tiers for YouTube partner program rewards. You can provide maximum three tiers. Each tier should has own multiplier.
tiers:
Expand Down
2 changes: 1 addition & 1 deletion packages/atlas/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@joystream/atlas",
"description": "UI for consuming Joystream - a user governed video platform",
"version": "4.9.0",
"version": "4.9.1",
"license": "GPL-3.0",
"scripts": {
"start": "vite",
Expand Down
22 changes: 20 additions & 2 deletions packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { AccountFormData, FaucetError, MemberFormData, RegisterError, useCreateM
import { useMediaMatch } from '@/hooks/useMediaMatch'
import { useSegmentAnalytics } from '@/hooks/useSegmentAnalytics'
import { useUniqueMemberHandle } from '@/hooks/useUniqueMemberHandle'
import { handleAnonymousAuth } from '@/providers/auth/auth.helpers'
import { useAuthStore } from '@/providers/auth/auth.store'
import { useSnackbar } from '@/providers/snackbars'
import { useYppStore } from '@/providers/ypp/ypp.store'
Expand Down Expand Up @@ -59,11 +60,12 @@ export const SignUpModal = () => {
const [amountOfTokens, setAmountofTokens] = useState<number>()
const memberRef = useRef<string | null>(null)
const memberPollingTries = useRef(0)
const haveTriedCreateSession = useRef(false)
const ytResponseData = useYppStore((state) => state.ytResponseData)
const setYppModalOpenName = useYppStore((state) => state.actions.setYppModalOpenName)
const setYtResponseData = useYppStore((state) => state.actions.setYtResponseData)
const { anonymousUserId } = useAuthStore()
const { displaySnackbar } = useSnackbar()
const ytEmailIsValid = Boolean(ytResponseData?.email && !ytResponseData.email.includes('@pages.plusgoogle.com'))

const { generateUniqueMemberHandleBasedOnInput } = useUniqueMemberHandle()

Expand Down Expand Up @@ -131,6 +133,21 @@ export const SignUpModal = () => {
})
setAuthModalOpenName(undefined)
}
if (error === RegisterError.SessionRequired) {
if (!haveTriedCreateSession.current) {
haveTriedCreateSession.current = true
handleAnonymousAuth(anonymousUserId).then(() => {
handleOrionAccountCreation()
})
} else {
displaySnackbar({
title: 'Something went wrong',
description: 'We could not create or find session. Please contact support.',
iconType: 'error',
})
setAuthModalOpenName(undefined)
}
}
},
onStart: () => {
goToStep(SignUpSteps.Creating)
Expand All @@ -148,6 +165,7 @@ export const SignUpModal = () => {
},
})
}, [
anonymousUserId,
createNewOrionAccount,
displaySnackbar,
goToNextStep,
Expand Down Expand Up @@ -380,7 +398,7 @@ export const SignUpModal = () => {
isOverflowing={overflow || !smMatch}
isEmailAlreadyTakenError={emailAlreadyTakenError}
onEmailSubmit={handleEmailStepSubmit}
email={signUpFormData.current.email || (ytEmailIsValid ? (ytResponseData?.email as string) : '')}
email={signUpFormData.current.email}
confirmedTerms={signUpFormData.current.confirmedTerms}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { FC, useEffect } from 'react'

import { SvgAlertsWarning24 } from '@/assets/icons'
import { WarningContainer } from '@/components/_auth/SignUpModal/SignUpSteps/SignUpSteps.styles'

import { SignUpStepsCommonProps } from './SignUpSteps.types'

import { AuthenticationModalStepTemplate } from '../../AuthenticationModalStepTemplate'
Expand All @@ -16,7 +19,18 @@ export const SignUpCreatingMemberStep: FC<SignUpStepsCommonProps> = ({ setPrimar
return (
<AuthenticationModalStepTemplate
title="Creating membership..."
subtitle="Please wait while your membership is being created. Our faucet server will create it for you so you don't need to worry about any fees. This may take up to 1 minute on a slow network."
subtitle={
<span>
Please wait while your membership is being created. Our faucet server will create it for you so you don't need
to worry about any fees. This may take up to 1 minute on a slow network.
<br />
<br />
<WarningContainer>
<SvgAlertsWarning24 />
Please do not close the browser tab or reload the page.
</WarningContainer>
</span>
}
loader
hasNavigatedBack={hasNavigatedBack}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ export const StyledLink = styled.a`
color: ${cVar('colorTextPrimary')};
text-decoration: underline;
`

export const WarningContainer = styled.span`
display: flex;
justify-content: flex-start;
align-items: center;
`
5 changes: 5 additions & 0 deletions packages/atlas/src/hooks/useCreateMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export enum RegisterError {
EmailAlreadyExists = 'EmailAlreadyExists',
UnknownError = 'UnknownError',
MembershipNotFound = 'MembershipNotFound',
SessionRequired = 'SessionRequired',
}

type SignUpParams<T, E> = {
Expand Down Expand Up @@ -241,9 +242,13 @@ export const useCreateMember = () => {
'To create new membership you need to use an email that is not connected to already existing account.',
})
onError?.(RegisterError.EmailAlreadyExists)
return
} else if (errorMessage.startsWith('Membership not found by id')) {
onError?.(RegisterError.MembershipNotFound)
return
} else if (errorMessage.startsWith("cookie 'session_id' required")) {
onError?.(RegisterError.SessionRequired)
return
} else {
displaySnackbar({
title: 'Something went wrong',
Expand Down
9 changes: 0 additions & 9 deletions packages/atlas/src/providers/auth/auth.provider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useApolloClient } from '@apollo/client'
import { u8aToHex } from '@polkadot/util'
import { cryptoWaitReady } from '@polkadot/util-crypto'
import { isAxiosError } from 'axios'
Expand Down Expand Up @@ -39,7 +38,6 @@ export const AuthProvider: FC<PropsWithChildren> = ({ children }) => {
const [lazyCurrentAccountQuery, { refetch }] = useGetCurrentAccountLazyQuery()
const { setApiActiveAccount } = useJoystream()
const { identifyUser, trackLogout } = useSegmentAnalytics()
const client = useApolloClient()
const {
anonymousUserId,
encodedSeed,
Expand All @@ -56,13 +54,6 @@ export const AuthProvider: FC<PropsWithChildren> = ({ children }) => {
const { data } = await lazyCurrentAccountQuery()
if (!data) {
handleAnonymousAuth(anonymousUserId).then((userId) => {
client.refetchQueries({
include: 'active',
onQueryUpdated: (observableQuery) => {
// don't refetch GetBasicVideos query, as it's a duplicate of GetBasicVideosLightweight
return observableQuery.queryName !== 'GetBasicVideos'
},
})
setAnonymousUserId(userId ?? null)
})
setIsAuthenticating(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ export const YppDashboardMainTab: FC<YppDashboardMainTabProps> = ({ currentTier
<Button variant="primary" _textOnly to={atlasConfig.features.ypp.suspensionReasonsLink ?? ''}>
one of these reasons
</Button>
. If you have questions, we are happy to help in our{' '}
<Button variant="primary" _textOnly to={atlasConfig.features.ypp.suspendedSupportLink ?? ''}>
{atlasConfig.features.ypp.suspendedLinkText ?? 'Discord support channel'}{' '}
</Button>
.
</Text>
}
Expand Down
Loading