We can improve list of options in the UI in a couple of ways for improved UX:

Alphabetize them

This MR sorts the following lists in select dropdowns and the lists of little clickable "chips" or "pills". It does not change the order of selected items, such as query sorts, which would of course change the actual behavior.

  • Entity types
  • Fields
  • Filters
  • Includes
  • Sorts

Prevent the same sort field from being added multiple times

It doesn't make sense to select the same sort field more than once, for example, sorting by title twice. This MR disables a sort field once it's been added and re-enables it if it's removed.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

traviscarden created an issue. See original summary.

traviscarden’s picture

Assigned: traviscarden » Unassigned
Status: Active » Needs review
ankitv18’s picture

Assigned: Unassigned » ankitv18
traviscarden’s picture

Title: Sort lists of available options alphabetically » Improve lists of available options
Issue summary: View changes
Issue tags: +UX

Ya know what? As long as we're touching this code, let's make one more related enhancement and disable "Sort" fields once added to prevent adding the same one more than once.

balsama’s picture

Status: Needs review » Needs work

Hmm, when I use this MR, UUID appears in the list of sort options, which is not valid.

traviscarden’s picture

Status: Needs work » Needs review

Thanks, @balsama. That was actually to be expected insofar as the fix for that issue* just hadn't been committed yet at the time this MR was created. I've rebased. It should work and the problem should be gone now.

* #3545512: Errors when sorting

balsama’s picture

Status: Needs review » Reviewed & tested by the community

Oh geez. Right. Looks good now. Thanks.

  • balsama committed 7b322b8e on 2.0.x authored by traviscarden
    [#3549064] fix: Improve lists of available options
    
    By: traviscarden
    By...
traviscarden’s picture

Assigned: ankitv18 » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.