-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[WIP] tables #2092
[WIP] tables #2092
Conversation
I'm hardly the right person to comment, but everything here looks reasonable to me. Though we'll likely have to do a semi-large manual QA to make sure there aren't tables somewhere in the deep dark parts of solidus we will need to change. |
I will make a QA session tomorrow morning |
Cool! Going to run through this now. |
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.
- spacing is a little odd on the products table (too much space between the image and the name)
It looks like almost all of the tables need some alignment adjustment. I'm going to have a look at fixing these.
The stock management table in particular falls apart here. I had already been working on some changes to that table. I will coordinate with @Mandily to clean up that area. |
Nice work @Mandily 👏 Sorry in advance - this is hence the nature of this change - a very long review comment 😞 I really like the new table style. Hence tables are a mayor UI pattern in Solidus admin there is still some work to do. Walking through the admin I found these issues:
Again, great work. Please feel free to contact me for help. Maybe we should even consider to split this PR up into smaller PRs. Thanks for the great work! |
@tvdeyen beauty! I nabbed the There might also be some |
Bootstap handles the bulk of the styling and we no longer need these extra styles.
This increases data scanability.
Now that we have new table styles where table headings are aligned to the left by default we want our table cells to follow suit.
These no longer apply any styles. If striping is desired this can be much more easily accomplish by using nth-child in your CSS.
Now that we are using Bootstrap table styles we no longer need to push around pixels like this.
This was necessary before switching to Bootstrap table styles but this class now has no effect.
I believe I've nabbed all of @tvdeyen's concerns as well as a couple of my own. This PR is rebased and I believe ready for a proper review. |
This will make sure that the table headers properly line up with their content below.
Now that the majority of text is left aligned this will make multi-line table cells easier to read.
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.
Great progress. Thanks @graygilmore for helping out. I found some small glitches here and there. Just commented them below for further reference, but will provide a PR against @Mandily branch.
border-right: 1px solid $color-border; | ||
border-bottom: 1px solid $color-border; | ||
vertical-align: middle; | ||
vertical-align: top; |
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.
This is bootstraps default. We can remove this 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.
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.
I actually prefer the before to the after. As a general rule, I try to keep less space between the lines of the same label/list item/paragraph and more between it and whatever is around. It helps keep the item grouped with itself a little better.
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.
I'm with @Mandily on this one, not a fan of the large line-height.
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.
I agree that the large line-height is not ideal, but I also think that the vertical alignment of single line rows should be corrected. What makes me thinking is that the default tables in Bootstraps documentation are all correctly aligned. 🤔
I will have a second look into this problem
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.
@graygilmore @Mandily I know why the vertical alignment for single line rows is off. The action buttons occupy more space then the text and thats why the row is too high.
Solution would be to get rid of the round background.
We should handle this problem in separate PR.
WDYT about this approach?
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.
Separate PR makes sense. I think we're due for another solution in that area entirely.
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.
A bunch of these (this particular example included) can be removed and replaced with the inline editing solution that Martin worked on. I linked a drive document in #2042 for those. I'm ok with this style for the ones that remain.
@@ -1,6 +1,6 @@ | |||
<tr class="option_value fields" id="spree_<%= dom_id(f.object) %>" data-hook="option_value" class="<%= cycle('odd', 'even')%>"> | |||
<tr class="option_value fields" id="spree_<%= dom_id(f.object) %>" data-hook="option_value"> | |||
<% if f.object.persisted? %> |
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.
@@ -65,17 +65,17 @@ | |||
<tr data-hook="admin_products_index_headers"> | |||
<th><%= Spree::Variant.human_attribute_name(:sku) %></th> | |||
<th colspan="2"><%= sort_link @search,:name, Spree::Product.human_attribute_name(:name), { default_order: "desc" }, {title: 'admin_products_listing_name_title'} %></th> |
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.
We should remove the colspan
here and add an empty <td>
instead.
<td class="align-center"><%= render 'spree/admin/shared/image', image: product.display_image, size: :mini %></td> | ||
<tr <%== "style='color: red;'" if product.deleted? %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows"> | ||
<td><%= product.sku %></td> | ||
<td><%= render 'spree/admin/shared/image', image: product.display_image, size: :mini %></td> |
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.
The image should have a align-center
class and we should reduce the column width, so the image looks belonging to the name.
The table cell for the sortable handle of the options types form was not present for newly builded records. The cell should always be present only the handle should be hidden.
The stock management table still had a lot of redundant styles.
Is there any other work required to get this into an acceptable state? |
All of the above are solved in Mandily#2 |
@graygilmore FYI |
Merged as #2159 |
I've started some work to clean up the tables in the Solidus admin. I think a lot of the existing table code is redundant now that we've got Bootstrap in the project, so I removed what I could to clean it up, and then added a couple of styles back in to "clean up" what was left. I've just tackled the index pages (except for the stock page) at the moment, and I'd like some feedback before I go through the rest of the views.
Orders

Products

Reports

Promotions

Users

@Sinetheta @jhawthorn @tvdeyen @graygilmore can I get your thoughts on this?