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

2.1.3 Release #181

Merged
merged 17 commits into from
Aug 4, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
node property parameter-select: order results by size ASC (#173)
* sort parameter-select results by size ASC

Related to #163

* Make change more explicit by adding "ASC"

* Casting values to string so that we can always sort by size

Co-authored-by: Niels de Jong <[email protected]>
  • Loading branch information
jsuesse and nielsdejong committed Aug 3, 2022
commit 12d1b7a9428b47df129f159ba2d442dd4dfc1146
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ const NeoCardSettingsContentPropertySelect = ({ type, database, settings, onRepo
// Set query based on whether we are selecting a node or relationship property.
onReportSettingUpdate('parameterName', new_parameter_name);
if (settings['type'] == "Node Property") {
const newQuery = "MATCH (n:`" + entityType + "`) \nWHERE toLower(toString(n.`" + propertyType + "`)) CONTAINS toLower($input) \nRETURN DISTINCT n.`" + propertyType + "` as value LIMIT 5";
const newQuery = "MATCH (n:`" + entityType + "`) \nWHERE toLower(toString(n.`" + propertyType + "`)) CONTAINS toLower($input) \nRETURN DISTINCT n.`" + propertyType + "` as value ORDER BY size(toString(value)) ASC LIMIT 5";
onQueryUpdate(newQuery);
} else if (settings['type'] == "Relationship Property"){
const newQuery = "MATCH ()-[n:`" + entityType + "`]->() \nWHERE toLower(toString(n.`" + propertyType + "`)) CONTAINS toLower($input) \nRETURN DISTINCT n.`" + propertyType + "` as value LIMIT 5";
const newQuery = "MATCH ()-[n:`" + entityType + "`]->() \nWHERE toLower(toString(n.`" + propertyType + "`)) CONTAINS toLower($input) \nRETURN DISTINCT n.`" + propertyType + "` as value ORDER BY size(toString(value)) ASC LIMIT 5";
onQueryUpdate(newQuery);
} else {
const newQuery = "RETURN true";
Expand Down Expand Up @@ -194,4 +194,4 @@ const NeoCardSettingsContentPropertySelect = ({ type, database, settings, onRepo
</div>;
}

export default NeoCardSettingsContentPropertySelect;
export default NeoCardSettingsContentPropertySelect;