+
onChange(e.target.value || '')}
+ className="date-selector-input"
+ />
+
+ {value ? formatDateForDisplay(value) : placeholder}
+
+ {value && (
+
+ )}
+
+ )
+}
+
// Компонент формы условия разблокировки
function ConditionForm({ tasks, projects, onSubmit, onCancel }) {
- const [type, setType] = useState('task_completion')
+ const [type, setType] = useState('project_points')
const [taskId, setTaskId] = useState('')
const [projectId, setProjectId] = useState('')
const [requiredPoints, setRequiredPoints] = useState('')
- const [periodType, setPeriodType] = useState('')
+ const [startDate, setStartDate] = useState('')
const handleSubmit = (e) => {
e.preventDefault()
@@ -574,15 +652,15 @@ function ConditionForm({ tasks, projects, onSubmit, onCancel }) {
task_id: type === 'task_completion' ? parseInt(taskId) : null,
project_id: type === 'project_points' ? parseInt(projectId) : null,
required_points: type === 'project_points' ? parseFloat(requiredPoints) : null,
- period_type: type === 'project_points' && periodType ? periodType : null,
+ start_date: type === 'project_points' && startDate ? startDate : null,
}
onSubmit(condition)
// Сброс формы
- setType('task_completion')
+ setType('project_points')
setTaskId('')
setProjectId('')
setRequiredPoints('')
- setPeriodType('')
+ setStartDate('')
}
return (
@@ -597,8 +675,8 @@ function ConditionForm({ tasks, projects, onSubmit, onCancel }) {
onChange={(e) => setType(e.target.value)}
className="form-input"
>
-