From f0b53cee6b0952f15d10befb9cc134e5c14002e6 Mon Sep 17 00:00:00 2001 From: Will Sadler Date: Thu, 13 Dec 2018 12:50:02 -0600 Subject: [PATCH 1/5] add bar number to view and seed --- efcms-service/storage/fixtures/efcms.json | 3 ++- web-client/src/views/PartyInformation.jsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/efcms-service/storage/fixtures/efcms.json b/efcms-service/storage/fixtures/efcms.json index f3df4a2408d..42a1e0ed751 100644 --- a/efcms-service/storage/fixtures/efcms.json +++ b/efcms-service/storage/fixtures/efcms.json @@ -90,7 +90,8 @@ "userId": "respondent", "respondentId": "respondent", "email": "testrespondent@example.com", - "token": "respondent" + "token": "respondent", + "barNumber": "IR1228" }, "userId": "taxpayer", "irsSendDate": "2018-12-12T23:32:48.416Z", diff --git a/web-client/src/views/PartyInformation.jsx b/web-client/src/views/PartyInformation.jsx index 61abb327474..3d659130edc 100644 --- a/web-client/src/views/PartyInformation.jsx +++ b/web-client/src/views/PartyInformation.jsx @@ -38,7 +38,8 @@ export default connect( Respondent
- {caseDetail.respondent.name}
+ {caseDetail.respondent.name} {caseDetail.respondent.barNumber}{' '} +

{caseDetail.respondent.address}
{caseDetail.respondent.city} {caseDetail.respondent.state}{' '} From 18e82ffe236495630ecf899f038a14c79886efaf Mon Sep 17 00:00:00 2001 From: Will Sadler Date: Thu, 13 Dec 2018 14:13:17 -0600 Subject: [PATCH 2/5] concatenate in computed --- web-client/src/presenter/computeds/formattedCaseDetail.js | 6 +++++- web-client/src/views/PartyInformation.jsx | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/web-client/src/presenter/computeds/formattedCaseDetail.js b/web-client/src/presenter/computeds/formattedCaseDetail.js index 4c7be57acc4..95d1eb893be 100644 --- a/web-client/src/presenter/computeds/formattedCaseDetail.js +++ b/web-client/src/presenter/computeds/formattedCaseDetail.js @@ -12,7 +12,10 @@ const formatCase = (caseDetail, form) => { const result = _.cloneDeep(caseDetail); if (result.documents) result.documents.map(formatDocument); - + if (result.respondent) + result.respondent.formattedName = `${result.respondent.name} ${ + result.respondent.barNumber + }`; result.createdAtFormatted = moment(result.createdAt).format('L'); result.irsDateFormatted = moment(result.irsDate).format('L LT'); result.payGovDateFormatted = moment(result.payGovDate).format('L'); @@ -29,6 +32,7 @@ const formatCase = (caseDetail, form) => { result.status = result.status === 'general' ? 'general docket' : result.status; + return result; }; diff --git a/web-client/src/views/PartyInformation.jsx b/web-client/src/views/PartyInformation.jsx index 3d659130edc..85736d0ba62 100644 --- a/web-client/src/views/PartyInformation.jsx +++ b/web-client/src/views/PartyInformation.jsx @@ -5,7 +5,7 @@ import { state } from 'cerebral'; export default connect( { - caseDetail: state.caseDetail, + caseDetail: state.formattedCaseDetail, }, function PartyInformation({ caseDetail }) { return ( @@ -38,7 +38,7 @@ export default connect( Respondent
- {caseDetail.respondent.name} {caseDetail.respondent.barNumber}{' '} + {caseDetail.respondent.formattedName}

{caseDetail.respondent.address}
From b2fafbfa635e28ca74674a33909ec1a032dec01f Mon Sep 17 00:00:00 2001 From: Will Sadler Date: Thu, 13 Dec 2018 14:16:07 -0600 Subject: [PATCH 3/5] spec --- web-client/src/tests/computeds.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web-client/src/tests/computeds.test.js b/web-client/src/tests/computeds.test.js index 8c04a99c0fe..fb8b9aeb340 100644 --- a/web-client/src/tests/computeds.test.js +++ b/web-client/src/tests/computeds.test.js @@ -27,6 +27,15 @@ describe('formatted case details computed', () => { }); expect(result[0].irsDateFormatted).toContain('11/21/2018'); }); + + it('formats the respondent name to include barnumber', () => { + const result = runCompute(formattedCases, { + state: { + cases: [{ respondent: { name: 'test', barNumber: '123'} }], + }, + }); + expect(result[0].respondent.formattedName).toContain('test 123'); + }); }); describe('formatted search parameters computed', () => { From 68592411f68f415ef5b8c52adba4437300f431d5 Mon Sep 17 00:00:00 2001 From: Will Sadler Date: Thu, 13 Dec 2018 14:18:00 -0600 Subject: [PATCH 4/5] spec --- web-client/src/tests/computeds.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-client/src/tests/computeds.test.js b/web-client/src/tests/computeds.test.js index fb8b9aeb340..4409f01aa13 100644 --- a/web-client/src/tests/computeds.test.js +++ b/web-client/src/tests/computeds.test.js @@ -31,7 +31,7 @@ describe('formatted case details computed', () => { it('formats the respondent name to include barnumber', () => { const result = runCompute(formattedCases, { state: { - cases: [{ respondent: { name: 'test', barNumber: '123'} }], + cases: [{ respondent: { name: 'test', barNumber: '123' } }], }, }); expect(result[0].respondent.formattedName).toContain('test 123'); From 2f15dced51924b6070079ad56a121d13cbdd33ea Mon Sep 17 00:00:00 2001 From: Will Sadler Date: Thu, 13 Dec 2018 14:21:52 -0600 Subject: [PATCH 5/5] address --- web-client/src/views/PartyInformation.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web-client/src/views/PartyInformation.jsx b/web-client/src/views/PartyInformation.jsx index 85736d0ba62..e43b3edbfba 100644 --- a/web-client/src/views/PartyInformation.jsx +++ b/web-client/src/views/PartyInformation.jsx @@ -41,7 +41,8 @@ export default connect( {caseDetail.respondent.formattedName}

- {caseDetail.respondent.address}
+ {caseDetail.respondent.addressLine1}
+ {caseDetail.respondent.addressLine2}
{caseDetail.respondent.city} {caseDetail.respondent.state}{' '} {caseDetail.respondent.zip}