From cc9aac3b583077292cb03b7069186e6ce4079be4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 08:19:07 -0400 Subject: [PATCH 1/7] Bump dayjs from 1.11.9 to 1.11.10 in /cypress (#6618) Bumps [dayjs](https://github.com/iamkun/dayjs) from 1.11.9 to 1.11.10. - [Release notes](https://github.com/iamkun/dayjs/releases) - [Changelog](https://github.com/iamkun/dayjs/blob/v1.11.10/CHANGELOG.md) - [Commits](https://github.com/iamkun/dayjs/compare/v1.11.9...v1.11.10) --- updated-dependencies: - dependency-name: dayjs dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- cypress/package.json | 2 +- cypress/yarn.lock | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/cypress/package.json b/cypress/package.json index 7010d0c4b6b..dbcce8c7062 100644 --- a/cypress/package.json +++ b/cypress/package.json @@ -6,7 +6,7 @@ "@faker-js/faker": "^8.0.2", "cypress": "^11.0.0", "cypress-localstorage-commands": "^2.2.4", - "dayjs": "^1.11.9", + "dayjs": "^1.11.10", "eslint": "^8.50.0", "eslint-plugin-cypress": "^2.14.0", "otplib": "^12.0.1", diff --git a/cypress/yarn.lock b/cypress/yarn.lock index 2d0391758f2..c19bb00d2c5 100644 --- a/cypress/yarn.lock +++ b/cypress/yarn.lock @@ -523,15 +523,10 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -dayjs@^1.10.4: - version "1.11.0" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.0.tgz#009bf7ef2e2ea2d5db2e6583d2d39a4b5061e805" - integrity sha512-JLC809s6Y948/FuCZPm5IX8rRhQwOiyMb2TfVVQEixG7P8Lm/gt5S7yoQZmC8x1UehI9Pb7sksEt4xx14m+7Ug== - -dayjs@^1.11.9: - version "1.11.9" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.9.tgz#9ca491933fadd0a60a2c19f6c237c03517d71d1a" - integrity sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA== +dayjs@^1.10.4, dayjs@^1.11.10: + version "1.11.10" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0" + integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ== debug@^3.1.0: version "3.2.7" From c8e23f95bf967efbb126338566a93a50cb290de4 Mon Sep 17 00:00:00 2001 From: Zedd Shmais Date: Wed, 27 Sep 2023 10:20:14 -0500 Subject: [PATCH 2/7] correct backend tests (#6645) --- .../usds/simplereport/service/DiseaseCacheServiceTest.java | 4 ++-- .../gov/cdc/usds/simplereport/service/DiseaseServiceTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseCacheServiceTest.java b/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseCacheServiceTest.java index e3eb8c77ba8..8622ab235d4 100644 --- a/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseCacheServiceTest.java +++ b/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseCacheServiceTest.java @@ -34,7 +34,7 @@ void getDiseaseCacheWhenCachePopulated_successful() { Map serviceMap = _service.getKnownSupportedDiseasesMap(); List repoList = repo.findAll(); - assertThat(serviceMap).isNotNull().hasSize(4); + assertThat(serviceMap).isNotNull().isNotEmpty(); repoList.forEach( d -> { @@ -50,7 +50,7 @@ void getDiseaseCacheWhenCacheNotPopulated_successful() { Map serviceMap = _service.getKnownSupportedDiseasesMap(); List repoList = repo.findAll(); - assertThat(serviceMap).isNotNull().hasSize(4); + assertThat(serviceMap).isNotNull().isNotEmpty(); repoList.forEach( d -> { diff --git a/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseServiceTest.java b/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseServiceTest.java index 55928d7f5d7..afc26533b93 100644 --- a/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseServiceTest.java +++ b/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseServiceTest.java @@ -73,7 +73,7 @@ void getSupportedDiseasesMap_successful() { assertThat(supportedDiseasesMap) .isNotNull() - .hasSize(4) + .isNotEmpty() .containsEntry(_service.covid().getInternalId(), _service.covid()) .containsEntry(_service.fluA().getInternalId(), _service.fluA()) .containsEntry(_service.fluB().getInternalId(), _service.fluB()) @@ -86,7 +86,7 @@ void getSupportedDiseasesList_successful() { assertThat(supportedDiseasesList) .isNotNull() - .hasSize(4) + .isNotEmpty() .contains(_service.covid()) .contains(_service.fluA()) .contains(_service.fluB()) From 26b850b85968b00b8877d5501fced9e320edb04b Mon Sep 17 00:00:00 2001 From: Zedd Shmais Date: Wed, 27 Sep 2023 11:58:54 -0500 Subject: [PATCH 3/7] Add person notes to frontend (#6584) * add notes field patient add/edit screen * add spanish translations * update generated graphql * update ui tests * update snap * update codegen * run linter --- frontend/src/app/constants/constants.d.ts | 1 + frontend/src/app/patients/AddPatient.test.tsx | 6 +- frontend/src/app/patients/AddPatient.tsx | 3 + .../patients/Components/ManageEmails.test.tsx | 1 + .../app/patients/Components/PersonForm.tsx | 22 +- .../src/app/patients/EditPatient.test.tsx | 13 +- frontend/src/app/patients/EditPatient.tsx | 4 + .../__snapshots__/EditPatient.test.tsx.snap | 1959 ++++++++++++++++- frontend/src/app/patients/personSchema.ts | 5 + frontend/src/generated/graphql.tsx | 10 + frontend/src/lang/en.ts | 5 + frontend/src/lang/es.ts | 5 + 12 files changed, 2021 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/constants/constants.d.ts b/frontend/src/app/constants/constants.d.ts index 9d77ae3c56d..84efbf74281 100644 --- a/frontend/src/app/constants/constants.d.ts +++ b/frontend/src/app/constants/constants.d.ts @@ -605,6 +605,7 @@ interface PersonUpdate extends Address { country: string; emails: string[]; preferredLanguage: Language | null; + notes: string | null; testResultDelivery: TestResultDeliveryPreference | null; } diff --git a/frontend/src/app/patients/AddPatient.test.tsx b/frontend/src/app/patients/AddPatient.test.tsx index fcf525d609c..d310d49933c 100644 --- a/frontend/src/app/patients/AddPatient.test.tsx +++ b/frontend/src/app/patients/AddPatient.test.tsx @@ -113,6 +113,7 @@ const addPatientRequestParams = { facilityId: mockFacilityID, preferredLanguage: null, testResultDelivery: "SMS", + notes: "Green tent", }; const addPatientRequestNoDelivery = { @@ -355,8 +356,8 @@ describe("AddPatient", () => { "Email address": "foo@bar.org", "Street address 1": "25 Shattuck St", City: "Boston", - "ZIP code": "02115", + Notes: "Green tent", }, { Facility: mockFacilityID, State: "MA", Country: "USA" }, { @@ -557,8 +558,8 @@ describe("AddPatient", () => { "Email address": "foo@bar.org", "Street address 1": "25 Shattuck St", City: "Boston", - "ZIP code": "02115", + notes: "Green tent", }, { Facility: mockFacilityID, State: "MA", Country: "USA" }, { @@ -628,6 +629,7 @@ describe("AddPatient", () => { "Street address 1": "25 Shattuck St", City: "Boston", "ZIP code": "02115", + notes: "Green tent", }, { Facility: mockFacilityID, State: "MA", Country: "USA" }, { diff --git a/frontend/src/app/patients/AddPatient.tsx b/frontend/src/app/patients/AddPatient.tsx index c99ca44a85e..143f46760fd 100644 --- a/frontend/src/app/patients/AddPatient.tsx +++ b/frontend/src/app/patients/AddPatient.tsx @@ -53,6 +53,7 @@ export const EMPTY_PERSON: Nullable = { country: "USA", preferredLanguage: null, testResultDelivery: null, + notes: null, }; export const PATIENT_EXISTS = gql` @@ -98,6 +99,7 @@ export const ADD_PATIENT = gql` $employedInHealthcare: Boolean $preferredLanguage: String $testResultDelivery: TestResultDeliveryPreference + $notes: String ) { addPatient( facilityId: $facilityId @@ -125,6 +127,7 @@ export const ADD_PATIENT = gql` employedInHealthcare: $employedInHealthcare preferredLanguage: $preferredLanguage testResultDelivery: $testResultDelivery + notes: $notes ) { internalId facility { diff --git a/frontend/src/app/patients/Components/ManageEmails.test.tsx b/frontend/src/app/patients/Components/ManageEmails.test.tsx index b277125d42c..b631fbd6bbd 100644 --- a/frontend/src/app/patients/Components/ManageEmails.test.tsx +++ b/frontend/src/app/patients/Components/ManageEmails.test.tsx @@ -41,6 +41,7 @@ const patient = { testResultDelivery: null, preferredLanguage: null, tribalAffiliation: null, + notes: null, }; function ManageEmailsContainer() { diff --git a/frontend/src/app/patients/Components/PersonForm.tsx b/frontend/src/app/patients/Components/PersonForm.tsx index d330ba807e9..ce156255f94 100644 --- a/frontend/src/app/patients/Components/PersonForm.tsx +++ b/frontend/src/app/patients/Components/PersonForm.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useState, useEffect, useRef } from "react"; import { SchemaOf } from "yup"; import { useTranslation } from "react-i18next"; -import { ComboBox } from "@trussworks/react-uswds"; +import { ComboBox, Label, Textarea } from "@trussworks/react-uswds"; import { canadianProvinceCodes, @@ -611,6 +611,26 @@ const PersonForm = (props: Props) => { ) : null} +
+
+ + + {t("patient.form.notes.helpText")} + +