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

[FEATURE_REQUEST] Allow case insensitive alphabetical sorting #352

Closed
BOZG opened this issue Dec 6, 2021 · 4 comments
Closed

[FEATURE_REQUEST] Allow case insensitive alphabetical sorting #352

BOZG opened this issue Dec 6, 2021 · 4 comments
Labels
🦄 Feature Request [ISSUE] Suggestion for new feature, update or change 👩‍💻 Good First Issue [ISSUE] Great task for newcomers to work on

Comments

@BOZG
Copy link
Contributor

BOZG commented Dec 6, 2021

Is your feature request related to a problem? If so, please describe.

Choosing "alphabetical" as the "Sort by" option is case sensitive meaning that 'A' and 'a' are not sorted together.

Describe the solution you'd like

If feasible, an option to ignore case sensitivity when sorting alphabetically would be nice. Just making sorting case insensitive doesn't strike me as an alternative as I'm sure there are others out there who prefer sorting as it is.

This is obviously a very personal peeve and easily mitigated by me renaming services so I don't expect it to be a priority in any way.

Priority

Low (Nice-to-have)

Is this something you would be keen to implement

No response

@BOZG BOZG added the 🦄 Feature Request [ISSUE] Suggestion for new feature, update or change label Dec 6, 2021
@Lissy93
Copy link
Owner

Lissy93 commented Dec 6, 2021

Hiya @BOZG - Thanks for your suggestion :)
I agree, it would make more sense for sorting to be non-case sensitive. It was probably a mistake that it isn't currently case sensitive, and I hadn't noticed since all my links start with a capital.
I will implement the change this week, and update you here when done :)

@Lissy93 Lissy93 added the 👩‍💻 Good First Issue [ISSUE] Great task for newcomers to work on label Dec 6, 2021
@liss-bot
Copy link
Collaborator

liss-bot commented Dec 6, 2021

This issue has been marked as a good first issue for first-time contributors to implement! This is a great way to support the project, while also improving your skills, you'll also be credited as a contributor once your PR is merged. If you're new to web development, here are a collection of resources to help you get started. You can also find step-by-step tutorials for common tasks within Dashy, on the Dev Guides page. If you need any support at all, feel free to reach out via GitHub Discussions.


I am a bot, and this is an automated message 🤖

@Lissy93
Copy link
Owner

Lissy93 commented Dec 6, 2021

I can make this change either later this evening, or tomorrow. Unless anyone else would like to pick it up, this should be a pretty easy task to implement, sorting is done within the Section component:

/* Sorts items alphabetically using the title attribute */
sortAlphabetically(items) {
return items.sort((a, b) => (a.title > b.title ? 1 : -1));
},

So using toLowerCase() within the sort function should mean titles can be effectively compared. Something like this:

sortAlphabetically(items) {
  return items.sort((a, b) => (a.title.toLowerCase() > b.title.toLowerCase() ? 1 : -1));
},

The reverse-alphabetical sort uses the same method, and then just reverses the order, so the change is only needed in one place.

@Lissy93
Copy link
Owner

Lissy93 commented Dec 6, 2021

Implemented in #354 :)

@Lissy93 Lissy93 closed this as completed in fddf650 Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦄 Feature Request [ISSUE] Suggestion for new feature, update or change 👩‍💻 Good First Issue [ISSUE] Great task for newcomers to work on
Projects
None yet
Development

No branches or pull requests

3 participants