Skip to content

Commit

Permalink
Merge pull request #23 from openimis/develop
Browse files Browse the repository at this point in the history
MERGING RELEASE branches
  • Loading branch information
dragos-dobre authored Apr 20, 2023
2 parents 20eb211 + 5ff46ae commit 19a29f0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 21 deletions.
19 changes: 12 additions & 7 deletions src/pages/BillsPage.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
import React from "react";
import { Helmet, withModulesManager, formatMessage } from "@openimis/fe-core";
import React, { useEffect } from "react";
import { Helmet, withModulesManager, formatMessage, clearCurrentPaginationPage } from "@openimis/fe-core";
import { injectIntl } from "react-intl";
import { withTheme, withStyles } from "@material-ui/core/styles";
import { connect } from "react-redux";
import { connect, useDispatch } from "react-redux";
import { RIGHT_BILL_SEARCH } from "../constants";
import { createInvoiceEventMessage } from "../actions"
import { createInvoiceEventMessage } from "../actions";
import BillSearcher from "../components/BillSearcher";

const styles = (theme) => ({
page: theme.page,
fab: theme.fab,
});

const BILL_SEARCHER_ACTION_CONTRIBUTION_KEY = "invoice.bill.SelectionAction"
const BILL_SEARCHER_ACTION_CONTRIBUTION_KEY = "invoice.bill.SelectionAction";

const BillsPage = (props) => {
const { intl, classes, rights } = props;
const dispatch = useDispatch();

useEffect(() => {
dispatch(clearCurrentPaginationPage());
}, []);

let actions = [];
return (
rights.includes(RIGHT_BILL_SEARCH) && (
<div className={classes.page}>
<Helmet title={formatMessage(props.intl, "bill", "bills.pageTitle")} />
<BillSearcher
rights={rights}
<BillSearcher
rights={rights}
actions={actions}
actionsContributionKey={BILL_SEARCHER_ACTION_CONTRIBUTION_KEY}
/>
Expand Down
27 changes: 18 additions & 9 deletions src/pages/InvoicesPage.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
import React from "react";
import { Helmet, withModulesManager, formatMessage } from "@openimis/fe-core";
import React, { useEffect } from "react";
import { Helmet, withModulesManager, formatMessage, clearCurrentPaginationPage } from "@openimis/fe-core";
import { injectIntl } from "react-intl";
import { withTheme, withStyles } from "@material-ui/core/styles";
import { connect } from "react-redux";
import { connect, useDispatch } from "react-redux";
import { RIGHT_INVOICE_SEARCH } from "../constants";
import InvoiceSearcher from "../components/InvoiceSearcher";
import { defaultPageStyles } from "../util/styles";

const InvoicesPage = ({ intl, classes, rights }) =>
rights.includes(RIGHT_INVOICE_SEARCH) && (
<div className={classes.page}>
<Helmet title={formatMessage(intl, "invoice", "invoices.pageTitle")} />
<InvoiceSearcher rights={rights} />
</div>
const InvoicesPage = ({ intl, classes, rights }) => {
const dispatch = useDispatch();

useEffect(() => {
dispatch(clearCurrentPaginationPage());
}, []);

return (
rights.includes(RIGHT_INVOICE_SEARCH) && (
<div className={classes.page}>
<Helmet title={formatMessage(intl, "invoice", "invoices.pageTitle")} />
<InvoiceSearcher rights={rights} />
</div>
)
);
};

const mapStateToProps = (state) => ({
rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [],
Expand Down
10 changes: 5 additions & 5 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"delete": {
"confirm": {
"title": "Delete {code}?",
"message": "Deleting data does not mean erasing it from OpenIMIS database. The data will only be deactivated from the viewed list."
"message": "Deleting data does not mean erasing it from openIMIS database. The data will only be deactivated from the viewed list."
},
"mutationLabel": "Delete Invoice {code}"
}
Expand Down Expand Up @@ -104,7 +104,7 @@
"delete": {
"confirm": {
"title": "Delete {invoicePaymentLabel}?",
"message": "Deleting data does not mean erasing it from OpenIMIS database. The data will only be deactivated from the viewed list."
"message": "Deleting data does not mean erasing it from openIMIS database. The data will only be deactivated from the viewed list."
},
"mutationLabel": "Delete Invoice Payment {invoicePaymentLabel} of {invoiceCode}"
}
Expand Down Expand Up @@ -164,7 +164,7 @@
"delete": {
"confirm": {
"title": "Delete {code}?",
"message": "Deleting data does not mean erasing it from OpenIMIS database. The data will only be deactivated from the viewed list."
"message": "Deleting data does not mean erasing it from openIMIS database. The data will only be deactivated from the viewed list."
},
"mutationLabel": "Delete Bill {code}"
},
Expand Down Expand Up @@ -224,7 +224,7 @@
"delete": {
"confirm": {
"title": "Delete {billPaymentLabel}?",
"message": "Deleting data does not mean erasing it from OpenIMIS database. The data will only be deactivated from the viewed list."
"message": "Deleting data does not mean erasing it from openIMIS database. The data will only be deactivated from the viewed list."
},
"mutationLabel": "Delete Bill Payment {billPaymentLabel} of {billCode}"
}
Expand Down Expand Up @@ -290,7 +290,7 @@
"delete": {
"confirm": {
"title": "Delete {paymentInvoiceLabel}?",
"message": "Deleting data does not mean erasing it from OpenIMIS database. The data will only be deactivated from the viewed list."
"message": "Deleting data does not mean erasing it from openIMIS database. The data will only be deactivated from the viewed list."
},
"mutationLabel": "Delete Payment {paymentInvoiceLabel} of {code}"
}
Expand Down

0 comments on commit 19a29f0

Please sign in to comment.