change(ui): session list date range

This commit is contained in:
Shekar Siri 2023-06-14 16:40:34 +02:00
parent 26e32d48db
commit d4e51415cd

View file

@ -23,6 +23,7 @@ function SessionHeader(props: Props) {
filter: { startDate, endDate, rangeValue }, filter: { startDate, endDate, rangeValue },
activeTab, activeTab,
isEnterprise, isEnterprise,
listCount,
} = props; } = props;
const period = Period({ start: startDate, end: endDate, rangeName: rangeValue }); const period = Period({ start: startDate, end: endDate, rangeName: rangeValue });
@ -51,8 +52,12 @@ function SessionHeader(props: Props) {
<> <>
<SessionTags /> <SessionTags />
<div className="mr-auto" /> <div className="mr-auto" />
<SelectDateRange period={period} onChange={onDateChange} right={true} /> {listCount > 0 && (
<div className="mx-2" /> <>
<SelectDateRange period={period} onChange={onDateChange} right={true} />
<div className="mx-2" />
</>
)}
</> </>
)} )}
<SessionSort /> <SessionSort />
@ -72,7 +77,7 @@ function SessionHeader(props: Props) {
export default connect( export default connect(
(state: any) => ({ (state: any) => ({
filter: state.getIn(['search', 'instance']), filter: state.getIn(['search', 'instance']),
listCount: numberWithCommas(state.getIn(['sessions', 'total'])), listCount: state.getIn(['sessions', 'total']),
activeTab: state.getIn(['search', 'activeTab', 'type']), activeTab: state.getIn(['search', 'activeTab', 'type']),
isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee', isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee',
}), }),