From 2bdf15bbf69b8a037b16012486e8261027c28828 Mon Sep 17 00:00:00 2001 From: bobbyqiz448 Date: Thu, 29 Feb 2024 14:58:54 +0300 Subject: [PATCH] Further refactoring --- app/src/App/fhir-apps.tsx | 2 +- app/src/constants.tsx | 1 - app/src/routes/index.tsx | 2 +- .../src/components/AllLocationListFlat/index.tsx | 11 +---------- packages/fhir-location-management/src/constants.ts | 1 + packages/location-management/src/index.tsx | 1 - packages/location-management/tsconfig.json | 2 +- 7 files changed, 5 insertions(+), 15 deletions(-) diff --git a/app/src/App/fhir-apps.tsx b/app/src/App/fhir-apps.tsx index 69297eed2..bd22d1305 100644 --- a/app/src/App/fhir-apps.tsx +++ b/app/src/App/fhir-apps.tsx @@ -34,7 +34,6 @@ import { URL_USER_ROLES, URL_FHIR_CARE_TEAM, URL_TEAM_ASSIGNMENT, - URL_ALL_LOCATIONS, } from '../constants'; import { providers } from '../configs/settings'; import CustomConnectedAPICallBack from '../components/page/CustomCallback'; @@ -83,6 +82,7 @@ import { LocationUnitList as FHIRLocationUnitList, NewEditLocationUnit as FHIRNewEditLocationUnit, AllLocationListFlat as ListAllLocationsFlat, + URL_ALL_LOCATIONS, } from '@opensrp/fhir-location-management'; import { teamAffiliationProps, diff --git a/app/src/constants.tsx b/app/src/constants.tsx index a0be98c53..36db26ecc 100644 --- a/app/src/constants.tsx +++ b/app/src/constants.tsx @@ -28,7 +28,6 @@ export const URL_LOCATION_UNIT_EDIT = `${URL_LOCATION_UNIT}/edit/:id`; export const URL_LOCATION_UNIT_GROUP = `${URL_ADMIN}/location/group`; export const URL_LOCATION_UNIT_GROUP_ADD = `${URL_LOCATION_UNIT_GROUP}/add`; export const URL_LOCATION_UNIT_GROUP_EDIT = `${URL_LOCATION_UNIT_GROUP}/edit/:id`; -export const URL_ALL_LOCATIONS = `${URL_ADMIN}/location/all`; export const URL_UPLOAD_JSON_VALIDATOR = `${URL_ADMIN}/form-config/json-validators/upload`; export const URL_JSON_VALIDATOR_LIST = `${URL_ADMIN}/form-config/json-validators`; export const URL_DRAFT_FILE_LIST = `${URL_ADMIN}/form-config/drafts`; diff --git a/app/src/routes/index.tsx b/app/src/routes/index.tsx index 8f17a6b45..795aa6986 100644 --- a/app/src/routes/index.tsx +++ b/app/src/routes/index.tsx @@ -11,13 +11,13 @@ import { import { URL_USER, URL_LOCATION_UNIT, - URL_ALL_LOCATIONS, URL_TEAMS, URL_TEAM_ASSIGNMENT, URL_USER_GROUPS, URL_USER_ROLES, URL_FHIR_CARE_TEAM, } from '../constants'; +import { URL_ALL_LOCATIONS } from '@opensrp/fhir-location-management'; import { QUEST_VIEW_URL } from '@opensrp/fhir-views'; import type { TFunction } from '@opensrp/i18n'; import { LIST_HEALTHCARE_URL } from '@opensrp/fhir-healthcare-service'; diff --git a/packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx b/packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx index 1f67c9c95..14fe8cd7c 100644 --- a/packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx +++ b/packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx @@ -59,9 +59,7 @@ export const AllLocationListFlat: React.FC = (props) => { return ; } - - useEffect(() => { - }, [data, isFetching, isLoading, error]); + useEffect(() => {}, [data, isFetching, isLoading, error]); const tableData: any[] = (data?.records ?? []).map((datum: Dictionary) => ({ key: datum.id, @@ -170,13 +168,6 @@ export const AllLocationListFlat: React.FC = (props) => { - {detailId ? ( - setDetailId('')} - detailId={detailId} - /> - ) : null} ); diff --git a/packages/fhir-location-management/src/constants.ts b/packages/fhir-location-management/src/constants.ts index 848f60fb9..8bd3fee42 100644 --- a/packages/fhir-location-management/src/constants.ts +++ b/packages/fhir-location-management/src/constants.ts @@ -7,3 +7,4 @@ export const URL_ADMIN = '/admin'; export const URL_LOCATION_UNIT = `${URL_ADMIN}/location/unit`; export const URL_LOCATION_UNIT_ADD = `${URL_LOCATION_UNIT}/add`; export const URL_LOCATION_UNIT_EDIT = `${URL_LOCATION_UNIT}/edit`; +export const URL_ALL_LOCATIONS = `${URL_ADMIN}/location/all`; diff --git a/packages/location-management/src/index.tsx b/packages/location-management/src/index.tsx index a4f1d6eb5..f6db12aeb 100644 --- a/packages/location-management/src/index.tsx +++ b/packages/location-management/src/index.tsx @@ -17,4 +17,3 @@ export * from './ducks/locationHierarchy/utils'; export * from './helpers/dataLoaders'; export * from './ducks/locationHierarchy/types'; export * from './ducks/location-units'; -export * from '../../fhir-location-management/src/components/AllLocationListFlat'; diff --git a/packages/location-management/tsconfig.json b/packages/location-management/tsconfig.json index 954118b1b..5388af492 100644 --- a/packages/location-management/tsconfig.json +++ b/packages/location-management/tsconfig.json @@ -5,6 +5,6 @@ "declaration": true, "declarationDir": "dist/types" }, - "include": ["**/src", "../fhir-location-management/src/components/AllLocationListFlat"], + "include": ["**/src"], "exclude": ["**/node_modules", "**/coverage", "**/dist", "**/*.spec.ts", "**/*tests"] }