Preselect default task (#22)
This commit is contained in:
committed by
Tobias Miesel
parent
5e62e16751
commit
8a72f242f9
@@ -14,6 +14,7 @@ import {
|
||||
findProjectByValue,
|
||||
findProjectByIdentifier,
|
||||
findTask,
|
||||
defaultTask,
|
||||
formatDate,
|
||||
} from "utils"
|
||||
import { parseISO } from "date-fns"
|
||||
@@ -73,7 +74,7 @@ class App extends Component {
|
||||
const { service, lastTaskId } = this.props
|
||||
return (
|
||||
findTask(this.changeset.task_id || service?.taskId || lastTaskId)(this.project) ||
|
||||
head(this.project?.tasks)
|
||||
defaultTask(this.project?.tasks)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -121,7 +122,7 @@ class App extends Component {
|
||||
|
||||
if (name === "assignment_id") {
|
||||
const project = findProjectByValue(value)(projects)
|
||||
this.changeset.task_id = head(project?.tasks)?.value
|
||||
this.changeset.task_id = defaultTask(project?.tasks)?.value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user