style(booking): remove initial doctor selection hint

This commit is contained in:
Dana Medical Developer 2026-10-22 14:02:01 +00:00
parent 37fe9acd55
commit 0bca60ed0b
2 changed files with 14 additions and 11 deletions

View File

@ -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();

View File

@ -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 ? (
availabilityMessage ? (
<p className={`lead-modal__availability${doctorsLoaded && !date && doctorOptions.length === 0 ? ' lead-modal__availability--warning' : ''}`} role="status">
{date && availability.error
? 'Не удалось проверить расписание. Попробуйте выбрать дату ещё раз.'
: date && !availability.loading && doctorsLoaded && doctorOptions.length === 0
? 'На эту дату свободных окон нет. Выберите другую дату.'
: doctorsLoaded && doctorOptions.length === 0
? 'Список врачей сейчас недоступен. Позвоните в клинику, чтобы уточнить запись.'
: date ? 'Выберите врача из списка — покажем его свободные часы на выбранную дату.'
: 'Выберите дату или врача — покажем только реальные свободные окна из 1С.'}
{availabilityMessage}
</p>
) : null
) : native ? (
<NativeBooking key={`${selectedDoctor.id}:${date}`} doctor={selectedDoctor} filterDate={date} initialSlot={requestedSlot} onClose={onClose} onUnavailable={onNativeUnavailable} />
) : status.state === 'done' ? (