Skip to content

Commit 8dabb29

Browse files
Fixing wrong behaviour in GraphChart report Action (#782)
* drafting solution, looks like is deeper than expected in the graphChart * reverting commit, found realError, global variable was overwritten in local scope (type) --------- Co-authored-by: Alfred Rubin <[email protected]> Co-authored-by: Niels de Jong <[email protected]>
1 parent f5b13c5 commit 8dabb29

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/extensions/actions/ActionsRuleCreationModal.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ export const NeoCustomReportActionsModal = ({
236236
return [];
237237
};
238238

239-
const createFieldVariableSuggestionsFromRule = (rule, type) => {
240-
let suggestions;
241-
if (type) {
239+
const createFieldVariableSuggestionsFromRule = (rule, skipRuleFieldCheck) => {
240+
let suggestions: string[];
241+
if (skipRuleFieldCheck) {
242242
suggestions = createFieldVariableSuggestions(rule.condition, true, null).filter((e) =>
243243
e.toLowerCase().startsWith(rule.field.toLowerCase())
244244
);
@@ -249,13 +249,11 @@ export const NeoCustomReportActionsModal = ({
249249
e.toLowerCase().startsWith(rule.value.toLowerCase())
250250
);
251251
}
252-
253252
// When we are accessing node properties (not page names), parse the node label + property pair to only show properties.
254253
// Fields for graph and map reports are structured differently than regular reports (table, bar, etc.), so we access suggestions differently.
255254
if (rule.customization !== 'set page' && (type == 'graph' || type == 'map' || type == 'graph3d')) {
256255
suggestions = suggestions.map((e) => e.split('.')[1] || e);
257256
}
258-
259257
return suggestions;
260258
};
261259

0 commit comments

Comments
 (0)