change(ui): change recordings page for non ee
This commit is contained in:
parent
17d9a4a116
commit
29c4f32d6e
2 changed files with 38 additions and 21 deletions
|
|
@ -1,50 +1,67 @@
|
|||
import React from 'react';
|
||||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||
import withPageTitle from 'HOCs/withPageTitle';
|
||||
import withPermissions from 'HOCs/withPermissions'
|
||||
import withPermissions from 'HOCs/withPermissions';
|
||||
import AssistRouter from './AssistRouter';
|
||||
import { SideMenuitem } from 'UI';
|
||||
import { withSiteId, assist, recordings } from 'App/routes';
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
interface Props extends RouteComponentProps {
|
||||
siteId: string;
|
||||
history: any;
|
||||
isEnterprise: boolean;
|
||||
}
|
||||
|
||||
function Assist(props: Props) {
|
||||
const { history, siteId } = props;
|
||||
const { history, siteId, isEnterprise } = props;
|
||||
const isAssist = history.location.pathname.includes('assist');
|
||||
const isRecords = history.location.pathname.includes('recordings');
|
||||
|
||||
const redirect = (path: string) => {
|
||||
history.push(withSiteId(path, siteId));
|
||||
};
|
||||
return (
|
||||
<div className="page-margin container-90 flex relative">
|
||||
if (isEnterprise) {
|
||||
return (
|
||||
<div className="page-margin container-90 flex relative">
|
||||
<div className="flex-1 flex">
|
||||
<div className="side-menu">
|
||||
<SideMenuitem
|
||||
active={isAssist}
|
||||
id="menu-assist"
|
||||
title="Live Sessions"
|
||||
iconName="play-circle-light"
|
||||
onClick={() => redirect(assist())}
|
||||
/>
|
||||
<SideMenuitem
|
||||
active={isRecords}
|
||||
id="menu-rec"
|
||||
title="Recordings"
|
||||
iconName="record-circle"
|
||||
onClick={() => redirect(recordings())}
|
||||
/>
|
||||
<SideMenuitem
|
||||
active={isAssist}
|
||||
id="menu-assist"
|
||||
title="Live Sessions"
|
||||
iconName="play-circle-light"
|
||||
onClick={() => redirect(assist())}
|
||||
/>
|
||||
<SideMenuitem
|
||||
active={isRecords}
|
||||
id="menu-rec"
|
||||
title="Recordings"
|
||||
iconName="record-circle"
|
||||
onClick={() => redirect(recordings())}
|
||||
/>
|
||||
</div>
|
||||
<div className="side-menu-margined w-full">
|
||||
<AssistRouter />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="page-margin container-90 flex relative">
|
||||
<AssistRouter />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default withPageTitle("Assist - OpenReplay")(withPermissions(['ASSIST_LIVE'])(withRouter(Assist)));
|
||||
const Cont = connect((state: any) => ({
|
||||
isEnterprise:
|
||||
state.getIn(['user', 'account', 'edition']) === 'ee' ||
|
||||
state.getIn(['user', 'authDetails', 'edition']) === 'ee',
|
||||
}))(Assist);
|
||||
|
||||
export default withPageTitle('Assist - OpenReplay')(
|
||||
withPermissions(['ASSIST_LIVE'])(withRouter(Cont))
|
||||
);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ function AssistRouter(props: Props) {
|
|||
} = props;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="w-full">
|
||||
<Switch>
|
||||
<Route exact strict path={withSiteId(assist(), siteId)}>
|
||||
<AssistView />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue