Add loading splash to BPE

This commit is contained in:
Rob H
2014-01-04 15:50:26 +08:00
parent c6222f2180
commit 687332d2b0
3 changed files with 15 additions and 4 deletions

View File

@@ -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

View File

@@ -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' }

View File

@@ -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