Skip to content

Commit

Permalink
#864 - show all task statuses when task type is not selected
Browse files Browse the repository at this point in the history
  • Loading branch information
petmongrels committed Dec 29, 2022
1 parent 323e511 commit bda0511
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/assignment/reducers/TaskAssignmentReducer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { filter, flatMap, get, isEmpty, map, mapValues, find } from "lodash";
import { filter, flatMap, get, isEmpty, map, mapValues, find, isNil } from "lodash";
import { labelValue } from "../util/util";

const initialAssignmentCriteria = {
Expand Down Expand Up @@ -100,7 +100,8 @@ export const getMetadataOptions = (taskMetadata, filterCriteria) => {
const userOptions = map(taskMetadata.users, ({ name, id }) => labelValue(name, id));
const applicableTaskStatuses = filter(
taskMetadata.taskStatuses,
({ taskTypeId }) => taskTypeId === get(filterCriteria.taskType, "value")
({ taskTypeId }) =>
taskTypeId === get(filterCriteria.taskType, "value") || isNil(filterCriteria.taskType)
);
const taskStatusOptions = map(applicableTaskStatuses, ({ name, id }) => labelValue(name, id));
return { taskTypeOptions, userOptions, taskStatusOptions };
Expand Down

0 comments on commit bda0511

Please sign in to comment.