From f6c961013193ef1099474fa7e192f4401b4fa43c Mon Sep 17 00:00:00 2001 From: henrikmv Date: Wed, 6 Nov 2024 13:51:21 +0100 Subject: [PATCH] fix: review comments --- i18n/en.pot | 8 +++--- .../Modal/UnlinkAndDeleteModal.js | 4 +-- .../hooks/useRelationshipTypeAccess.js | 1 - .../WidgetsChangelog/common/hooks/index.js | 1 - .../capture-core/dataQueries/index.js | 2 -- .../dataQueries/useOrganisationUnits.js | 25 ------------------- 6 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 src/core_modules/capture-core/dataQueries/useOrganisationUnits.js diff --git a/i18n/en.pot b/i18n/en.pot index cdff7f2122..8439b6cd95 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-11-04T17:57:57.557Z\n" -"PO-Revision-Date: 2024-11-04T17:57:57.557Z\n" +"POT-Creation-Date: 2024-11-06T12:51:22.564Z\n" +"PO-Revision-Date: 2024-11-06T12:51:22.564Z\n" msgid "Choose one or more dates..." msgstr "Choose one or more dates..." @@ -1497,10 +1497,10 @@ msgid "An error occurred while unlinking and deleting the event." msgstr "An error occurred while unlinking and deleting the event." msgid "" -"Are you sure you want delete the relationsship and the related event? This " +"Are you sure you want delete the relationship and the related event? This " "will permanently remove the event and all related data." msgstr "" -"Are you sure you want delete the relationsship and the related event? This " +"Are you sure you want delete the relationship and the related event? This " "will permanently remove the event and all related data." msgid "Yes, unlink and delete event" diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/OverflowMenu/Modal/UnlinkAndDeleteModal.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/OverflowMenu/Modal/UnlinkAndDeleteModal.js index 875aefa4e4..647a60552f 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/OverflowMenu/Modal/UnlinkAndDeleteModal.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/OverflowMenu/Modal/UnlinkAndDeleteModal.js @@ -56,12 +56,12 @@ export const UnlinkAndDeleteModal = ({ }); return ( - + {i18n.t('Delete event')}

{i18n.t( - 'Are you sure you want delete the relationsship and the related event? This will permanently remove the event and all related data.', + 'Are you sure you want delete the relationship and the related event? This will permanently remove the event and all related data.', )}

diff --git a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/hooks/useRelationshipTypeAccess.js b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/hooks/useRelationshipTypeAccess.js index 484dbdf0c6..a4befc955d 100644 --- a/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/hooks/useRelationshipTypeAccess.js +++ b/src/core_modules/capture-core/components/WidgetTwoEventWorkspace/hooks/useRelationshipTypeAccess.js @@ -5,7 +5,6 @@ import { userStores } from '../../../storageControllers/stores'; export const useRelationshipTypeAccess = (relationshipTypeId: string) => { const storageController = getUserStorageController(); - console.log('relationshipTypeId', relationshipTypeId); const { data, error, isLoading } = useIndexedDBQuery( ['relationshipTypeAccess', relationshipTypeId], diff --git a/src/core_modules/capture-core/components/WidgetsChangelog/common/hooks/index.js b/src/core_modules/capture-core/components/WidgetsChangelog/common/hooks/index.js index 1cc9b74cc8..af7f2f4226 100644 --- a/src/core_modules/capture-core/components/WidgetsChangelog/common/hooks/index.js +++ b/src/core_modules/capture-core/components/WidgetsChangelog/common/hooks/index.js @@ -1,3 +1,2 @@ // @flow - export { useChangelogData } from './useChangelogData'; diff --git a/src/core_modules/capture-core/dataQueries/index.js b/src/core_modules/capture-core/dataQueries/index.js index 7b929714ea..c77469ff0c 100644 --- a/src/core_modules/capture-core/dataQueries/index.js +++ b/src/core_modules/capture-core/dataQueries/index.js @@ -1,4 +1,2 @@ export { useOrganisationUnit } from './useOrganisationUnit'; -export { useOrganisationUnits } from './useOrganisationUnits'; - export { useOrgUnitAutoSelect } from './useOrgUnitsForAutoSelect'; diff --git a/src/core_modules/capture-core/dataQueries/useOrganisationUnits.js b/src/core_modules/capture-core/dataQueries/useOrganisationUnits.js deleted file mode 100644 index 9baac6fe9b..0000000000 --- a/src/core_modules/capture-core/dataQueries/useOrganisationUnits.js +++ /dev/null @@ -1,25 +0,0 @@ -// @flow -import { useApiMetadataQuery } from '../utils/reactQueryHelpers'; - -export const useOrganisationUnits = (customQueryOptions: Object) => { - const queryKey = ['organisationUnits']; - const queryFn = { - resource: 'organisationUnits', - params: { - fields: ['id, displayName~rename(name), path'], - withinUserHierarchy: true, - }, - }; - const defaultQueryOptions = { - select: ({ organisationUnits }) => organisationUnits, - }; - - const queryOptions = { ...defaultQueryOptions, ...customQueryOptions }; - - const { data, isLoading } = useApiMetadataQuery(queryKey, queryFn, queryOptions); - - return { - isLoading, - data, - }; -};