Skip to content

Commit

Permalink
Fix semantic sorting table
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Nov 23, 2024
1 parent 49c6b62 commit 43f90e6
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ const sortReducer = (state, action) => {
state.direction === 'ascending' ? 'descending' : 'ascending',
};
}

console.log(state.data);

Check warning on line 95 in frontend/packages/volto-ploneconf/src/components/Registrations/RegistrationsManagement.jsx

View workflow job for this annotation

GitHub Actions / frontend / code-analysis

Unexpected console statement
console.log(action.column);
return {
column: action.column,
data: sortBy(state.data, [action.column]),
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -203,7 +202,8 @@ const RegistrationsManagement = () => {
/>
</Segment>
<Segment secondary>{pageTitle}</Segment>
<Table
{/* @sneridagh: Commenting the RAC alternative for now */}
{/* <Table
aria-label="Example table with client side sorting"
sortDescriptor={list.sortDescriptor}
onSortChange={list.sort}
Expand Down Expand Up @@ -232,15 +232,18 @@ const RegistrationsManagement = () => {
</Row>
)}
</TableBody>
</Table>
</Table> */}
<SemanticTable className={'sortable'}>
<SemanticTableHeader>
<TableRow>
{allTrainings && (
<TableHeaderCell
sorted={column === 'training' ? direction : null}
onClick={() =>
sortDispatch({ type: 'CHANGE_SORT', column: 'training' })
sortDispatch({
type: 'CHANGE_SORT',
column: 'training.title',
})
}
>
<FormattedMessage
Expand All @@ -252,7 +255,7 @@ const RegistrationsManagement = () => {
<TableHeaderCell
sorted={column === 'name' ? direction : null}
onClick={() =>
sortDispatch({ type: 'CHANGE_SORT', column: 'name' })
sortDispatch({ type: 'CHANGE_SORT', column: 'user_id' })
}
>
<FormattedMessage id={'Name'} defaultMessage={'Name'} />
Expand Down

0 comments on commit 43f90e6

Please sign in to comment.