Name and Producer columns grow to fill and other tweaks

If neither are visible, the first column on the left (eg image) will grow. But that's not a likely scenario.

Min-widths help manage sizes on smaller screens in Chrome.
The title for Inherits Properties gets cut off, but I think it's better than cutting off content.

Oh look, it fixed a spec too!
This commit is contained in:
David Cook
2024-06-17 12:14:36 +10:00
parent 3c9f77dc2b
commit aff50f66c4
2 changed files with 6 additions and 7 deletions

View File

@@ -15,19 +15,19 @@
%table.products{ 'data-column-preferences-target': "table" }
%colgroup
-# The `min-width` property works in Chrome but not Firefox.
-# The `min-width` property works in Chrome but not Firefox so is considered progressive enhancement.
%col{ 'data-column-preferences-name': :image, width:"56px" }= # (image size + padding)
%col{ 'data-column-preferences-name': :name, width:"15%", style:"min-width: 6em" }= # (grow to fill)
%col{ 'data-column-preferences-name': :sku, width:"10%", style:"min-width: 6em" }
%col{ 'data-column-preferences-name': :name, style:"min-width: 6em" }= # (grow to fill)
%col{ 'data-column-preferences-name': :sku, width:"8%", style:"min-width: 6em" }
%col{ 'data-column-preferences-name': :unit_scale, width:"8%" }
%col{ 'data-column-preferences-name': :unit, width:"8%" }
%col{ 'data-column-preferences-name': :price, width:"5%", style:"min-width: 5em" }
%col{ 'data-column-preferences-name': :on_hand, width:"10%"}
%col{ 'data-column-preferences-name': :producer, width:"15%"}
%col{ 'data-column-preferences-name': :producer, style:"min-width: 6em" }= # (grow to fill)
%col{ 'data-column-preferences-name': :category, width:"8%" }
%col{ 'data-column-preferences-name': :tax_category, width:"8%" }
%col{ 'data-column-preferences-name': :inherits_properties, width:"8%" }
%col{ width:"1%", style:"min-width: 5em"}= # Actions
%col{ 'data-column-preferences-name': :inherits_properties, width:"5%" }
%col{ width:"5%", style:"min-width: 3em"}= # Actions
%thead
%tr
%td.form-actions-wrapper{ colspan: 12 }

View File

@@ -1038,7 +1038,6 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
tomselect_search_and_select(category_to_select, from: "Category")
sleep(0.1)
pending "unable to select tax_category dropdown, possibly because category is still open and too big, covering the tax_cat." # rubocop:disable Layout/LineLength
validate_tomselect_with_search!(
page, "Tax Category",
tax_categories_search_selector