Skip to content

Commit e3e7833

Browse files
authored
Merge pull request #728 from neo4j-labs/feature/686-param-selector-limit
Ordering suggestion values by length in parameter selector report
2 parents 3cc3f1a + 4e2c2f4 commit e3e7833

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/chart/parameter/ParameterSelectCardSettings.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,13 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
299299
handleNodeLabelSelectionUpdate(value);
300300
} else if (settings.type == 'Node Property') {
301301
queryCallback(
302-
'CALL db.labels() YIELD label WITH label as nodeLabel WHERE toLower(nodeLabel) CONTAINS toLower($input) RETURN DISTINCT nodeLabel LIMIT 5',
302+
'CALL db.labels() YIELD label WITH label as nodeLabel WHERE toLower(nodeLabel) CONTAINS toLower($input) RETURN DISTINCT nodeLabel ORDER BY size(nodeLabel) LIMIT 5',
303303
{ input: value },
304304
setLabelRecords
305305
);
306306
} else {
307307
queryCallback(
308-
'CALL db.relationshipTypes() YIELD relationshipType WITH relationshipType as relType WHERE toLower(relType) CONTAINS toLower($input) RETURN DISTINCT relType LIMIT 5',
308+
'CALL db.relationshipTypes() YIELD relationshipType WITH relationshipType as relType WHERE toLower(relType) CONTAINS toLower($input) RETURN DISTINCT relType ORDER BY size(relType) LIMIT 5',
309309
{ input: value },
310310
setLabelRecords
311311
);
@@ -343,7 +343,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
343343
handlePropertyNameSelectionUpdate(value);
344344
} else {
345345
queryCallback(
346-
'CALL db.propertyKeys() YIELD propertyKey as propertyName WITH propertyName WHERE toLower(propertyName) CONTAINS toLower($input) RETURN DISTINCT propertyName LIMIT 5',
346+
'CALL db.propertyKeys() YIELD propertyKey as propertyName WITH propertyName WHERE toLower(propertyName) CONTAINS toLower($input) RETURN DISTINCT propertyName ORDER BY size(propertyName) LIMIT 5',
347347
{ input: value },
348348
setPropertyRecords
349349
);
@@ -379,7 +379,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
379379
handlePropertyDisplayNameSelectionUpdate(value);
380380
} else {
381381
queryCallback(
382-
'CALL db.propertyKeys() YIELD propertyKey as propertyName WITH propertyName WHERE toLower(propertyName) CONTAINS toLower($input) RETURN DISTINCT propertyName LIMIT 5',
382+
'CALL db.propertyKeys() YIELD propertyKey as propertyName WITH propertyName WHERE toLower(propertyName) CONTAINS toLower($input) RETURN DISTINCT propertyName ORDER BY size(propertyName) LIMIT 5',
383383
{ input: value },
384384
setPropertyRecords
385385
);

0 commit comments

Comments
 (0)