feat(frontend): order models and brain by name (#3009)

# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
This commit is contained in:
Antoine Dewez 2024-08-14 23:40:50 +02:00 committed by GitHub
parent 2812ea4f35
commit a36837e361
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,9 +65,16 @@ export const getBrains = async (
return -1;
} else if (a.brain_type !== "model" && b.brain_type === "model") {
return 1;
} else if (
a.brain_type === "model" &&
b.brain_type === "model" &&
a.display_name &&
b.display_name
) {
return a.display_name.localeCompare(b.display_name);
} else {
return a.name.localeCompare(b.name);
}
return 0;
});
return sortedBrains.map(mapBackendMinimalBrainToMinimalBrain);