From 556393380558f32ed6359225483f4bb472cf29fc Mon Sep 17 00:00:00 2001 From: wzglinieckisoldevelo <98958634+wzglinieckisoldevelo@users.noreply.github.com> Date: Tue, 21 Mar 2023 12:13:52 +0100 Subject: [PATCH 1/2] OP-869: Changed spelling of openIMIS. (#21) --- src/translations/en.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/translations/en.json b/src/translations/en.json index b9b92b9..e4cb52e 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -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}" } @@ -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}" } @@ -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}" }, @@ -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}" } @@ -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}" } From 5ff46ae1a0241fff8f7811514f1ae1704882c729 Mon Sep 17 00:00:00 2001 From: olewandowski1 <109145288+olewandowski1@users.noreply.github.com> Date: Wed, 22 Mar 2023 16:00:53 +0100 Subject: [PATCH 2/2] OTC-757: Clearing pagination state if enetered the BillsPage or InvoicesPage (#22) --- src/pages/BillsPage.js | 19 ++++++++++++------- src/pages/InvoicesPage.js | 27 ++++++++++++++++++--------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/pages/BillsPage.js b/src/pages/BillsPage.js index d826aa7..82eead8 100644 --- a/src/pages/BillsPage.js +++ b/src/pages/BillsPage.js @@ -1,10 +1,10 @@ -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) => ({ @@ -12,18 +12,23 @@ const styles = (theme) => ({ 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) && (
- diff --git a/src/pages/InvoicesPage.js b/src/pages/InvoicesPage.js index 0ce296f..ae3ef5c 100644 --- a/src/pages/InvoicesPage.js +++ b/src/pages/InvoicesPage.js @@ -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) && ( -
- - -
+const InvoicesPage = ({ intl, classes, rights }) => { + const dispatch = useDispatch(); + + useEffect(() => { + dispatch(clearCurrentPaginationPage()); + }, []); + + return ( + rights.includes(RIGHT_INVOICE_SEARCH) && ( +
+ + +
+ ) ); +}; const mapStateToProps = (state) => ({ rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [],