Skip to content

Commit

Permalink
Fix typo and grammar in messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mutuajames committed Jul 21, 2023
1 parent 948c33c commit a08c7a2
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
})
Expand Down Expand Up @@ -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'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export const LocationUnitList: React.FC<Props> = (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),
};
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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'));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/reports/src/components/DistrictReport/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe('DistrictReport', () => {
});

expect(notificationErrorMock).toHaveBeenCalledWith(
'There was a problem fetching location hierachy'
'There was a problem fetching the location hierachy'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ export const ServerSettingsView: React.FC<Props> = (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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/team-management/src/components/ListView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit a08c7a2

Please sign in to comment.