From 5ef4df0aa6dab075ad6219c7ae9f407ac622030f Mon Sep 17 00:00:00 2001 From: "Brian.Jiang2021" Date: Mon, 22 Jan 2024 10:00:14 +0800 Subject: [PATCH] feat: quote hide or show checkout and disccount https://bigc-b2b.atlassian.net/browse/BUN-1870 --- .../src/pages/quote/QuoteDetail.tsx | 19 +++++++++++-------- .../quote/components/QuoteDetailSummary.tsx | 1 + .../src/shared/service/b2b/graphql/quote.ts | 2 ++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/apps/storefront/src/pages/quote/QuoteDetail.tsx b/apps/storefront/src/pages/quote/QuoteDetail.tsx index a33616a2..42aae309 100644 --- a/apps/storefront/src/pages/quote/QuoteDetail.tsx +++ b/apps/storefront/src/pages/quote/QuoteDetail.tsx @@ -534,14 +534,17 @@ function QuoteDetail() { - {+role !== 2 && +quoteDetail.status !== 4 && isShowFooter && ( - - )} + {+role !== 2 && + +quoteDetail.status !== 4 && + isShowFooter && + quoteDetail?.allowCheckout && ( + + )} ) diff --git a/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx b/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx index 040e1692..bf207965 100644 --- a/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx +++ b/apps/storefront/src/pages/quote/components/QuoteDetailSummary.tsx @@ -123,6 +123,7 @@ export default function QuoteDetailSummary(props: QuoteDetailSummaryProps) { justifyContent="space-between" sx={{ margin: '4px 0', + display: quoteDetail?.displayDiscount ? '' : 'none', }} > diff --git a/apps/storefront/src/shared/service/b2b/graphql/quote.ts b/apps/storefront/src/shared/service/b2b/graphql/quote.ts index 69f3e0c8..951ff0ba 100644 --- a/apps/storefront/src/shared/service/b2b/graphql/quote.ts +++ b/apps/storefront/src/shared/service/b2b/graphql/quote.ts @@ -284,6 +284,8 @@ const getQuoteInfo = (data: { id: number; date: string }) => `{ quoteUrl, channelId, channelName, + allowCheckout, + displayDiscount, } }`