From a237a1b50e9d06f80b9ea09ebb271aa18479d36c Mon Sep 17 00:00:00 2001
From: luciatugui
Date: Thu, 11 Jul 2024 16:46:22 +0300
Subject: [PATCH 1/2] fix: financial data error translations
---
.../src/assets/locales/en/translation.json | 8 ++-
.../src/assets/locales/ro/translation.json | 8 ++-
.../OrganizationFinancial.tsx | 57 +++++++++++--------
3 files changed, 44 insertions(+), 29 deletions(-)
diff --git a/frontend/src/assets/locales/en/translation.json b/frontend/src/assets/locales/en/translation.json
index 560d8042..27b6549c 100644
--- a/frontend/src/assets/locales/en/translation.json
+++ b/frontend/src/assets/locales/en/translation.json
@@ -695,7 +695,11 @@
"label": "Other expenses",
"info": "Enter here the total of any other expenses you have not entered in other segments of this budget (for example the purchase of a trailer for a caravan etc.)."
}
- }
+ },
+ "retry_anaf_warning": "Your data is not up to date.",
+ "retry_anaf_button": "Try again",
+ "retry_anaf_error": "Service unavailable.",
+ "no_financial_info": "No data available for your request."
},
"open_data": {
"load_error": "Data could not be uploaded",
@@ -1576,4 +1580,4 @@
"date_added": "Date of feedback"
}
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/assets/locales/ro/translation.json b/frontend/src/assets/locales/ro/translation.json
index f97e5110..c512a426 100644
--- a/frontend/src/assets/locales/ro/translation.json
+++ b/frontend/src/assets/locales/ro/translation.json
@@ -698,7 +698,11 @@
"label": "Alte cheltuieli",
"info": "Introduci aici totalul oricăror altor cheltuieli pe care nu le-ai trecut in alte segmente ale acestui buget (de exemplu achiziția unei rulote pentru o caravana etc.)."
}
- }
+ },
+ "retry_anaf_warning": "Datele nu au fost actualizate.",
+ "retry_anaf_button": "Încearcă din nou",
+ "retry_anaf_error": "Service unavailable.",
+ "no_financial_info": "Nu există date pentru solicitarea dumneavoastră."
},
"open_data": {
"load_error": "Datele nu s-au putut încărca",
@@ -1580,4 +1584,4 @@
"date_added": "Data acordării feedback-ului"
}
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/pages/organization/components/OrganizationFinancial/OrganizationFinancial.tsx b/frontend/src/pages/organization/components/OrganizationFinancial/OrganizationFinancial.tsx
index 9c8181f9..49180334 100644
--- a/frontend/src/pages/organization/components/OrganizationFinancial/OrganizationFinancial.tsx
+++ b/frontend/src/pages/organization/components/OrganizationFinancial/OrganizationFinancial.tsx
@@ -82,19 +82,21 @@ const OrganizationFinancial = () => {
const onUpdateAnaf = () => {
if (organization && organizationGeneral?.cui) {
- retryAnaf({ organizationId: organization?.id, cui: organizationGeneral?.cui }, {
- onSuccess: (data) => {
- if (data[0].synched_anaf === false) {
+ retryAnaf(
+ { organizationId: organization?.id, cui: organizationGeneral?.cui },
+ {
+ onSuccess: (data) => {
+ if (data[0].synched_anaf === false) {
+ useErrorToast(t('no_financial_info'));
+ }
+ },
+ onError: () => {
useErrorToast(t('retry_anaf_error'));
- }
+ },
},
- onError: () => {
- useErrorToast(t('retry_anaf_error'));
- }
- });
+ );
}
- }
-
+ };
const onView = (row: IOrganizationFinancial) => {
setSelectedReport(row);
@@ -135,21 +137,26 @@ const OrganizationFinancial = () => {
{t('data_update', { ns: 'financial' })}
- {organization?.status === OrganizationStatus.PENDING && organizationFinancial[0].synched_anaf === false && role == UserRole.SUPER_ADMIN && (
-
-
- {t('retry_anaf_warning')}
-
-
- {isLoadinAnaf &&
}
-
)}
+ {organization?.status === OrganizationStatus.PENDING &&
+ organizationFinancial[0].synched_anaf === false &&
+ role == UserRole.SUPER_ADMIN && (
+
+
+
+ {t('retry_anaf_warning')}
+
+
+
+ {isLoadinAnaf &&
}
+
+ )}
Date: Thu, 11 Jul 2024 16:49:47 +0300
Subject: [PATCH 2/2] fix: ro translation
---
frontend/src/assets/locales/ro/translation.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/src/assets/locales/ro/translation.json b/frontend/src/assets/locales/ro/translation.json
index c512a426..64a9979d 100644
--- a/frontend/src/assets/locales/ro/translation.json
+++ b/frontend/src/assets/locales/ro/translation.json
@@ -701,7 +701,7 @@
},
"retry_anaf_warning": "Datele nu au fost actualizate.",
"retry_anaf_button": "Încearcă din nou",
- "retry_anaf_error": "Service unavailable.",
+ "retry_anaf_error": "Serviciu momentan indisponibil.",
"no_financial_info": "Nu există date pentru solicitarea dumneavoastră."
},
"open_data": {