Skip to content

Commit

Permalink
EDERCMS-219: Fix sort order event page
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Morbitzer committed Sep 30, 2024
1 parent 2370e49 commit eb58051
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions blocks/events/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function renderItem(item) {
export default async function decorate(block) {
const config = readBlockConfig(block);
config.classes = [...block.classList];

decorateList(block, config, 'events', renderItem, manipulateEventItems)
.then();
}
5 changes: 4 additions & 1 deletion blocks/events/lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function getDateRange(item) {
* @returns {Array}
*/
function manipulateEventItems(items) {
return items.filter((item) => {
const filteredItems = items.filter((item) => {
// check if event has ended
if (!isCurrentEvent(item)) {
return false;
Expand All @@ -67,6 +67,9 @@ function manipulateEventItems(items) {
).outerHTML;
return true;
});

// reverse items
return filteredItems.reverse();
}

export default manipulateEventItems;
4 changes: 0 additions & 4 deletions helix-query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ indices:
- /events/**/**
- /newstermine/veranstaltungen/detail/**
- /newstermine/veranstaltungen/detail/**/**
- /aktuelles/agratec-aktuell/termine/**
- /aktuelles/agratec-aktuell/termine/detail/**
- /aktuelles/agratec-aktuell/termine/detail/**/**
- /aktuelles/landtechnik-aktuell/termine/**
- /aktuelles/landtechnik-aktuell/termine/detail/**
- /aktuelles/landtechnik-aktuell/termine/detail/**/**
target: /query-index-events.xlsx
Expand Down Expand Up @@ -140,10 +138,8 @@ indices:
- /news/**/**
- /newstermine/pressemeldungen/detail/**
- /newstermine/pressemeldungen/detail/**/**
- /aktuelles/agratec-aktuell/news/**
- /aktuelles/agratec-aktuell/news/artikel/**
- /aktuelles/agratec-aktuell/news/artikel/**/**
- /aktuelles/landtechnik-aktuell/news/**
- /aktuelles/landtechnik-aktuell/news/artikel/**
- /aktuelles/landtechnik-aktuell/news/artikel/**/**
target: /query-index-news.xlsx
Expand Down

0 comments on commit eb58051

Please sign in to comment.