feat: remove auto updating of likely/pessimistic values

This commit is contained in:
wpetit 2023-08-31 20:33:59 -06:00
parent 53cc3a25d8
commit 18f43482e0
2 changed files with 175 additions and 175 deletions

View File

@ -124,14 +124,6 @@ export function handleUpdateTaskEstimation(project: Project, action: UpdateTaskE
[action.confidence]: action.value
};
if (estimations.likely < estimations.optimistic) {
estimations.likely = estimations.optimistic;
}
if (estimations.pessimistic < estimations.likely) {
estimations.pessimistic = estimations.likely;
}
return {
...project,
tasks: {

View File

@ -117,7 +117,9 @@ const TaskTable: FunctionComponent<TaskTableProps> = ({ project, onTaskAdd, onEs
{
isPrint ?
<span>{t.estimations.optimistic}</span> :
<input className="input" type="number" value={t.estimations.optimistic}
<input
className="input" type="number"
value={t.estimations.optimistic}
min={0}
onChange={onOptimisticChange.bind(null, t.id)} />
}
@ -126,7 +128,10 @@ const TaskTable: FunctionComponent<TaskTableProps> = ({ project, onTaskAdd, onEs
{
isPrint ?
<span>{t.estimations.likely}</span> :
<input className="input" type="number" value={t.estimations.likely}
<input
className={`input ${t.estimations.likely < t.estimations.optimistic ? 'is-danger' : ''}`}
type="number"
value={t.estimations.likely}
min={0}
onChange={onLikelyChange.bind(null, t.id)} />
}
@ -135,7 +140,10 @@ const TaskTable: FunctionComponent<TaskTableProps> = ({ project, onTaskAdd, onEs
{
isPrint ?
<span>{t.estimations.pessimistic}</span> :
<input className="input" type="number" value={t.estimations.pessimistic}
<input
className={`input ${t.estimations.pessimistic < t.estimations.likely ? 'is-danger' : ''}`}
type="number"
value={t.estimations.pessimistic}
min={0}
onChange={onPessimisticChange.bind(null, t.id)} />
}