From 25c890c9a9bd5218c6f62d61e9444a7b649d0126 Mon Sep 17 00:00:00 2001 From: olewandowski1 <109145288+olewandowski1@users.noreply.github.com> Date: Wed, 26 Apr 2023 10:53:32 +0200 Subject: [PATCH 1/3] OP-1392: Remain buttons in a horizontal orientation (#14) --- src/components/PayerSearcher.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/PayerSearcher.js b/src/components/PayerSearcher.js index b696249..87d1a7a 100644 --- a/src/components/PayerSearcher.js +++ b/src/components/PayerSearcher.js @@ -1,15 +1,22 @@ import React, { useState, useCallback } from "react"; -import { usePayersQuery } from "../hooks"; -import { Searcher, useTranslations, useModulesManager, ConfirmDialog } from "@openimis/fe-core"; -import PayerFilters from "./PayerFilters"; + import { Tooltip, IconButton } from "@material-ui/core"; import { Tab as TabIcon, Delete as DeleteIcon } from "@material-ui/icons"; +import { withTheme, withStyles } from "@material-ui/core/styles"; + +import { Searcher, useTranslations, useModulesManager, combine, ConfirmDialog } from "@openimis/fe-core"; +import { usePayersQuery } from "../hooks"; +import PayerFilters from "./PayerFilters"; const isRowDisabled = (_, row) => Boolean(row.validityTo); const formatLocation = (location) => (location ? `${location.code} - ${location.name}` : null); +const styles = (theme) => ({ + horizontalButtonContainer: theme.buttonContainer.horizontal, +}); + const PayerSearcher = (props) => { - const { cacheFiltersKey, onDelete, canDelete, onDoubleClick } = props; + const { cacheFiltersKey, classes, onDelete, canDelete, onDoubleClick } = props; const modulesManager = useModulesManager(); const { formatMessage, formatDateFromISO, formatMessageWithValues } = useTranslations("payer", modulesManager); const [filters, setFilters] = useState({}); @@ -76,7 +83,7 @@ const PayerSearcher = (props) => { (p) => formatDateFromISO(p.validityTo), (p) => !filters.showHistory?.value ? ( - <> +
onDoubleClick(p, true)}> @@ -89,7 +96,7 @@ const PayerSearcher = (props) => { )} - +
) : null, ]; }, []); @@ -128,4 +135,6 @@ const PayerSearcher = (props) => { ); }; -export default PayerSearcher; +const enhance = combine(withTheme, withStyles(styles)); + +export default enhance(PayerSearcher); From 19cda796d9c01445b3098fbcd81124c715aed2a4 Mon Sep 17 00:00:00 2001 From: olewandowski Date: Thu, 4 May 2023 12:54:33 +0200 Subject: [PATCH 2/3] OP-1439: Make a receipt field required --- src/components/AddFundingDialog.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/AddFundingDialog.js b/src/components/AddFundingDialog.js index a00384d..ad713b5 100644 --- a/src/components/AddFundingDialog.js +++ b/src/components/AddFundingDialog.js @@ -67,6 +67,7 @@ const AddFundingDialog = (props) => { label="receipt" name="receipt" value={form.receipt} + required onChange={(receipt) => setForm({ ...form, receipt })} /> From 998d263d9ccad36c0704099b5091abc84426f250 Mon Sep 17 00:00:00 2001 From: olewandowski Date: Thu, 4 May 2023 14:06:40 +0200 Subject: [PATCH 3/3] OP-1439: Make a pay date field required --- src/components/AddFundingDialog.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/AddFundingDialog.js b/src/components/AddFundingDialog.js index ad713b5..d69b381 100644 --- a/src/components/AddFundingDialog.js +++ b/src/components/AddFundingDialog.js @@ -76,6 +76,7 @@ const AddFundingDialog = (props) => { pubRef="core.DatePicker" value={form.payDate} module="payer" + required label="payDate" onChange={(payDate) => setForm({ ...form, payDate })} />