change(ui): removed session settings from sessions list page

This commit is contained in:
Shekar Siri 2023-08-09 12:30:26 +05:30
parent 5a59b7a1bb
commit c224cf8c58
3 changed files with 13 additions and 14 deletions

View file

@ -4,6 +4,7 @@ import { useStore } from 'App/mstore';
import { observer } from 'mobx-react-lite';
import { connect } from 'react-redux';
import cn from 'classnames';
import { Switch } from 'antd';
type Props = {
isAdmin: boolean;
@ -51,7 +52,7 @@ function CaptureRate(props: Props) {
<div className='my-1'>The percentage of session you want to capture</div>
<Tooltip title="You don't have permission to change." disabled={isAdmin} delay={0}>
<div className={cn('mt-2 mb-4 mr-1 flex items-center', { disabled: !isAdmin })}>
<Toggler checked={captureAll} name='test' onChange={toggleRate} />
<Switch checked={captureAll} onChange={toggleRate} />
<span className='ml-2' style={{ color: captureAll ? '#000000' : '#999' }}>
100%
</span>

View file

@ -1,5 +1,5 @@
import React from 'react';
import { Switch } from 'UI';
import { Switch } from 'antd';
import { useStore } from 'App/mstore';
import { useObserver } from 'mobx-react-lite';
import { toast } from 'react-toastify';

View file

@ -1,5 +1,4 @@
import React, { useMemo } from 'react';
import { numberWithCommas } from 'App/utils';
import { applyFilter } from 'Duck/search';
import Period from 'Types/app/period';
import SelectDateRange from 'Shared/SelectDateRange';
@ -8,7 +7,6 @@ import NoteTags from '../Notes/NoteTags';
import { connect } from 'react-redux';
import SessionSort from '../SessionSort';
import { setActiveTab } from 'Duck/search';
import SessionSettingButton from '../SessionSettingButton';
interface Props {
listCount: number;
@ -18,12 +16,13 @@ interface Props {
applyFilter: (filter: any) => void;
setActiveTab: (tab: any) => void;
}
function SessionHeader(props: Props) {
const {
filter: { startDate, endDate, rangeValue },
activeTab,
isEnterprise,
listCount,
listCount
} = props;
const period = Period({ start: startDate, end: endDate, rangeName: rangeValue });
@ -33,7 +32,7 @@ function SessionHeader(props: Props) {
return 'Notes';
}
if (activeTab === 'bookmark') {
return isEnterprise? 'Vault' : 'Bookmarks';
return isEnterprise ? 'Vault' : 'Bookmarks';
}
return 'Sessions';
}, [activeTab]);
@ -44,29 +43,28 @@ function SessionHeader(props: Props) {
};
return (
<div className="flex items-center px-4 py-1 justify-between w-full">
<h2 className="text-2xl capitalize mr-4">{title}</h2>
<div className='flex items-center px-4 py-1 justify-between w-full'>
<h2 className='text-2xl capitalize mr-4'>{title}</h2>
{activeTab !== 'notes' ? (
<div className="flex items-center w-full justify-end">
<div className='flex items-center w-full justify-end'>
{activeTab !== 'bookmark' && (
<>
<SessionTags />
<div className="mr-auto" />
<div className='mr-auto' />
{listCount > 0 && (
<>
<SelectDateRange period={period} onChange={onDateChange} right={true} />
<div className="mx-2" />
<div className='mx-2' />
</>
)}
</>
)}
<SessionSort />
<SessionSettingButton />
</div>
) : null}
{activeTab === 'notes' && (
<div className="flex items-center justify-end w-full">
<div className='flex items-center justify-end w-full'>
<NoteTags />
</div>
)}
@ -79,7 +77,7 @@ export default connect(
filter: state.getIn(['search', 'instance']),
listCount: state.getIn(['sessions', 'total']),
activeTab: state.getIn(['search', 'activeTab', 'type']),
isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee',
isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee'
}),
{ applyFilter, setActiveTab }
)(SessionHeader);