From 365742e3c6c84bf322f65bd19bfc53a5d2887589 Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Wed, 30 Aug 2023 17:33:17 +0530 Subject: [PATCH 1/6] fix: case insensitive search --- packages/roomkit-react/src/Prebuilt/common/hooks.js | 2 +- .../src/Prebuilt/components/Footer/ParticipantList.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/common/hooks.js b/packages/roomkit-react/src/Prebuilt/common/hooks.js index dff4ae81fc..a97c404178 100644 --- a/packages/roomkit-react/src/Prebuilt/common/hooks.js +++ b/packages/roomkit-react/src/Prebuilt/common/hooks.js @@ -88,7 +88,7 @@ export const useParticipants = params => { participantList = participantList.filter(peer => peer.roleName === params.role); } if (params?.search) { - const search = params.search.toLowerCase(); + const search = params.search; // Removed peer.roleName?.toLowerCase().includes(search) participantList = participantList.filter(peer => peer.name.toLowerCase().includes(search)); } diff --git a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.jsx b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.jsx index 6de9c08641..769c6756c2 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.jsx @@ -52,7 +52,7 @@ export const ParticipantList = () => { if (!filterValue) { filterValue = {}; } - filterValue.search = value; + filterValue.search = value.toLowerCase(); return { ...filterValue }; }); }, []); From eef60be299618b38c482f9f29a6b6ef7d0bfc42b Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Wed, 30 Aug 2023 17:57:42 +0530 Subject: [PATCH 2/6] fix: crash, spacing --- .../src/Prebuilt/components/Toast/ToastConfig.jsx | 7 +++++-- packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Toast/ToastConfig.jsx b/packages/roomkit-react/src/Prebuilt/components/Toast/ToastConfig.jsx index 6eabaac279..3b19b8961a 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Toast/ToastConfig.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/Toast/ToastConfig.jsx @@ -34,8 +34,11 @@ const HandRaiseAction = React.forwardRef(({ id = '', isSingleHandRaise = true }, const isParticipantsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS); const peer = useHMSStore(selectPeerByID(id)); const layout = useRoomLayout(); - const { bring_to_stage_label, on_stage_role, off_stage_roles } = - layout?.screens?.conferencing?.default?.elements.on_stage_exp || {}; + const { + bring_to_stage_label, + on_stage_role, + off_stage_roles = [], + } = layout?.screens?.conferencing?.default?.elements.on_stage_exp || {}; const onClickHandler = useCallback(() => { if (isSingleHandRaise) { diff --git a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx index 30a8428819..b2e390e86e 100644 --- a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx +++ b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx @@ -25,7 +25,7 @@ const SidePane = ({ css = {} }) => { } else if (sidepane === SIDE_PANE_OPTIONS.STREAMING) { ViewComponent = StreamingLanding; } - if (!ViewComponent && !activeScreensharePeerId) { + if (!ViewComponent && !trackId) { return null; } @@ -39,6 +39,7 @@ const SidePane = ({ css = {} }) => { w: '$100', h: '100%', flexShrink: 0, + gap: '$4', '@md': { position: mwebStreamingChat ? 'absolute' : '', zIndex: 21 }, }} > From 478fae527701db6f5df1fa9bdd37cf3ab9b85984 Mon Sep 17 00:00:00 2001 From: Kaustubh Kumar Date: Wed, 30 Aug 2023 18:08:18 +0530 Subject: [PATCH 3/6] fix: overflow in participants --- .../src/Prebuilt/components/Footer/ParticipantList.jsx | 4 ++++ .../src/Prebuilt/components/Footer/RoleAccordion.jsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.jsx b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.jsx index 769c6756c2..0a472bf126 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.jsx @@ -139,6 +139,10 @@ const VirtualizedParticipants = ({ css={{ gap: '$8', mt: '$4', + maxHeight: '100%', + overflowY: 'auto', + overflowX: 'hidden', + pr: '$3', }} > + Date: Wed, 30 Aug 2023 18:32:55 +0530 Subject: [PATCH 4/6] fix: add check for 0 on pagination --- .../roomkit-react/src/Prebuilt/components/SecondaryTiles.tsx | 4 +++- .../src/Prebuilt/components/VideoLayouts/EqualProminence.tsx | 4 +++- .../src/Prebuilt/components/VideoLayouts/RoleProminence.tsx | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/SecondaryTiles.tsx b/packages/roomkit-react/src/Prebuilt/components/SecondaryTiles.tsx index 4493ae453d..0fead331a6 100644 --- a/packages/roomkit-react/src/Prebuilt/components/SecondaryTiles.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/SecondaryTiles.tsx @@ -14,7 +14,9 @@ export const SecondaryTiles = ({ peers, onPageChange, onPageSize }: LayoutProps) const pageSize = pagesWithTiles[0]?.length || 0; useEffect(() => { - onPageSize?.(pageSize); + if (pageSize > 0) { + onPageSize?.(pageSize + 1); // include screenshare peer as well for page size + } }, [pageSize, onPageSize]); return ( diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx index ad060f5988..005963a2ff 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx @@ -33,7 +33,9 @@ export function EqualProminence({ peers, onPageChange, onPageSize }: LayoutProps const pageSize = pagesWithTiles[0]?.length || 0; useEffect(() => { - onPageSize?.(pageSize); + if (pageSize > 0) { + onPageSize?.(pageSize); + } }, [pageSize, onPageSize]); return ( diff --git a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx index 39dce26092..ee552f94f2 100644 --- a/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx @@ -25,7 +25,9 @@ export function RoleProminence({ peers, onPageChange, onPageSize }: LayoutProps) const pageSize = pagesWithTiles[0]?.length || 0; useEffect(() => { - onPageSize?.(pageSize); + if (pageSize > 0) { + onPageSize?.(pageSize); + } }, [pageSize, onPageSize]); return ( From 4aeedb6f653dd0713215fef524816e9f97b2f5bf Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Wed, 30 Aug 2023 19:08:38 +0530 Subject: [PATCH 5/6] fix: participants --- packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx index b2e390e86e..0c2999d99d 100644 --- a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx +++ b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.jsx @@ -59,6 +59,8 @@ const SidePane = ({ css = {} }) => { w: '$100', h: mwebStreamingChat ? '0' : '100%', p: '$10', + flex: '1 1 0', + minHeight: 0, maxHeight: mwebStreamingChat ? '300px' : 'unset', background: mwebStreamingChat ? 'linear-gradient(180deg, rgba(0, 0, 0, 0.00) 35.94%, rgba(0, 0, 0, 0.64) 100%)' From e092f5935c6f1a7d0296723c537daf0d8e3a30ae Mon Sep 17 00:00:00 2001 From: Kaustubh Kumar Date: Wed, 30 Aug 2023 19:12:11 +0530 Subject: [PATCH 6/6] fix: remove pdf url sharing --- .../components/pdfAnnotator/pdfErrorView.jsx | 29 ------- .../pdfAnnotator/pdfFileOptions.jsx | 77 ++----------------- .../components/pdfAnnotator/submitPdf.jsx | 49 +----------- .../components/pdfAnnotator/uploadedFile.jsx | 19 +---- 4 files changed, 11 insertions(+), 163 deletions(-) delete mode 100644 packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx diff --git a/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx b/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx deleted file mode 100644 index cb47d30cc0..0000000000 --- a/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import { InfoIcon } from '@100mslive/react-icons'; -import { Text } from '../../../'; -import { DialogRow } from '../../primitives/DialogContent'; - -export const PdfErrorView = ({ isPDFUrlValid }) => { - return ( - !isPDFUrlValid && ( - - - - Please enter a valid PDF URL - - - ) - ); -}; diff --git a/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx b/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx index 356917bfc0..d836c22c8b 100644 --- a/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx @@ -1,17 +1,12 @@ import React, { useState } from 'react'; -import { Dialog, Flex, HorizontalDivider, Input, Text } from '../../../'; -import { DialogInputFile, DialogRow } from '../../primitives/DialogContent'; -import { PdfErrorView } from './pdfErrorView'; +import { Dialog, Flex } from '../../../'; +import { DialogInputFile } from '../../primitives/DialogContent'; import { PDFHeader } from './pdfHeader'; -import { PDFInfo } from './pdfInfo'; import { SubmitPDF } from './submitPdf'; import { UploadedFile } from './uploadedFile'; export function PDFFileOptions({ onOpenChange }) { - const [isPDFUrlValid, setIsPDFUrlValid] = useState(true); - const [isValidateProgress, setIsValidateProgress] = useState(false); const [pdfFile, setPDFFile] = useState(null); - const [pdfURL, setPDFURL] = useState(''); return !pdfFile ? ( @@ -35,75 +30,13 @@ export function PDFFileOptions({ onOpenChange }) { type="file" accept=".pdf" /> - - - - OR - - - - - Import from URL - - { - setIsPDFUrlValid(true); - setIsValidateProgress(false); - }} - onChange={e => { - setPDFURL(e.target.value); - }} - placeholder="Paste PDF URL" - type="text" - error={!isPDFUrlValid} - /> - {!isPDFUrlValid && } - - + + ) : ( - + ); } diff --git a/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx b/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx index ffa2991b9f..47f496fd8d 100644 --- a/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx @@ -1,49 +1,11 @@ -import React, { useCallback } from 'react'; +import React from 'react'; import { Button, Flex } from '../../../'; import { useSetAppDataByKey } from '../AppData/useUISettings'; import { APP_DATA } from '../../common/constants'; -export const SubmitPDF = ({ - pdfFile, - pdfURL, - isValidateProgress, - setIsPDFUrlValid, - setIsValidateProgress, - onOpenChange, -}) => { +export const SubmitPDF = ({ pdfFile, onOpenChange }) => { const [, setPDFConfig] = useSetAppDataByKey(APP_DATA.pdfConfig); - const isValidPDF = useCallback( - pdfURL => { - const extension = pdfURL.split('.').pop().toLowerCase(); - setIsValidateProgress(true); - if (extension === 'pdf') { - setIsPDFUrlValid(true); - setIsValidateProgress(false); - setPDFConfig({ state: true, file: pdfFile, url: pdfURL }); - onOpenChange(false); - } - - fetch(pdfURL, { method: 'HEAD' }) - .then(response => response.headers.get('content-type')) - .then(contentType => { - if (contentType === 'application/pdf') { - setIsPDFUrlValid(true); - setIsValidateProgress(false); - setPDFConfig({ state: true, file: pdfFile, url: pdfURL }); - onOpenChange(false); - } else { - setIsPDFUrlValid(false); - setIsValidateProgress(false); - } - }) - .catch(() => { - setIsPDFUrlValid(false); - setIsValidateProgress(false); - }); - }, - [onOpenChange, pdfFile, setIsPDFUrlValid, setIsValidateProgress, setPDFConfig], - ); return ( { if (pdfFile) { - setPDFConfig({ state: true, file: pdfFile, url: pdfURL }); + setPDFConfig({ state: true, file: pdfFile }); onOpenChange(false); - } else if (pdfURL) { - isValidPDF(pdfURL); } }} - disabled={!pdfFile && !pdfURL} - loading={isValidateProgress} + disabled={!pdfFile} data-testid="share_pdf_btn" css={{ w: '50%', diff --git a/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx b/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx index 4f8df6d1a1..79eb8a6847 100644 --- a/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx @@ -6,15 +6,7 @@ import { PDFHeader } from './pdfHeader'; import { PDFInfo } from './pdfInfo'; import { SubmitPDF } from './submitPdf'; -export const UploadedFile = ({ - pdfFile, - pdfURL, - isValidateProgress, - setPDFFile, - setIsPDFUrlValid, - setIsValidateProgress, - onOpenChange, -}) => { +export const UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => { const [fileName, ext] = pdfFile.name.split('.'); return ( @@ -70,14 +62,7 @@ export const UploadedFile = ({ /> - +