Problem/Motivation

The new field type category system doesn't allow you to control the order of its options. I think that would be useful so I could for example place entity reference revisions at the end of the reference category, right now it just pops up somewhere in the middle.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#9 Screenshot 2023-07-27 at 7.40.39 PM.png286.21 KBsrishtiiee

Issue fork drupal-3375887

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

Berdir created an issue. See original summary.

lauriii’s picture

Issue tags: +Field UX

srishtiiee made their first commit to this issue’s fork.

srishtiiee’s picture

Status: Active » Needs review
lauriii’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Can we add some test coverage for this? 😇

berdir’s picture

there are a few categories where the current order doesn't really reflect importance. A good example is IMHO Selection list, at least for me, list (text) is the 90%+ use case, rarely list (integer) and I don't think I've ever used list (float) in my life. The current order is the opposite of that. we could use weights to improve that and then a test can assert that list (text) shows up before list (integer)?

kind of same for number, number (integer) is I think also the most common option, but float and decimal line currently nicely have the same height, not sure how that will look then ;)

(the add example for test was actually a crosspost with my comment)

lauriii’s picture

I agree that we could use this for re-ordering the selection list options based on what @Berdir is proposing. That seems like a perfect way to show case this feature 👍

srishtiiee’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new286.21 KB

Number field types don't look that bad IMO, will revert the changes if we decide otherwise.

berdir’s picture

Nice. Should decimal be before float given that the description of float says you should probably use decimal?

utkarsh_33’s picture

Status: Needs review » Reviewed & tested by the community

Changes look good to me and also the feedbacks in #7 and #10 are addressed.So marking it as RTBC.

  • lauriii committed f9b363c0 on 11.x
    Issue #3375887 by srishtiiee, Berdir, Utkarsh_33: Add a weight for the...

lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed f9b363c and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

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