diff --git a/src/components/ReportCard/ReportCard.js b/src/components/ReportCard/ReportCard.js index e0497d7..bb6b9fe 100644 --- a/src/components/ReportCard/ReportCard.js +++ b/src/components/ReportCard/ReportCard.js @@ -17,7 +17,7 @@ class ReportCard extends Component { getDefaultColumnWidths = () => { return [ { columnName: 'key', width: 215 }, - { columnName: 'value', width: 180 }, + { columnName: 'value', width: 200 }, ] }; getDefaultLinkColumnWidths = () => { diff --git a/src/helpers/Api.js b/src/helpers/Api.js index 5db5907..4f5954b 100644 --- a/src/helpers/Api.js +++ b/src/helpers/Api.js @@ -24,6 +24,7 @@ export const fetchParticipantSummaryDataset = async (redcapId) => { participantSummaryDataset(redcapId: $redcapId){ enrollmentCategory redcapId + adjudicatedCategory } }`; const response = await apolloClient.query({ diff --git a/src/helpers/dataHelper.js b/src/helpers/dataHelper.js index 81d9a48..1ab8312 100644 --- a/src/helpers/dataHelper.js +++ b/src/helpers/dataHelper.js @@ -42,6 +42,7 @@ export const mapSummaryKeysToPresentationStyle = (data) => { const result = {}; result['Participant ID'] = ""; result['Enrollment Category'] = ""; + result['Primary Adjudicated Category'] = ""; if (!data || data === {}) { return result; } @@ -51,6 +52,9 @@ export const mapSummaryKeysToPresentationStyle = (data) => { if (data['enrollmentCategory']) { result['Enrollment Category'] = data['enrollmentCategory'] ? data['enrollmentCategory'] : ""; } + if (data['adjudicatedCategory']) { + result['Primary Adjudicated Category'] = data['adjudicatedCategory'] ? data['adjudicatedCategory'] : ""; + } return result; }; diff --git a/src/helpers/dataHelper.test.js b/src/helpers/dataHelper.test.js index b3c00c4..6cc6162 100644 --- a/src/helpers/dataHelper.test.js +++ b/src/helpers/dataHelper.test.js @@ -5,36 +5,42 @@ describe('dataHelper', () => { it('should return remapped values when object params given', () => { let summaryUnmapped = { redcapId: "test-redcapId", - enrollmentCategory: "test-enrollmentCategory" + enrollmentCategory: "test-enrollmentCategory", + adjudicatedCategory: "test-adjudicatedCategory" }; let summaryMappingResult = mapSummaryKeysToPresentationStyle(summaryUnmapped); let expectedSummaryMapping = { 'Participant ID': "test-redcapId", - 'Enrollment Category': "test-enrollmentCategory" + 'Enrollment Category': "test-enrollmentCategory", + 'Primary Adjudicated Category': "test-adjudicatedCategory" } expect(summaryMappingResult).toEqual(expectedSummaryMapping); }), it('should return remapped values when some values from object params given', () => { let summaryUnmapped = { redcapId: "test-redcapId", - enrollmentCategory: "" + enrollmentCategory: "", + adjudicatedCategory: "" }; let summaryMappingResult = mapSummaryKeysToPresentationStyle(summaryUnmapped); let expectedSummaryMapping = { 'Participant ID': "test-redcapId", - 'Enrollment Category': "" + 'Enrollment Category': "", + 'Primary Adjudicated Category': "" } expect(summaryMappingResult).toEqual(expectedSummaryMapping); }), it('should return remapped values when some values from object params given', () => { let summaryUnmapped = { redcapId: "", - enrollmentCategory: "test-enrollmentCategory" + enrollmentCategory: "test-enrollmentCategory", + adjudicatedCategory: "" }; let summaryMappingResult = mapSummaryKeysToPresentationStyle(summaryUnmapped); let expectedSummaryMapping = { 'Participant ID': "", - 'Enrollment Category': "test-enrollmentCategory" + 'Enrollment Category': "test-enrollmentCategory", + 'Primary Adjudicated Category': "" } expect(summaryMappingResult).toEqual(expectedSummaryMapping); }), @@ -43,7 +49,8 @@ describe('dataHelper', () => { let summaryMappingResult = mapSummaryKeysToPresentationStyle(summaryUnmapped); let expectedSummaryMapping = { 'Participant ID': "", - 'Enrollment Category': "" + 'Enrollment Category': "", + 'Primary Adjudicated Category': "" } expect(summaryMappingResult).toEqual(expectedSummaryMapping); }), @@ -52,7 +59,8 @@ describe('dataHelper', () => { let summaryMappingResult = mapSummaryKeysToPresentationStyle(summaryUnmapped); let expectedSummaryMapping = { 'Participant ID': "", - 'Enrollment Category': "" + 'Enrollment Category': "", + 'Primary Adjudicated Category': "" } expect(summaryMappingResult).toEqual(expectedSummaryMapping); }); @@ -60,7 +68,8 @@ describe('dataHelper', () => { let summaryMappingResult = mapSummaryKeysToPresentationStyle(); let expectedSummaryMapping = { 'Participant ID': "", - 'Enrollment Category': "" + 'Enrollment Category': "", + 'Primary Adjudicated Category': "" } expect(summaryMappingResult).toEqual(expectedSummaryMapping); });