@voyant-travel/bookings-react 0.186.0 → 0.186.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -203,6 +203,19 @@ export function BookingJourney(props) {
|
|
|
203
203
|
(quote.data.available === false ||
|
|
204
204
|
(quote.data.invalidReason != null && quote.data.invalidReason !== ""));
|
|
205
205
|
const quoteBlocked = hasQuoteError || quoteUnpriceable;
|
|
206
|
+
// The pristine baseline quote is intentionally un-priceable: a product has no
|
|
207
|
+
// price until its price driver — a room, or a traveler count — is chosen, and
|
|
208
|
+
// the engine reports that empty draft as `no_sell_amount_configured`. Suppress
|
|
209
|
+
// the un-priceable banner (and the side-panel error) for exactly that baseline
|
|
210
|
+
// so step 1 doesn't scream "can't be priced" before the buyer has picked
|
|
211
|
+
// anything. Any other reason (e.g. `rates_missing` on an already-picked stay,
|
|
212
|
+
// #2638), or the same code once a driver IS picked (a room that carries no
|
|
213
|
+
// price), still surfaces. Commit stays gated on `quoteBlocked` regardless, so
|
|
214
|
+
// an unpriced booking can never be submitted.
|
|
215
|
+
const priceDriversConfigured = (draft?.configure?.optionSelections?.length ?? 0) > 0 ||
|
|
216
|
+
Object.values(draft?.configure?.pax ?? {}).reduce((sum, n) => sum + (n ?? 0), 0) > 0;
|
|
217
|
+
const isPristineUnconfigured = quote.data?.invalidReason === "no_sell_amount_configured" && !priceDriversConfigured;
|
|
218
|
+
const showQuoteUnpriceable = quoteBlocked && !isPristineUnconfigured;
|
|
206
219
|
const quoteReady = Boolean(quote.data?.quoteId);
|
|
207
220
|
// Step navigation only hard-blocks on a thrown quote error (a transient fetch
|
|
208
221
|
// failure that a retry fixes). An un-priceable quote (e.g. `rates_missing`
|
|
@@ -404,7 +417,7 @@ export function BookingJourney(props) {
|
|
|
404
417
|
setConfirmError(null);
|
|
405
418
|
void quote.refetch();
|
|
406
419
|
};
|
|
407
|
-
const quoteErrorBanner =
|
|
420
|
+
const quoteErrorBanner = showQuoteUnpriceable ? (_jsxs("div", { role: "alert", "aria-live": "polite", className: "flex flex-col items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-destructive text-sm", children: [_jsx("span", { children: hasQuoteError
|
|
408
421
|
? messages.bookingJourney.validation.quoteFailed
|
|
409
422
|
: messages.bookingJourney.validation.pricingUnavailable }), hasQuoteError ? (_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: retryQuote, disabled: quote.isQuoting, children: messages.bookingJourney.validation.retryQuote })) : null] })) : null;
|
|
410
423
|
// Renders one step's content. Shared by both layouts — the wizard shows
|
|
@@ -31,7 +31,7 @@ export function PriceSidePanel({ pricing, isQuoting, invalidReason, entitySummar
|
|
|
31
31
|
// Departure shows directly under the product title — it's the most-glanced
|
|
32
32
|
// fact, so it doesn't belong buried in the recap accordion.
|
|
33
33
|
const departureText = draft ? stepHeadline("departure", draft, messages, locale) : "";
|
|
34
|
-
return (_jsxs(Card, { className: className, children: [entitySummary?.heroImageUrl ? (_jsx("img", { src: entitySummary.heroImageUrl, alt: entitySummary.name, className: "aspect-video w-full object-cover" })) : null, entitySummary ? (_jsx(EntityHeader, { summary: entitySummary, departureText: departureText })) : null, _jsxs(CardContent, { className: "space-y-4", children: [steps && steps.length > 0 && currentStep && draft ? (_jsx(StepRecap, { steps: steps, currentStep: currentStep, draft: draft })) : null, invalidReason ? _jsx("p", { className: "text-destructive text-sm", children:
|
|
34
|
+
return (_jsxs(Card, { className: className, children: [entitySummary?.heroImageUrl ? (_jsx("img", { src: entitySummary.heroImageUrl, alt: entitySummary.name, className: "aspect-video w-full object-cover" })) : null, entitySummary ? (_jsx(EntityHeader, { summary: entitySummary, departureText: departureText })) : null, _jsxs(CardContent, { className: "space-y-4", children: [steps && steps.length > 0 && currentStep && draft ? (_jsx(StepRecap, { steps: steps, currentStep: currentStep, draft: draft })) : null, invalidReason && showPricing ? (_jsx("p", { className: "text-destructive text-sm", children: messages.bookingJourney.validation.pricingUnavailable })) : null, !showPricing ? (_jsx("p", { className: "border-t pt-4 text-muted-foreground text-sm", children: pricingHint })) : isQuoting && !pricing ? (_jsxs("div", { className: "space-y-2 border-t pt-4", children: [_jsx(Skeleton, { className: "h-4 w-24" }), _jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-4 w-20" })] })) : null, showPricing && pricing ? (_jsxs("div", { className: "space-y-2 border-t pt-4", children: [_jsx("ul", { className: "space-y-1 text-sm", children: pricing.lines.map((line) => (_jsxs("li", { className: "flex justify-between", children: [_jsxs("span", { children: [line.label, line.quantity ? (_jsxs("span", { className: "text-muted-foreground", children: [" \u00D7 ", line.quantity] })) : null] }), _jsx("span", { children: formatMoney(line.totalAmount, pricing.currency, locale) })] }, `${line.kind}-${line.label}-${line.totalAmount}`))) }), pricing.taxes.length > 0 ? (_jsx("ul", { className: "space-y-1 border-t pt-2 text-sm text-muted-foreground", children: pricing.taxes.map((tax) => (_jsxs("li", { className: "flex justify-between", children: [_jsxs("span", { children: [tax.label, tax.rate > 0 ? ` (${formatTaxRate(tax.rate)})` : ""] }), _jsx("span", { children: formatMoney(tax.amount, pricing.currency, locale) })] }, tax.code))) })) : null, _jsxs("div", { className: "flex justify-between border-t pt-2 font-medium", children: [_jsx("span", { children: messages.bookingJourney.sidePanel.total }), _jsx("span", { children: formatMoney(pricing.total, pricing.currency, locale) })] })] })) : null, pricingExtras ? _jsx("div", { className: "border-t pt-4", children: pricingExtras }) : null] })] }));
|
|
35
35
|
}
|
|
36
36
|
function EntityHeader({ summary, departureText, }) {
|
|
37
37
|
// Text block only — the hero image is rendered as a direct Card child above.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/bookings-react",
|
|
3
|
-
"version": "0.186.
|
|
3
|
+
"version": "0.186.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -150,24 +150,24 @@
|
|
|
150
150
|
"react-dom": "^19.0.0",
|
|
151
151
|
"react-hook-form": "^7.80.0",
|
|
152
152
|
"zod": "^4.0.0",
|
|
153
|
-
"@voyant-travel/accommodations": "^0.146.0",
|
|
154
153
|
"@voyant-travel/admin": "^0.128.3",
|
|
155
|
-
"@voyant-travel/bookings": "^0.186.
|
|
154
|
+
"@voyant-travel/bookings": "^0.186.1",
|
|
155
|
+
"@voyant-travel/accommodations": "^0.146.0",
|
|
156
156
|
"@voyant-travel/catalog": "^0.184.0",
|
|
157
157
|
"@voyant-travel/catalog-react": "^0.184.0",
|
|
158
158
|
"@voyant-travel/distribution-react": "^0.176.0",
|
|
159
159
|
"@voyant-travel/relationships-react": "^0.186.0",
|
|
160
|
-
"@voyant-travel/finance": "^0.186.0",
|
|
161
160
|
"@voyant-travel/finance-react": "^0.186.0",
|
|
162
161
|
"@voyant-travel/identity-react": "^0.186.0",
|
|
163
162
|
"@voyant-travel/legal-react": "^0.186.0",
|
|
164
|
-
"@voyant-travel/commerce-react": "^0.68.0",
|
|
165
163
|
"@voyant-travel/cruises": "^0.185.0",
|
|
166
164
|
"@voyant-travel/inventory-react": "^0.68.0",
|
|
167
165
|
"@voyant-travel/inventory": "^0.14.22",
|
|
168
|
-
"@voyant-travel/storefront-react": "^0.188.0",
|
|
169
166
|
"@voyant-travel/ui": "^0.109.3",
|
|
170
|
-
"@voyant-travel/
|
|
167
|
+
"@voyant-travel/storefront-react": "^0.188.0",
|
|
168
|
+
"@voyant-travel/operations-react": "^0.67.0",
|
|
169
|
+
"@voyant-travel/finance": "^0.186.0",
|
|
170
|
+
"@voyant-travel/commerce-react": "^0.68.0"
|
|
171
171
|
},
|
|
172
172
|
"peerDependenciesMeta": {
|
|
173
173
|
"@tanstack/react-table": {
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
"zod": "^4.4.3",
|
|
254
254
|
"@voyant-travel/accommodations": "^0.146.0",
|
|
255
255
|
"@voyant-travel/admin": "^0.128.3",
|
|
256
|
-
"@voyant-travel/bookings": "^0.186.
|
|
256
|
+
"@voyant-travel/bookings": "^0.186.1",
|
|
257
257
|
"@voyant-travel/catalog": "^0.184.0",
|
|
258
258
|
"@voyant-travel/catalog-react": "^0.184.0",
|
|
259
259
|
"@voyant-travel/distribution-react": "^0.176.0",
|