Skip to content

Commit

Permalink
Add ability to bulk update products for product managers
Browse files Browse the repository at this point in the history
I forgot to do this in #12328 [BUU] Remove Stimulus Reflex from Products screen
  • Loading branch information
dacook committed Apr 23, 2024
1 parent 574e8f0 commit 9b9e459
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/spree/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def add_product_management_abilities(user)
OpenFoodNetwork::Permissions.new(user).managed_product_enterprises.include? product.supplier
end

can [:admin, :index], :products_v3
can [:admin, :index, :bulk_update], :products_v3

can [:create], Spree::Variant
can [:admin, :index, :read, :edit,
Expand Down
5 changes: 2 additions & 3 deletions spec/system/admin/products_v3/products_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@
fill_in "Name", with: "Pommes"
end

pending "#12403"
expect {
click_button "Save changes"

Expand Down Expand Up @@ -179,14 +178,14 @@
search_by_category "Category 1"

# expect(page).to have_content "1 product found for your search criteria."
expect(page).to have_select "category_id", selected: "Category 1"
expect(page).to have_select "category_id", selected: "Category 1" # succeeds in CI but not dev.

Check warning on line 181 in spec/system/admin/products_v3/products_spec.rb

View workflow job for this annotation

GitHub Actions / runner / rubocop

[rubocop] reported by reviewdog 🐶 Line is too long. [103/100] Raw Output: spec/system/admin/products_v3/products_spec.rb:181:101: C: Layout/LineLength: Line is too long. [103/100]
expect_products_count_to_be 1
expect(page).to have_field "Name", with: product_by_category.name
end
end
end

xdescribe "updating" do # pending #12403
describe "updating" do
let!(:variant_a1) {
product_a.variants.first.tap{ |v|
v.update! display_name: "Medium box", sku: "APL-01", price: 5.25, on_hand: 5,
Expand Down

0 comments on commit 9b9e459

Please sign in to comment.