From 544a9f12185acda884f65a23daeefa70fa18ff18 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 15 Nov 2024 09:37:58 -0700 Subject: [PATCH 1/9] 10460: Use pre-existing funciton in our date handler class to generate correct date string for fetched trial session message; Updated Unit tests; --- .../src/business/entities/EntityConstants.ts | 3 +++ .../TrialSession/setTimeStampAction.test.ts | 21 ++++++++++++++----- .../TrialSession/setTimeStampAction.ts | 7 +++++-- .../Public/publicTrialSessionsHelper.ts | 7 ------- .../Public/gotoPublicTrialSessionsSequence.ts | 3 ++- .../TrialsSessions/PublicTrialSessions.tsx | 12 +++++++++-- 6 files changed, 36 insertions(+), 17 deletions(-) diff --git a/shared/src/business/entities/EntityConstants.ts b/shared/src/business/entities/EntityConstants.ts index b78f7960772..896b3e19185 100644 --- a/shared/src/business/entities/EntityConstants.ts +++ b/shared/src/business/entities/EntityConstants.ts @@ -50,6 +50,9 @@ export const STANDING_PRETRIAL_EVENT_CODES = ['SPOS', 'SPTO']; export const CLERK_OF_THE_COURT_CONFIGURATION = 'clerk-of-court-configuration'; +export const FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY = + 'FetchedTrialSessionsTimestamp'; + export const LEGACY_DOCUMENT_TYPES = [ { documentType: 'Designation of Counsel to Receive Service', diff --git a/web-client/src/presenter/actions/TrialSession/setTimeStampAction.test.ts b/web-client/src/presenter/actions/TrialSession/setTimeStampAction.test.ts index 101dbf86ec7..019afea92d4 100644 --- a/web-client/src/presenter/actions/TrialSession/setTimeStampAction.test.ts +++ b/web-client/src/presenter/actions/TrialSession/setTimeStampAction.test.ts @@ -1,14 +1,25 @@ -import { DateTime } from 'luxon'; +import { FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY } from '@shared/business/entities/EntityConstants'; +import { FORMATS, formatNow } from '@shared/business/utilities/DateHandler'; import { runAction } from '@web-client/presenter/test.cerebral'; import { setTimeStampAction } from '@web-client/presenter/actions/TrialSession/setTimeStampAction'; describe('setTimeStampAction', () => { it('should set time stamp', async () => { - const propertyName = 'FetchedTrialSessions'; - const result = await runAction(setTimeStampAction({ propertyName }), {}); + const result = await runAction( + setTimeStampAction({ + propertyName: FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY, + }), + {}, + ); - const expectedDate = DateTime.now().setZone('America/New_York').toISODate(); + const fetchedTrialSessionsTimestamp = + result.state[FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY]; - expect(result.state[propertyName].toISODate()).toEqual(expectedDate); + const expectedDate = formatNow(FORMATS.CURRENT_AS_OF_TIMESTAMP); + + const date = fetchedTrialSessionsTimestamp.split(':'); + const expectedDateSplit = expectedDate.split(':'); + expect(date[0]).toEqual(expectedDateSplit[0]); + expect(date[1]).toContain('Eastern'); }); }); diff --git a/web-client/src/presenter/actions/TrialSession/setTimeStampAction.ts b/web-client/src/presenter/actions/TrialSession/setTimeStampAction.ts index bc1c9848e29..a172479f711 100644 --- a/web-client/src/presenter/actions/TrialSession/setTimeStampAction.ts +++ b/web-client/src/presenter/actions/TrialSession/setTimeStampAction.ts @@ -1,8 +1,11 @@ -import { DateTime } from 'luxon'; +import { FORMATS, formatNow } from '@shared/business/utilities/DateHandler'; import { state } from '@web-client/presenter/app.cerebral'; export const setTimeStampAction = ({ propertyName }: { propertyName: string }) => ({ store }: ActionProps) => { - store.set(state[propertyName], DateTime.now().setZone('America/New_York')); + const formattedEasternTimeStamp = formatNow( + FORMATS.CURRENT_AS_OF_TIMESTAMP, + ); + store.set(state[propertyName], formattedEasternTimeStamp); }; diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts index 9279565dfd9..853b73e5ec9 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts @@ -13,7 +13,6 @@ import { getTrialCitiesGroupedByState } from '@shared/business/utilities/trialSe import { state } from '@web-client/presenter/app-public.cerebral'; export type PublicTrialSessionsHelperResults = { - fetchedDateString: string; sessionTypeOptions: { label: string; value: string; @@ -86,7 +85,6 @@ const PAGE_SIZE = 100; export const publicTrialSessionsHelper = ( get: Get, ): PublicTrialSessionsHelperResults => { - const fetchedTrialSessions = get(state['FetchedTrialSessions']); const trialSessionJudges = get(state.judges) || []; const { judges = {}, @@ -97,10 +95,6 @@ export const publicTrialSessionsHelper = ( } = get(state.publicTrialSessionData); const trialSessions = get(state.trialSessionsPage.trialSessions) || []; - const fetchedDateString = fetchedTrialSessions.toFormat( - "MM/dd/yy hh:mm a 'Eastern'", - ); - const sessionTypeOptions = Object.values(SESSION_TYPES).map(sessionType => ({ label: sessionType, value: sessionType, @@ -162,7 +156,6 @@ export const publicTrialSessionsHelper = ( const groupedTrialsSessions = groupTrialSessions(trialSessionRows); return { - fetchedDateString, filtersHaveBeenModified, groupedTrialsSessions, sessionTypeOptions, diff --git a/web-client/src/presenter/sequences/Public/gotoPublicTrialSessionsSequence.ts b/web-client/src/presenter/sequences/Public/gotoPublicTrialSessionsSequence.ts index 72d9ed65ca0..7ce2c214cd9 100644 --- a/web-client/src/presenter/sequences/Public/gotoPublicTrialSessionsSequence.ts +++ b/web-client/src/presenter/sequences/Public/gotoPublicTrialSessionsSequence.ts @@ -1,3 +1,4 @@ +import { FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY } from '@shared/business/entities/EntityConstants'; import { clearErrorAlertsAction } from '@web-client/presenter/actions/clearErrorAlertsAction'; import { closeMobileMenuAction } from '@web-client/presenter/actions/closeMobileMenuAction'; import { getTrialSessionsAction } from '@web-client/presenter/actions/TrialSession/getTrialSessionsAction'; @@ -23,6 +24,6 @@ export const gotoPublicTrialSessionsSequence = [ setAllAndCurrentJudgesAction, ], ]), - setTimeStampAction({ propertyName: 'FetchedTrialSessions' }), + setTimeStampAction({ propertyName: FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY }), setupCurrentPageAction('PublicTrialSessions'), ] as unknown as () => void; diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index f7ca7dbb52a..f4730fb05bb 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -4,6 +4,7 @@ import { } from '@web-client/ustc-ui/Accordion/Accordion'; import { BigHeader } from '@web-client/views/BigHeader'; import { Button } from '@web-client/ustc-ui/Button/Button'; +import { FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY } from '@shared/business/entities/EntityConstants'; import { Mobile, NonMobile, @@ -25,6 +26,7 @@ import React, { useRef, useState } from 'react'; const ROOT = 'publicTrialSessionData'; type TrialsSessionsUiParams = { + fetchedTrialSessionsTimestamp: string; publicTrialSessionsHelper: PublicTrialSessionsHelperResults; resetPublicTrialSessionDataSequence: () => void; updateFormValueSequence: (props: { @@ -53,6 +55,7 @@ type TrialsSessionsUiParams = { export const PublicTrialSessions = connect( { displayProgressSpinnerSequence: sequences.displayProgressSpinnerSequence, + fetchedTrialSessionsTimestamp: state[FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY], publicTrialSessionData: state[ROOT], publicTrialSessionsHelper: state.publicTrialSessionsHelper, resetPublicTrialSessionDataSequence: @@ -61,6 +64,7 @@ export const PublicTrialSessions = connect( }, function ({ displayProgressSpinnerSequence, + fetchedTrialSessionsTimestamp, publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, @@ -72,6 +76,7 @@ export const PublicTrialSessions = connect( {NonMobilePublicTrialsSessions({ displayProgressSpinnerSequence, + fetchedTrialSessionsTimestamp, publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, @@ -79,6 +84,7 @@ export const PublicTrialSessions = connect( })} {MobilePublicTrialsSessions({ displayProgressSpinnerSequence, + fetchedTrialSessionsTimestamp, publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, @@ -91,6 +97,7 @@ export const PublicTrialSessions = connect( function NonMobilePublicTrialsSessions({ displayProgressSpinnerSequence, + fetchedTrialSessionsTimestamp, publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, @@ -102,7 +109,7 @@ function NonMobilePublicTrialsSessions({
@@ -146,6 +153,7 @@ function NonMobilePublicTrialsSessions({ function MobilePublicTrialsSessions({ displayProgressSpinnerSequence, + fetchedTrialSessionsTimestamp, publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, @@ -176,7 +184,7 @@ function MobilePublicTrialsSessions({
From 031c0229c0b12d506d52129b852226d91a772c4c Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 15 Nov 2024 10:00:43 -0700 Subject: [PATCH 2/9] 10460: Consistently use plural TrialSessions; extracted state key to constant; --- .../src/business/entities/EntityConstants.ts | 2 + .../resetPublicTrialSessionDataAction.test.ts | 18 ------ .../resetPublicTrialSessionDataAction.ts | 5 -- ...resetPublicTrialSessionsDataAction.test.ts | 19 ++++++ .../resetPublicTrialSessionsDataAction.ts | 6 ++ .../Public/publicTrialSessionHelper.test.ts | 40 +++++------- .../Public/publicTrialSessionsHelper.ts | 3 +- web-client/src/presenter/presenter-public.ts | 4 +- .../resetPublicTrialSessionDataSequence.ts | 5 -- .../resetPublicTrialSessionsDataSequence.ts | 5 ++ web-client/src/presenter/state-public.ts | 19 +++--- .../TrialsSessions/PublicTrialSessions.tsx | 63 ++++++++++--------- .../PublicTrialSessionsFilters.tsx | 6 +- 13 files changed, 97 insertions(+), 98 deletions(-) delete mode 100644 web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts delete mode 100644 web-client/src/presenter/actions/resetPublicTrialSessionDataAction.ts create mode 100644 web-client/src/presenter/actions/resetPublicTrialSessionsDataAction.test.ts create mode 100644 web-client/src/presenter/actions/resetPublicTrialSessionsDataAction.ts delete mode 100644 web-client/src/presenter/sequences/resetPublicTrialSessionDataSequence.ts create mode 100644 web-client/src/presenter/sequences/resetPublicTrialSessionsDataSequence.ts diff --git a/shared/src/business/entities/EntityConstants.ts b/shared/src/business/entities/EntityConstants.ts index 896b3e19185..06d329a16df 100644 --- a/shared/src/business/entities/EntityConstants.ts +++ b/shared/src/business/entities/EntityConstants.ts @@ -53,6 +53,8 @@ export const CLERK_OF_THE_COURT_CONFIGURATION = 'clerk-of-court-configuration'; export const FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY = 'FetchedTrialSessionsTimestamp'; +export const PUBLIC_TRIAL_SESSIONS_DATA_KEY = 'publicTrialSessionsData'; + export const LEGACY_DOCUMENT_TYPES = [ { documentType: 'Designation of Counsel to Receive Service', diff --git a/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts b/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts deleted file mode 100644 index 43d00566f31..00000000000 --- a/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { PublicClientState } from '@web-client/presenter/state-public'; -import { resetPublicTrialSessionDataAction } from '@web-client/presenter/actions/resetPublicTrialSessionDataAction'; -import { runAction } from '@web-client/presenter/test.cerebral'; - -describe('resetPublicTrialSessionDataAction', () => { - it('should reset trial session data', async () => { - const result = await runAction( - resetPublicTrialSessionDataAction, - { - state: { - publicTrialSessionData: { id: 123 }, - }, - }, - ); - - expect(result.state.publicTrialSessionData).toEqual({}); - }); -}); diff --git a/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.ts b/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.ts deleted file mode 100644 index f3282342c1d..00000000000 --- a/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { state } from '@web-client/presenter/app-public.cerebral'; - -export const resetPublicTrialSessionDataAction = ({ store }: ActionProps) => { - store.set(state.publicTrialSessionData, {}); -}; diff --git a/web-client/src/presenter/actions/resetPublicTrialSessionsDataAction.test.ts b/web-client/src/presenter/actions/resetPublicTrialSessionsDataAction.test.ts new file mode 100644 index 00000000000..7e6d127c6e1 --- /dev/null +++ b/web-client/src/presenter/actions/resetPublicTrialSessionsDataAction.test.ts @@ -0,0 +1,19 @@ +import { PUBLIC_TRIAL_SESSIONS_DATA_KEY } from '@shared/business/entities/EntityConstants'; +import { PublicClientState } from '@web-client/presenter/state-public'; +import { resetPublicTrialSessionsDataAction } from '@web-client/presenter/actions/resetPublicTrialSessionsDataAction'; +import { runAction } from '@web-client/presenter/test.cerebral'; + +describe('resetPublicTrialSessionsDataAction', () => { + it('should reset trial sessions data', async () => { + const result = await runAction( + resetPublicTrialSessionsDataAction, + { + state: { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { id: 123 }, + }, + }, + ); + + expect(result.state[PUBLIC_TRIAL_SESSIONS_DATA_KEY]).toEqual({}); + }); +}); diff --git a/web-client/src/presenter/actions/resetPublicTrialSessionsDataAction.ts b/web-client/src/presenter/actions/resetPublicTrialSessionsDataAction.ts new file mode 100644 index 00000000000..cf8db8bec4b --- /dev/null +++ b/web-client/src/presenter/actions/resetPublicTrialSessionsDataAction.ts @@ -0,0 +1,6 @@ +import { PUBLIC_TRIAL_SESSIONS_DATA_KEY } from '@shared/business/entities/EntityConstants'; +import { state } from '@web-client/presenter/app-public.cerebral'; + +export const resetPublicTrialSessionsDataAction = ({ store }: ActionProps) => { + store.set(state[PUBLIC_TRIAL_SESSIONS_DATA_KEY], {}); +}; diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts index 98e4c7d2e25..78cd2378c8e 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts @@ -1,4 +1,5 @@ import { DateTime } from 'luxon'; +import { PUBLIC_TRIAL_SESSIONS_DATA_KEY } from '@shared/business/entities/EntityConstants'; import { TrialSessionInfoDTO } from '@shared/business/dto/trialSessions/TrialSessionInfoDTO'; import { publicTrialSessionsHelper } from '@web-client/presenter/computeds/Public/publicTrialSessionsHelper'; import { runCompute } from '@web-client/presenter/test.cerebral'; @@ -13,22 +14,11 @@ describe('publicTrialSessionsHelper', () => { year: 2024, }); - it('should generate the correct "fetchedDateString" string', () => { - const { fetchedDateString } = runCompute(publicTrialSessionsHelper, { - state: { - FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: {}, - }, - }); - - expect(fetchedDateString).toBe('10/22/24 12:00 AM Eastern'); - }); - - it('should return the "sessiontTypeOptions" value correctly', () => { + it('should return the "sessionTypeOptions" value correctly', () => { const { sessionTypeOptions } = runCompute(publicTrialSessionsHelper, { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: {}, + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, }, }); @@ -64,7 +54,7 @@ describe('publicTrialSessionsHelper', () => { const { trialCitiesByState } = runCompute(publicTrialSessionsHelper, { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: {}, + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, }, }); @@ -75,13 +65,13 @@ describe('publicTrialSessionsHelper', () => { const { trialSessionJudgeOptions } = runCompute(publicTrialSessionsHelper, { state: { FetchedTrialSessions: TEST_TIME, + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, judges: [ { name: 'TEST_JUDGE_1', userId: '1' }, { name: 'TEST_JUDGE_2', userId: '2' }, { name: 'TEST_JUDGE_3', userId: '3' }, { name: 'TEST_JUDGE_4', userId: '4' }, ], - publicTrialSessionData: {}, }, }); @@ -112,7 +102,7 @@ describe('publicTrialSessionsHelper', () => { { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: {}, + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, }, }, ); @@ -126,7 +116,7 @@ describe('publicTrialSessionsHelper', () => { { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { proceedingType: 'SOME_OPTION', }, }, @@ -142,7 +132,7 @@ describe('publicTrialSessionsHelper', () => { { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { judges: { TEST_JUDGE: 'TEST_JUDGE', }, @@ -160,7 +150,7 @@ describe('publicTrialSessionsHelper', () => { { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { locations: { TEST_LOCATION: 'TEST_LOCATION', }, @@ -178,7 +168,7 @@ describe('publicTrialSessionsHelper', () => { { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { sessionTypes: { TEST_SESSION_TYPE: 'TEST_SESSION_TYPE', }, @@ -229,7 +219,7 @@ describe('publicTrialSessionsHelper', () => { const { trialSessionsCount } = runCompute(publicTrialSessionsHelper, { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: {}, + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, trialSessionsPage: { trialSessions: TEST_TRIAL_SESSIONS, }, @@ -258,7 +248,7 @@ describe('publicTrialSessionsHelper', () => { { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { proceedingType: TEST_PROCEEDING_TYPE, }, trialSessionsPage: { @@ -315,7 +305,7 @@ describe('publicTrialSessionsHelper', () => { { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { judges: { [TEST_JUDGE_NAME]: TEST_JUDGE_NAME, }, @@ -374,7 +364,7 @@ describe('publicTrialSessionsHelper', () => { { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { locations: { [TEST_LOCATION]: TEST_LOCATION, }, @@ -433,7 +423,7 @@ describe('publicTrialSessionsHelper', () => { { state: { FetchedTrialSessions: TEST_TIME, - publicTrialSessionData: { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { sessionTypes: { [TEST_SESSION_TYPE]: TEST_SESSION_TYPE, }, diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts index 853b73e5ec9..e7ff8c93a40 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts @@ -1,5 +1,6 @@ import { Get } from 'cerebral'; import { + PUBLIC_TRIAL_SESSIONS_DATA_KEY, SESSION_TYPES, TRIAL_SESSION_SCOPE_TYPES, } from '@shared/business/entities/EntityConstants'; @@ -92,7 +93,7 @@ export const publicTrialSessionsHelper = ( pageNumber = 0, proceedingType = 'All', sessionTypes = {}, - } = get(state.publicTrialSessionData); + } = get(state[PUBLIC_TRIAL_SESSIONS_DATA_KEY]); const trialSessions = get(state.trialSessionsPage.trialSessions) || []; const sessionTypeOptions = Object.values(SESSION_TYPES).map(sessionType => ({ diff --git a/web-client/src/presenter/presenter-public.ts b/web-client/src/presenter/presenter-public.ts index beba89178d1..75d0d57d5a8 100644 --- a/web-client/src/presenter/presenter-public.ts +++ b/web-client/src/presenter/presenter-public.ts @@ -35,7 +35,7 @@ import { persistFormsOnReloadSequence } from './sequences/persistFormsOnReloadSe import { redirectToCreatePetitionerAccountSequence } from '@web-client/presenter/sequences/redirectToCreatePetitionerAccountSequence'; import { redirectToDashboardSequence } from '@web-client/presenter/sequences/redirectToDashboardSequence'; import { redirectToLoginSequence } from '@web-client/presenter/sequences/Public/redirectToLoginSequence'; -import { resetPublicTrialSessionDataSequence } from '@web-client/presenter/sequences/resetPublicTrialSessionDataSequence'; +import { resetPublicTrialSessionsDataSequence } from '@web-client/presenter/sequences/resetPublicTrialSessionsDataSequence'; import { setCurrentPageErrorSequence } from './sequences/setCurrentPageErrorSequence'; import { showMaintenancePageDecorator } from './utilities/showMaintenancePageDecorator'; import { showMoreResultsSequence } from './sequences/showMoreResultsSequence'; @@ -110,7 +110,7 @@ export const presenterSequences = { redirectToCreatePetitionerAccountSequence, redirectToDashboardSequence, redirectToLoginSequence, - resetPublicTrialSessionDataSequence, + resetPublicTrialSessionsDataSequence, showMoreResultsSequence, sortTodaysOrdersSequence, submitLoginSequence, diff --git a/web-client/src/presenter/sequences/resetPublicTrialSessionDataSequence.ts b/web-client/src/presenter/sequences/resetPublicTrialSessionDataSequence.ts deleted file mode 100644 index d0dd4f666ca..00000000000 --- a/web-client/src/presenter/sequences/resetPublicTrialSessionDataSequence.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { resetPublicTrialSessionDataAction } from '@web-client/presenter/actions/resetPublicTrialSessionDataAction'; - -export const resetPublicTrialSessionDataSequence = [ - resetPublicTrialSessionDataAction, -] as unknown as () => void; diff --git a/web-client/src/presenter/sequences/resetPublicTrialSessionsDataSequence.ts b/web-client/src/presenter/sequences/resetPublicTrialSessionsDataSequence.ts new file mode 100644 index 00000000000..97bcef5928b --- /dev/null +++ b/web-client/src/presenter/sequences/resetPublicTrialSessionsDataSequence.ts @@ -0,0 +1,5 @@ +import { resetPublicTrialSessionsDataAction } from '@web-client/presenter/actions/resetPublicTrialSessionsDataAction'; + +export const resetPublicTrialSessionsDataSequence = [ + resetPublicTrialSessionsDataAction, +] as unknown as () => void; diff --git a/web-client/src/presenter/state-public.ts b/web-client/src/presenter/state-public.ts index 8f3dfe207a9..e3404db5f8c 100644 --- a/web-client/src/presenter/state-public.ts +++ b/web-client/src/presenter/state-public.ts @@ -1,4 +1,7 @@ -import { PUBLIC_DOCKET_RECORD_FILTER_OPTIONS } from '../../../shared/src/business/entities/EntityConstants'; +import { + PUBLIC_DOCKET_RECORD_FILTER_OPTIONS, + PUBLIC_TRIAL_SESSIONS_DATA_KEY, +} from '../../../shared/src/business/entities/EntityConstants'; import { RawUser } from '@shared/business/entities/User'; import { TrialSessionInfoDTO } from '@shared/business/dto/trialSessions/TrialSessionInfoDTO'; import { advancedDocumentSearchHelper } from './computeds/AdvancedSearch/advancedDocumentSearchHelper'; @@ -42,6 +45,13 @@ const computeds = { }; export const baseState = { + [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {} as { + judges?: { [key: string]: string }; + locations?: { [key: string]: string }; + sessionTypes?: { [key: string]: string }; + pageNumber?: number; + proceedingType?: string; + }, advancedSearchForm: {}, advancedSearchTab: 'case', alertError: null, @@ -71,13 +81,6 @@ export const baseState = { waitingForResponse: false, waitingForResponseRequests: 0, }, - publicTrialSessionData: {} as { - judges?: { [key: string]: string }; - locations?: { [key: string]: string }; - sessionTypes?: { [key: string]: string }; - pageNumber?: number; - proceedingType?: string; - }, sessionMetadata: { docketRecordFilter: PUBLIC_DOCKET_RECORD_FILTER_OPTIONS.allDocuments, docketRecordSort: {}, diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index f4730fb05bb..332252da2d8 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -4,7 +4,10 @@ import { } from '@web-client/ustc-ui/Accordion/Accordion'; import { BigHeader } from '@web-client/views/BigHeader'; import { Button } from '@web-client/ustc-ui/Button/Button'; -import { FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY } from '@shared/business/entities/EntityConstants'; +import { + FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY, + PUBLIC_TRIAL_SESSIONS_DATA_KEY, +} from '@shared/business/entities/EntityConstants'; import { Mobile, NonMobile, @@ -23,12 +26,10 @@ import { focusPaginatorTop } from '@web-client/presenter/utilities/focusPaginato import { sequences, state } from '@web-client/presenter/app-public.cerebral'; import React, { useRef, useState } from 'react'; -const ROOT = 'publicTrialSessionData'; - type TrialsSessionsUiParams = { fetchedTrialSessionsTimestamp: string; publicTrialSessionsHelper: PublicTrialSessionsHelperResults; - resetPublicTrialSessionDataSequence: () => void; + resetPublicTrialSessionsDataSequence: () => void; updateFormValueSequence: (props: { index?: number; root?: string; @@ -36,7 +37,7 @@ type TrialsSessionsUiParams = { value: any; allowEmptyString?: boolean; }) => void; - publicTrialSessionData: { + publicTrialSessionsData: { judges?: { [key: string]: string; }; @@ -56,18 +57,18 @@ export const PublicTrialSessions = connect( { displayProgressSpinnerSequence: sequences.displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp: state[FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY], - publicTrialSessionData: state[ROOT], + publicTrialSessionsData: state[PUBLIC_TRIAL_SESSIONS_DATA_KEY], publicTrialSessionsHelper: state.publicTrialSessionsHelper, - resetPublicTrialSessionDataSequence: - sequences.resetPublicTrialSessionDataSequence, + resetPublicTrialSessionsDataSequence: + sequences.resetPublicTrialSessionsDataSequence, updateFormValueSequence: sequences.updateFormValueSequence, }, function ({ displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp, - publicTrialSessionData, + publicTrialSessionsData, publicTrialSessionsHelper, - resetPublicTrialSessionDataSequence, + resetPublicTrialSessionsDataSequence, updateFormValueSequence, }) { return ( @@ -77,17 +78,17 @@ export const PublicTrialSessions = connect( {NonMobilePublicTrialsSessions({ displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp, - publicTrialSessionData, + publicTrialSessionsData, publicTrialSessionsHelper, - resetPublicTrialSessionDataSequence, + resetPublicTrialSessionsDataSequence, updateFormValueSequence, })} {MobilePublicTrialsSessions({ displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp, - publicTrialSessionData, + publicTrialSessionsData, publicTrialSessionsHelper, - resetPublicTrialSessionDataSequence, + resetPublicTrialSessionsDataSequence, updateFormValueSequence, })} @@ -98,9 +99,9 @@ export const PublicTrialSessions = connect( function NonMobilePublicTrialsSessions({ displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp, - publicTrialSessionData, + publicTrialSessionsData, publicTrialSessionsHelper, - resetPublicTrialSessionDataSequence, + resetPublicTrialSessionsDataSequence, updateFormValueSequence, }: TrialsSessionsUiParams) { return ( @@ -116,7 +117,7 @@ function NonMobilePublicTrialsSessions({
- +
@@ -130,7 +131,7 @@ function NonMobilePublicTrialsSessions({ data-testid="trial-sessions-reset-filters-button" disabled={!publicTrialSessionsHelper.filtersHaveBeenModified} onClick={() => { - resetPublicTrialSessionDataSequence(); + resetPublicTrialSessionsDataSequence(); displayProgressSpinnerSequence({ timeInSeconds: 0.25 }); }} > @@ -139,7 +140,7 @@ function NonMobilePublicTrialsSessions({
@@ -154,16 +155,16 @@ function NonMobilePublicTrialsSessions({ function MobilePublicTrialsSessions({ displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp, - publicTrialSessionData, + publicTrialSessionsData, publicTrialSessionsHelper, - resetPublicTrialSessionDataSequence, + resetPublicTrialSessionsDataSequence, updateFormValueSequence, }: TrialsSessionsUiParams) { const { judges = {}, locations = {}, sessionTypes = {}, - } = publicTrialSessionData; + } = publicTrialSessionsData; const [isOpen, setIsOpen] = useState(false); @@ -175,7 +176,7 @@ function MobilePublicTrialsSessions({ updateFormValueSequence(...args); updateFormValueSequence({ key: 'pageNumber', - root: ROOT, + root: PUBLIC_TRIAL_SESSIONS_DATA_KEY, value: 0, }); }; @@ -198,13 +199,13 @@ function MobilePublicTrialsSessions({ {isOpen && ( <> - +
@@ -304,7 +305,7 @@ function TablePagination({ onPageChange={selectedPage => { updateFormValueSequence({ key: 'pageNumber', - root: ROOT, + root: PUBLIC_TRIAL_SESSIONS_DATA_KEY, value: selectedPage, }); focusPaginatorTop(paginatorTop); @@ -323,7 +324,7 @@ function TablePagination({ onPageChange={selectedPage => { updateFormValueSequence({ key: 'pageNumber', - root: ROOT, + root: PUBLIC_TRIAL_SESSIONS_DATA_KEY, value: selectedPage, }); focusPaginatorTop(paginatorTop); diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx index 7d49209ae0c..9d057d6a337 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx @@ -17,7 +17,7 @@ const props = cerebralProps as unknown as PublicTrialSessionsFiltersProps; const PublicTrialSessionsFiltersDeps = { displayProgressSpinnerSequence: sequences.displayProgressSpinnerSequence, - publicTrialSessionData: state[props.ROOT], + publicTrialSessionsData: state[props.ROOT], publicTrialSessionsHelper: state.publicTrialSessionsHelper, updateFormValueSequence: sequences.updateFormValueSequence, }; @@ -29,7 +29,7 @@ export const PublicTrialSessionsFilters = connect< PublicTrialSessionsFiltersDeps, function ({ displayProgressSpinnerSequence, - publicTrialSessionData, + publicTrialSessionsData, publicTrialSessionsHelper, ROOT, updateFormValueSequence, @@ -44,7 +44,7 @@ export const PublicTrialSessionsFilters = connect< locations = {}, proceedingType = 'All', sessionTypes = {}, - } = publicTrialSessionData; + } = publicTrialSessionsData; const handleUpdateFormValue = (key: string, value: string | undefined) => { displayProgressSpinnerSequence({ timeInSeconds: 0.25 }); From a99d336325bdff05489b3b19ef2500680cbffa7e Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 15 Nov 2024 10:03:12 -0700 Subject: [PATCH 3/9] 10460: Delete fetch timestamp from state, not needed no mo in helper; --- .../Public/publicTrialSessionHelper.test.ts | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts index 78cd2378c8e..dc73b3406e6 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts @@ -1,23 +1,12 @@ -import { DateTime } from 'luxon'; import { PUBLIC_TRIAL_SESSIONS_DATA_KEY } from '@shared/business/entities/EntityConstants'; import { TrialSessionInfoDTO } from '@shared/business/dto/trialSessions/TrialSessionInfoDTO'; import { publicTrialSessionsHelper } from '@web-client/presenter/computeds/Public/publicTrialSessionsHelper'; import { runCompute } from '@web-client/presenter/test.cerebral'; describe('publicTrialSessionsHelper', () => { - const TEST_TIME = DateTime.fromObject({ - day: 22, - hour: 0, - minute: 0, - month: 10, - second: 0, - year: 2024, - }); - it('should return the "sessionTypeOptions" value correctly', () => { const { sessionTypeOptions } = runCompute(publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, }, }); @@ -53,7 +42,6 @@ describe('publicTrialSessionsHelper', () => { it('should return the "trialCitiesByState" value correctly', () => { const { trialCitiesByState } = runCompute(publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, }, }); @@ -64,7 +52,6 @@ describe('publicTrialSessionsHelper', () => { it('should return the "trialSessionJudgeOptions" value correctly', () => { const { trialSessionJudgeOptions } = runCompute(publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, judges: [ { name: 'TEST_JUDGE_1', userId: '1' }, @@ -101,7 +88,6 @@ describe('publicTrialSessionsHelper', () => { publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, }, }, @@ -115,7 +101,6 @@ describe('publicTrialSessionsHelper', () => { publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { proceedingType: 'SOME_OPTION', }, @@ -131,7 +116,6 @@ describe('publicTrialSessionsHelper', () => { publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { judges: { TEST_JUDGE: 'TEST_JUDGE', @@ -149,7 +133,6 @@ describe('publicTrialSessionsHelper', () => { publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { locations: { TEST_LOCATION: 'TEST_LOCATION', @@ -167,7 +150,6 @@ describe('publicTrialSessionsHelper', () => { publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { sessionTypes: { TEST_SESSION_TYPE: 'TEST_SESSION_TYPE', @@ -218,7 +200,6 @@ describe('publicTrialSessionsHelper', () => { const { trialSessionsCount } = runCompute(publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: {}, trialSessionsPage: { trialSessions: TEST_TRIAL_SESSIONS, @@ -247,7 +228,6 @@ describe('publicTrialSessionsHelper', () => { publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { proceedingType: TEST_PROCEEDING_TYPE, }, @@ -304,7 +284,6 @@ describe('publicTrialSessionsHelper', () => { publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { judges: { [TEST_JUDGE_NAME]: TEST_JUDGE_NAME, @@ -363,7 +342,6 @@ describe('publicTrialSessionsHelper', () => { publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { locations: { [TEST_LOCATION]: TEST_LOCATION, @@ -422,7 +400,6 @@ describe('publicTrialSessionsHelper', () => { publicTrialSessionsHelper, { state: { - FetchedTrialSessions: TEST_TIME, [PUBLIC_TRIAL_SESSIONS_DATA_KEY]: { sessionTypes: { [TEST_SESSION_TYPE]: TEST_SESSION_TYPE, From d1769bce5075b38d9d01d3e0ab54df9ed0267ccf Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Fri, 15 Nov 2024 13:03:17 -0500 Subject: [PATCH 4/9] 10460: Consistently use TrialSessions; --- .../Public/publicTrialSessionsHelper.ts | 6 ++--- .../PublicMobileTrialSessionsTable.tsx | 4 ++-- .../TrialsSessions/PublicTrialSessions.tsx | 22 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts index e7ff8c93a40..93e98429d2d 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts @@ -30,7 +30,7 @@ export type PublicTrialSessionsHelperResults = { totalPages: number; trialSessionsCount: number; trialSessionRows: (TrialSessionRow | TrialSessionWeek)[]; - groupedTrialsSessions: { + groupedTrialSessions: { header: TrialSessionWeek; rows: TrialSessionRow[]; }[]; @@ -154,11 +154,11 @@ export const publicTrialSessionsHelper = ( trialSessions: paginatedTrialSessions, }); - const groupedTrialsSessions = groupTrialSessions(trialSessionRows); + const groupedTrialSessions = groupTrialSessions(trialSessionRows); return { filtersHaveBeenModified, - groupedTrialsSessions, + groupedTrialSessions, sessionTypeOptions, totalPages: Math.ceil(filteredTrialSessions.length / PAGE_SIZE), trialCitiesByState, diff --git a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx index 9c8a4802b4c..fe0a48144cd 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx @@ -13,7 +13,7 @@ export const PublicMobileTrialSessionsTable = connect< PublicMobileTrialSessionsTableProps, typeof PublicMobileTrialSessionsTableDeps >(PublicMobileTrialSessionsTableDeps, function ({ publicTrialSessionsHelper }) { - const { groupedTrialsSessions } = publicTrialSessionsHelper; + const { groupedTrialSessions } = publicTrialSessionsHelper; return ( <>
@@ -36,7 +36,7 @@ export const PublicMobileTrialSessionsTable = connect< - {groupedTrialsSessions.map(tsGroup => { + {groupedTrialSessions.map(tsGroup => { return ( void; @@ -75,7 +75,7 @@ export const PublicTrialSessions = connect( <> - {NonMobilePublicTrialsSessions({ + {NonMobilePublicTrialSessions({ displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp, publicTrialSessionsData, @@ -83,7 +83,7 @@ export const PublicTrialSessions = connect( resetPublicTrialSessionsDataSequence, updateFormValueSequence, })} - {MobilePublicTrialsSessions({ + {MobilePublicTrialSessions({ displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp, publicTrialSessionsData, @@ -96,14 +96,14 @@ export const PublicTrialSessions = connect( }, ); -function NonMobilePublicTrialsSessions({ +function NonMobilePublicTrialSessions({ displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp, publicTrialSessionsData, publicTrialSessionsHelper, resetPublicTrialSessionsDataSequence, updateFormValueSequence, -}: TrialsSessionsUiParams) { +}: TrialSessionsUiParams) { return (
@@ -152,14 +152,14 @@ function NonMobilePublicTrialsSessions({ ); } -function MobilePublicTrialsSessions({ +function MobilePublicTrialSessions({ displayProgressSpinnerSequence, fetchedTrialSessionsTimestamp, publicTrialSessionsData, publicTrialSessionsHelper, resetPublicTrialSessionsDataSequence, updateFormValueSequence, -}: TrialsSessionsUiParams) { +}: TrialSessionsUiParams) { const { judges = {}, locations = {}, @@ -168,7 +168,7 @@ function MobilePublicTrialsSessions({ const [isOpen, setIsOpen] = useState(false); - const publicTrialsSessionUpdateFormValueSequence = ( + const publicTrialSessionUpdateFormValueSequence = ( ...args: Parameters ) => { if (displayProgressSpinnerSequence) @@ -224,7 +224,7 @@ function MobilePublicTrialsSessions({ key={sessionTypeLabel} text={sessionTypeLabel} onRemove={() => { - publicTrialsSessionUpdateFormValueSequence({ + publicTrialSessionUpdateFormValueSequence({ key: `sessionTypes.${sessionTypeKey}`, root: PUBLIC_TRIAL_SESSIONS_DATA_KEY, value: undefined, @@ -242,7 +242,7 @@ function MobilePublicTrialsSessions({ key={sessionTypeLabel} text={sessionTypeLabel} onRemove={() => { - publicTrialsSessionUpdateFormValueSequence({ + publicTrialSessionUpdateFormValueSequence({ key: `locations.${sessionTypeKey}`, root: PUBLIC_TRIAL_SESSIONS_DATA_KEY, value: undefined, @@ -260,7 +260,7 @@ function MobilePublicTrialsSessions({ key={sessionTypeLabel} text={sessionTypeLabel} onRemove={() => { - publicTrialsSessionUpdateFormValueSequence({ + publicTrialSessionUpdateFormValueSequence({ key: `judges.${sessionTypeKey}`, root: PUBLIC_TRIAL_SESSIONS_DATA_KEY, value: undefined, From acf6adffad9a6cc0830086dedc6268970cdbdfc3 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Fri, 15 Nov 2024 13:09:41 -0500 Subject: [PATCH 5/9] 10460: Simplify check if filters were modified; --- .../Public/publicTrialSessionsHelper.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts index 93e98429d2d..7d00f873900 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts @@ -43,18 +43,16 @@ function areAnyFiltersModified( sessionTypes: { [key: string]: string }, ): boolean { const proceedingTypeModified = proceedingType !== 'All'; - const judgesModified = Object.values(judges).filter(j => !!j).length; - const locationsModified = Object.values(locations).filter(l => !!l).length; - const sessionTypesModified = Object.values(sessionTypes).filter( - st => !!st, - ).length; - - return ( - !!proceedingTypeModified || - !!judgesModified || - !!locationsModified || - !!sessionTypesModified - ); + const judgesModified = Object.values(judges).some(Boolean); + const locationsModified = Object.values(locations).some(Boolean); + const sessionTypesModified = Object.values(sessionTypes).some(Boolean); + + return [ + proceedingTypeModified, + judgesModified, + locationsModified, + sessionTypesModified, + ].some(Boolean); } function groupTrialSessions( From 060d0112337da524f4fa6faeca8dd4882936fab4 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 15 Nov 2024 12:42:04 -0700 Subject: [PATCH 6/9] 10460: Refactor child component to not use cerebral and have all its data passed in from parent; --- .../TrialsSessions/PublicTrialSessions.tsx | 28 +- .../PublicTrialSessionsFilters.tsx | 260 +++++++++--------- 2 files changed, 159 insertions(+), 129 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index 31a5d7c207c..8ed7810cfa1 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -117,7 +117,19 @@ function NonMobilePublicTrialSessions({
- +
@@ -199,7 +211,19 @@ function MobilePublicTrialSessions({ {isOpen && ( <> - +