feat: замена period_type на start_date в wishlist, обновление UI формы условий
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m5s

- Добавлена миграция 020 для замены period_type на start_date в score_conditions
- Обновлена функция подсчёта баллов: calculateProjectPointsFromDate вместо calculateProjectPointsForPeriod
- Добавлен компонент DateSelector для выбора даты начала подсчёта
- По умолчанию выбран тип условия 'Баллы'
- Переименованы опции: 'Баллы' и 'Задача'
- Версия: 3.9.3
This commit is contained in:
poignatov
2026-01-12 17:02:33 +03:00
parent d368929a4a
commit b3a83e1e8f
6 changed files with 309 additions and 107 deletions

View File

@@ -166,16 +166,14 @@ function WishlistDetail({ wishlistId, onNavigate, onRefresh }) {
const requiredPoints = condition.required_points || 0
const currentPoints = condition.current_points || 0
const project = condition.project_name || 'Проект'
let period = ''
if (condition.period_type) {
const periodLabels = {
week: 'за неделю',
month: 'за месяц',
year: 'за год',
}
period = ' ' + periodLabels[condition.period_type] || ''
let dateText = ''
if (condition.start_date) {
const date = new Date(condition.start_date + 'T00:00:00')
dateText = ` с ${date.toLocaleDateString('ru-RU')}`
} else {
dateText = ' за всё время'
}
conditionText = `${requiredPoints} в ${project}${period}`
conditionText = `${requiredPoints} в ${project}${dateText}`
progress = {
type: 'points',
current: currentPoints,