-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
Set default width for grid datetime columns, ref #2239 #2544
Conversation
The inconstant width of the columns in the grids is a disturbing visual issue in the Backend and which I reported here #2239. There are over 120 Grid.php files and this issue should be solved in the following order:
I'm testing and if it's fine it can be proposed for approval. |
This PR must be tested together with PR #2422. The latter fixes the issues related to the date columns in the grids. Yesterday it took me almost half an hour to understand why only by taking this PR further the columns were not presented correctly, the calendar icon moving to the next line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is fine. Two comments:
|
I checked all the changes and they are fine in the Grid.php files:
In order to approve it, I am waiting for the opinion related to the value of the default width at 150/155. |
I've changed datetime column width to 160px (as in first commit). Note: there is (at least) one grid that is still "broken", because all columns have width set. I cant find it right now and will be fixed later. |
@addison74 just an idea ... some date columns are aligned left, others centered. Centered looks better imho ... |
I will tell you my opinion in a discussion post. Left and right alignment is prefered for most columns. Center align for a few, for example Action column or colums with words closed as length (Enable/Disable). |
'width' => 140 | ||
], | ||
]; | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 150 enought when the hour is like “22.00”? Cause there’s gonna be ine more digit.
now that @sreichel set it to 160 i think its ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
160 seems to cover all scenarios. If not we can create a new PR later. We should implement default values for other types (TBD).
I have not checked any columns of type date. Maybe the change from 140 to 160 should be made there as well. |
No. Date columns require less space (no time shown) and could be even smaller, but column header needs around 140px. |
In boxes.css (Magento legacy theme) and override.css (OpenMage theme) there is already established the minimum width value at 140px. Practically, through this PR we control a value greater than this for all grids which is useful in my opinion. It can be seen from the modified files that there is an inconsistency related to the value of the two columns, one of which even has a value of 1. |
Description (*)
This PR replaces all admin grid
width
attributes fordatetime
columns width a default value to make grids more consistent.The required width for datetime is allways same, so it does not make sense to set it 140 here, to 200 there ...
This could be extended to set defaults for other grid types too (date, action, currency, store ...)
Fixed Issues (if relevant)
Contribution checklist (*)