@@ -49,7 +49,7 @@ const formatGroup = (item, config, meta, isForDisplay = false, parentField = nul
49
49
50
50
const isRuleGroup = ( type === "rule_group" ) ;
51
51
// TIP: don't cut group for mode == 'struct' and don't do aggr format (maybe later)
52
- const groupField = isRuleGroup && mode == "array " ? properties . get ( "field" ) : null ;
52
+ const groupField = isRuleGroup && mode != "struct " ? properties . get ( "field" ) : null ;
53
53
const canHaveEmptyChildren = isRuleGroup && mode == "array" ;
54
54
const not = properties . get ( "not" ) ;
55
55
const list = children
@@ -63,7 +63,7 @@ const formatGroup = (item, config, meta, isForDisplay = false, parentField = nul
63
63
conjunction = defaultConjunction ( config ) ;
64
64
const conjunctionDefinition = config . conjunctions [ conjunction ] ;
65
65
66
- const conjStr = list . size ? conjunctionDefinition . formatConj ( list , conjunction , not , isForDisplay ) : null ;
66
+ const conjStr = list . size ? conjunctionDefinition . formatConj ( list , conjunction , not , isForDisplay , groupField ) : null ;
67
67
68
68
let ret ;
69
69
if ( groupField ) {
@@ -192,8 +192,6 @@ const formatRule = (item, config, meta, isForDisplay = false, parentField = null
192
192
const [ formattedValue , valueSrc , valueType ] = formatItemValue (
193
193
config , properties , meta , operator , isForDisplay , parentField
194
194
) ;
195
- if ( formattedValue === undefined )
196
- return undefined ;
197
195
198
196
const args = [
199
197
formattedField ,
@@ -211,6 +209,9 @@ const formatRule = (item, config, meta, isForDisplay = false, parentField = null
211
209
if ( returnArgs ) {
212
210
return args ;
213
211
} else {
212
+ if ( formattedValue === undefined )
213
+ return undefined ;
214
+
214
215
//format expr
215
216
let ret = fn . call ( config . ctx , ...args ) ;
216
217
@@ -274,7 +275,7 @@ const formatField = (config, meta, field, isForDisplay, parentField = null, cutP
274
275
const fieldLabel2 = fieldDefinition . label2 || fieldFullLabel ;
275
276
const formatFieldFn = config . settings . formatField ;
276
277
const fieldName = formatFieldName ( field , config , meta , cutParentField ? parentField : null , { useTableName : true } ) ;
277
- ret = formatFieldFn ( fieldName , fieldParts , fieldLabel2 , fieldDefinition , config , isForDisplay ) ;
278
+ ret = formatFieldFn ( fieldName , fieldParts , fieldLabel2 , fieldDefinition , config , isForDisplay , parentField ) ;
278
279
}
279
280
return ret ;
280
281
} ;
0 commit comments