- Раскройте нужный день, выберите подходящую половину и затем сохраните выбор ниже.
-
-
-
{grouped.map(([date, dateSlots]) => (
diff --git a/src/components/client/DeliverySlotsPicker.test.jsx b/src/components/client/DeliverySlotsPicker.test.jsx
index 78ecb85..e44f21e 100644
--- a/src/components/client/DeliverySlotsPicker.test.jsx
+++ b/src/components/client/DeliverySlotsPicker.test.jsx
@@ -37,6 +37,23 @@ describe("DeliverySlotsPicker", () => {
expect(markup).toContain("послезавтра · 15.04.2026");
expect(markup).toContain("первая половина дня");
expect(markup).toContain("вторая половина дня");
+ expect(markup).not.toContain("выберите день и половину дня доставки");
+ });
+
+ it("renders the first half of day before the second half", () => {
+ const markup = renderToStaticMarkup(
+ {}}
+ selectedSlotId={null}
+ referenceDate={new Date("2026-04-13T09:00:00Z")}
+ />,
+ ).toLowerCase();
+
+ expect(markup.indexOf("первая половина дня")).toBeLessThan(markup.indexOf("вторая половина дня"));
});
it("marks the selected slot", () => {
diff --git a/src/pages/ClientDeliveryPage.jsx b/src/pages/ClientDeliveryPage.jsx
index 5efc373..019e72b 100644
--- a/src/pages/ClientDeliveryPage.jsx
+++ b/src/pages/ClientDeliveryPage.jsx
@@ -152,6 +152,16 @@ export const buildSelectedSlotFromInvitation = (invitation, slots = []) => {
};
};
+export const getClientDeliveryHeroDescription = (isActiveState, isChoiceSaved) => {
+ if (isChoiceSaved) {
+ return "";
+ }
+
+ return isActiveState
+ ? "Вам предложены варианты доставки. Выберите удобную дату и время."
+ : "По этому заказу согласование доставки завершено или передано логисту.";
+};
+
export const ClientDeliveryPage = () => {
const { token } = useParams();
const [invitation, setInvitation] = React.useState(null);
@@ -216,6 +226,7 @@ export const ClientDeliveryPage = () => {
const savedChoiceLabel = effectiveSelectedSlot
? `${formatDeliveryDate(effectiveSelectedSlot.date)} / ${effectiveSelectedSlot.time}`
: "";
+ const heroDescription = getClientDeliveryHeroDescription(isActiveState, isChoiceSaved);
const handleSaveChoice = async () => {
if (!token) {
@@ -263,10 +274,6 @@ export const ClientDeliveryPage = () => {
setError("");
};
- const handleRequestNewLink = () => {
- setActionMessage("Если ссылка больше не работает, логист передаст новую ссылку вручную.");
- };
-
if (loading) {
return (
@@ -301,11 +308,11 @@ export const ClientDeliveryPage = () => {
Доставка заказа
Согласование доставки
-
- {isActiveState
- ? "Вам предложены варианты доставки. Выберите удобную дату и время."
- : "По этому заказу согласование доставки завершено или передано логисту."}
-
+ {heroDescription ? (
+
+ {heroDescription}
+
+ ) : null}
{isChoiceSaved && savedChoiceLabel ? (
@@ -334,7 +341,6 @@ export const ClientDeliveryPage = () => {
invitation={invitation}
selectedSlot={effectiveSelectedSlot}
onConfirmChoice={handleSaveChoice}
- onRequestNewLink={handleRequestNewLink}
/>
) : !isChoiceSaved ? (
diff --git a/src/pages/ClientDeliveryPage.test.js b/src/pages/ClientDeliveryPage.test.js
index 2613222..e9b1d3e 100644
--- a/src/pages/ClientDeliveryPage.test.js
+++ b/src/pages/ClientDeliveryPage.test.js
@@ -3,6 +3,7 @@ import { getInvitationReferenceLabel } from "../components/client/invitationRefe
import {
buildDeliveryConfirmationPayload,
buildSelectedSlotFromInvitation,
+ getClientDeliveryHeroDescription,
groupSlotsFromInvitation,
} from "./ClientDeliveryPage";
@@ -176,4 +177,14 @@ describe("ClientDeliveryPage helpers", () => {
}),
).toBe("Счета: СФ Т\\ЕА-28687, СФ Т\\ЕА-28700");
});
+
+ it("hides the hero helper text after the client saves the choice", () => {
+ expect(getClientDeliveryHeroDescription(true, true)).toBe("");
+ expect(getClientDeliveryHeroDescription(true, false)).toBe(
+ "Вам предложены варианты доставки. Выберите удобную дату и время.",
+ );
+ expect(getClientDeliveryHeroDescription(false, false)).toBe(
+ "По этому заказу согласование доставки завершено или передано логисту.",
+ );
+ });
});