Skip to content

Commit

Permalink
fix: apply date filter on unassigned tasks if hidden riders is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Atala committed Nov 27, 2024
1 parent 18db27a commit 29a5b43
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions js/app/dashboard/redux/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@ export const isTaskVisible = (task, filters, date) => {
const isFinished = _.includes(['DONE', 'FAILED'], task.status)
const isCancelled = 'CANCELLED' === task.status
const isIncidentReported = task.hasIncidents
/**
* Action to move task to top or bottom of tasklist
* @param {Object} task - Task
* @param {string[]} tags - List of tag slugs
*/

const isTaskInTags = (task, tags) => {
if (task.tags.length === 0) {
return false
Expand All @@ -130,11 +126,7 @@ export const isTaskVisible = (task, filters, date) => {

return true
}
/**
* Action to move task to top or bottom of tasklist
* @param {Object} task - Task
* @param {string[]} orgNames - Names of the orgs
*/

const isTaskInOrgs = (task, orgNames) => {
return orgNames.includes(task.orgName)
}
Expand Down Expand Up @@ -205,12 +197,7 @@ export const isTaskVisible = (task, filters, date) => {
}

if (hiddenCouriers.length > 0) {

if (!task.isAssigned) {
return true
}

if (_.includes(hiddenCouriers, task.assignedTo)) {
if (task.isAssigned && _.includes(hiddenCouriers, task.assignedTo)) {
return false
}
}
Expand Down

0 comments on commit 29a5b43

Please sign in to comment.