Skip to content

Commit 4a951f8

Browse files
authored
Merge branch 'main' into feature/25-00-NC-feat-church-invites
2 parents 545d5e9 + 67ed901 commit 4a951f8

File tree

4 files changed

+8
-56
lines changed

4 files changed

+8
-56
lines changed

apps/videos-admin/src/app/(dashboard)/videos/[videoId]/audio/add/page.spec.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,16 +268,9 @@ describe('AddAudioLanguageDialog', () => {
268268
})
269269
})
270270

271-
// Select Max Resolution
272-
await act(async () => {
273-
fireEvent.change(screen.getAllByTestId('mui-select')[1], {
274-
target: { value: 'fhd' }
275-
})
276-
})
277-
278271
// Select Status
279272
await act(async () => {
280-
fireEvent.change(screen.getAllByTestId('mui-select')[2], {
273+
fireEvent.change(screen.getAllByTestId('mui-select')[1], {
281274
target: { value: 'published' }
282275
})
283276
})

apps/videos-admin/src/app/(dashboard)/videos/[videoId]/audio/add/page.tsx

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,14 @@ interface AddAudioLanguageDialogProps {
3434
const validationSchema = object().shape({
3535
edition: string().required('Edition is required'),
3636
language: object().nullable().required('Language is required'),
37-
file: mixed().required('Video file is required'),
38-
maxResolution: string().required('Max resolution is required')
37+
file: mixed().required('Video file is required')
3938
})
4039

4140
const initialValues: FormikValues = {
4241
edition: 'base',
4342
language: null,
4443
file: null,
45-
published: 'unpublished',
46-
maxResolution: 'fhd'
44+
published: 'unpublished'
4745
}
4846

4947
const GET_ADMIN_VIDEO_VARIANTS = graphql(`
@@ -100,7 +98,6 @@ export default function AddAudioLanguageDialog({
10098
values.edition,
10199
values.published === 'published',
102100
videoSlug,
103-
values.maxResolution,
104101
() => {
105102
router.push(returnUrl, {
106103
scroll: false
@@ -202,38 +199,6 @@ export default function AddAudioLanguageDialog({
202199
)}
203200
/>
204201
</Box>
205-
<FormControl
206-
fullWidth
207-
error={touched.maxResolution && errors.maxResolution != null}
208-
>
209-
<InputLabel id="max-resolution-label">
210-
Max Resolution
211-
</InputLabel>
212-
<Select
213-
labelId="max-resolution-label"
214-
data-testid="MaxResolutionSelect"
215-
id="maxResolution"
216-
name="maxResolution"
217-
label="Video Resolution"
218-
error={
219-
touched.maxResolution && errors.maxResolution != null
220-
}
221-
value={values.maxResolution}
222-
onChange={async (event) => {
223-
await setFieldValue('maxResolution', event.target.value)
224-
}}
225-
disabled={isUploadInProgress}
226-
>
227-
<MenuItem value="fhd">Up to 1K - Full HD (1080p)</MenuItem>
228-
<MenuItem value="qhd">2K - Quad HD (1440p)</MenuItem>
229-
<MenuItem value="uhd">4K - Ultra HD (2160p)</MenuItem>
230-
</Select>
231-
<FormHelperText>
232-
{touched.maxResolution && errors.maxResolution
233-
? (errors.maxResolution as string)
234-
: undefined}
235-
</FormHelperText>
236-
</FormControl>
237202
<FormControl variant="standard">
238203
<InputLabel id="status-select-label">Status</InputLabel>
239204
<Select
@@ -279,8 +244,7 @@ export default function AddAudioLanguageDialog({
279244
isUploadInProgress ||
280245
values.language == null ||
281246
values.edition === '' ||
282-
values.file == null ||
283-
values.maxResolution === ''
247+
values.file == null
284248
}
285249
>
286250
Add

apps/videos-admin/src/app/_UploadVideoVariantProvider/UploadVideoVariantProvider.spec.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const createMuxVideoUploadByUrlMock = {
5353
url: 'https://mock.cloudflare-domain.com/video-id/variants/language-id/videos/uuidv4/language-id_video-id.mp4',
5454
userGenerated: false,
5555
downloadable: true,
56-
maxResolution: undefined
56+
maxResolution: 'uhd'
5757
}
5858
},
5959
result: {
@@ -170,7 +170,7 @@ const createMuxVideoUploadByUrlErrorMock = {
170170
url: 'https://mock.cloudflare-domain.com/video-id/variants/language-id/videos/uuidv4/language-id_video-id.mp4',
171171
userGenerated: false,
172172
downloadable: true,
173-
maxResolution: undefined
173+
maxResolution: 'uhd'
174174
}
175175
},
176176
error: new Error('Mux creation failed')
@@ -593,8 +593,7 @@ describe('UploadVideoVariantContext', () => {
593593
'en',
594594
'base',
595595
false,
596-
'video-slug',
597-
undefined
596+
'video-slug'
598597
)
599598
})
600599

apps/videos-admin/src/app/_UploadVideoVariantProvider/UploadVideoVariantProvider.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { ReactNode, createContext, useContext, useReducer } from 'react'
77
import { v4 as uuidv4 } from 'uuid'
88

99
import { graphql } from '@core/shared/gql'
10-
// Remove the invalid import for MaxResolutionTier
11-
// import { MaxResolutionTier } from '@core/shared/gql/__generated__/graphql'
1210

1311
import { getExtension } from '../(dashboard)/videos/[videoId]/audio/add/_utils/getExtension'
1412
import { useCreateR2AssetMutation } from '../../libs/useCreateR2Asset/useCreateR2Asset'
@@ -92,7 +90,6 @@ interface UploadVideoVariantContextType {
9290
edition: string,
9391
published: boolean,
9492
videoSlug?: string,
95-
maxResolution?: 'fhd' | 'qhd' | 'uhd',
9693
onComplete?: () => void
9794
) => Promise<void>
9895
clearUploadState: () => void
@@ -299,7 +296,6 @@ export function UploadVideoVariantProvider({
299296
edition: string,
300297
published: boolean,
301298
videoSlug?: string,
302-
maxResolution?: 'fhd' | 'qhd' | 'uhd',
303299
onComplete?: () => void
304300
) => {
305301
try {
@@ -358,7 +354,7 @@ export function UploadVideoVariantProvider({
358354
url: r2Response.data.cloudflareR2Create.publicUrl,
359355
userGenerated: false,
360356
downloadable: true,
361-
maxResolution: maxResolution || undefined
357+
maxResolution: 'uhd'
362358
}
363359
})
364360

0 commit comments

Comments
 (0)