Skip to content

Commit

Permalink
Merge pull request #728 from neo4j-labs/feature/686-param-selector-limit
Browse files Browse the repository at this point in the history
Ordering suggestion values by length in parameter selector report
  • Loading branch information
AleSim94 authored Dec 6, 2023
2 parents 3cc3f1a + 4e2c2f4 commit e3e7833
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/chart/parameter/ParameterSelectCardSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,13 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
handleNodeLabelSelectionUpdate(value);
} else if (settings.type == 'Node Property') {
queryCallback(
'CALL db.labels() YIELD label WITH label as nodeLabel WHERE toLower(nodeLabel) CONTAINS toLower($input) RETURN DISTINCT nodeLabel LIMIT 5',
'CALL db.labels() YIELD label WITH label as nodeLabel WHERE toLower(nodeLabel) CONTAINS toLower($input) RETURN DISTINCT nodeLabel ORDER BY size(nodeLabel) LIMIT 5',
{ input: value },
setLabelRecords
);
} else {
queryCallback(
'CALL db.relationshipTypes() YIELD relationshipType WITH relationshipType as relType WHERE toLower(relType) CONTAINS toLower($input) RETURN DISTINCT relType LIMIT 5',
'CALL db.relationshipTypes() YIELD relationshipType WITH relationshipType as relType WHERE toLower(relType) CONTAINS toLower($input) RETURN DISTINCT relType ORDER BY size(relType) LIMIT 5',
{ input: value },
setLabelRecords
);
Expand Down Expand Up @@ -343,7 +343,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
handlePropertyNameSelectionUpdate(value);
} else {
queryCallback(
'CALL db.propertyKeys() YIELD propertyKey as propertyName WITH propertyName WHERE toLower(propertyName) CONTAINS toLower($input) RETURN DISTINCT propertyName LIMIT 5',
'CALL db.propertyKeys() YIELD propertyKey as propertyName WITH propertyName WHERE toLower(propertyName) CONTAINS toLower($input) RETURN DISTINCT propertyName ORDER BY size(propertyName) LIMIT 5',
{ input: value },
setPropertyRecords
);
Expand Down Expand Up @@ -379,7 +379,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
handlePropertyDisplayNameSelectionUpdate(value);
} else {
queryCallback(
'CALL db.propertyKeys() YIELD propertyKey as propertyName WITH propertyName WHERE toLower(propertyName) CONTAINS toLower($input) RETURN DISTINCT propertyName LIMIT 5',
'CALL db.propertyKeys() YIELD propertyKey as propertyName WITH propertyName WHERE toLower(propertyName) CONTAINS toLower($input) RETURN DISTINCT propertyName ORDER BY size(propertyName) LIMIT 5',
{ input: value },
setPropertyRecords
);
Expand Down

0 comments on commit e3e7833

Please sign in to comment.