fix(ui): fix assist stats labels

This commit is contained in:
nick-delirium 2023-10-30 12:30:57 +01:00
parent b68908b279
commit c0dbd4a53f
6 changed files with 21 additions and 31 deletions

View file

@ -209,17 +209,18 @@ function AssistStats() {
<div className={'mx-auto'} style={{ maxWidth: 1360 }} id={'pdf-anchor'}>
<div id={'pdf-ignore'} className={'w-full flex items-center mb-2'}>
<Typography.Title style={{ marginBottom: 0 }} level={4}>
Assist Stats
Cobrowsing Report
</Typography.Title>
<div className={'ml-auto flex items-center gap-2'}>
<UserSearch onUserSelect={onUserSelect} />
<SelectDateRange period={period} onChange={onChangePeriod} right={true} isAnt />
<Tooltip title={'Export PDF'}>
<Tooltip title={!sessions || sessions.total === 0 ? 'No data at the moment to export.' : 'Export PDF'}>
<Button
onClick={getPdf2}
shape={'default'}
size={'small'}
disabled={!sessions || sessions.total === 0}
icon={<FilePdfOutlined rev={undefined} />}
/>
</Tooltip>
@ -292,4 +293,4 @@ function AssistStats() {
);
}
export default withPageTitle('Assist Stats - Openreplay')(AssistStats);
export default withPageTitle('Cobrowsing Report - Openreplay')(AssistStats);

View file

@ -65,7 +65,12 @@ function StatsTable({ onSort, isLoading, onPageChange, page, sessions, exportCSV
</Space>
</Button>
</Dropdown>
<Button size={'small'} icon={<TableOutlined rev={undefined} />} onClick={exportCSV}>
<Button
size={'small'}
icon={<TableOutlined rev={undefined} />}
onClick={exportCSV}
disabled={sessions?.list.length === 0}
>
Export CSV
</Button>
</div>

View file

@ -79,11 +79,12 @@ function TeamMembers({
</Space>
</Button>
</Dropdown>
<Tooltip title={'Export CSV'}>
<Tooltip title={topMembers.list.length === 0 ? 'No data at the moment to export.' : 'Export CSV'}>
<Button
onClick={onExport}
shape={'default'}
size={'small'}
disabled={topMembers.list.length === 0}
icon={<TableOutlined rev={undefined} />}
/>
</Tooltip>

View file

@ -12,9 +12,9 @@ export const getPdf2 = async () => {
const now = new Date().toISOString();
doc.addMetadata('Author', 'OpenReplay');
doc.addMetadata('Title', 'OpenReplay Assist Stats');
doc.addMetadata('Subject', 'OpenReplay Assist Stats');
doc.addMetadata('Keywords', 'OpenReplay Assist Stats');
doc.addMetadata('Title', 'OpenReplay Cobrowsing Report');
doc.addMetadata('Subject', 'OpenReplay Cobrowsing Report');
doc.addMetadata('Keywords', 'OpenReplay Cobrowsing Report');
doc.addMetadata('Creator', 'OpenReplay');
doc.addMetadata('Producer', 'OpenReplay');
doc.addMetadata('CreationDate', now);

View file

@ -1,12 +1,7 @@
import React from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import {
sessions as sessionsRoute,
liveSession as liveSessionRoute,
withSiteId,
} from 'App/routes';
import { sessions as sessionsRoute, liveSession as liveSessionRoute, withSiteId } from 'App/routes';
import { BackLink, Link } from 'UI';
import { toggleFavorite, setSessionPath } from 'Duck/sessions';
import cn from 'classnames';
@ -26,8 +21,8 @@ function PlayerBlockHeader(props: any) {
const [hideBack, setHideBack] = React.useState(false);
const { player, store } = React.useContext(PlayerContext);
const playerState = store?.get?.() || { width: 0, height: 0, showEvents: false }
const { width = 0, height = 0, showEvents = false } = playerState
const playerState = store?.get?.() || { width: 0, height: 0, showEvents: false };
const { width = 0, height = 0, showEvents = false } = playerState;
const {
session,
@ -49,16 +44,7 @@ function PlayerBlockHeader(props: any) {
}, []);
const backHandler = () => {
if (
sessionPath.pathname === history.location.pathname ||
sessionPath.pathname.includes('/session/')
) {
history.push(withSiteId(SESSIONS_ROUTE, siteId));
} else {
history.push(
sessionPath ? sessionPath.pathname + sessionPath.search : withSiteId(SESSIONS_ROUTE, siteId)
);
}
history.push(withSiteId(SESSIONS_ROUTE, siteId));
};
const { metadata } = session;
@ -78,10 +64,7 @@ function PlayerBlockHeader(props: any) {
<div className={cn(stl.header, 'flex justify-between', { hidden: fullscreen })}>
<div className="flex w-full items-center">
{!hideBack && (
<div
className="flex items-center h-full cursor-pointer group"
onClick={backHandler}
>
<div className="flex items-center h-full cursor-pointer group" onClick={backHandler}>
{/* @ts-ignore TODO */}
<BackLink label="Back" className="h-full ml-2" />
<div className={stl.divider} />

View file

@ -74,7 +74,7 @@ export const categories: Category[] = [
items: [
{ label: 'Cobrowse', key: MENU.LIVE_SESSIONS, icon: 'broadcast' },
{ label: 'Recordings', key: MENU.RECORDINGS, icon: 'record-btn', isEnterprise: true },
{ label: 'Stats', key: MENU.STATS, icon: 'file-bar-graph', isEnterprise: true },
{ label: 'Cobrowsing Report', key: MENU.STATS, icon: 'file-bar-graph', isEnterprise: true },
]
},
{