ui: conditional rec fixes
This commit is contained in:
parent
4b21194ec5
commit
d031210365
4 changed files with 27 additions and 12 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import { Icon, Input } from 'UI';
|
||||
import cn from 'classnames';
|
||||
import { FilterList } from 'Shared/Filters/FilterList';
|
||||
import { FilterList, EventsList } from 'Shared/Filters/FilterList';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { Typography } from 'antd';
|
||||
import { BranchesOutlined } from '@ant-design/icons';
|
||||
|
|
@ -77,6 +77,18 @@ function ConditionSetComponent({
|
|||
</div>
|
||||
<div className={'p-2'}>
|
||||
<div className={conditions.filter.filters.length > 0 ? 'p-2 mb-2' : ''}>
|
||||
<EventsList
|
||||
filter={conditions.filter}
|
||||
onUpdateFilter={onUpdateFilter}
|
||||
onRemoveFilter={onRemoveFilter}
|
||||
onChangeEventsOrder={onChangeEventsOrder}
|
||||
hideEventsOrder
|
||||
onAddFilter={onAddFilter}
|
||||
excludeFilterKeys={excludeFilterKeys}
|
||||
readonly={readonly}
|
||||
isConditional={isConditional}
|
||||
borderless
|
||||
/>
|
||||
<FilterList
|
||||
filter={conditions.filter}
|
||||
onUpdateFilter={onUpdateFilter}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ export const EventsList = observer((props: Props) => {
|
|||
actions = [],
|
||||
onAddFilter,
|
||||
cannotAdd,
|
||||
excludeCategory
|
||||
excludeCategory,
|
||||
borderless
|
||||
} = props;
|
||||
|
||||
const filters = filter.filters;
|
||||
|
|
@ -199,8 +200,10 @@ export const EventsList = observer((props: Props) => {
|
|||
const eventsNum = filters.filter((i: any) => i.isEvent).length;
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
'border-b border-b-gray-lighter pt-2 px-4 rounded-xl bg-white border border-gray-lighter'
|
||||
className={cn(
|
||||
'bg-white',
|
||||
borderless ? '' : 'pb-2 px-4 rounded-xl border border-gray-lighter'
|
||||
)
|
||||
}
|
||||
style={{
|
||||
borderBottomLeftRadius: props.mergeDown ? 0 : undefined,
|
||||
|
|
@ -217,6 +220,7 @@ export const EventsList = observer((props: Props) => {
|
|||
mode={'events'}
|
||||
filter={undefined}
|
||||
onFilterClick={onAddFilter}
|
||||
excludeFilterKeys={excludeFilterKeys}
|
||||
excludeCategory={excludeCategory}
|
||||
>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -201,7 +201,8 @@ export default class API {
|
|||
Timing(app, options)
|
||||
Focus(app)
|
||||
Fonts(app)
|
||||
if (!options.network.disabled) {
|
||||
const skipNetwork = options.network?.disabled
|
||||
if (!skipNetwork) {
|
||||
Network(app, options.network)
|
||||
}
|
||||
Selection(app)
|
||||
|
|
|
|||
|
|
@ -87,13 +87,10 @@ export default class ConditionsManager {
|
|||
}
|
||||
|
||||
createConditionFromFilter = (filter: Filter) => {
|
||||
if (filter.value.length) {
|
||||
const resultCondition = mapCondition(filter)
|
||||
if (resultCondition.type) {
|
||||
return resultCondition
|
||||
}
|
||||
const resultCondition = mapCondition(filter)
|
||||
if (resultCondition.type) {
|
||||
return resultCondition
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
trigger(conditionName: string) {
|
||||
|
|
@ -390,8 +387,9 @@ const mapCondition = (condition: Filter): Condition => {
|
|||
con = {
|
||||
type: 'session_duration',
|
||||
// @ts-ignore
|
||||
value: condition.value[0],
|
||||
value: condition.value,
|
||||
key: '',
|
||||
operator: 'is',
|
||||
}
|
||||
break
|
||||
case 'fetchUrl':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue