style(booking): remove initial doctor selection hint
This commit is contained in:
parent
37fe9acd55
commit
0bca60ed0b
@ -68,7 +68,8 @@ try {
|
|||||||
assert.ok(container.querySelector('input[type="date"]'));
|
assert.ok(container.querySelector('input[type="date"]'));
|
||||||
assert.equal(container.querySelector('input[type="tel"]'), null);
|
assert.equal(container.querySelector('input[type="tel"]'), null);
|
||||||
assert.deepEqual(times(), []);
|
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.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']);
|
assert.deepEqual(await availableDoctorIDs(), ['1','2','3']);
|
||||||
await openPicker();
|
await openPicker();
|
||||||
|
|||||||
@ -169,6 +169,13 @@ export default function LeadModal({ form = 'appointment', doctor, slot, service,
|
|||||||
|
|
||||||
const nameRequired = form !== 'callback';
|
const nameRequired = form !== 'callback';
|
||||||
const textRequired = form === 'review';
|
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) => {
|
const submit = async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -270,16 +277,11 @@ export default function LeadModal({ form = 'appointment', doctor, slot, service,
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{form === 'appointment' && !selectedDoctor ? (
|
{form === 'appointment' && !selectedDoctor ? (
|
||||||
|
availabilityMessage ? (
|
||||||
<p className={`lead-modal__availability${doctorsLoaded && !date && doctorOptions.length === 0 ? ' lead-modal__availability--warning' : ''}`} role="status">
|
<p className={`lead-modal__availability${doctorsLoaded && !date && doctorOptions.length === 0 ? ' lead-modal__availability--warning' : ''}`} role="status">
|
||||||
{date && availability.error
|
{availabilityMessage}
|
||||||
? 'Не удалось проверить расписание. Попробуйте выбрать дату ещё раз.'
|
|
||||||
: date && !availability.loading && doctorsLoaded && doctorOptions.length === 0
|
|
||||||
? 'На эту дату свободных окон нет. Выберите другую дату.'
|
|
||||||
: doctorsLoaded && doctorOptions.length === 0
|
|
||||||
? 'Список врачей сейчас недоступен. Позвоните в клинику, чтобы уточнить запись.'
|
|
||||||
: date ? 'Выберите врача из списка — покажем его свободные часы на выбранную дату.'
|
|
||||||
: 'Выберите дату или врача — покажем только реальные свободные окна из 1С.'}
|
|
||||||
</p>
|
</p>
|
||||||
|
) : null
|
||||||
) : native ? (
|
) : native ? (
|
||||||
<NativeBooking key={`${selectedDoctor.id}:${date}`} doctor={selectedDoctor} filterDate={date} initialSlot={requestedSlot} onClose={onClose} onUnavailable={onNativeUnavailable} />
|
<NativeBooking key={`${selectedDoctor.id}:${date}`} doctor={selectedDoctor} filterDate={date} initialSlot={requestedSlot} onClose={onClose} onUnavailable={onNativeUnavailable} />
|
||||||
) : status.state === 'done' ? (
|
) : status.state === 'done' ? (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user