From 646915b6b1b1b710670bf14a4d151558a775dcc0 Mon Sep 17 00:00:00 2001 From: Matt Stover Date: Mon, 6 Nov 2023 11:03:26 -0800 Subject: [PATCH] fix: move ftd settings query to checkoutSettings file, add basic sentry log for missing data --- src/graphql/query/checkout/checkoutSettings.graphql | 12 ++++++++++++ .../query/checkout/initializeCheckout.graphql | 12 ------------ src/pages/Checkout/CheckoutPage.vue | 8 ++++++++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/graphql/query/checkout/checkoutSettings.graphql b/src/graphql/query/checkout/checkoutSettings.graphql index dae6a9df23..4dc8e15c59 100644 --- a/src/graphql/query/checkout/checkoutSettings.graphql +++ b/src/graphql/query/checkout/checkoutSettings.graphql @@ -4,6 +4,18 @@ query checkoutSettings($basketId: String) { value key } + ftd_message_enable: uiConfigSetting(key: "ftd_message_enable") { + key + value + } + ftd_message_amount: uiConfigSetting(key: "ftd_message_amount") { + key + value + } + ftd_message_valid_date: uiConfigSetting(key: "ftd_message_valid_date") { + key + value + } } shop (basketId: $basketId) { id diff --git a/src/graphql/query/checkout/initializeCheckout.graphql b/src/graphql/query/checkout/initializeCheckout.graphql index 11183e0815..bfdfafff5f 100644 --- a/src/graphql/query/checkout/initializeCheckout.graphql +++ b/src/graphql/query/checkout/initializeCheckout.graphql @@ -34,18 +34,6 @@ query initializeCheckout($basketId: String) { value description } - ftd_message_enable: uiConfigSetting(key: "ftd_message_enable") { - key - value - } - ftd_message_amount: uiConfigSetting(key: "ftd_message_amount") { - key - value - } - ftd_message_valid_date: uiConfigSetting(key: "ftd_message_valid_date") { - key - value - } } shop (basketId: $basketId) { id diff --git a/src/pages/Checkout/CheckoutPage.vue b/src/pages/Checkout/CheckoutPage.vue index bef5a8b2fe..0d5434ff79 100644 --- a/src/pages/Checkout/CheckoutPage.vue +++ b/src/pages/Checkout/CheckoutPage.vue @@ -523,6 +523,14 @@ export default { const validationErrors = _get(shopMutationData, 'validatePreCheckout', []); this.showCheckoutError(validationErrors, true); + // Fire error for empty shop state + if (!this.isServer && !this.totals) { + Sentry.withScope(scope => { + scope.setTag('init_checkout', 'Missing baseline basket information'); + Sentry.captureMessage(`Missing baseline basket information; totals value is ${this.totals}.`); + }); + } + // TODO: Implement check against contentful setting // to signify if holiday mode is enabled