From 43f90e66ae49aa614f44472b701e729200b114e8 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Sat, 23 Nov 2024 10:28:59 -0300 Subject: [PATCH] Fix semantic sorting table --- .../Registrations/RegistrationsManagement.jsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/frontend/packages/volto-ploneconf/src/components/Registrations/RegistrationsManagement.jsx b/frontend/packages/volto-ploneconf/src/components/Registrations/RegistrationsManagement.jsx index ad755ca..654a38d 100644 --- a/frontend/packages/volto-ploneconf/src/components/Registrations/RegistrationsManagement.jsx +++ b/frontend/packages/volto-ploneconf/src/components/Registrations/RegistrationsManagement.jsx @@ -92,7 +92,8 @@ const sortReducer = (state, action) => { state.direction === 'ascending' ? 'descending' : 'ascending', }; } - + console.log(state.data); + console.log(action.column); return { column: action.column, data: sortBy(state.data, [action.column]), @@ -167,8 +168,6 @@ const RegistrationsManagement = () => { // return item.uid; // }, async sort({ items, sortDescriptor }) { - console.log(items); - console.log(sortDescriptor.column); return { items: items.sort((a, b) => { let first = a[sortDescriptor.column]; @@ -203,7 +202,8 @@ const RegistrationsManagement = () => { /> {pageTitle} - { )} -
+ */} @@ -240,7 +240,10 @@ const RegistrationsManagement = () => { - sortDispatch({ type: 'CHANGE_SORT', column: 'training' }) + sortDispatch({ + type: 'CHANGE_SORT', + column: 'training.title', + }) } > { - sortDispatch({ type: 'CHANGE_SORT', column: 'name' }) + sortDispatch({ type: 'CHANGE_SORT', column: 'user_id' }) } >