EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

BooleanField suddenly reversed

Open Yoran-Memo opened this issue 2 years ago • 15 comments

In the detail page of an entity within a CrudController, the booleanField is suddenly reversed since the update.

To Reproduce I updated easycorp/easyadmin-bundle from (v4.7.7 => v4.8.4)

Make an CrudController for an entity and create a booleanField (Active for example). Create the entity so its shown on the indexpage. Go to the detail page of the entity.

(OPTIONAL) Additional context image (2) image (1)

Yoran-Memo avatar Nov 10 '23 10:11 Yoran-Memo

Happened with the changes from v4.7.7 => v4.8.0. Actually trying to identify the exact point in the code.

danielsippel avatar Nov 15 '23 12:11 danielsippel

It looks like the css of the field-boolean field-label and field-value is switched.

I personally rewrote the elements in CSS back to standard:

.ea-detail .field-group.field-boolean .field-label {
    flex: unset;
    min-width: 0;
    margin: 0 15px 0 0 !important;
    width: 130px !important;
    text-align: right !important;
}

.ea-detail .field-group.field-boolean {
    flex-direction: row !important;
}

.ea-detail .field-group.field-boolean .field-value {
    flex: 1 !important;
    min-width: 66% !important;
    text-align: left !important;
}

Yoran-Memo avatar Nov 20 '23 12:11 Yoran-Memo

And I also realized that the help text tooltip isn't showing properly image

Other than that, you can see that there is no question-mark icon anymore if a field contains a help-text. Is this a bug or the new design? The label is only underlined.

Is there a possibility to set a help-text option to display the text fully underneath the field? As it is already on the edit-page.

siggidiel avatar Nov 21 '23 12:11 siggidiel

I can confirm that even with latest 4.8.12 version, boolean field display in details views is still wrong as mentioned above.

juban avatar Jan 29 '24 14:01 juban

I came here thinking it was a bug as well, but it looks like it's actually intended : https://github.com/EasyCorp/EasyAdminBundle/pull/5977#issuecomment-1779880015

Nispeon avatar Mar 07 '24 15:03 Nispeon

@Nispeon haaa, thanks for finding out :-)

danielsippel avatar Mar 07 '24 15:03 danielsippel

Vote this comment up for: Leave it like it is right now, I like the new version.

easycorp/easyadmin-bundle (v4.9.3): Bildschirmfoto 2024-03-07 um 17 36 00

danielsippel avatar Mar 07 '24 15:03 danielsippel

Vote this comment up for: Please revert the change, labels for checkboxes should go back to the left.

easycorp/easyadmin-bundle (v4.7.7): Bildschirmfoto 2024-03-07 um 17 34 41

danielsippel avatar Mar 07 '24 15:03 danielsippel

@javiereguiluz @john-dufrene-dev Can we revert the flip of label/value? Or as an alternative add a setting in the Dashboard/Crud config classes?

danielsippel avatar Mar 26 '24 06:03 danielsippel

After reading #5977 I'm still confused about the motivation of that change. Why would the flipped label / value be more relevant for boolean fields?

juban avatar Mar 30 '24 17:03 juban

@juban Same here, no idea.

danielsippel avatar Apr 02 '24 12:04 danielsippel

After reading #5977 I'm still confused about the motivation of that change. Why would the flipped label / value be more relevant for boolean fields?

I think when reading Javier's comment https://github.com/EasyCorp/EasyAdminBundle/pull/5977#issuecomment-1779880015 it's getting clearer what's the motivation behind that. Thing is that the label column is very narrow in most cases (or even all cases) and it wouldn't make sense to give the "yes" or "no" values so much space while giving the label too little.

But I am still for having some opt-in possibility for this swap.

siggidiel avatar Apr 02 '24 18:04 siggidiel

After reading #5977 I'm still confused about the motivation of that change. Why would the flipped label / value be more relevant for boolean fields?

I think when reading Javier's comment #5977 (comment) it's getting clearer what's the motivation behind that. Thing is that the label column is very narrow in most cases (or even all cases) and it wouldn't make sense to give the "yes" or "no" values so much space while giving the label too little.

But I am still for having some opt-in possibility for this swap.

Well, as I understand the comment related to label length being possibility much larger than its value, what's still not clear is why it should apply more to a boolean value than any other field type. To present constantly anything one way and suddenly reverse the order for boolean is a bold move, to say the least. I know that the intention was good, but on an UX perspective, it's kind of a non sense to me.

Anyway, I also agree that it should be an opt-in option, and not the default behavior.

juban avatar Apr 03 '24 11:04 juban