From b441ac2644296341c5e849c90b578ab2e0773fff Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 29 Jun 2020 20:07:08 +0200 Subject: [PATCH] Update paths to "noimage" images --- app/assets/javascripts/darkswarm/services/products.js.coffee | 2 +- app/assets/javascripts/templates/product_modal.html.haml | 2 +- app/serializers/api/admin/product_serializer.rb | 4 ++-- app/serializers/api/variant_serializer.rb | 2 +- app/views/groups/show.html.haml | 2 +- app/views/spree/admin/products/new.html.haml | 2 +- app/views/spree/admin/variants/_autocomplete.js.erb | 2 +- spec/features/admin/bulk_product_update_spec.rb | 2 +- .../unit/darkswarm/services/products_spec.js.coffee | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/darkswarm/services/products.js.coffee b/app/assets/javascripts/darkswarm/services/products.js.coffee index 59bd19efb4..83b19251bb 100644 --- a/app/assets/javascripts/darkswarm/services/products.js.coffee +++ b/app/assets/javascripts/darkswarm/services/products.js.coffee @@ -34,7 +34,7 @@ Darkswarm.factory 'Products', (OrderCycleResource, OrderCycle, Shopfront, curren product.price = Math.min.apply(null, prices) product.hasVariants = product.variants?.length > 0 product.primaryImage = product.images[0]?.small_url if product.images - product.primaryImageOrMissing = product.primaryImage || "/assets/noimage/small.png" + product.primaryImageOrMissing = product.primaryImage || "/noimage/small.png" product.largeImage = product.images[0]?.large_url if product.images dereference: -> diff --git a/app/assets/javascripts/templates/product_modal.html.haml b/app/assets/javascripts/templates/product_modal.html.haml index 9c65bbbad7..95c74c5f72 100644 --- a/app/assets/javascripts/templates/product_modal.html.haml +++ b/app/assets/javascripts/templates/product_modal.html.haml @@ -15,6 +15,6 @@ .columns.small-12.medium-6.large-6.product-img %img{"ng-src" => "{{::product.largeImage}}", "ng-if" => "::product.largeImage"} - %img.placeholder{ src: "/assets/noimage/large.png", "ng-if" => "::!product.largeImage"} + %img.placeholder{ src: "/noimage/large.png", "ng-if" => "::!product.largeImage"} %ng-include{src: "'partials/close.html'"} diff --git a/app/serializers/api/admin/product_serializer.rb b/app/serializers/api/admin/product_serializer.rb index c4b9f15a34..2be4995305 100644 --- a/app/serializers/api/admin/product_serializer.rb +++ b/app/serializers/api/admin/product_serializer.rb @@ -12,7 +12,7 @@ class Api::Admin::ProductSerializer < ActiveModel::Serializer if object.images.present? object.images.first.attachment.url(:product) else - "/assets/noimage/product.png" + "/noimage/product.png" end end @@ -20,7 +20,7 @@ class Api::Admin::ProductSerializer < ActiveModel::Serializer if object.images.present? object.images.first.attachment.url(:mini) else - "/assets/noimage/mini.png" + "/noimage/mini.png" end end diff --git a/app/serializers/api/variant_serializer.rb b/app/serializers/api/variant_serializer.rb index 38cc649910..0306c95f95 100644 --- a/app/serializers/api/variant_serializer.rb +++ b/app/serializers/api/variant_serializer.rb @@ -35,7 +35,7 @@ class Api::VariantSerializer < ActiveModel::Serializer if object.product.images.present? object.product.images.first.attachment.url(:mini) else - "/assets/noimage/mini.png" + "/noimage/mini.png" end end end diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 4701791daa..b5622063a2 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -22,7 +22,7 @@ - if @group.logo.present? %img.group-logo{"src" => @group.logo} - else - %img.group-logo{"src" => image_path('noimage/group.png') } + %img.group-logo{"src" => '/noimage/group.png' } %h2.group-name= @group.name %p= @group.description diff --git a/app/views/spree/admin/products/new.html.haml b/app/views/spree/admin/products/new.html.haml index 34665fbdcb..908f30b5b9 100644 --- a/app/views/spree/admin/products/new.html.haml +++ b/app/views/spree/admin/products/new.html.haml @@ -83,7 +83,7 @@ %fieldset.no-border-bottom{ id: "image" } %legend{align: "center"}= t(".image") .row - = image_tag "noimage/product.png", class: "four columns alpha" + = image_tag "/noimage/product.png", class: "four columns alpha" .row = f.fields_for 'images_attributes[]', f.object.images.build do |image_fields| = image_fields.file_field :attachment diff --git a/app/views/spree/admin/variants/_autocomplete.js.erb b/app/views/spree/admin/variants/_autocomplete.js.erb index 9e4c29a50a..c4d1f8d96a 100644 --- a/app/views/spree/admin/variants/_autocomplete.js.erb +++ b/app/views/spree/admin/variants/_autocomplete.js.erb @@ -4,7 +4,7 @@ {{#if variant.image }} {{ else }} - + {{/if}} diff --git a/spec/features/admin/bulk_product_update_spec.rb b/spec/features/admin/bulk_product_update_spec.rb index 09bdf68fca..c0b55ed224 100644 --- a/spec/features/admin/bulk_product_update_spec.rb +++ b/spec/features/admin/bulk_product_update_spec.rb @@ -770,7 +770,7 @@ feature ' expect(page).to have_selector "td.image" # Shows default image when no image set - expect(page).to have_css "img[src='/assets/noimage/mini.png']" + expect(page).to have_css "img[src='/noimage/mini.png']" @old_thumb_src = page.find("a.image-modal img")['src'] # Click image diff --git a/spec/javascripts/unit/darkswarm/services/products_spec.js.coffee b/spec/javascripts/unit/darkswarm/services/products_spec.js.coffee index 88ff585f00..db9ed1e628 100644 --- a/spec/javascripts/unit/darkswarm/services/products_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/services/products_spec.js.coffee @@ -107,7 +107,7 @@ describe 'Products service', -> $httpBackend.expectGET(endpoint).respond([product]) $httpBackend.flush() expect(Products.products[0].primaryImage).toBeUndefined() - expect(Products.products[0].primaryImageOrMissing).toEqual "/assets/noimage/small.png" + expect(Products.products[0].primaryImageOrMissing).toEqual "/noimage/small.png" it "sets largeImage", -> $httpBackend.expectGET(endpoint).respond([productWithImage])