Skip to content

Commit

Permalink
Changes made in response to earlier PR
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorAntony committed Jul 23, 2024
1 parent 5596d61 commit fb4081e
Show file tree
Hide file tree
Showing 4 changed files with 21,636 additions and 1,818 deletions.
1 change: 0 additions & 1 deletion packages/esm-covid-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"prepublishOnly": "npm run build",
"extract-translations": "i18next 'src/**/*.component.tsx'"
},
"proxy": "https://openmrs-dev.globalhealthapp.net",
"browserslist": [
"extends browserslist-config-openmrs"
],
Expand Down
10 changes: 10 additions & 0 deletions packages/esm-covid-app/src/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ export const configSchema = {
covidLabCancellationFormUuid: 'd38bc949-c95b-39eb-a2c5-08b82a36409c',
covidSampleCollectionFormUuid: '371d19b6-485f-11ec-99cc-1fdd2d4e9d88',
},
reportIds: {
_type: Type.Object,
_description: 'Report UUIDs.',
_default: {
covidReport: 'ecabd559-14f6-4c65-87af-1254dfdf1304',
htsReport: '3ffa5a53-fc65-4a1e-a434-46dbcf1c2de2',
motherHivStatusReport: 'mother_hiv_status',
adxHivReport: '2f236b1-b0b5-4ecc-9037-681c23fb45bd',
},
},
},
};

Expand Down
13 changes: 7 additions & 6 deletions packages/esm-covid-app/src/home.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ import {
DatePickerInput,
} from '@carbon/react';
import { OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib';
import { openmrsFetch } from '@openmrs/esm-framework';
import { openmrsFetch, useConfig } from '@openmrs/esm-framework';
import styles from './home.component.scss';

const BASE_WS_API_URL = '/ws/rest/v1/mamba/report';

const HomeComponent = () => {
const config = useConfig();
const [headers, setHeaders] = useState([]);
const [rows, setRows] = useState([]);
const [reportId, setReportId] = useState('mother_hiv_status');
const [reportId, setReportId] = useState(config.reportIds.motherHivStatusReport);
const [ptrackerId, setPtrackerId] = useState('12345A232567');
const [personUuid, setPersonUuid] = useState('bd49d697-b1de-49b9-95c2-6031fb1375fd');
const [startDate, setStartDate] = useState('');
Expand Down Expand Up @@ -102,10 +103,10 @@ const HomeComponent = () => {
titleText="Select Report"
label="Select a report to display"
items={[
{ id: 'ecabd559-14f6-4c65-87af-1254dfdf1304', text: 'Covid-19 Report' },
{ id: '3ffa5a53-fc65-4a1e-a434-46dbcf1c2de2', text: 'HTS Report' },
{ id: 'mother_hiv_status', text: 'Mother HIV Status Report' },
{ id: '2f236b1-b0b5-4ecc-9037-681c23fb45bd', text: 'ADX-HIV Report' },
{ id: config.reportIds.covidReport, text: 'Covid-19 Report' },
{ id: config.reportIds.htsReport, text: 'HTS Report' },
{ id: config.reportIds.motherHivStatusReport, text: 'Mother HIV Status Report' },
{ id: config.reportIds.adxHivReport, text: 'ADX-HIV Report' },
]}
itemToString={(item) => (item ? item.text : '')}
onChange={({ selectedItem }) => setReportId(selectedItem.id)}
Expand Down
Loading

0 comments on commit fb4081e

Please sign in to comment.