-
- {filter.eventsHeader || 'EVENTS'}
-
+ const eventsNum = filters.filter((i: any) => i.isEvent).size;
+ return (
+
+ {onlyFilters ? null : (
+
+
+ {filter.eventsHeader || 'Events'}
+
-
- {!hideEventsOrder && }
- {actions && actions.map((action, index) => (
- {action}
- ))}
-
+
+ {!hideEventsOrder && (
+
+ )}
+ {actions &&
+ actions.map((action, index) => {action}
)}
+
+
+
+ {filters.map((filter: any, filterIndex: number) =>
+ filter.isEvent ? (
+
handleDragOverEv(e, filterIndex)}
+ onDrop={(e) => handleDrop(e)}
+ key={`${filter.key}-${filterIndex}`}
+ >
+ {!!props.onFilterMove && eventsNum > 1 ? (
+
+ handleDragStart(
+ e,
+ filterIndex,
+ `${filter.key}-${filterIndex}`
+ )
+ }
+ >
+
-
- {filters.map((filter: any, filterIndex: number) =>
- filter.isEvent ? (
-
handleDragOverEv(e, filterIndex)}
- onDrop={(e) => handleDrop(e)}
- key={`${filter.key}-${filterIndex}`}
- >
- {!!props.onFilterMove && eventsNum > 1 ? (
-
- handleDragStart(
- e,
- filterIndex,
- `${filter.key}-${filterIndex}`
- )
- }
- >
-
-
- ) : null}
-
- props.onUpdateFilter(filterIndex, filter)
- }
- onRemoveFilter={() => onRemoveFilter(filterIndex)}
- saveRequestPayloads={saveRequestPayloads}
- disableDelete={cannotDeleteFilter}
- excludeFilterKeys={excludeFilterKeys}
- readonly={props.readonly}
- isConditional={isConditional}
- />
-
- ) : null
- )}
-
-
- >
+ ) : null}
+
+ props.onUpdateFilter(filterIndex, filter)
+ }
+ onRemoveFilter={() => onRemoveFilter(filterIndex)}
+ saveRequestPayloads={saveRequestPayloads}
+ disableDelete={cannotDeleteFilter}
+ excludeFilterKeys={excludeFilterKeys}
+ readonly={props.readonly}
+ isConditional={isConditional}
+ />
+
+ ) : null
)}
+
+
+ )}
- {hasFilters && (
- <>
- {hasEvents &&
}
-
FILTERS
- {filters.map((filter: any, filterIndex: any) =>
- !filter.isEvent ? (
-
- props.onUpdateFilter(filterIndex, filter)}
- onRemoveFilter={() => onRemoveFilter(filterIndex)}
- excludeFilterKeys={excludeFilterKeys}
- isConditional={isConditional}
- />
-
- ) : null
- )}
- >
- )}
+
+
+
Filters
+
+ }
+ type="default"
+ size={'small'}
+ >
+ Add
+
+
- );
+ {filters.map((filter: any, filterIndex: any) =>
+ !filter.isEvent ? (
+
+ props.onUpdateFilter(filterIndex, filter)}
+ onRemoveFilter={() => onRemoveFilter(filterIndex)}
+ excludeFilterKeys={excludeFilterKeys}
+ isConditional={isConditional}
+ />
+
+ ) : null
+ )}
+
+
+ );
}
export default observer(FilterList);
diff --git a/frontend/app/components/shared/LiveSessionSearch/LiveSessionSearch.tsx b/frontend/app/components/shared/LiveSessionSearch/LiveSessionSearch.tsx
index 82303564c..9c291dbf0 100644
--- a/frontend/app/components/shared/LiveSessionSearch/LiveSessionSearch.tsx
+++ b/frontend/app/components/shared/LiveSessionSearch/LiveSessionSearch.tsx
@@ -9,8 +9,8 @@ function LiveSessionSearch() {
const { projectsStore, searchStoreLive, sessionStore } = useStore();
const saveRequestPayloads = projectsStore.active?.saveRequestPayloads;
const appliedFilter = searchStoreLive.instance;
- const hasEvents = appliedFilter.filters.filter(i => i.isEvent).length > 0;
- const hasFilters = appliedFilter.filters.filter(i => !i.isEvent).length > 0;
+ const hasEvents = appliedFilter.filters.filter((i) => i.isEvent).length > 0;
+ const hasFilters = appliedFilter.filters.filter((i) => !i.isEvent).length > 0;
useEffect(() => {
void searchStoreLive.fetchSessions();
@@ -31,7 +31,7 @@ function LiveSessionSearch() {
});
searchStoreLive.edit({
- filters: newFilters
+ filters: newFilters,
});
void searchStoreLive.fetchSessions();
@@ -39,45 +39,23 @@ function LiveSessionSearch() {
const onChangeEventsOrder = (e: any, { name, value }: any) => {
searchStoreLive.edit({
- eventsOrder: value
+ eventsOrder: value,
});
void searchStoreLive.fetchSessions();
};
- return (hasEvents || hasFilters) ? (
-
-
-
-
-
-
-
-
- {/* */}
-
-
-
-
-
-
-
- ) : <>>;
+ return (
+
+ );
}
export default observer(LiveSessionSearch);
diff --git a/frontend/app/components/shared/SessionItem/MetaItem/MetaItem.tsx b/frontend/app/components/shared/SessionItem/MetaItem/MetaItem.tsx
index 5b88d1896..42eae0244 100644
--- a/frontend/app/components/shared/SessionItem/MetaItem/MetaItem.tsx
+++ b/frontend/app/components/shared/SessionItem/MetaItem/MetaItem.tsx
@@ -10,11 +10,11 @@ interface Props {
export default function MetaItem(props: Props) {
const { className = '', label, value } = props
return (
-
-
+
+
-
+
diff --git a/frontend/app/components/shared/SessionItem/SessionItem.tsx b/frontend/app/components/shared/SessionItem/SessionItem.tsx
index a87bfc3c4..ea5b54882 100644
--- a/frontend/app/components/shared/SessionItem/SessionItem.tsx
+++ b/frontend/app/components/shared/SessionItem/SessionItem.tsx
@@ -13,14 +13,7 @@ import {
sessions as sessionsRoute,
} from 'App/routes';
import { capitalize } from 'App/utils';
-import {
- Avatar,
- CountryFlag,
- Icon,
- Label,
- TextEllipsis,
- Tooltip,
-} from 'UI';
+import { Avatar, CountryFlag, Icon, Label, TextEllipsis, Tooltip } from 'UI';
import Counter from './Counter';
import ErrorBars from './ErrorBars';
@@ -83,7 +76,7 @@ const PREFETCH_STATE = {
none: 0,
loading: 1,
fetched: 2,
-}
+};
function SessionItem(props: RouteComponentProps & Props) {
const { settingsStore, sessionStore } = useStore();
@@ -130,32 +123,32 @@ function SessionItem(props: RouteComponentProps & Props) {
const location = props.location;
const queryParams = Object.fromEntries(new URLSearchParams(location.search));
- const isMobile = platform !== 'web'
+ const isMobile = platform !== 'web';
const formattedDuration = durationFormatted(duration);
const hasUserId = userId || userAnonymousId;
const isSessions = isRoute(SESSIONS_ROUTE, location.pathname);
const isAssist =
(!ignoreAssist &&
- (isRoute(ASSIST_ROUTE, location.pathname) ||
- isRoute(ASSIST_LIVE_SESSION, location.pathname) ||
- location.pathname.includes('multiview'))) ||
+ (isRoute(ASSIST_ROUTE, location.pathname) ||
+ isRoute(ASSIST_LIVE_SESSION, location.pathname) ||
+ location.pathname.includes('multiview'))) ||
props.live;
const isLastPlayed = lastPlayedSessionId === sessionId;
- const _metaList = Object.keys(metadata)
- .map((key) => {
- const value = metadata[key];
- return { label: key, value };
- });
+ const _metaList = Object.keys(metadata).map((key) => {
+ const value = metadata[key];
+ return { label: key, value };
+ });
const handleHover = async () => {
if (
- prefetchState !== PREFETCH_STATE.none
- || props.live
- || isAssist
- || isMobile
- ) return;
+ prefetchState !== PREFETCH_STATE.none ||
+ props.live ||
+ isAssist ||
+ isMobile
+ )
+ return;
setPrefetched(PREFETCH_STATE.loading);
try {
@@ -167,10 +160,10 @@ function SessionItem(props: RouteComponentProps & Props) {
};
const populateData = () => {
if (
- props.live
- || isAssist
- || prefetchState === PREFETCH_STATE.none
- || isMobile
+ props.live ||
+ isAssist ||
+ prefetchState === PREFETCH_STATE.none ||
+ isMobile
) {
return;
}
@@ -193,38 +186,46 @@ function SessionItem(props: RouteComponentProps & Props) {
{!compact && (
-
-
-
- !disableUser && !hasUserFilter && hasUserId
- ? onUserClick(userId, userAnonymousId)
- : null
- }
- >
-
+
+
+
+ !disableUser && !hasUserFilter && hasUserId
+ ? onUserClick(userId, userAnonymousId)
+ : null
+ }
+ >
+
+
+
+ {_metaList.length > 0 && (
+
+ )}
)}
@@ -281,8 +282,8 @@ function SessionItem(props: RouteComponentProps & Props) {
{eventsCount}
{eventsCount === 0 || eventsCount > 1
- ? 'Events'
- : 'Event'}
+ ? 'Events'
+ : 'Event'}
@@ -292,8 +293,8 @@ function SessionItem(props: RouteComponentProps & Props) {
{live || props.live ? (
) : (
- formattedDuration
- )}
+ formattedDuration
+ )}
@@ -394,22 +395,19 @@ function SessionItem(props: RouteComponentProps & Props) {