From cd7b1ba19866b79c99bcbb34292e9ee98d5180a3 Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Tue, 27 Jun 2023 13:13:30 +0800 Subject: [PATCH] Group the cards without UI update Signed-off-by: Egor Savkin --- static/js/shop.jsx | 5 ++-- static/js/shop.min.js | 12 ++++++--- static/js/shop_data.js | 56 +++++++++++++++++++++++++----------------- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/static/js/shop.jsx b/static/js/shop.jsx index ffc5000..dbdff36 100644 --- a/static/js/shop.jsx +++ b/static/js/shop.jsx @@ -77,7 +77,7 @@ const copy = ( droppableSource, droppableDestination ) => { - const sourceClone = Array.from(source.itemIds); + const sourceClone = Array.from(source.categories.map(groupId => groupId.itemIds).flat()); const destClone = Array.from(destination.items); const item = sourceClone[droppableSource.index]; @@ -1515,7 +1515,8 @@ class Backlog extends React.PureComponent { isMobile, } = this.props; - const ordered_items = data.itemIds.map(itemId => items[itemId]); + + const ordered_items = data.categories.map(groupItem => groupItem.itemIds.map(itemId => items[itemId])).flat(); const products = ordered_items.map((item, index) => { return (