Commit Graph

216 Commits

Author SHA1 Message Date
gnezim 9ff034d19f 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.
2026-04-20 18:27:31 +03:00
gnezim 2134447664 Replace margin/padding 20px directional literals with vars.$space-xl tokens (3 files) 2026-04-20 18:19:10 +03:00
gnezim 8de1f197fd Replace padding/margin 10px/20px literals with vars.$space-m/$space-xl tokens (3 files) 2026-04-20 18:17:41 +03:00
gnezim 2bc61de87d Replace gap 10/12/15/20px literals with vars.$space-m/m2/l/xl tokens across 5 SCSS files 2026-04-20 18:05:50 +03:00
gnezim 9778d6ba8a Replace 8px padding/gap/margin literals with vars.$space-s2 across 7 SCSS files 2026-04-20 18:04:33 +03:00
gnezim 50885b7afd font-size 22px/30px → fonts.$font-size-xl2/$font-size-xxl across 4 SCSS files 2026-04-20 17:54:01 +03:00
gnezim 623f282f56 font-size 18px/20px → fonts.$font-size-xl/$font-size-xl1 across 16 SCSS files (brand palette parity) 2026-04-20 17:52:31 +03:00
gnezim fbf99f427f font-size: 16px → fonts.$font-size-l across 8 SCSS files (brand palette parity) 2026-04-20 17:49:21 +03:00
gnezim 93684c1bbb font-size: 14px → fonts.$font-size-m across 15 SCSS files (brand palette parity) 2026-04-20 17:48:12 +03:00
gnezim 41ed2bdc1d font-size: 12px → fonts.$font-size-s across 21 SCSS files (brand palette parity) 2026-04-20 17:37:03 +03:00
gnezim 42e595cb16 font-size: 10px → fonts.$font-size-xs across 5 feature SCSS files 2026-04-20 17:35:44 +03:00
gnezim 2037ba0141 Swap font-weight 400/700 literals for fonts.$font-regular/$font-bold tokens across 8 SCSS files 2026-04-20 17:25:01 +03:00
gnezim 4a653849f4 Final font-weight: 500 sweep: 9 more SCSS files use fonts.$font-medium (brand palette parity) 2026-04-20 17:21:22 +03:00
gnezim 43a7380059 Replace font-weight: 500 literals with fonts.$font-medium across 8 SCSS files (brand palette parity) 2026-04-20 17:08:06 +03:00
gnezim 9b5aaaeebc Replace remaining font-weight: 600 with fonts.$font-bold across 4 SCSS files (brand palette parity) 2026-04-20 17:06:20 +03:00
gnezim c283e3bab4 WeekTabs + FullRouteTimeline: font-weight: 600 → fonts.$font-bold (brand palette parity) 2026-04-20 16:56:28 +03:00
gnezim 4e8934f0c9 OnlineBoardDetailsPage cancelled bar: derive light red from $red token (#fbd4d4 → rgba($red, 0.2)) 2026-04-20 16:38:25 +03:00
gnezim d44f97d312 OnlineBoardSearchPage retry button: $blue-light fill + $blue-light--hover (brand button parity) 2026-04-20 16:22:03 +03:00
gnezim 67bf78d22e BoardDetailsHeader actions: transparent button hover uses $blue-extra-light (brand palette) 2026-04-20 15:51:46 +03:00
gnezim f823aafb35 FlightCard/FlightDetailsAccordion: #8a8a8a → $light-gray (brand palette parity) 2026-04-20 15:28:15 +03:00
gnezim 23b5a35c70 DayTabs: mobile breakpoint 768px→640px, non-standard 8px radius→vars.$border-radius (Angular parity)
CI / ci (push) Failing after 51s
Deploy / build-and-deploy (push) Failing after 6s
2026-04-20 15:25:03 +03:00
gnezim 81d979aa34 OnlineBoardSearchPage footer: render Angular page-footer-notes DOM + styling (blue-extra-light card, sort-note *) 2026-04-20 15:15:12 +03:00
gnezim 6947e07fd1 FlightsMiniList selected: blue-light border (Angular parity, not blue) 2026-04-20 14:07:42 +03:00
gnezim c91fec16c2 FlightSchedule days strip: filled -color pills (Angular .days .day parity) 2026-04-20 14:00:33 +03:00
gnezim 3e0b19f633 FlightDetailsAccordion: 1.3px dotted divider between tabs (Angular parity) 2026-04-20 13:32:20 +03:00
gnezim 2434bd702b OnlineBoardFilter: validate departure===arrival mismatch with inline error (Angular parity) 2026-04-20 12:33:21 +03:00
gnezim 45a8023b68 OnlineBoardFilter: seed time range from URL params (Angular parity) 2026-04-20 12:28:02 +03:00
gnezim c456de9f9f OnlineBoardFilter: wire time range slider to route-search URL (Angular parity) 2026-04-20 12:26:29 +03:00
gnezim 001b3f993d OnlineBoardFilter: constrain Calendar to ±1/+7 day window (Angular boardMin/MaxDate parity) 2026-04-20 12:23:23 +03:00
gnezim 37ebda8455 Allow departure-only / arrival-only online-board search submits
Previously handleRouteSubmit required both fields and returned silently
when only one was filled. Angular's
OnlineBoardUrlBuilderService.getRoutePageUrl switches on which side is
populated, routing to /onlineboard/departure/{dep}-{date} or
/onlineboard/arrival/{arr}-{date} for one-sided searches. React now
mirrors the same branch and only no-ops when neither side is filled
(matching Angular's `if (!departure && !arrival) return;` in
OnlineBoardFilterService.toRoutePage).
2026-04-20 11:53:36 +03:00
gnezim af473f9877 Resolve popular-request airport codes to city codes before prefill
Popular-requests API returns mixed airport (SVO) and city (MOW) IATA
codes. Clicking a "Шереметьево → Санкт-Петербург" entry used to paste
SVO into the departure field, leaving a specific airport pinned even
though the visible label already resolves to the owning city name.

Both start pages now route request.departure/arrival through
getCityCodeByAirportCode(dictionaries, code), so the filter form seeds
with MOW instead of SVO (and falls back to the raw code when
dictionaries aren't loaded yet). buildOnlineBoardPrefillState takes
an optional dictionaries arg for the same reason.

ScheduleStartPage.test mocks @/shared/dictionaries/index.js to preserve
the existing assertions (which expect unresolved codes).
2026-04-20 11:37:27 +03:00
gnezim 706b8f444b Clear the last 19 lint warnings — make check now passes clean
- BuyTicketButton / FlightsMiniListItem: narrow firstLeg/lastLeg with
  explicit null guards (throw / return '').
- FlightSchedule.tsx: `match?.[1] ?? iso` for the regex capture.
- OnlineBoardSearchPage + schedule/api: `split('T')[0] ?? iso` for the
  date-prefix extraction.
- ServicesPanel: icon lookup uses a third '' fallback instead of `!`.
- buildCountryCityRows: explicit `break` if cities[i] is undefined.
- useAppSettings: `match?.[1]` null-check before parseInt.
- datetime/index.ts: guard bare HH:MM capture groups together.
- ScheduleDetailsCatchAllRoute: drop unused `t` + useTranslation import.
- ScheduleDetailsPage.tsx: prefix unused `getLegs` with underscore.
- 4 seo/json-ld tests: drop now-redundant eslint-disable comments.
- calendarRange.test + api.test: prefix unused helper names with `_`.

Warning count: 19 → 0. make check (typecheck + lint + test) exits 0.
2026-04-20 09:30:34 +03:00
gnezim 8d409572b7 Drop 11 more non-null assertions across 5 files
- ErrorPage.tsx: FALLBACK_CONFIG literal instead of ERROR_CONFIG["500"]!
- ErrorBoundary.tsx: hoist FALLBACK_RU / FALLBACK_EN to consts so
  pickStrings returns them without the bang.
- routesToPolylines.ts: narrow spider-mode block on filterState.departure
  truthy; guard each route-code lookup.
- FlightsMapStartPage.tsx: narrow firstRoute/depCode/arrCode together
  instead of asserting each individually.
- OnlineBoardDetailsPage.tsx: IIFE over legs[i+1] for TransferBar;
  `_canonicalOrigin` prefix for currently-unused prop.

Warning count: 30 → 19.
2026-04-20 09:22:49 +03:00
gnezim 298f007463 Drop 11 non-null assertions in api.ts, DayGroupedFlightList, FlightCard
Regex capture groups and array boundary accesses replaced with nullish
fallbacks / explicit guards. Warning count: 41 → 30.
2026-04-20 09:19:14 +03:00
gnezim 5c47498472 Allow non-null assertions in tests; refactor two production hotspots to drop them
- eslint.config.js: disable no-non-null-assertion for *.test.ts/tsx and
  tests/** (fixture-driven tests routinely use arr[0]! after a length
  check — signal there is low).
- closestFlight.ts: replace flights.legs[0]! / flights[flights.length-1]!
  with explicit null checks.
- FlightDetailsAccordion.tsx: refactor transition + meal/service
  branches to use local consts narrowed by a preceding truthy check,
  dropping the `leg.transition!.registration!` patterns.

Warning count: 190 → 65. Remaining warnings are pre-existing production-code
non-null assertions spread across the codebase.
2026-04-20 08:24:01 +03:00
gnezim a982d9a669 Fix lint: route sessionStorage through shared storage module, drop dead imports
- storage.ts: add sessionStore wrapper (getRaw/setRaw/delete/clear) so
  transientPrefill + ScheduleStartPage tests don't trip the
  no-restricted-globals rule.
- transientPrefill.ts + ScheduleStartPage.test.tsx: use sessionStore.
- closestFlight.ts: hoist bracket-index key so no newline-before-[ ASI.
- Test files: hoist typeof import(...) into named type alias with
  type-only namespace import.
- Drop unused imports: FlightCard (Link, languageToLocale),
  OnlineBoardDetailsPage (operatingCarrier),
  ScheduleSearchPage (FlightList, inline import() types),
  PageLayout (FeedbackButton).
- Drop react-hooks/exhaustive-deps disable comments for a rule not
  registered in eslint.config.js.
2026-04-20 08:15:21 +03:00
gnezim 8e476b5883 OnlineBoardStartPage: background-position: left center (matches Angular) 2026-04-20 07:29:51 +03:00
gnezim 68e7b3e9ec Normalize 4/6/8px radii to vars.$border-radius (3px) across 5 SCSS files 2026-04-20 07:10:12 +03:00
gnezim 69020946b8 Card border-radius 8px→$border-radius (3px) on FlightsMiniList + FullRouteTimeline 2026-04-20 07:07:43 +03:00
gnezim 6faa01a998 DayTabs: 3px top-corner radius matching Angular date-tabs carousel arrows 2026-04-20 07:02:38 +03:00
gnezim ef845f587f Final token sweep: pastel blues, blues, greys to design tokens (8 files) 2026-04-20 06:14:55 +03:00
gnezim b10e78f6a6 Token cleanup for OnlineBoardFilter + FlightsMap switch/tooltip colors 2026-04-20 06:11:26 +03:00
gnezim 2fdd7ac0ff Use tokens for FlightDetailsAccordion status colors (#c8102e/#f37b09/#4a90e2/#333/#657282) 2026-04-20 05:47:25 +03:00
gnezim 4d741c18e1 Token cleanup in OnlineBoardDetailsPage (#333/#657282/#d1dcea/#d0d5dd/#eee → tokens) 2026-04-20 05:44:41 +03:00
gnezim 8b0f4f75c2 Use tokens for FlightSchedule colors and FlightsMiniList flight-number navy 2026-04-20 05:41:35 +03:00
gnezim c1534bba44 Token cleanup for online-board components (#fff/#333/#657282/#d0dae5 → tokens) 2026-04-20 05:20:46 +03:00
gnezim 928d072577 Align DetailsBackButton to Angular: left-aligned label, $button-height, tokens 2026-04-20 05:14:11 +03:00
gnezim 8e37fac674 Use design tokens for share-panel background/border/padding and 10px element gap 2026-04-20 04:49:13 +03:00
gnezim 89dd51cbaf Match Angular flight-events chip shape (squared 3px corners, 0/10 padding, line-height 16) 2026-04-20 04:47:01 +03:00
gnezim c8257baf26 Replace border-radius: 4px with vars.$border-radius (3px) to match Angular 2026-04-20 04:26:19 +03:00