Skip to content

Commit

Permalink
Schedule Criteria: Fixed table sorting (#2782)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgbaybay authored Nov 1, 2024
1 parent 0de66da commit 4ec8e04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 5 additions & 1 deletion lib/Factory/ScheduleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ public function query($sortOrder = null, $filterBy = [])
`schedule`.updatedOn,
`schedule`.name,
`schedule`.dataSetId,
`schedule`.dataSetParams
`schedule`.dataSetParams,
`sc`.eventId AS criteria
';

$body = ' FROM `schedule`
Expand All @@ -427,6 +428,9 @@ public function query($sortOrder = null, $filterBy = [])
ON `syncgroup`.syncGroupId = `schedule`.syncGroupId
LEFT OUTER JOIN `user`
ON `user`.userId = `schedule`.modifiedBy
LEFT OUTER JOIN (
SELECT DISTINCT `eventId` FROM schedule_criteria
) AS sc ON `schedule`.eventId = sc.eventId
WHERE 1 = 1';

if ($parsedFilter->getInt('eventId') !== null) {
Expand Down
8 changes: 2 additions & 6 deletions views/schedule-page.twig
Original file line number Diff line number Diff line change
Expand Up @@ -1529,15 +1529,11 @@
responsivePriority: 2,
},
{
data: 'criteria',
name: 'criteria',
className: 'align-middle',
responsivePriority: 2,
data: function (data, type, row) {
if (data.criteria && data.criteria.length > 0) {
return dataTableTickCrossColumn(1, type, row);
} else {
return '';
}
return (data.criteria && data.criteria.length > 0) ? dataTableTickCrossColumn(1, type, row) : ''
}
},
{
Expand Down

0 comments on commit 4ec8e04

Please sign in to comment.