From 697528259910203ca48b03974fd7006d4ccaabc4 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Thu, 7 Dec 2023 12:27:09 +0100 Subject: [PATCH] fix(ui) uxt fixes --- .../Player/LivePlayer/LivePlayerBlockHeader.tsx | 10 +++++----- frontend/app/components/UsabilityTesting/TestEdit.tsx | 8 ++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/app/components/Session/Player/LivePlayer/LivePlayerBlockHeader.tsx b/frontend/app/components/Session/Player/LivePlayer/LivePlayerBlockHeader.tsx index 51b49d26b..6d87c2dae 100644 --- a/frontend/app/components/Session/Player/LivePlayer/LivePlayerBlockHeader.tsx +++ b/frontend/app/components/Session/Player/LivePlayer/LivePlayerBlockHeader.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { connect } from 'react-redux'; -import { withRouter } from 'react-router-dom'; +import { useHistory } from 'react-router-dom'; import { assist as assistRoute, withSiteId, @@ -23,7 +23,7 @@ function LivePlayerBlockHeader(props: any) { const [hideBack, setHideBack] = React.useState(false); const { store } = React.useContext(PlayerContext); const { assistMultiviewStore } = useStore(); - + const history = useHistory(); const { width, height } = store.get(); const { @@ -32,7 +32,6 @@ function LivePlayerBlockHeader(props: any) { closedLive = false, siteId, location, - history, isMultiview, } = props; @@ -42,7 +41,8 @@ function LivePlayerBlockHeader(props: any) { }, []); const backHandler = () => { - history.push(withSiteId(ASSIST_ROUTE, siteId)); + history.goBack(); + // history.push(withSiteId(ASSIST_ROUTE, siteId)); }; const { userId, metadata, isCallActive, agentIds } = session; @@ -117,4 +117,4 @@ const PlayerHeaderCont = connect( } )(observer(LivePlayerBlockHeader)); -export default withRouter(PlayerHeaderCont); +export default PlayerHeaderCont; diff --git a/frontend/app/components/UsabilityTesting/TestEdit.tsx b/frontend/app/components/UsabilityTesting/TestEdit.tsx index e233789f2..4c1c97d30 100644 --- a/frontend/app/components/UsabilityTesting/TestEdit.tsx +++ b/frontend/app/components/UsabilityTesting/TestEdit.tsx @@ -74,8 +74,12 @@ function TestEdit() { setHasChanged(false); if (testId && testId !== 'new') { uxtestingStore.updateTest(uxtestingStore.instance!).then((testId) => { - toast.success('The usability test is now live and accessible to participants.'); - history.push(withSiteId(usabilityTestingView(testId!.toString()), siteId)); + if (isPreview) { + window.open(`${uxtestingStore.instance!.startingPath}?oruxt=${testId}`, '_blank', 'noopener,noreferrer'); + } else { + toast.success('The usability test is now live and accessible to participants.'); + history.push(withSiteId(usabilityTestingView(testId!.toString()), siteId)); + } }); } else { uxtestingStore.createNewTest(isPreview).then((test) => {