-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ismay
committed
Nov 29, 2023
1 parent
0796094
commit 011ac56
Showing
9 changed files
with
37 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { useJobAndQueueFilter, useShowSystemJobs } from './hooks' | ||
import { useNameFilter, useShowSystemJobs } from './hooks' | ||
|
||
export { default as Store } from './Store' | ||
export { useJobAndQueueFilter, useShowSystemJobs } | ||
export { useNameFilter, useShowSystemJobs } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
const filterJobsAndQueues = ({ | ||
jobAndQueueFilter, | ||
showSystemJobs, | ||
jobsAndQueues, | ||
}) => { | ||
// Filter jobs and queues by the current jobAndQueueFilter | ||
const applyJobAndQueueFilter = (jobOrQueue) => | ||
jobOrQueue.name.toLowerCase().includes(jobAndQueueFilter.toLowerCase()) | ||
const filterJobsAndQueues = ({ nameFilter, showSystemJobs, jobsAndQueues }) => { | ||
// Filter jobs and queues by the current nameFilter | ||
const applyNameFilter = (jobOrQueue) => | ||
jobOrQueue.name.toLowerCase().includes(nameFilter.toLowerCase()) | ||
|
||
// Filter jobs depending on the current showSystemJobs | ||
const applyShowSystemJobs = (jobOrQueue) => | ||
// Jobs that are configurable are user jobs | ||
showSystemJobs ? true : jobOrQueue.configurable | ||
|
||
return jobsAndQueues | ||
.filter(applyJobAndQueueFilter) | ||
.filter(applyShowSystemJobs) | ||
return jobsAndQueues.filter(applyNameFilter).filter(applyShowSystemJobs) | ||
} | ||
|
||
export default filterJobsAndQueues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters