From 4df4c58263ce29d0ad524a1be2f7d4eb654e5520 Mon Sep 17 00:00:00 2001 From: Adam Loup <124325935+adamloup-enquizit@users.noreply.github.com> Date: Wed, 4 Sep 2024 13:08:01 -0500 Subject: [PATCH 1/6] [FIX] Patient sorting (#1766) * local environment * adds support for legalname sorting --- .gitignore | 5 +- .../PatientSearchCriteriaSortResolver.java | 44 ++++++++++-------- .../test/java/gov/cdc/nbs/RunCucumber.java | 2 +- .../search/PatientSearchSortingSteps.java | 2 + .../PatientSearchVerificationSteps.java | 7 +-- .../search/PatientSearch.sorting.feature | 46 ++++++++++++++++--- 6 files changed, 72 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 0bf9acd6e1..108c2495a0 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +# local environment set up application-local.yml - -# merged .graphqls files used in code generation -ui/src/generated/schema.graphqls \ No newline at end of file +local.env \ No newline at end of file diff --git a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientSearchCriteriaSortResolver.java b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientSearchCriteriaSortResolver.java index 60e2432e56..bddb5d3123 100644 --- a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientSearchCriteriaSortResolver.java +++ b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientSearchCriteriaSortResolver.java @@ -7,6 +7,7 @@ import org.springframework.stereotype.Component; import java.util.List; +import java.util.stream.Stream; import static gov.cdc.nbs.search.SearchSorting.asSortOption; import static gov.cdc.nbs.search.SearchSorting.asSortOrder; @@ -18,31 +19,34 @@ class PatientSearchCriteriaSortResolver { List resolve(final Pageable pageable) { return pageable.getSort() .stream() - .map(this::asOption) + .flatMap(this::asOption) .toList(); } - private SortOptions asOption(final Sort.Order sorting) { + private Stream asOption(final Sort.Order sorting) { SortOrder order = asSortOrder(sorting.getDirection()); - return switch (sorting.getProperty()) { - case ADDRESS -> asSortOption(ADDRESS, "address.streetAddr1.keyword", order); - case "birthTime" -> asSortOption("birth_time", order); - case "city" -> asSortOption(ADDRESS, "address.city.keyword", order); - case "county" -> asSortOption(ADDRESS, "address.cntyText.keyword", order); - case "country" -> asSortOption(ADDRESS, "address.cntryText.keyword", order); - case "email" -> asSortOption("email", "email.emailAddress.keyword", order); - case "firstNm" -> asSortOption("name", "name.firstNm.keyword", order); - case "id" -> asSortOption("patient", order); - case "identification" -> asSortOption("entity_id", "entity_id.rootExtensionTxt.keyword", order); - case "lastNm" -> asSortOption("name", "name.lastNm.keyword", order); - case "phoneNumber" -> asSortOption("phone", "phone.telephoneNbr.keyword", order); - case "relevance" -> asSortOption("_score", order); - case "state" -> asSortOption(ADDRESS, "address.stateText.keyword", order); - case "sex" -> asSortOption("curr_sex_cd", order); - case "zip" -> asSortOption(ADDRESS, "address.zip.keyword", order); - // local_id : - default -> asSortOption(sorting.getProperty(), order); + return switch (sorting.getProperty().toLowerCase()) { + case "patientid" -> Stream.of(asSortOption("local_id", order)); + case "legalname" -> Stream.of( + asSortOption("name", "name.lastNm.keyword", order), + asSortOption("name", "name.firstNm.keyword", order) + ); + case "lastnm" -> Stream.of(asSortOption("name", "name.lastNm.keyword", order)); + case "firstnm" -> Stream.of(asSortOption("name", "name.firstNm.keyword", order)); + case ADDRESS -> Stream.of(asSortOption(ADDRESS, "address.streetAddr1.keyword", order)); + case "birthtime", "birthday" -> Stream.of(asSortOption("birth_time", order)); + case "city" -> Stream.of(asSortOption(ADDRESS, "address.city.keyword", order)); + case "county" -> Stream.of(asSortOption(ADDRESS, "address.cntyText.keyword", order)); + case "country" -> Stream.of(asSortOption(ADDRESS, "address.cntryText.keyword", order)); + case "email" -> Stream.of(asSortOption("email", "email.emailAddress.keyword", order)); + case "id" -> Stream.of(asSortOption("patient", order)); + case "identification" -> Stream.of(asSortOption("entity_id", "entity_id.rootExtensionTxt.keyword", order)); + case "phonenumber" -> Stream.of(asSortOption("phone", "phone.telephoneNbr.keyword", order)); + case "state" -> Stream.of(asSortOption(ADDRESS, "address.stateText.keyword", order)); + case "sex" -> Stream.of(asSortOption("curr_sex_cd", order)); + case "zip" -> Stream.of(asSortOption(ADDRESS, "address.zip.keyword", order)); + default -> Stream.of(asSortOption("_score", order)); }; } } diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/RunCucumber.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/RunCucumber.java index bd17d92d46..fee3a07f74 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/RunCucumber.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/RunCucumber.java @@ -30,7 +30,7 @@ @CucumberContextConfiguration @SpringBootTest @Import(PatientLocalIdentifierGeneratorTestConfiguration.class) -@ActiveProfiles({"default", "test"}) +@ActiveProfiles({"default", "test", "local"}) @AutoConfigureMockMvc @Testcontainers @EmbeddedNbsDatabase diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchSortingSteps.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchSortingSteps.java index 93b7caf927..e78923e591 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchSortingSteps.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchSortingSteps.java @@ -18,9 +18,11 @@ public void i_want_patients_sorted_by(final String sortBy, final String directio Sort.Direction sortDirection = direction.equalsIgnoreCase("desc") ? Sort.Direction.DESC : Sort.Direction.ASC; String field = switch (sortBy.toLowerCase()) { + case "local_id", "patient id" -> "patientid"; case "birthday" -> "birthTime"; case "first name" -> "firstNm"; case "last name" -> "lastNm"; + case "legal name" -> "legalName"; case "phone" -> "phoneNumber"; default -> sortBy.toLowerCase(); }; diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchVerificationSteps.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchVerificationSteps.java index 0b5641c3dd..933ab0cde5 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchVerificationSteps.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchVerificationSteps.java @@ -45,7 +45,8 @@ public void i_am_not_able_to_execute_the_search() throws Exception { public void search_result_n_has_a_x_of_y( final int position, final String field, - final String value) throws Exception { + final String value + ) throws Exception { int index = position - 1; @@ -118,7 +119,7 @@ private JsonPathResultMatchers matchingPath(final String field, final String pos "$.data.findPatientsByFilter.content[%s].identification[*].value", position ); - case "local id" -> jsonPath("$.data.findPatientsByFilter.content[%s].shortId", position); + case "patientid", "patient id", "short id" -> jsonPath("$.data.findPatientsByFilter.content[%s].shortId", position); default -> throw new AssertionError("Unexpected property check %s".formatted(field)); }; } @@ -126,7 +127,7 @@ private JsonPathResultMatchers matchingPath(final String field, final String pos private Matcher matchingValue(final String field, final String value) { return switch (field.toLowerCase()) { case "birthday", "sex" -> equalTo(value); - case "local id" -> equalTo(Integer.parseInt(value)); + case "patientid","patient id", "short id" -> equalTo(Integer.parseInt(value)); case "status" -> hasItem(PatientStatusCriteriaResolver.resolve(value).name()); default -> hasItem(value); }; diff --git a/apps/modernization-api/src/test/resources/features/patient/search/PatientSearch.sorting.feature b/apps/modernization-api/src/test/resources/features/patient/search/PatientSearch.sorting.feature index 22eb954384..e00bd64121 100644 --- a/apps/modernization-api/src/test/resources/features/patient/search/PatientSearch.sorting.feature +++ b/apps/modernization-api/src/test/resources/features/patient/search/PatientSearch.sorting.feature @@ -32,6 +32,38 @@ Feature: Patient Search Sorting And search result 2 has a "birthday" of "1987-01-15" And search result 3 has a "birthday" of "1974-05-29" + Scenario: I can find the most relevant patient when sorting by legal name ascending + Given the patient has the "legal" name "Wanda" "Maximoff" + And I have another patient + And the patient has the "legal" name "Helen" "Cho" + And I have another patient + And the patient has the "legal" name "Pietro" "Maximoff" + And patients are available for search + And I want patients sorted by "legal name" "asc" + When I search for patients + Then search result 1 has a "first name" of "Helen" + And search result 1 has a "last name" of "Cho" + And search result 2 has a "first name" of "Pietro" + And search result 2 has a "last name" of "Maximoff" + And search result 3 has a "first name" of "Wanda" + And search result 3 has a "last name" of "Maximoff" + + Scenario: I can find the most relevant patient when sorting by legal name descending + Given the patient has the "legal" name "Wanda" "Maximoff" + And I have another patient + And the patient has the "legal" name "Helen" "Cho" + And I have another patient + And the patient has the "legal" name "Pietro" "Maximoff" + And patients are available for search + And I want patients sorted by "last name" "desc" + When I search for patients + Then search result 1 has a "first name" of "Wanda" + And search result 1 has a "last name" of "Maximoff" + And search result 2 has a "first name" of "Pietro" + And search result 2 has a "last name" of "Maximoff" + And search result 3 has a "first name" of "Helen" + And search result 3 has a "last name" of "Cho" + Scenario: I can find the most relevant patient when sorting by last name ascending Given the patient has the "legal" name "Timothy" "Jackson" And I have another patient @@ -281,9 +313,9 @@ Feature: Patient Search Sorting And patients are available for search And I want patients sorted by "local_id" "asc" When I search for patients - Then search result 1 has an "local id" of "120" - And search result 2 has an "local id" of "220" - And search result 3 has an "local id" of "320" + Then search result 1 has a "patient id" of "120" + And search result 2 has a "patient id" of "220" + And search result 3 has a "patient id" of "320" Scenario: I can find the most relevant patient when sorting by local id descending Given the patient has an "local id" of "PSN10000120GA01" @@ -292,11 +324,11 @@ Feature: Patient Search Sorting And I have another patient And the patient has an "local id" of "PSN10000220GA01" And patients are available for search - And I want patients sorted by "local_id" "desc" + And I want patients sorted by "patient id" "desc" When I search for patients - Then search result 1 has an "local id" of "320" - And search result 2 has an "local id" of "220" - And search result 3 has an "local id" of "120" + Then search result 1 has a "patient id" of "320" + And search result 2 has a "patient id" of "220" + And search result 3 has a "patient id" of "120" Scenario: I can find the most relevant patient when sorting by state ascending Given the patient has a "state" of "01" From 523cc08599fea97dab591dd44a782949b94023c8 Mon Sep 17 00:00:00 2001 From: Michael Peels <109251240+mpeels@users.noreply.github.com> Date: Thu, 5 Sep 2024 09:49:51 -0400 Subject: [PATCH 2/6] Clear county when state value is cleared. Hook error fix (#1756) * Clear county when state value is cleared. Hook error fix * Make better --------- Co-authored-by: Michael Peels --- .../sexBirth/BirthAndGenderEntryFields.tsx | 20 ++++++++++--------- .../src/location/useCountyCodedValues.ts | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/apps/modernization-ui/src/apps/patient/profile/sexBirth/BirthAndGenderEntryFields.tsx b/apps/modernization-ui/src/apps/patient/profile/sexBirth/BirthAndGenderEntryFields.tsx index c596ffd5d2..e96a244c3e 100644 --- a/apps/modernization-ui/src/apps/patient/profile/sexBirth/BirthAndGenderEntryFields.tsx +++ b/apps/modernization-ui/src/apps/patient/profile/sexBirth/BirthAndGenderEntryFields.tsx @@ -3,8 +3,8 @@ import { DatePickerInput } from 'components/FormInputs/DatePickerInput'; import { Input } from 'components/FormInputs/Input'; import { SelectInput } from 'components/FormInputs/SelectInput'; import { calculateAge } from 'date'; -import { CountiesCodedValues, useCountyCodedValues } from 'location'; -import { useMemo } from 'react'; +import { useCountyCodedValues } from 'location'; +import { useEffect, useMemo } from 'react'; import { Controller, useFormContext, useWatch } from 'react-hook-form'; import { maxLengthRule } from 'validation/entry'; import { BirthAndGenderEntry } from './BirthAndGenderEntry'; @@ -13,20 +13,22 @@ import { usePatientSexBirthCodedValues } from './usePatientSexBirthCodedValues'; const UNKNOWN_GENDER = 'U'; export const BirthAndGenderEntryFields = () => { - const { control } = useFormContext(); + const { control, setValue } = useFormContext(); const currentBirthday = useWatch({ control, name: 'birth.bornOn' }); - const age = useMemo(() => calculateAge(currentBirthday), [currentBirthday]); - const selectedCurrentGender = useWatch({ control, name: 'gender.current' }); - const selectedState = useWatch({ control, name: 'birth.state' }); - const selectedMultipleBirth = useWatch({ control, name: 'birth.multipleBirth' }); const coded = usePatientSexBirthCodedValues(); - const byState: CountiesCodedValues = selectedState ? useCountyCodedValues(selectedState) : { counties: [] }; + const { counties } = useCountyCodedValues(selectedState); + + useEffect(() => { + if (!selectedState) { + setValue('birth.county', ''); + } + }, [selectedState]); return (
@@ -244,7 +246,7 @@ export const BirthAndGenderEntryFields = () => { id={name} name={name} htmlFor={name} - options={byState.counties} + options={counties} /> )} /> diff --git a/apps/modernization-ui/src/location/useCountyCodedValues.ts b/apps/modernization-ui/src/location/useCountyCodedValues.ts index af4efcdcc6..d0760ed247 100644 --- a/apps/modernization-ui/src/location/useCountyCodedValues.ts +++ b/apps/modernization-ui/src/location/useCountyCodedValues.ts @@ -30,7 +30,7 @@ type CountiesCodedValues = { counties: GroupedCodedValue[]; }; -const useCountyCodedValues = (state?: string | undefined) => { +const useCountyCodedValues = (state?: string | undefined | null) => { const [coded, setCoded] = useState(initial); const [getCodedValues] = useCodedValueQuery({ onCompleted: setCoded }); From 40987d41672df29a9c30cf4b18c911f9c408f3d8 Mon Sep 17 00:00:00 2001 From: Adam Loup <124325935+adamloup-enquizit@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:55:08 -0500 Subject: [PATCH 3/6] [CNFT1-2939] List view sort options (#1769) * sorting preferences * saving list sorting --- .../src/apps/search/basic/BasicPatient.tsx | 12 ++ .../investigation/InvestigationSearch.tsx | 56 ++++---- .../LaboratoryReportSearch.tsx | 47 ++++--- .../options/list/SearchResultsListOptions.tsx | 70 +++------- .../search-results-list-options.module.scss | 26 +--- .../search/layout/search-layout.module.scss | 2 - .../src/apps/search/patient/PatientSearch.tsx | 40 +++--- .../src/design-system/icon/Icon.tsx | 6 +- .../src/design-system/icon/icon.module.scss | 5 + .../panel/closable/ClosablePanel.spec.tsx | 104 ++++++++++++++ .../panel/closable/ClosablePanel.tsx | 57 ++++++++ .../panel/closable/closable-panel.module.scss | 26 ++++ .../src/design-system/panel/closable/index.ts | 2 + .../sorting/preferences/SortPreference.tsx | 22 +++ .../preferences/SortingPreferencesPanel.tsx | 23 ++++ .../sorting/preferences/index.ts | 3 + .../sorting/preferences/selectable.ts | 9 ++ .../preferences/sort-preference.module.scss | 30 ++++ .../useSortingPreferences.spec.tsx | 124 +++++++++++++++++ .../preferences/useSortingPreferences.tsx | 130 ++++++++++++++++++ .../src/sorting/useSorting.tsx | 1 - .../modernization-ui/src/styles/_tooltip.scss | 2 +- apps/modernization-ui/tsconfig.json | 2 + 23 files changed, 660 insertions(+), 139 deletions(-) create mode 100644 apps/modernization-ui/src/design-system/icon/icon.module.scss create mode 100644 apps/modernization-ui/src/design-system/panel/closable/ClosablePanel.spec.tsx create mode 100644 apps/modernization-ui/src/design-system/panel/closable/ClosablePanel.tsx create mode 100644 apps/modernization-ui/src/design-system/panel/closable/closable-panel.module.scss create mode 100644 apps/modernization-ui/src/design-system/panel/closable/index.ts create mode 100644 apps/modernization-ui/src/design-system/sorting/preferences/SortPreference.tsx create mode 100644 apps/modernization-ui/src/design-system/sorting/preferences/SortingPreferencesPanel.tsx create mode 100644 apps/modernization-ui/src/design-system/sorting/preferences/index.ts create mode 100644 apps/modernization-ui/src/design-system/sorting/preferences/selectable.ts create mode 100644 apps/modernization-ui/src/design-system/sorting/preferences/sort-preference.module.scss create mode 100644 apps/modernization-ui/src/design-system/sorting/preferences/useSortingPreferences.spec.tsx create mode 100644 apps/modernization-ui/src/design-system/sorting/preferences/useSortingPreferences.tsx diff --git a/apps/modernization-ui/src/apps/search/basic/BasicPatient.tsx b/apps/modernization-ui/src/apps/search/basic/BasicPatient.tsx index 40c9947b6e..eb52b6b951 100644 --- a/apps/modernization-ui/src/apps/search/basic/BasicPatient.tsx +++ b/apps/modernization-ui/src/apps/search/basic/BasicPatient.tsx @@ -2,6 +2,8 @@ import { Link } from 'react-router-dom'; import { displayName } from 'name'; import { asSelectableGender } from 'options/gender'; import { Mapping, Maybe } from 'utils'; +import { SortingSelectable } from 'design-system/sorting/preferences'; +import { Direction } from 'sorting'; type BasicPatient = { birthTime?: string | null; @@ -28,3 +30,13 @@ const displayProfileLink = (patient: Maybe) => ( const displayGender = (patient: Maybe) => asSelectableGender(patient?.currSexCd)?.name; export { withPatient, displayProfileLink, displayGender }; + +const sorting: SortingSelectable[] = [ + { property: 'relavance', direction: Direction.Descending, name: 'Closest match' }, + { property: 'legalName', direction: Direction.Ascending, name: 'Patient name (A-Z)' }, + { property: 'legalName', direction: Direction.Descending, name: 'Patient name (Z-A)' }, + { property: 'birthday', direction: Direction.Ascending, name: 'Date of birth (Ascending)' }, + { property: 'birthday', direction: Direction.Descending, name: 'Date of birth (Descending)' } +]; + +export { sorting }; diff --git a/apps/modernization-ui/src/apps/search/investigation/InvestigationSearch.tsx b/apps/modernization-ui/src/apps/search/investigation/InvestigationSearch.tsx index f552b3820d..b3a28f11ab 100644 --- a/apps/modernization-ui/src/apps/search/investigation/InvestigationSearch.tsx +++ b/apps/modernization-ui/src/apps/search/investigation/InvestigationSearch.tsx @@ -4,6 +4,8 @@ import { findByValue } from 'options'; import { SearchLayout, SearchResultList } from 'apps/search/layout'; import { useSearchResultDisplay } from 'apps/search/useSearchResultDisplay'; import { Investigation } from 'generated/graphql/schema'; +import { SortingPreferenceProvider } from 'design-system/sorting/preferences'; +import { sorting } from 'apps/search/basic'; import { InvestigationSearchResultListItem } from './result/list'; import { InvestigationSearchForm } from './InvestigationSearchForm'; import { InvestigationFilterEntry } from './InvestigationFormTypes'; @@ -34,32 +36,34 @@ const InvestigationSearch = () => { return ( - - } - resultsAsList={() => ( - - results={results} - render={(result) => ( - - )} - /> - )} - resultsAsTable={() => ( - - )} - searchEnabled={enabled} - onSearch={search} - onClear={clear} - /> - + + + } + resultsAsList={() => ( + + results={results} + render={(result) => ( + + )} + /> + )} + resultsAsTable={() => ( + + )} + searchEnabled={enabled} + onSearch={search} + onClear={clear} + /> + + ); }; diff --git a/apps/modernization-ui/src/apps/search/laboratory-report/LaboratoryReportSearch.tsx b/apps/modernization-ui/src/apps/search/laboratory-report/LaboratoryReportSearch.tsx index 3c54ef22b0..15feca0c13 100644 --- a/apps/modernization-ui/src/apps/search/laboratory-report/LaboratoryReportSearch.tsx +++ b/apps/modernization-ui/src/apps/search/laboratory-report/LaboratoryReportSearch.tsx @@ -3,6 +3,8 @@ import { SearchLayout, SearchResultList } from 'apps/search/layout'; import { removeTerm } from 'apps/search/terms'; import { useSearchResultDisplay } from 'apps/search/useSearchResultDisplay'; import { LabReport } from 'generated/graphql/schema'; +import { SortingPreferenceProvider } from 'design-system/sorting/preferences'; +import { sorting } from 'apps/search/basic'; import { useLaboratoryReportSearch } from './useLaboratoryReportSearch'; import { LabReportFilterEntry, initial as defaultValues } from './labReportFormTypes'; import { LaboratoryReportSearchResultListItem } from './result/list'; @@ -34,26 +36,31 @@ const LaboratoryReportSearch = () => { return ( - - } - resultsAsList={() => ( - - results={results} - render={(result) => ( - - )} - /> - )} - resultsAsTable={() => ( - - )} - searchEnabled={enabled} - onSearch={search} - onClear={clear} - /> - + + + } + resultsAsList={() => ( + + results={results} + render={(result) => ( + + )} + /> + )} + resultsAsTable={() => ( + + )} + searchEnabled={enabled} + onSearch={search} + onClear={clear} + /> + + ); }; diff --git a/apps/modernization-ui/src/apps/search/layout/result/header/options/list/SearchResultsListOptions.tsx b/apps/modernization-ui/src/apps/search/layout/result/header/options/list/SearchResultsListOptions.tsx index f8dca0d856..737807704d 100644 --- a/apps/modernization-ui/src/apps/search/layout/result/header/options/list/SearchResultsListOptions.tsx +++ b/apps/modernization-ui/src/apps/search/layout/result/header/options/list/SearchResultsListOptions.tsx @@ -1,62 +1,32 @@ -import { ButtonActionMenu } from 'components/ButtonActionMenu/ButtonActionMenu'; -import styles from './search-results-list-options.module.scss'; -import { Direction, useSorting } from 'sorting'; -import { SortField } from 'generated/graphql/schema'; -import { useEffect } from 'react'; import { Button } from 'components/button'; import { Icon } from 'design-system/icon'; -import classNames from 'classnames'; +import { SortingPreferencesPanel } from 'design-system/sorting/preferences'; +import { OverlayPanel } from 'overlay'; + +import styles from './search-results-list-options.module.scss'; type Props = { disabled?: boolean; }; const SearchResultsListOptions = ({ disabled = false }: Props) => { - const { sortBy, property, direction } = useSorting(); - - const savePreferences = (selection: SortField, direction: Direction) => { - localStorage.setItem('searchResultsSortBy', selection); - localStorage.setItem('searchResultsSortDirection', direction); - }; - - useEffect(() => { - const sortName = localStorage.getItem('searchResultsSortBy'); - const sortDirection = localStorage.getItem('searchResultsSortDirection'); - - if (sortName && sortDirection) { - sortBy(sortName, sortDirection as Direction); - } - }, []); - - const isActive = (field: SortField, dir: Direction) => property === field && direction === dir; - - const renderSortButton = (field: SortField, dir: Direction, label: string) => ( - - ); - return ( - } - disabled={disabled}> - {renderSortButton(SortField.Relevance, Direction.Descending, 'Closest match')} - {renderSortButton(SortField.LastNm, Direction.Ascending, 'Patient name (A-Z)')} - {renderSortButton(SortField.LastNm, Direction.Descending, 'Patient name (Z-A)')} - {renderSortButton(SortField.BirthTime, Direction.Ascending, 'Date of birth (Ascending)')} - {renderSortButton(SortField.BirthTime, Direction.Descending, 'Date of birth (Descending)')} - + ( +
- {selectedConfigurationIndex ? : } + {showConfiguration ? : }
); diff --git a/apps/modernization-ui/src/apps/dedup-config/MatchConfiguration/PassConfiguration/PassConfiguration.module.scss b/apps/modernization-ui/src/apps/dedup-config/MatchConfiguration/PassConfiguration/PassConfiguration.module.scss index 358432c18e..c88eac4821 100644 --- a/apps/modernization-ui/src/apps/dedup-config/MatchConfiguration/PassConfiguration/PassConfiguration.module.scss +++ b/apps/modernization-ui/src/apps/dedup-config/MatchConfiguration/PassConfiguration/PassConfiguration.module.scss @@ -3,5 +3,24 @@ .criteria { background-color: colors.$base-white; margin-bottom: 1rem; - padding: 1.5rem; + border: 1px solid colors.$base-lighter; + border-radius: 0.3125rem; + + &.disabled { + background-color: colors.$disabled-light; + } + + .criteriaHeadingContainer { + padding: 1.5rem; + border-bottom: 1px solid colors.$base-lighter; + } + + .criteriaContentContainer { + padding: 1.5rem; + + .criteriaRequest { + border-bottom: 1px solid colors.$base-lighter; + padding-bottom: 1.5rem; + } + } } diff --git a/apps/modernization-ui/src/apps/dedup-config/MatchConfiguration/PassConfiguration/PassConfiguration.tsx b/apps/modernization-ui/src/apps/dedup-config/MatchConfiguration/PassConfiguration/PassConfiguration.tsx index 3dc8873ab5..6b76ae9520 100644 --- a/apps/modernization-ui/src/apps/dedup-config/MatchConfiguration/PassConfiguration/PassConfiguration.tsx +++ b/apps/modernization-ui/src/apps/dedup-config/MatchConfiguration/PassConfiguration/PassConfiguration.tsx @@ -1,11 +1,38 @@ +import { Button, Icon } from '@trussworks/react-uswds'; import styles from './PassConfiguration.module.scss'; const PassConfiguration = () => { return (
-
Blocking criteria
-
Matching criteria
-
Matching bounds
+
+
+

Blocking criteria

+ Include records that meet all these conditions +
+
+

Please add blocking criteria to get started

+ +
+
+
+
+

Matching criteria

+ Include records that meet all these conditions +
+
+

Please add a matching attribute to continue

+ +
+
+
+

Matching bounds

+
); }; From 0516fcf9a985e5e457203799c66996a8fbdcc5bf Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 10 Sep 2024 16:36:02 -0500 Subject: [PATCH 6/6] fix linting --- .../src/options/autocompete/ResultedTestsAutocomplete.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/modernization-ui/src/options/autocompete/ResultedTestsAutocomplete.tsx b/apps/modernization-ui/src/options/autocompete/ResultedTestsAutocomplete.tsx index beb1af9512..56d94d75ec 100644 --- a/apps/modernization-ui/src/options/autocompete/ResultedTestsAutocomplete.tsx +++ b/apps/modernization-ui/src/options/autocompete/ResultedTestsAutocomplete.tsx @@ -10,7 +10,6 @@ const resolver = (criteria: string, limit?: number) => limit: limit }).then((response) => response as Selectable[]); - const ResultedTestsAutocomplete = (props: TextAutocompleteSingleProps) => ( );