From a08c7a22f8aab02288a7884dca346bb708f21b45 Mon Sep 17 00:00:00 2001 From: mutuajames Date: Fri, 21 Jul 2023 16:28:26 +0300 Subject: [PATCH] Fix typo and grammar in messages --- .../src/components/EditLocationUnit/index.tsx | 4 ++-- .../src/components/LocationUnitList/index.tsx | 3 ++- .../src/components/NewLocationUnit/index.tsx | 4 ++-- packages/reports/src/components/DistrictReport/index.tsx | 2 +- .../src/components/DistrictReport/tests/index.test.tsx | 2 +- .../src/components/ServerSettingsView/index.tsx | 3 +-- .../src/components/ServerSettingsView/tests/index.test.tsx | 2 +- packages/team-management/src/components/ListView/index.tsx | 2 +- .../src/components/ListView/tests/index.test.tsx | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/location-management/src/components/EditLocationUnit/index.tsx b/packages/location-management/src/components/EditLocationUnit/index.tsx index 701010703..332f2f383 100644 --- a/packages/location-management/src/components/EditLocationUnit/index.tsx +++ b/packages/location-management/src/components/EditLocationUnit/index.tsx @@ -163,7 +163,7 @@ const EditLocationUnit = (props: EditLocationUnitProps) => { queryKey: [LOCATION_HIERARCHY, location.id], queryFn: () => new OpenSRPService(LOCATION_HIERARCHY, opensrpBaseURL).read(location.id), onError: () => - sendErrorNotification(t('There was a problem fetching location hierachy')), + sendErrorNotification(t('There was a problem fetching the location hierachy')), select: (res: RawOpenSRPHierarchy) => generateJurisdictionTree(res).model, }; }) @@ -215,7 +215,7 @@ const EditLocationUnit = (props: EditLocationUnitProps) => { queryClient .invalidateQueries([LOCATION_HIERARCHY, grandparenthierarchy.id]) .catch(() => - sendErrorNotification(t('There was a problem fetching location hierachy')) + sendErrorNotification(t('There was a problem fetching the location hierachy')) ); else sendErrorNotification(t('There was a problem getting the hierachy node')); } diff --git a/packages/location-management/src/components/LocationUnitList/index.tsx b/packages/location-management/src/components/LocationUnitList/index.tsx index 81e951d1d..249297b79 100644 --- a/packages/location-management/src/components/LocationUnitList/index.tsx +++ b/packages/location-management/src/components/LocationUnitList/index.tsx @@ -102,7 +102,8 @@ export const LocationUnitList: React.FC = (props: Props) => { return { queryKey: [LOCATION_HIERARCHY, location.id], queryFn: () => new OpenSRPService(LOCATION_HIERARCHY, opensrpBaseURL).read(location.id), - onError: () => sendErrorNotification(t('There was a problem fetching location hierachy')), + onError: () => + sendErrorNotification(t('There was a problem fetching the location hierachy')), select: (res: RawOpenSRPHierarchy) => generateJurisdictionTree(res), }; }) diff --git a/packages/location-management/src/components/NewLocationUnit/index.tsx b/packages/location-management/src/components/NewLocationUnit/index.tsx index af34f899e..8660b6b46 100644 --- a/packages/location-management/src/components/NewLocationUnit/index.tsx +++ b/packages/location-management/src/components/NewLocationUnit/index.tsx @@ -98,7 +98,7 @@ const NewLocationUnit = (props: NewLocationUnitProps) => { queryKey: [LOCATION_HIERARCHY, location.id], queryFn: () => new OpenSRPService(LOCATION_HIERARCHY, opensrpBaseURL).read(location.id), onError: () => - sendErrorNotification(t('There was a problem fetching location hierachy')), + sendErrorNotification(t('There was a problem fetching the location hierachy')), // Todo : useQueries doesn't support select or types yet https://github.com/tannerlinsley/react-query/pull/1527 select: (res: RawOpenSRPHierarchy) => generateJurisdictionTree(res).model, }; @@ -136,7 +136,7 @@ const NewLocationUnit = (props: NewLocationUnitProps) => { queryClient .invalidateQueries([LOCATION_HIERARCHY, grandparenthierarchy]) .catch(() => - sendErrorNotification(t('There was a problem fetching location hierachy')) + sendErrorNotification(t('There was a problem fetching the location hierachy')) ); else sendErrorNotification(t('There was a problem getting hierachy node')); } diff --git a/packages/reports/src/components/DistrictReport/index.tsx b/packages/reports/src/components/DistrictReport/index.tsx index e91bc8dad..477019508 100644 --- a/packages/reports/src/components/DistrictReport/index.tsx +++ b/packages/reports/src/components/DistrictReport/index.tsx @@ -87,7 +87,7 @@ export const DistrictReport = ({ opensrpBaseURL }: DistrictReportProps) => { { // start fetching when userLocSettings hook succeeds enabled: userLocSettings.isSuccess && userLocSettings.data.uuid.length > 0, - onError: () => sendErrorNotification(t('There was a problem fetching location hierachy')), + onError: () => sendErrorNotification(t('There was a problem fetching the location hierachy')), onSuccess: (res: RawOpenSRPHierarchy) => { const hierarchy = generateJurisdictionTree(res); dispatch(fetchAllHierarchiesActionCreator([hierarchy.model])); diff --git a/packages/reports/src/components/DistrictReport/tests/index.test.tsx b/packages/reports/src/components/DistrictReport/tests/index.test.tsx index bdb9db840..0e3c92d0c 100644 --- a/packages/reports/src/components/DistrictReport/tests/index.test.tsx +++ b/packages/reports/src/components/DistrictReport/tests/index.test.tsx @@ -234,7 +234,7 @@ describe('DistrictReport', () => { }); expect(notificationErrorMock).toHaveBeenCalledWith( - 'There was a problem fetching location hierachy' + 'There was a problem fetching the location hierachy' ); }); }); diff --git a/packages/server-settings/src/components/ServerSettingsView/index.tsx b/packages/server-settings/src/components/ServerSettingsView/index.tsx index 131f994e4..947f33fb8 100644 --- a/packages/server-settings/src/components/ServerSettingsView/index.tsx +++ b/packages/server-settings/src/components/ServerSettingsView/index.tsx @@ -130,8 +130,7 @@ export const ServerSettingsView: React.FC = (props: Props) => { SECURITY_AUTHENTICATE_ENDPOINT, () => new OpenSRPService(SECURITY_AUTHENTICATE_ENDPOINT, baseURL).list(), { - onError: () => - sendErrorNotification(t('There was a problem authenticating User Location settings')), + onError: () => sendErrorNotification(t('There was a problem fetching user assignment data')), select: (res: { locations: RawOpenSRPHierarchy }) => res.locations, onSuccess: (userLocSettings) => { const processedHierarchy = generateJurisdictionTree(userLocSettings); diff --git a/packages/server-settings/src/components/ServerSettingsView/tests/index.test.tsx b/packages/server-settings/src/components/ServerSettingsView/tests/index.test.tsx index 6c6e010e5..792f7f251 100644 --- a/packages/server-settings/src/components/ServerSettingsView/tests/index.test.tsx +++ b/packages/server-settings/src/components/ServerSettingsView/tests/index.test.tsx @@ -405,7 +405,7 @@ describe('activate mission', () => { wrapper.update(); }); expect(notificationErrorMock).toHaveBeenCalledWith( - 'There was a problem authenticating User Location settings' + 'There was a problem fetching user assignment data' ); // broken page as well diff --git a/packages/team-management/src/components/ListView/index.tsx b/packages/team-management/src/components/ListView/index.tsx index 4524a355a..455ecc872 100644 --- a/packages/team-management/src/components/ListView/index.tsx +++ b/packages/team-management/src/components/ListView/index.tsx @@ -198,7 +198,7 @@ const TeamAssignmentView = (props: TeamAssignmentViewProps) => { Promise.all([plansPromise, assignmentsPromise, organizationsPromise]) .catch(() => { - sendErrorNotification(t('There waes a problem fetching Plans|Assignments|Organizations')); + sendErrorNotification(t('There was a problem fetching Plans|Assignments|Organizations')); setApiError(true); }) .finally(() => { diff --git a/packages/team-management/src/components/ListView/tests/index.test.tsx b/packages/team-management/src/components/ListView/tests/index.test.tsx index 12a8a8e5d..ac9fd45f0 100644 --- a/packages/team-management/src/components/ListView/tests/index.test.tsx +++ b/packages/team-management/src/components/ListView/tests/index.test.tsx @@ -307,7 +307,7 @@ describe('List view Page', () => { }); expect(notificationErrorMock).toHaveBeenCalled(); expect(notificationErrorMock).toHaveBeenCalledWith( - 'There waes a problem fetching Plans|Assignments|Organizations' + 'There was a problem fetching Plans|Assignments|Organizations' ); wrapper.unmount(); });