Исправления задач-желаний и версия 3.22.0
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 50s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 50s
This commit is contained in:
@@ -643,8 +643,8 @@ function TaskForm({ onNavigate, taskId, wishlistId, isTest: isTestFromProps = fa
|
||||
// При создании: отправляем currentWishlistId если указан (уже число)
|
||||
// При редактировании: отправляем null только если была привязка (currentWishlistId) и пользователь отвязал (!wishlistInfo)
|
||||
// Если не было привязки или привязка осталась - не отправляем поле (undefined)
|
||||
wishlist_id: taskId
|
||||
? (currentWishlistId && !wishlistInfo ? null : undefined)
|
||||
wishlist_id: taskId
|
||||
? currentWishlistId // При редактировании сохраняем текущую привязку к желанию
|
||||
: (currentWishlistId || undefined),
|
||||
reward_policy: (wishlistInfo || currentWishlistId) ? rewardPolicy : undefined,
|
||||
rewards: rewards.map(r => ({
|
||||
@@ -806,16 +806,6 @@ function TaskForm({ onNavigate, taskId, wishlistId, isTest: isTestFromProps = fa
|
||||
<span className="wishlist-link-text">
|
||||
Связана с желанием: <strong>{wishlistInfo.name}</strong>
|
||||
</span>
|
||||
{taskId && currentWishlistId && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleUnlinkWishlist}
|
||||
className="wishlist-unlink-x"
|
||||
title="Отвязать от желания"
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
<div className="form-group" style={{ marginTop: '12px' }}>
|
||||
<label htmlFor="reward_policy">Политика награждения:</label>
|
||||
@@ -837,7 +827,7 @@ function TaskForm({ onNavigate, taskId, wishlistId, isTest: isTestFromProps = fa
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!isTest && (
|
||||
{!isTest && !wishlistInfo && (
|
||||
<div className="form-group">
|
||||
<label htmlFor="progression_base">Прогрессия</label>
|
||||
<input
|
||||
@@ -920,6 +910,7 @@ function TaskForm({ onNavigate, taskId, wishlistId, isTest: isTestFromProps = fa
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!wishlistInfo && (
|
||||
<div className="form-group">
|
||||
<label htmlFor="repetition_period">Повторения</label>
|
||||
{(() => {
|
||||
@@ -1007,6 +998,7 @@ function TaskForm({ onNavigate, taskId, wishlistId, isTest: isTestFromProps = fa
|
||||
)
|
||||
})()}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="form-group">
|
||||
<label htmlFor="reward_message">Сообщение награды</label>
|
||||
|
||||
Reference in New Issue
Block a user