ui: fix assist filter list
This commit is contained in:
parent
b4d2e685de
commit
ab84a872db
4 changed files with 21 additions and 5 deletions
|
|
@ -134,7 +134,7 @@ export const getMatchingEntries = (
|
|||
};
|
||||
|
||||
interface Props {
|
||||
isLive: boolean;
|
||||
isLive?: boolean;
|
||||
conditionalFilters: any;
|
||||
mobileConditionalFilters: any;
|
||||
onFilterClick?: (filter: any) => void;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ interface Props {
|
|||
isConditional?: boolean;
|
||||
isMobile?: boolean;
|
||||
mode: 'filters' | 'events';
|
||||
isLive?: boolean;
|
||||
}
|
||||
|
||||
function FilterSelection(props: Props) {
|
||||
|
|
@ -33,6 +34,7 @@ function FilterSelection(props: Props) {
|
|||
isConditional,
|
||||
isMobile,
|
||||
mode,
|
||||
isLive,
|
||||
} = props;
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
|
||||
|
|
@ -84,7 +86,7 @@ function FilterSelection(props: Props) {
|
|||
{showModal && (
|
||||
<div className="absolute mt-2 left-0 rounded-2xl shadow-lg bg-white z-50">
|
||||
<FilterModal
|
||||
isLive={isRoute(ASSIST_ROUTE, window.location.pathname)}
|
||||
isLive={isRoute(ASSIST_ROUTE, window.location.pathname) || isLive}
|
||||
onFilterClick={onAddFilter}
|
||||
excludeFilterKeys={excludeFilterKeys}
|
||||
allowedFilterKeys={allowedFilterKeys}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ function LiveSessionSearch() {
|
|||
onRemoveFilter={onRemoveFilter}
|
||||
onChangeEventsOrder={onChangeEventsOrder}
|
||||
saveRequestPayloads={saveRequestPayloads}
|
||||
isLive
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -920,15 +920,28 @@ const mapFilters = (list) => {
|
|||
};
|
||||
|
||||
const liveFilterSupportedOperators = ['is', 'contains'];
|
||||
const liveFilterKeys = [
|
||||
FilterKey.METADATA,
|
||||
FilterKey.USERID,
|
||||
FilterKey.USER_COUNTRY,
|
||||
FilterKey.USER_CITY,
|
||||
FilterKey.USER_STATE,
|
||||
FilterKey.USERANONYMOUSID,
|
||||
FilterKey.USER_BROWSER,
|
||||
FilterKey.USER_OS,
|
||||
FilterKey.USER_DEVICE,
|
||||
FilterKey.PLATFORM,
|
||||
FilterKey.UTM_MEDIUM,
|
||||
FilterKey.UTM_SOURCE,
|
||||
FilterKey.UTM_CAMPAIGN,
|
||||
]
|
||||
const mapLiveFilters = (list) => {
|
||||
const obj = {};
|
||||
list.forEach(filter => {
|
||||
if (
|
||||
filter.category !== FilterCategory.EVENTS &&
|
||||
filter.category !== FilterCategory.DEVTOOLS &&
|
||||
filter.key !== FilterKey.DURATION &&
|
||||
filter.key !== FilterKey.REFERRER &&
|
||||
filter.key !== FilterKey.TAGGED_ELEMENT
|
||||
liveFilterKeys.includes(filter.key)
|
||||
) {
|
||||
obj[filter.key] = { ...filter };
|
||||
obj[filter.key].operatorOptions = filter.operatorOptions.filter(operator => liveFilterSupportedOperators.includes(operator.value));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue