From 82953499ecfd5b958a19c526ca8f96b684237b32 Mon Sep 17 00:00:00 2001
From: Emanuele Dall'Ara <71103219+LeleDallas@users.noreply.github.com>
Date: Tue, 22 Oct 2024 12:37:58 +0200
Subject: [PATCH 1/2] fix: [IOBP-900] Remove parenthesis from tax code in
payment screen (#6317)
## Short description
This pull request includes changes to the `getPayerInfoLabel` function
and its corresponding tests to improve the formatting of the payer's tax
code. The main change is the removal of parentheses around the tax code
in the output.
## List of changes proposed in this pull request
- Remove parenthesis from `getPayerInfoLabel` function
- Update `getPayerInfoLabel` test
## How to test
- Go into `Pagamenti`
- Tap on a payment from the list
- Check the tax code under the payer name
## Preview
---
.../bizEventsTransaction/utils/__tests__/index.test.ts | 8 +++++++-
ts/features/payments/bizEventsTransaction/utils/index.ts | 5 ++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ts/features/payments/bizEventsTransaction/utils/__tests__/index.test.ts b/ts/features/payments/bizEventsTransaction/utils/__tests__/index.test.ts
index 5df6e53961c..5147a37b83f 100644
--- a/ts/features/payments/bizEventsTransaction/utils/__tests__/index.test.ts
+++ b/ts/features/payments/bizEventsTransaction/utils/__tests__/index.test.ts
@@ -63,7 +63,13 @@ describe("getPayerInfoLabel", () => {
it("should return only the taxCode if name is not provided", () => {
const payer = { taxCode: "123456789" };
const result = getPayerInfoLabel(payer);
- expect(result).toBe("(123456789)");
+ expect(result).toBe("123456789");
+ });
+
+ it("should return only the taxCode if name is empty string", () => {
+ const payer = { taxCode: "123456789", name: "" };
+ const result = getPayerInfoLabel(payer);
+ expect(result).toBe("123456789");
});
it("should return name and taxCode formatted correctly", () => {
diff --git a/ts/features/payments/bizEventsTransaction/utils/index.ts b/ts/features/payments/bizEventsTransaction/utils/index.ts
index efc065c5dcd..04a4995190b 100644
--- a/ts/features/payments/bizEventsTransaction/utils/index.ts
+++ b/ts/features/payments/bizEventsTransaction/utils/index.ts
@@ -65,10 +65,9 @@ export const getPayerInfoLabel = (payer: InfoNotice["payer"]): string => {
}
const name = payer.name ? payer.name.trim() : "";
- const taxCode = payer.taxCode ? `(${payer.taxCode.trim()})` : "";
+ const taxCode = payer.taxCode ? payer.taxCode.trim() : "";
- const payerInfo =
- name && taxCode ? `${name}\n${taxCode}` : `${name}${taxCode}`;
+ const payerInfo = name ? (taxCode ? `${name}\n(${taxCode})` : name) : taxCode;
return payerInfo.trim();
};
From 36d29c8a26d9b9d31b43a99b9cf77e7aaa8e7c4d Mon Sep 17 00:00:00 2001
From: Alessandro
Date: Tue, 22 Oct 2024 14:30:29 +0200
Subject: [PATCH 2/2] feat: [IOBP-834] Add pull to refresh into transactions
list screen (#6213)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## ⚠️ This PR depends on #6187 ⚠️
## Short description
This PR adds the refresh control with the pull-to-refresh feature inside
the biz-events transaction list screen
## List of changes proposed in this pull request
- Added the `refreshing` property and the `onRefresh` handler to the
SectionList.
- Added the `isRefreshing` state that changes when the user pull down to
refresh the content.
## How to test
- With the dev-server started, open the `Payments` home page;
- Tap on the `Show all` CTA on the top right corner of the list;
- You should be able to pull to refresh the content when inside that
list;
## Preview
https://github.com/user-attachments/assets/9ebbecc3-c507-466b-ad87-ec852d16a85e
---------
Co-authored-by: Mario Perrotta
---
...PaymentsTransactionBizEventsListScreen.tsx | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/ts/features/payments/bizEventsTransaction/screens/PaymentsTransactionBizEventsListScreen.tsx b/ts/features/payments/bizEventsTransaction/screens/PaymentsTransactionBizEventsListScreen.tsx
index f79eb80ac52..41acb4548b8 100644
--- a/ts/features/payments/bizEventsTransaction/screens/PaymentsTransactionBizEventsListScreen.tsx
+++ b/ts/features/payments/bizEventsTransaction/screens/PaymentsTransactionBizEventsListScreen.tsx
@@ -53,6 +53,7 @@ const PaymentsTransactionBizEventsListScreen = () => {
const scrollTranslationY = useSharedValue(0);
const [titleHeight, setTitleHeight] = React.useState(0);
+ const [isRefreshing, setIsRefreshing] = React.useState(false);
const [continuationToken, setContinuationToken] = React.useState<
string | undefined
>();
@@ -104,8 +105,19 @@ const PaymentsTransactionBizEventsListScreen = () => {
setTitleHeight(height);
};
- const handleOnSuccess = (continuationToken?: string) => {
- setContinuationToken(continuationToken);
+ const handleOnSuccess = (paginationToken?: string) => {
+ setContinuationToken(paginationToken);
+ setIsRefreshing(false);
+ };
+
+ const handleOnRefreshTransactionsList = () => {
+ setIsRefreshing(true);
+ dispatch(
+ getPaymentsBizEventsTransactionsAction.request({
+ firstLoad: true,
+ onSuccess: handleOnSuccess
+ })
+ );
};
useOnFirstRender(
@@ -192,7 +204,8 @@ const PaymentsTransactionBizEventsListScreen = () => {
return (