From 885e9c69582218f140bd735ef519c26b94eeab75 Mon Sep 17 00:00:00 2001 From: swtmply Date: Tue, 14 Mar 2023 02:36:41 +0800 Subject: [PATCH] added the card payment option on actions and menu --- .../components/header/header.component.jsx | 16 ++++++++ .../jobs-detail-header-actions.component.jsx | 16 ++++++++ .../src/graphql/payment_response.queries.js | 40 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 client/src/graphql/payment_response.queries.js diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx index 1ed3f526d..7a0679daa 100644 --- a/client/src/components/header/header.component.jsx +++ b/client/src/components/header/header.component.jsx @@ -70,6 +70,8 @@ const mapDispatchToProps = (dispatch) => ({ setReportCenterContext: (context) => dispatch(setModalContext({ context: context, modal: "reportCenter" })), signOutStart: () => dispatch(signOutStart()), + setCardPaymentContext: (context) => + dispatch(setModalContext({ context: context, modal: "cardPayment" })), }); function Header({ @@ -83,6 +85,7 @@ function Header({ setPaymentContext, setReportCenterContext, recentItems, + setCardPaymentContext, }) { const { Simple_Inventory } = useTreatments( ["Simple_Inventory"], @@ -240,6 +243,19 @@ function Header({ > {t("menus.header.enterpayment")} + {/* TODO: Enter Card Payment */} + { + setCardPaymentContext({ + actions: {}, + context: null, + }); + }} + icon={} + > + {t("menus.header.entercardpayment")} + }> diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx index 5002a0e5d..eda815742 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx @@ -38,6 +38,8 @@ const mapDispatchToProps = (dispatch) => ({ dispatch(setModalContext({ context: context, modal: "jobCosting" })), setTimeTicketContext: (context) => dispatch(setModalContext({ context: context, modal: "timeTicket" })), + setCardPaymentContext: (context) => + dispatch(setModalContext({ context: context, modal: "cardPayment" })), }); export function JobsDetailHeaderActions({ @@ -51,6 +53,7 @@ export function JobsDetailHeaderActions({ setJobCostingContext, jobRO, setTimeTicketContext, + setCardPaymentContext, }) { const { t } = useTranslation(); const client = useApolloClient(); @@ -221,6 +224,19 @@ export function JobsDetailHeaderActions({ > {t("menus.header.enterpayment")} + {/* TODO: Add Card payment */} + { + setCardPaymentContext({ + actions: {}, + context: { jobid: job.id }, + }); + }} + > + {t("menus.header.entercardpayment")} +