Skip to content

Commit 10a434d

Browse files
authored
Merge pull request #165 from mercedes-benz/VULCAN-999/RevertTableMess
fixed style evalutor
2 parents 6090cf4 + 19af8ff commit 10a434d

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,6 @@
144144
"webpack": "^5.77.0",
145145
"webpack-cli": "^4.9.1",
146146
"webpack-dev-server": "^4.7.3"
147-
}
147+
},
148+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
148149
}

src/extensions/styling/StyleRuleEvaluator.ts

+10-16
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,20 @@ export const evaluateRulesOnDict = (dict, rules, customizations) => {
6363
}
6464
for (const [index, rule] of rules.entries()) {
6565
// Only check customizations that are specified
66-
return evaluateSingleRuleOnDict (dict, rule, index, customizations)
67-
}
68-
// If no rules are met, return not found (index=-1)
69-
return -1;
70-
};
71-
72-
export const evaluateSingleRuleOnDict = (dict, rule, ruleIndex, customizations) => {
73-
if (customizations.includes(rule.customization)) {
74-
// if the row contains the specified field...
75-
if (dict[rule.field] !== undefined && dict[rule.field] !== null) {
76-
const realValue = dict[rule.field].low ? dict[rule.field].low : dict[rule.field];
77-
const ruleValue = rule.value;
78-
if (evaluateCondition(realValue, rule.condition, ruleValue)) {
79-
return ruleIndex;
66+
if (customizations.includes(rule.customization)) {
67+
// if the row contains the specified field...
68+
if (dict[rule.field] !== undefined && dict[rule.field] !== null) {
69+
const realValue = dict[rule.field].low ? dict[rule.field].low : dict[rule.field];
70+
const ruleValue = rule.value;
71+
if (evaluateCondition(realValue, rule.condition, ruleValue)) {
72+
return index;
73+
}
8074
}
8175
}
8276
}
77+
// If no rules are met, return not found (index=-1)
8378
return -1;
84-
}
85-
79+
};
8680

8781
/**
8882
* Evaluates the specified rule set on a node object returned by the Neo4j driver.

0 commit comments

Comments
 (0)