OnlineBoard search: render Купить/Онлайн регистрация in expanded row
Angular's board search results expansion shows [Купить] [Онлайн регистрация] [Детали рейса]. React only rendered Details. Added a `renderActions` prop on FlightCard/FlightList so the feature layer can inject extra buttons without the ui layer importing from features. OnlineBoardSearchPage wires it to FlightActions with showShare=false (the row already has a dedicated share icon). Visibility rules fall through to canBuyTicket / canRegister (same as BoardDetailsHeader), so cancelled/past flights still hide the Buy button and carriers without a registrationUrl still hide the Online Registration button — matching Angular's per-flight gating. Integration test mocks useAppSettings to avoid requiring the real ApiClientProvider in flight-search.test.tsx.
This commit is contained in:
@@ -18,6 +18,7 @@ import { useNavigate } from "@modern-js/runtime/router";
|
||||
import { useLocale } from "@/i18n/useLocale.js";
|
||||
import { useTranslation } from "@/i18n/provider.js";
|
||||
import { FlightList } from "@/ui/flights/FlightList.js";
|
||||
import { FlightActions } from "./BoardDetailsHeader/FlightActions.js";
|
||||
import { findClosestFlightId } from "../closestFlight.js";
|
||||
import { PageLayout } from "@/ui/layout/PageLayout.js";
|
||||
import { PageTabs } from "@/ui/layout/PageTabs.js";
|
||||
@@ -514,6 +515,18 @@ export const OnlineBoardSearchPage: FC<OnlineBoardSearchPageProps> = ({
|
||||
onFlightClick={handleFlightClick}
|
||||
initialCurrentFlightId={initialCurrentFlightId}
|
||||
direction={params.type}
|
||||
renderActions={(flight) => (
|
||||
// Mirrors Angular's board search expansion: each row
|
||||
// shows [Купить] [Онлайн регистрация] alongside the
|
||||
// Details button. Visibility falls through to the
|
||||
// same canBuyTicket / canRegister rules we use in the
|
||||
// BoardDetailsHeader.
|
||||
<FlightActions
|
||||
flight={flight}
|
||||
locale={language}
|
||||
showShare={false}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</section>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user