Skip to content

Commit

Permalink
Revert "wip #912 todo"
Browse files Browse the repository at this point in the history
This reverts commit 62289bd.
  • Loading branch information
ukrbublik committed May 8, 2023
1 parent 62289bd commit ac42561
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions packages/core/modules/export/queryString.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const formatGroup = (item, config, meta, isForDisplay = false, parentField = nul

const isRuleGroup = (type === "rule_group");
// TIP: don't cut group for mode == 'struct' and don't do aggr format (maybe later)
const groupField = isRuleGroup && mode != "struct" ? properties.get("field") : null;
const groupField = isRuleGroup && mode == "array" ? properties.get("field") : null;
const canHaveEmptyChildren = isRuleGroup && mode == "array";
const not = properties.get("not");
const list = children
Expand All @@ -63,7 +63,7 @@ const formatGroup = (item, config, meta, isForDisplay = false, parentField = nul
conjunction = defaultConjunction(config);
const conjunctionDefinition = config.conjunctions[conjunction];

const conjStr = list.size ? conjunctionDefinition.formatConj(list, conjunction, not, isForDisplay, groupField) : null;
const conjStr = list.size ? conjunctionDefinition.formatConj(list, conjunction, not, isForDisplay) : null;

let ret;
if (groupField) {
Expand Down Expand Up @@ -192,6 +192,8 @@ const formatRule = (item, config, meta, isForDisplay = false, parentField = null
const [formattedValue, valueSrc, valueType] = formatItemValue(
config, properties, meta, operator, isForDisplay, parentField
);
if (formattedValue === undefined)
return undefined;

const args = [
formattedField,
Expand All @@ -209,9 +211,6 @@ const formatRule = (item, config, meta, isForDisplay = false, parentField = null
if (returnArgs) {
return args;
} else {
if (formattedValue === undefined)
return undefined;

//format expr
let ret = fn.call(config.ctx, ...args);

Expand Down Expand Up @@ -275,7 +274,7 @@ const formatField = (config, meta, field, isForDisplay, parentField = null, cutP
const fieldLabel2 = fieldDefinition.label2 || fieldFullLabel;
const formatFieldFn = config.settings.formatField;
const fieldName = formatFieldName(field, config, meta, cutParentField ? parentField : null, {useTableName: true});
ret = formatFieldFn(fieldName, fieldParts, fieldLabel2, fieldDefinition, config, isForDisplay, parentField);
ret = formatFieldFn(fieldName, fieldParts, fieldLabel2, fieldDefinition, config, isForDisplay);
}
return ret;
};
Expand Down
4 changes: 2 additions & 2 deletions packages/core/modules/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ export type Widgets<C = Config> = TypedMap<Widget<C>>;
// Conjunctions
/////////////////

type FormatConj = (children: ImmutableList<string>, conj: string, not: boolean, isForDisplay?: boolean, groupField?: string) => string;
type FormatConj = (children: ImmutableList<string>, conj: string, not: boolean, isForDisplay?: boolean) => string;
type SqlFormatConj = (children: ImmutableList<string>, conj: string, not: boolean) => string;
type SpelFormatConj = (children: ImmutableList<string>, conj: string, not: boolean, omitBrackets?: boolean) => string;

Expand Down Expand Up @@ -841,7 +841,7 @@ type ChangeFieldStrategy = "default" | "keep" | "first" | "none";
type FormatReverse = (q: string, op: string, reversedOp: string, operatorDefinition: Operator, revOperatorDefinition: Operator, isForDisplay: boolean) => string;
type SqlFormatReverse = (q: string) => string;
type SpelFormatReverse = (q: string) => string;
type FormatField = (field: string, parts: Array<string>, label2: string, fieldDefinition: Field, config: Config, isForDisplay: boolean, parentField?: string) => string;
type FormatField = (field: string, parts: Array<string>, label2: string, fieldDefinition: Field, config: Config, isForDisplay: boolean) => string;
type FormatSpelField = (field: string, parentField: string | null, parts: Array<string>, partsExt: Array<SpelFieldMeta>, fieldDefinition: Field, config: Config) => string;
type CanCompareFieldWithField = (leftField: string, leftFieldConfig: Field, rightField: string, rightFieldConfig: Field, op: string) => boolean;
type FormatAggr = (whereStr: string, aggrField: string, operator: string, value: string | ImmutableList<string>, valueSrc: ValueSource, valueType: string, opDef: Operator, operatorOptions: AnyObject, isForDisplay: boolean, aggrFieldDef: Field) => string;
Expand Down

0 comments on commit ac42561

Please sign in to comment.