Skip to content

Commit

Permalink
🟣 Release 4.15.0
Browse files Browse the repository at this point in the history
Merge pull request #5874 from WRadoslaw/release/4.15.0
  • Loading branch information
WRadoslaw authored Feb 9, 2024
2 parents 35d064d + e048374 commit 9590c16
Show file tree
Hide file tree
Showing 14 changed files with 144 additions and 18 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ 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.15.0] - 2024-02-09

## Added

- Request response time logging

### Fixed

- Atlas and Orion email validation difference
- Lack of channel collaborator for subsequent Atlas channels of a single member that joined YPP

### Changed

- Changed feature arrival dates on pills
- Channel collaborator permissions
- Homepage language and category filtering

## [4.14.6] - 2024-01-12

### Fixed
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.14.6",
"version": "4.15.0",
"license": "GPL-3.0",
"scripts": {
"start": "vite",
Expand Down
56 changes: 55 additions & 1 deletion packages/atlas/src/api/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,34 @@ import { createClient } from 'graphql-ws'

import { ORION_GRAPHQL_URL, QUERY_NODE_GRAPHQL_SUBSCRIPTION_URL } from '@/config/env'
import { useUserLocationStore } from '@/providers/userLocation'
import { UserEventsLogger } from '@/utils/logs'

import { cache } from './cache'

const initializePerformanceObserver = () => {
try {
const observer = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
if (['fetch', 'xmlhttprequest'].includes((entry as PerformanceResourceTiming).initiatorType)) {
const queryString = entry.name.split('?')?.[1]
const params = new URLSearchParams(queryString)
const queryType = params.get('queryName')
UserEventsLogger.logUserEvent('request-response-time', {
requestName: queryType ?? entry.name,
timeToComplete: entry.duration,
})
}
}
})
// Start listening for `resource` entries to be dispatched.
observer.observe({ type: 'resource', buffered: true })
} catch (e) {
// Do nothing if the browser doesn't support this API.
}
}

initializePerformanceObserver()

