Skip to content

Commit

Permalink
Further refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyqiz448 committed Feb 29, 2024
1 parent 140969b commit 2bdf15b
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/src/App/fhir-apps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -83,6 +82,7 @@ import {
LocationUnitList as FHIRLocationUnitList,
NewEditLocationUnit as FHIRNewEditLocationUnit,
AllLocationListFlat as ListAllLocationsFlat,
URL_ALL_LOCATIONS,
} from '@opensrp/fhir-location-management';
import {
teamAffiliationProps,
Expand Down
1 change: 0 additions & 1 deletion app/src/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
2 changes: 1 addition & 1 deletion app/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export const AllLocationListFlat: React.FC<LocationListPropTypes> = (props) => {
return <BrokenPage errorMessage={(error as Error).message} />;
}


useEffect(() => {
}, [data, isFetching, isLoading, error]);
useEffect(() => {}, [data, isFetching, isLoading, error]);

Check failure on line 62 in packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx

View workflow job for this annotation

GitHub Actions / test (16.17.0, ubuntu-latest)

React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render

Check failure on line 62 in packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx

View workflow job for this annotation

GitHub Actions / test (16.17.0, ubuntu-latest)

Unexpected empty arrow function

const tableData: any[] = (data?.records ?? []).map((datum: Dictionary) => ({

Check warning on line 64 in packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx

View workflow job for this annotation

GitHub Actions / test (16.17.0, ubuntu-latest)

Unexpected any. Specify a different type
key: datum.id,
Expand Down Expand Up @@ -170,13 +168,6 @@ export const AllLocationListFlat: React.FC<LocationListPropTypes> = (props) => {
</div>
<TableLayout {...tableProps} />
</Col>
{detailId ? (
<LocationUnitDetail
fhirBaseUrl={fhirBaseURL}
onClose={() => setDetailId('')}
detailId={detailId}
/>
) : null}
</Row>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions packages/fhir-location-management/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
1 change: 0 additions & 1 deletion packages/location-management/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 1 addition & 1 deletion packages/location-management/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}

0 comments on commit 2bdf15b

Please sign in to comment.