From 0bca60ed0bcbc6d29b82e14255d38453866e8dea Mon Sep 17 00:00:00 2001 From: Dana Medical Developer Date: Thu, 22 Oct 2026 14:02:01 +0000 Subject: [PATCH] style(booking): remove initial doctor selection hint --- web/scripts/test-booking-flow.mjs | 3 ++- web/src/components/LeadModal.jsx | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/web/scripts/test-booking-flow.mjs b/web/scripts/test-booking-flow.mjs index 0a9c5de..0ad6cee 100644 --- a/web/scripts/test-booking-flow.mjs +++ b/web/scripts/test-booking-flow.mjs @@ -68,7 +68,8 @@ try { assert.ok(container.querySelector('input[type="date"]')); assert.equal(container.querySelector('input[type="tel"]'), null); assert.deepEqual(times(), []); - assert.match(text(), /Выберите дату или врача/); + assert.doesNotMatch(text(), /Сначала выберите врача|Выберите дату или врача/); + assert.equal(container.querySelector('.lead-modal__availability'), null, 'The removed initial hint must not leave an empty panel'); assert.equal(container.querySelector('.lead-modal__availability--warning'), null, 'Selection instructions must not look like an unavailable-schedule warning'); assert.deepEqual(await availableDoctorIDs(), ['1','2','3']); await openPicker(); diff --git a/web/src/components/LeadModal.jsx b/web/src/components/LeadModal.jsx index c9b2079..bf86cfc 100644 --- a/web/src/components/LeadModal.jsx +++ b/web/src/components/LeadModal.jsx @@ -169,6 +169,13 @@ export default function LeadModal({ form = 'appointment', doctor, slot, service, const nameRequired = form !== 'callback'; const textRequired = form === 'review'; + const availabilityMessage = date && availability.error + ? 'Не удалось проверить расписание. Попробуйте выбрать дату ещё раз.' + : date && !availability.loading && doctorsLoaded && doctorOptions.length === 0 + ? 'На эту дату свободных окон нет. Выберите другую дату.' + : doctorsLoaded && doctorOptions.length === 0 + ? 'Список врачей сейчас недоступен. Позвоните в клинику, чтобы уточнить запись.' + : date ? 'Выберите врача из списка — покажем его свободные часы на выбранную дату.' : ''; const submit = async (e) => { e.preventDefault(); @@ -270,16 +277,11 @@ export default function LeadModal({ form = 'appointment', doctor, slot, service, )} {form === 'appointment' && !selectedDoctor ? ( -

- {date && availability.error - ? 'Не удалось проверить расписание. Попробуйте выбрать дату ещё раз.' - : date && !availability.loading && doctorsLoaded && doctorOptions.length === 0 - ? 'На эту дату свободных окон нет. Выберите другую дату.' - : doctorsLoaded && doctorOptions.length === 0 - ? 'Список врачей сейчас недоступен. Позвоните в клинику, чтобы уточнить запись.' - : date ? 'Выберите врача из списка — покажем его свободные часы на выбранную дату.' - : 'Выберите дату или врача — покажем только реальные свободные окна из 1С.'} -

+ availabilityMessage ? ( +

+ {availabilityMessage} +

+ ) : null ) : native ? ( ) : status.state === 'done' ? (