From a90461b2a0a04313b4989051321f2debd2a30e45 Mon Sep 17 00:00:00 2001 From: Neeraj Swarnkar Date: Fri, 6 Oct 2023 12:05:37 +0530 Subject: [PATCH] feat(meetings): space id code change in meetings widget space id code change in meetings widget throw an error when someone passes the room ID demo samples & test changes setting the default values for enableUnifiedMeetings and enableAdhocMeetings to true updated @webex dependency --- demo/WebexMeetingsWidgetDemo.jsx | 45 +- demo/WebexMeetingsWidgetDemo.scss | 4 + package-lock.json | 6051 ++++++++++--------- package.json | 4 +- src/widgets/WebexMeetings/WebexMeetings.jsx | 6 + tests/util.js | 6 + 6 files changed, 3241 insertions(+), 2875 deletions(-) diff --git a/demo/WebexMeetingsWidgetDemo.jsx b/demo/WebexMeetingsWidgetDemo.jsx index 526ea1a6..98001183 100644 --- a/demo/WebexMeetingsWidgetDemo.jsx +++ b/demo/WebexMeetingsWidgetDemo.jsx @@ -4,12 +4,23 @@ import {Button, Input, Select, SelectOption} from '@momentum-ui/react'; import './WebexMeetingsWidgetDemo.scss'; import {WebexMeetingsWidget} from '../src'; +import {deconstructHydraId} from '@webex/common'; export default function WebexMeetingsWidgetDemo({token, fedramp}) { const [destination, setDestination] = useState(''); const [displayWidget, setDisplayWidget] = useState(false); const [theme, setTheme] = useState('dark'); const [layout, setLayout] = useState('Grid'); + const spaceIDErrorMessage = ( + + Using the space ID as a destination is no longer supported. Please refer to the{' '} + + migration guide + {' '} + to migrate to use the meeting ID or SIP address. + + ); + const [spaceIDError, setSpaceIDError] = useState(''); const ON_IOS_15_1 = typeof navigator !== 'undefined' && navigator.userAgent.includes('iPhone OS 15_1'); @@ -17,7 +28,18 @@ export default function WebexMeetingsWidgetDemo({token, fedramp}) { const handleDisplayMeetingWidget = (event) => { event.preventDefault(); - setDisplayWidget(true); + // Extract the Hydra ID for check + const hydraId = getHydraId(destination); + // Check if it's a room or not then show the meeting widget + if (!hydraId.room) { + setDisplayWidget(true); + // Clear the error message + setSpaceIDError(''); + } else { + // Set the space ID error message + setSpaceIDError(spaceIDErrorMessage); + setDisplayWidget(false); + } }; const handleHideMeetingWidget = (event) => { @@ -60,7 +82,7 @@ export default function WebexMeetingsWidgetDemo({token, fedramp}) {
setDestination(event.target.value)} placeholder="Widget Destination" @@ -82,6 +104,13 @@ export default function WebexMeetingsWidgetDemo({token, fedramp}) { + {spaceIDError && +
+
+ {spaceIDError} +
+
+ }
Theme