Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordering suggestion values by length in parameter selector report #728

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading