Pagination is actually linked to line_items and not orders

We display line_items as rows in BOM
This commit is contained in:
Jean-Baptiste Bellet
2023-02-03 11:37:51 +01:00
parent 428b8b0314
commit 06cbc120f5
4 changed files with 9 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.sharedResource = false
$scope.columns = Columns.columns
$scope.sorting = SortOptions
$scope.pagination = Orders.pagination
$scope.pagination = LineItems.pagination
$scope.per_page_options = [
{id: 15, name: t('js.admin.orders.index.per_page', results: 15)},
{id: 50, name: t('js.admin.orders.index.per_page', results: 50)},

View File

@@ -1,7 +1,7 @@
- position ||= ""
.per-page{'ng-show' => '!RequestMonitor.loading && orders.length > 0', class: ("right" if position == "right") }
.per-page{'ng-show' => '!RequestMonitor.loading && line_items.length > 0', class: ("right" if position == "right") }
%input.per-page-select.ofn-select2{type: 'number', data: 'per_page_options', 'min-search' => 999, 'ng-model' => 'per_page', 'ng-change' => 'fetchResults()'}
%span.per-page-feedback
{{ 'spree.admin.orders.index.results_found' | t:{number: pagination.results} }}
{{ 'spree.admin.orders.index.viewing' | t:{start: ((pagination.page -1) * pagination.per_page) +1, end: ((pagination.page -1) * pagination.per_page) + orders.length} }}
{{ 'spree.admin.line_items.index.results_found' | t:{number: pagination.results} }}
{{ 'spree.admin.orders.index.viewing' | t:{start: ((pagination.page -1) * pagination.per_page) +1, end: ((pagination.page -1) * pagination.per_page) + line_items.length} }}

View File

@@ -190,7 +190,7 @@
%td.actions
%a{ 'ng-click' => "deleteLineItem(line_item)", :class => "delete-line-item icon-trash no-text" }
%div{'ng-show' => "!RequestMonitor.loading && orders.length > 0" }
%div{'ng-show' => "!RequestMonitor.loading && line_items.length > 0" }
= render partial: 'admin/shared/angular_pagination'
= render 'spree/admin/shared/custom-confirm'

View File

@@ -3897,6 +3897,10 @@ See the %{link} to find out more about %{sitename}'s features and to start using
authorized: "Authorized"
received: "Received"
canceled: "Canceled"
line_items:
index:
results_found: "%{number} Results found."
viewing: "Viewing %{start} to %{end}."
orders:
add_product:
cannot_add_item_to_canceled_order: "Cannot add item to canceled order"