const delayLink = new ApolloLink((operation, forward) => {
const ctx = operation.getContext()
if (!ctx.delay) {
Expand All @@ -31,11 +56,40 @@ export const createApolloClient = () => {
})
)

const orionLink = ApolloLink.from([delayLink, new HttpLink({ uri: ORION_GRAPHQL_URL, credentials: 'include' })])
const orionLink = ApolloLink.from([
delayLink,
new HttpLink({
uri: ORION_GRAPHQL_URL,
credentials: 'include',
fetch: async (uri, options) => {
const queryName = options?.headers
? (options.headers?.['queryname' as keyof typeof options.headers] as string)
: null
const queryString = queryName ? `?queryName=${queryName}` : ''
return fetch(`${uri}${queryString}`, options)
},
}),
])

const operationSplitLink = split(
({ query, setContext }) => {
const locationStore = useUserLocationStore.getState()
const firstDefinition = query.definitions[0]
let queryName: string | null | undefined = null
if (firstDefinition.kind === 'OperationDefinition' && firstDefinition.operation === 'query') {
queryName = firstDefinition.name?.value
}

if (queryName) {
setContext(({ headers }: Record<string, object>) => {
return {
headers: {
...headers,
...(queryName ? { queryName } : {}),
},
}
})
}

if (
!locationStore.disableUserLocation &&
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/atlas/src/api/schemas/orion.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ExternalSignInModal: FC = () => {
const form = useForm<{ email: string }>({
resolver: zodResolver(
z.object({
email: z.string().email(),
email: z.string().regex(/^\S+@\S+\.\S+$/, 'Enter valid email address.'),
})
),
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const commonPasswordValidation = z

const schema = z.object({
[ForgotPasswordStep.EmailAndSeedStep]: z.object({
email: z.string().min(3, { message: 'Enter email address.' }).email({ message: 'Enter valid email address.' }),
email: z
.string()
.min(3, { message: 'Enter email address.' })
.regex(/^\S+@\S+\.\S+$/, 'Enter valid email address.'),
mnemonic: z
.string()
.min(1, 'Enter wallet seed phrase.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export const LogInModal = () => {
} = useForm<{ email: string; password: string }>({
resolver: zodResolver(
z.object({
email: z.string().min(3, { message: 'Enter email address.' }).email({ message: 'Enter valid email address.' }),
email: z
.string()
.min(3, { message: 'Enter email address.' })
.regex(/^\S+@\S+\.\S+$/, 'Enter valid email address.'),
password: z.string().min(1, 'Enter password.'),
})
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ import { AuthenticationModalStepTemplate } from '../../AuthenticationModalStepTe

const zodSchema = z
.object({
email: z.string().min(3, { message: 'Enter email address.' }).email({ message: 'Enter valid email address.' }),
email: z
.string()
.min(3, { message: 'Enter email address.' })
.regex(/^\S+@\S+\.\S+$/, 'Enter valid email address.'),
confirmEmail: z
.string()
.min(1, { message: 'Enter email address.' })
.email({ message: 'Enter valid email address.' }),
.regex(/^\S+@\S+\.\S+$/, 'Enter valid email address.'),
confirmedTerms: z.boolean().refine((value) => value, { message: 'Agree to Terms and Conditions to continue.' }),
})
.refine(
Expand Down
5 changes: 4 additions & 1 deletion packages/atlas/src/config/contentFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ export const cancelledVideoFilter: VideoWhereInput = {
},
}

const browserLanguage = navigator.language.split('-')[0]

export const publicCryptoVideoFilter: VideoWhereInput = {
isPublic_eq: true,
isCensored_eq: false,
orionLanguage_in: [...(browserLanguage ? [browserLanguage] : []), 'en'],
category: {
id_in: atlasConfig.content.categories.find((category) => category.name === 'Crypto')?.videoCategories,
id_in: atlasConfig.content.categories.map((category) => category.videoCategories).flat(),
},
media: {
isAccepted_eq: true,
Expand Down
6 changes: 3 additions & 3 deletions packages/atlas/src/hooks/useChannelFormSubmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ type CreateEditChannelSubmitParams = {
| undefined
}

export const useCreateEditChannelSubmit = () => {
export const useCreateEditChannelSubmit = (initialChannelId?: string) => {
const { joystream, proxyCallback } = useJoystream()
const { channelId, memberId, refetchUserMemberships } = useUser()

const { channelId: activeChannelId, memberId, refetchUserMemberships } = useUser()
const channelId = initialChannelId || activeChannelId
const addNewChannelIdToUploadsStore = useUploadsStore((state) => state.actions.addNewChannelId)
const getBucketsConfigForNewChannel = useBucketsConfigForNewChannel()
const { channelStateBloatBondValue, dataObjectStateBloatBondValue } = useBloatFeesAndPerMbFees()
Expand Down
6 changes: 6 additions & 0 deletions packages/atlas/src/joystream-lib/extrinsics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ export class JoystreamLibExtrinsics {
? {
[collaboratorMemberId]: createType('BTreeSet<PalletContentIterableEnumsChannelActionPermission>', [
'AddVideo',
'AgentRemark',
'UpdateChannelMetadata',
'UpdateVideoMetadata',
]),
}
: {}
Expand Down Expand Up @@ -295,6 +298,9 @@ export class JoystreamLibExtrinsics {
? {
[collaboratorMemberId]: createType('BTreeSet<PalletContentIterableEnumsChannelActionPermission>', [
'AddVideo',
'AgentRemark',
'UpdateChannelMetadata',
'UpdateVideoMetadata',
]),
}
: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const YppAuthorizationModal: FC<YppAuthorizationModalProps> = ({ unSynced
[setSelectedChannelId, setYtRequirementsErrors]
)

const createOrUpdateChannel = useCreateEditChannelSubmit()
const createOrUpdateChannel = useCreateEditChannelSubmit(selectedChannelId ?? undefined)

const handleCreateOrUpdateChannel = detailsFormMethods.handleSubmit(async (data) => {
setFinalFormData(() => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const YppCardsSections: FC = () => {
data-aos-easing="atlas-easing"
>
<ContentCard
pill={{ label: 'Coming late 2023' }}
pill={{ label: 'Coming early 2024' }}
title="Issue Channel Tokens"
subtitle="Creator tokens"
body="Turn viewers into evangelists by letting them hold a share in your channel when they buy your own channel token."
Expand Down Expand Up @@ -239,7 +239,7 @@ export const YppCardsSections: FC = () => {
data-aos-easing="atlas-easing"
>
<ContentCard
pill={{ label: 'Coming early 2024' }}
pill={{ label: 'Coming late 2024' }}
title="Get recognized and supported with tips"
subtitle="Tips"
body="Receive tips from your viewers who appreciate your work and want you to know about it."
Expand Down Expand Up @@ -281,7 +281,7 @@ export const YppCardsSections: FC = () => {
data-aos-easing="atlas-easing"
>
<ContentCard
pill={{ label: 'Coming early 2024' }}
pill={{ label: 'Coming late 2024' }}
title="Create videos which only your supporters can access"
subtitle="Gated content"
body="Offer exclusive content to the selected members who purchased your tokens and NFTs."
Expand Down

0 comments on commit 9590c16

Please sign in to comment.