Skip to content

Commit

Permalink
Merge pull request #17 from openimis/develop
Browse files Browse the repository at this point in the history
MERGING RELEASE branches
  • Loading branch information
delcroip authored May 16, 2023
2 parents 3db3427 + 0a3d49c commit 047c337
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/components/AddFundingDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const AddFundingDialog = (props) => {
label="receipt"
name="receipt"
value={form.receipt}
required
onChange={(receipt) => setForm({ ...form, receipt })}
/>
</Grid>
Expand All @@ -75,6 +76,7 @@ const AddFundingDialog = (props) => {
pubRef="core.DatePicker"
value={form.payDate}
module="payer"
required
label="payDate"
onChange={(payDate) => setForm({ ...form, payDate })}
/>
Expand Down
23 changes: 16 additions & 7 deletions src/components/PayerSearcher.js
Original file line number Diff line number Diff line change
@@ -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({});
Expand Down Expand Up @@ -76,7 +83,7 @@ const PayerSearcher = (props) => {
(p) => formatDateFromISO(p.validityTo),
(p) =>
!filters.showHistory?.value ? (
<>
<div className={classes.horizontalButtonContainer}>
<Tooltip title={formatMessage("PayerSearcher.openNewTab")}>
<IconButton onClick={() => onDoubleClick(p, true)}>
<TabIcon />
Expand All @@ -89,7 +96,7 @@ const PayerSearcher = (props) => {
</IconButton>
</Tooltip>
)}
</>
</div>
) : null,
];
}, []);
Expand Down Expand Up @@ -128,4 +135,6 @@ const PayerSearcher = (props) => {
);
};

export default PayerSearcher;
const enhance = combine(withTheme, withStyles(styles));

export default enhance(PayerSearcher);

0 comments on commit 047c337

Please sign in to comment.