mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-24 05:38:52 +00:00
Add loading splash to BPE
This commit is contained in:
@@ -167,6 +167,7 @@ productsApp.controller "AdminBulkProductsCtrl", [
|
||||
# Need to have suppliers before we get products so we can match suppliers to product.supplier
|
||||
dataFetcher("/api/products/managed?template=bulk_index;page=1;per_page=500").then (data) ->
|
||||
$scope.resetProducts data
|
||||
$scope.loading = false
|
||||
else if authorise_api_reponse.hasOwnProperty("error")
|
||||
$scope.api_error_msg = authorise_api_reponse("error")
|
||||
else
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
|
||||
|
||||
|
||||
%div{ 'ng-app' => 'bulk_product_update', 'ng-controller' => 'AdminBulkProductsCtrl', 'ng-init' => "initialise('#{@spree_api_key}');" }
|
||||
%div{ 'ng-app' => 'bulk_product_update', 'ng-controller' => 'AdminBulkProductsCtrl', 'ng-init' => "initialise('#{@spree_api_key}');loading=true;" }
|
||||
%div{ 'ng-show' => '!spree_api_key_ok' }
|
||||
{{ api_error_msg }}
|
||||
%div
|
||||
%div.loading{ 'ng-show' => 'loading' }
|
||||
%h2 Loading Products...
|
||||
%div{ 'ng-hide' => 'loading' }
|
||||
%div.options
|
||||
Filter Results:
|
||||
%input.search{ 'ng-model' => 'query', :name => "quick_filter", :type => 'text', 'placeholder' => 'Search Value' }
|
||||
|
||||
@@ -21,14 +21,22 @@ feature %q{
|
||||
login_to_admin_section
|
||||
end
|
||||
|
||||
it "displays a 'loading' splash for products" do
|
||||
101.times{ FactoryGirl.create(:product) }
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
|
||||
page.should have_selector "div.loading", :text => "Loading Products..."
|
||||
end
|
||||
|
||||
it "displays a list of products" do
|
||||
p1 = FactoryGirl.create(:product)
|
||||
p2 = FactoryGirl.create(:product)
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
|
||||
page.should have_field "product_name", with: p1.name
|
||||
page.should have_field "product_name", with: p2.name
|
||||
page.should have_field "product_name", with: p1.name, :visible => true
|
||||
page.should have_field "product_name", with: p2.name, :visible => true
|
||||
end
|
||||
|
||||
it "displays pagination information" do
|
||||
|
||||
Reference in New Issue
Block a user