From f64642c07db6c87cfac2301c0585e7442188e837 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 22 Oct 2024 12:42:26 -0600 Subject: [PATCH 01/79] 10460: Created helper for public trial sessions; --- .../Public/publicTrialSessionHelper.test.ts | 24 +++++++++++++++++++ .../Public/publicTrialSessionsHelper.ts | 19 +++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts create mode 100644 web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts new file mode 100644 index 00000000000..6bc222b7be4 --- /dev/null +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts @@ -0,0 +1,24 @@ +import { DateTime } from 'luxon'; +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 generate the correct "fetchedDateString" string', () => { + const { fetchedDateString } = runCompute(publicTrialSessionsHelper, { + state: { + FetchedTrialSessions: TEST_TIME, + }, + }); + + expect(fetchedDateString).toBe('10/22/24 12:00 AM Eastern'); + }); +}); diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts new file mode 100644 index 00000000000..7ffcc883396 --- /dev/null +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts @@ -0,0 +1,19 @@ +import { Get } from 'cerebral'; +import { state } from '@web-client/presenter/app-public.cerebral'; + +export type PublicTrialSessionsHelperResults = { + fetchedDateString: string; +}; + +export const publicTrialSessionsHelper = ( + get: Get, +): PublicTrialSessionsHelperResults => { + const fetchedTrialSessions = get(state['FetchedTrialSessions']); + const fetchedDateString = fetchedTrialSessions.toFormat( + "MM/dd/yy hh:mm a 'Eastern'", + ); + + return { + fetchedDateString, + }; +}; From 45342bed88e5abd6c945e036edc2183e8885555e Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 22 Oct 2024 12:45:06 -0600 Subject: [PATCH 02/79] 10460: Register helper for public trial sessions; --- web-client/src/presenter/state-public.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web-client/src/presenter/state-public.ts b/web-client/src/presenter/state-public.ts index ea97c476498..410bd92d4c7 100644 --- a/web-client/src/presenter/state-public.ts +++ b/web-client/src/presenter/state-public.ts @@ -10,6 +10,7 @@ import { practitionerSearchHelper } from '@web-client/presenter/computeds/Advanc import { publicAlertHelper } from './computeds/Public/publicAlertHelper'; import { publicCaseDetailHeaderHelper } from './computeds/Public/publicCaseDetailHeaderHelper'; import { publicCaseDetailHelper } from './computeds/Public/publicCaseDetailHelper'; +import { publicTrialSessionsHelper } from '@web-client/presenter/computeds/Public/publicTrialSessionsHelper'; import { templateHelper } from './computeds/templateHelper'; import { todaysOpinionsHelper } from './computeds/Public/todaysOpinionsHelper'; import { todaysOrdersHelper } from './computeds/Public/todaysOrdersHelper'; @@ -30,6 +31,9 @@ const computeds = { publicCaseDetailHelper: publicCaseDetailHelper as unknown as ReturnType< typeof publicCaseDetailHelper >, + publicTrialSessionsHelper: publicTrialSessionsHelper as unknown as ReturnType< + typeof publicTrialSessionsHelper + >, templateHelper, todaysOpinionsHelper, todaysOrdersHelper, From 27a8b7841ea942e204400338fdb58c1f388aae86 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 22 Oct 2024 13:26:36 -0600 Subject: [PATCH 03/79] 10460: Create TSX files for Public Trial Session; --- web-client/src/views/AppComponentPublic.tsx | 2 + .../src/views/Public/PublicTrialSessions.tsx | 52 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 web-client/src/views/Public/PublicTrialSessions.tsx diff --git a/web-client/src/views/AppComponentPublic.tsx b/web-client/src/views/AppComponentPublic.tsx index edb45c7d618..912c487d823 100644 --- a/web-client/src/views/AppComponentPublic.tsx +++ b/web-client/src/views/AppComponentPublic.tsx @@ -11,6 +11,7 @@ import { Privacy } from './Privacy'; import { PublicCaseDetail } from './Public/PublicCaseDetail'; import { PublicPrintableDocketRecord } from './Public/PublicPrintableDocketRecord'; import { PublicSearch } from './Public/PublicSearch'; +import { PublicTrialSessions } from '@web-client/views/Public/PublicTrialSessions'; import { TodaysOpinions } from './Public/TodaysOpinions'; import { TodaysOrders } from './Public/TodaysOrders'; import { UsaBanner } from './UsaBanner'; @@ -30,6 +31,7 @@ const pages = { PublicCaseDetail, PublicPrintableDocketRecord, PublicSearch, + PublicTrialSessions, TodaysOpinions, TodaysOrders, }; diff --git a/web-client/src/views/Public/PublicTrialSessions.tsx b/web-client/src/views/Public/PublicTrialSessions.tsx new file mode 100644 index 00000000000..40bef00d953 --- /dev/null +++ b/web-client/src/views/Public/PublicTrialSessions.tsx @@ -0,0 +1,52 @@ +import { BigHeader } from '@web-client/views/BigHeader'; +import { Button } from '@web-client/ustc-ui/Button/Button'; +import { connect } from '@web-client/presenter/shared.cerebral'; +import { state } from '@web-client/presenter/app-public.cerebral'; +import React from 'react'; + +const props = { + publicTrialSessionsHelper: state.publicTrialSessionsHelper, +}; + +export const PublicTrialSessions = connect( + props, + function ({ publicTrialSessionsHelper }) { + return ( + <> + +
+
+
+
+
+ Information on this page is current as of{' '} + {publicTrialSessionsHelper.fetchedDateString} +
+
+
+
+
+

Remote Proceedings

+
+
+
+ + +
+
+
+
+
+ + ); + }, +); + +PublicTrialSessions.displayName = 'PublicTrialSessions'; From 531644d03848f4cb82e9a186a4c7ba141ae35d2a Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 22 Oct 2024 14:44:18 -0600 Subject: [PATCH 04/79] 10460: Create component for Remote Proceedings Card; --- ...blicTrialSessionsRemoteProceedingsCard.tsx | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx diff --git a/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx b/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx new file mode 100644 index 00000000000..375389d9752 --- /dev/null +++ b/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx @@ -0,0 +1,31 @@ +import { Button } from '@web-client/ustc-ui/Button/Button'; +import { connect } from '@web-client/presenter/shared.cerebral'; +import React from 'react'; + +export const PublicTrialSessionsRemoteProceedingsCard = connect( + {}, + function () { + return ( + <> +
+
+

Remote Proceedings

+
+
+
+ + +
+
+
+ + ); + }, +); From ee0f2699024a4f14222b3c7de925930a394c1957 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 22 Oct 2024 14:51:28 -0600 Subject: [PATCH 05/79] 10460: Text align left for Card; --- .../Public/PublicTrialSessionsRemoteProceedingsCard.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx b/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx index 375389d9752..e64bfb1fbb5 100644 --- a/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx +++ b/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx @@ -11,15 +11,18 @@ export const PublicTrialSessionsRemoteProceedingsCard = connect(

Remote Proceedings

-
+
-
From a984b7a802d0e6545757aa233fc8b559d6467fe3 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Wed, 23 Oct 2024 09:40:06 -0600 Subject: [PATCH 06/79] 10460: Increase padding; --- .../views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx b/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx index e64bfb1fbb5..c496c75ec6d 100644 --- a/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx +++ b/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx @@ -12,7 +12,7 @@ export const PublicTrialSessionsRemoteProceedingsCard = connect(

Remote Proceedings

-
+
- -
-
-
+export const PublicTrialSessions = connect({}, function () { + return ( + <> + +
+
+
+ +
+
+
-
- - ); - }, -); +
+
+ + + ); +}); PublicTrialSessions.displayName = 'PublicTrialSessions'; From 2b002d672dfd5f7b6f9641e1967cb073a8efb490 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 24 Oct 2024 08:33:02 -0600 Subject: [PATCH 13/79] 10460: Moved components to own folder; --- web-client/src/views/AppComponentPublic.tsx | 2 +- .../views/Public/{ => TrialsSessions}/PublicTrialSessions.tsx | 4 ++-- .../{ => TrialsSessions}/PublicTrialSessionsFilters.tsx | 0 .../PublicTrialSessionsRemoteProceedingsCard.tsx | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename web-client/src/views/Public/{ => TrialsSessions}/PublicTrialSessions.tsx (88%) rename web-client/src/views/Public/{ => TrialsSessions}/PublicTrialSessionsFilters.tsx (100%) rename web-client/src/views/Public/{ => TrialsSessions}/PublicTrialSessionsRemoteProceedingsCard.tsx (100%) diff --git a/web-client/src/views/AppComponentPublic.tsx b/web-client/src/views/AppComponentPublic.tsx index 912c487d823..2dfad41f3c5 100644 --- a/web-client/src/views/AppComponentPublic.tsx +++ b/web-client/src/views/AppComponentPublic.tsx @@ -11,7 +11,7 @@ import { Privacy } from './Privacy'; import { PublicCaseDetail } from './Public/PublicCaseDetail'; import { PublicPrintableDocketRecord } from './Public/PublicPrintableDocketRecord'; import { PublicSearch } from './Public/PublicSearch'; -import { PublicTrialSessions } from '@web-client/views/Public/PublicTrialSessions'; +import { PublicTrialSessions } from '@web-client/views/Public/TrialsSessions/PublicTrialSessions'; import { TodaysOpinions } from './Public/TodaysOpinions'; import { TodaysOrders } from './Public/TodaysOrders'; import { UsaBanner } from './UsaBanner'; diff --git a/web-client/src/views/Public/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx similarity index 88% rename from web-client/src/views/Public/PublicTrialSessions.tsx rename to web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index d60cb22fab2..6d4e322cefd 100644 --- a/web-client/src/views/Public/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -1,6 +1,6 @@ import { BigHeader } from '@web-client/views/BigHeader'; -import { PublicTrialSessionsFilters } from '@web-client/views/Public/PublicTrialSessionsFilters'; -import { PublicTrialSessionsRemoteProceedingsCard } from '@web-client/views/Public/PublicTrialSessionsRemoteProceedingsCard'; +import { PublicTrialSessionsFilters } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsFilters'; +import { PublicTrialSessionsRemoteProceedingsCard } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard'; import { connect } from '@web-client/presenter/shared.cerebral'; import React from 'react'; diff --git a/web-client/src/views/Public/PublicTrialSessionsFilters.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx similarity index 100% rename from web-client/src/views/Public/PublicTrialSessionsFilters.tsx rename to web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx diff --git a/web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard.tsx similarity index 100% rename from web-client/src/views/Public/PublicTrialSessionsRemoteProceedingsCard.tsx rename to web-client/src/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard.tsx From c976c2237ccf09911d8c1ec3f57c0c4f433fb6e9 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 24 Oct 2024 10:31:10 -0600 Subject: [PATCH 14/79] 10460: Display trial sessions in table; --- .../Public/publicTrialSessionsHelper.ts | 24 ++-- .../computeds/trialSessionsHelper.ts | 4 +- .../TrialsSessions/PublicTrialSessions.tsx | 5 +- .../PublicTrialSessionsTable.tsx | 113 ++++++++++++++++++ 4 files changed, 135 insertions(+), 11 deletions(-) create mode 100644 web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts index 9000a9a0592..24012b837ec 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts @@ -1,6 +1,10 @@ import { Get } from 'cerebral'; import { SESSION_TYPES } from '@shared/business/entities/EntityConstants'; -import { formatTrialSessions } from '@web-client/presenter/computeds/trialSessionsHelper'; +import { + TrialSessionRow, + TrialSessionWeek, + formatTrialSessions, +} from '@web-client/presenter/computeds/trialSessionsHelper'; import { getTrialCitiesGroupedByState } from '@shared/business/utilities/trialSession/trialCitiesGroupedByState'; import { state } from '@web-client/presenter/app-public.cerebral'; @@ -22,6 +26,8 @@ export type PublicTrialSessionsHelperResults = { }; }[]; filtersHaveBeenModified: boolean; + trialSessionsCount: number; + trialSessionRows: (TrialSessionRow | TrialSessionWeek)[]; }; function areAnyFiltersModified( @@ -96,14 +102,14 @@ export const publicTrialSessionsHelper = ( .filter( ts => !Object.entries(sessionTypes).length || sessionTypes[ts.sessionType!], - ); + ) + .sort((sessionA, sessionB) => { + return sessionA.startDate.localeCompare(sessionB.startDate); + }); - console.log( - 'filteredTrialSessions', - formatTrialSessions({ - trialSessions: filteredTrialSessions, - }), - ); + const trialSessionRows = formatTrialSessions({ + trialSessions: filteredTrialSessions, + }); return { fetchedDateString, @@ -111,5 +117,7 @@ export const publicTrialSessionsHelper = ( sessionTypeOptions, trialCitiesByState, trialSessionJudgeOptions, + trialSessionRows, + trialSessionsCount: filteredTrialSessions.length, }; }; diff --git a/web-client/src/presenter/computeds/trialSessionsHelper.ts b/web-client/src/presenter/computeds/trialSessionsHelper.ts index e73b2a1bc1c..7265b506ddc 100644 --- a/web-client/src/presenter/computeds/trialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/trialSessionsHelper.ts @@ -314,7 +314,7 @@ export const thirtyDaysBeforeTrial = (startDate?: string): string => { return formatDateString(thirtyDaysBeforeTrialIso, FORMATS.MMDDYY); }; -type TrialSessionRow = { +export type TrialSessionRow = { trialSessionId: string; showAlertForNOTTReminder: boolean; alertMessageForNOTT: string; @@ -334,7 +334,7 @@ export function isTrialSessionRow(item: any): item is TrialSessionRow { return !!item?.trialSessionId; } -type TrialSessionWeek = { +export type TrialSessionWeek = { sessionWeekStartDate: string; formattedSessionWeekStartDate: string; }; diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index 6d4e322cefd..4c8c7f9e22c 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -1,6 +1,7 @@ import { BigHeader } from '@web-client/views/BigHeader'; import { PublicTrialSessionsFilters } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsFilters'; import { PublicTrialSessionsRemoteProceedingsCard } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard'; +import { PublicTrialSessionsTable } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsTable'; import { connect } from '@web-client/presenter/shared.cerebral'; import React from 'react'; @@ -17,7 +18,9 @@ export const PublicTrialSessions = connect({}, function () { -
+
+ +
); diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx new file mode 100644 index 00000000000..edc0cf760d7 --- /dev/null +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx @@ -0,0 +1,113 @@ +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { connect } from '@web-client/presenter/shared.cerebral'; +import { + isTrialSessionRow, + isTrialSessionWeek, +} from '@web-client/presenter/computeds/trialSessionsHelper'; +import { state } from '@web-client/presenter/app-public.cerebral'; +import React from 'react'; + +const props = { + publicTrialSessionsHelper: state.publicTrialSessionsHelper, +}; + +export const PublicTrialSessionsTable = connect( + props, + function ({ publicTrialSessionsHelper }) { + return ( + <> +
+
+ Count:{' '} + + {publicTrialSessionsHelper.trialSessionsCount} + +
+
+ + + + + + + + + + + {publicTrialSessionsHelper.trialSessionRows.map(row => { + if (isTrialSessionWeek(row)) { + return ( + + + + + + ); + } + if (isTrialSessionRow(row)) { + return ( + + + + + + + + + + + ); + } + })} +
Start Date + LocationProceeding TypeSession TypeJudge
+

+ {'Week of '} + {row.formattedSessionWeekStartDate} +

+
+ {row.showAlertForNOTTReminder && ( + + )} + {row.formattedStartDate} + + {row.swingSession && ( + + )} + + + {row.trialLocation} + + {row.proceedingType}{row.sessionType}{row.judge.name}
+ {publicTrialSessionsHelper.trialSessionRows.length === 0 && ( +

There are no trial sessions for the selected filters.

+ )} +
+ + ); + }, +); From 396769699b22f2e2529d9d299f78533aad9df06f Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 24 Oct 2024 12:43:34 -0600 Subject: [PATCH 15/79] 10460: Added test around filtering; --- .../Public/publicTrialSessionHelper.test.ts | 284 ++++++++++++++++++ .../Public/publicTrialSessionsHelper.ts | 1 - 2 files changed, 284 insertions(+), 1 deletion(-) diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionHelper.test.ts index 03f6554f3b4..e9b96d5cd5c 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 { TrialSessionInfoDTO } from '@shared/business/dto/trialSessions/TrialSessionInfoDTO'; import { publicTrialSessionsHelper } from '@web-client/presenter/computeds/Public/publicTrialSessionsHelper'; import { runCompute } from '@web-client/presenter/test.cerebral'; @@ -201,4 +202,287 @@ describe('publicTrialSessionsHelper', () => { expect(filtersHaveBeenModified).toEqual(true); }); }); + + describe('trialSessionRows', () => { + function createTrialSessionObject(overrides: { + [key: string]: any; + }): TrialSessionInfoDTO { + return { + isCalendared: true, + judge: { + name: 'Ashford', + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + proceedingType: 'In Person', + sessionScope: 'Standalone Remote', + sessionStatus: 'Open', + sessionType: 'Regular', + startDate: '2020-11-25T05:00:00.000Z', + term: 'Fall', + termYear: '2020', + trialLocation: 'Birmingham, Alabama', + ...overrides, + }; + } + + it('should return all the trialSessions if there are no filter', () => { + const TEST_TRIAL_SESSIONS: TrialSessionInfoDTO[] = [ + createTrialSessionObject({ proceedingType: 'Remote' }), + createTrialSessionObject({ sessionType: 'Small' }), + createTrialSessionObject({ trialLocation: 'Mobile, Alabama' }), + createTrialSessionObject({ + judge: { + name: 'Buch', + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + }), + ]; + + const { trialSessionsCount } = runCompute(publicTrialSessionsHelper, { + state: { + FetchedTrialSessions: TEST_TIME, + publicTrialSessionData: {}, + trialSessionsPage: { + trialSessions: TEST_TRIAL_SESSIONS, + }, + }, + }); + + expect(trialSessionsCount).toEqual(4); + }); + + it('should return all the trialSessions that meet the proceedingType filter', () => { + const TEST_PROCEEDING_TYPE = 'TEST_PROCEEDING_TYPE'; + const TEST_TRIAL_SESSIONS: TrialSessionInfoDTO[] = [ + createTrialSessionObject({ proceedingType: TEST_PROCEEDING_TYPE }), + createTrialSessionObject({ sessionType: 'Small' }), + createTrialSessionObject({ trialLocation: 'Mobile, Alabama' }), + createTrialSessionObject({ + judge: { + name: 'Buch', + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + }), + ]; + + const { trialSessionRows, trialSessionsCount } = runCompute( + publicTrialSessionsHelper, + { + state: { + FetchedTrialSessions: TEST_TIME, + publicTrialSessionData: { + proceedingType: TEST_PROCEEDING_TYPE, + }, + trialSessionsPage: { + trialSessions: TEST_TRIAL_SESSIONS, + }, + }, + }, + ); + + expect(trialSessionsCount).toEqual(1); + expect(trialSessionRows).toEqual([ + { + formattedSessionWeekStartDate: 'November 23, 2020', + sessionWeekStartDate: '2020-11-23T05:00:00.000+00:00', + }, + { + alertMessageForNOTT: '', + formattedEstimatedEndDate: '', + formattedNoticeIssuedDate: '', + formattedStartDate: '11/25/20', + judge: { + name: 'Ashford', + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + proceedingType: 'TEST_PROCEEDING_TYPE', + sessionStatus: 'Open', + sessionType: 'Regular', + showAlertForNOTTReminder: false, + startDate: '2020-11-25T05:00:00.000Z', + swingSession: false, + trialLocation: 'Birmingham, Alabama', + trialSessionId: '', + userIsAssignedToSession: false, + }, + ]); + }); + + it('should return all the trialSessions that meet the judge filter', () => { + const TEST_JUDGE_NAME = 'TEST_JUDGE_NAME'; + const TEST_TRIAL_SESSIONS: TrialSessionInfoDTO[] = [ + createTrialSessionObject({ proceedingType: 'Remote' }), + createTrialSessionObject({ sessionType: 'Small' }), + createTrialSessionObject({ trialLocation: 'Mobile, Alabama' }), + createTrialSessionObject({ + judge: { + name: TEST_JUDGE_NAME, + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + }), + ]; + + const { trialSessionRows, trialSessionsCount } = runCompute( + publicTrialSessionsHelper, + { + state: { + FetchedTrialSessions: TEST_TIME, + publicTrialSessionData: { + judges: { + [TEST_JUDGE_NAME]: TEST_JUDGE_NAME, + }, + }, + trialSessionsPage: { + trialSessions: TEST_TRIAL_SESSIONS, + }, + }, + }, + ); + + expect(trialSessionsCount).toEqual(1); + expect(trialSessionRows).toEqual([ + { + formattedSessionWeekStartDate: 'November 23, 2020', + sessionWeekStartDate: '2020-11-23T05:00:00.000+00:00', + }, + { + alertMessageForNOTT: '', + formattedEstimatedEndDate: '', + formattedNoticeIssuedDate: '', + formattedStartDate: '11/25/20', + judge: { + name: TEST_JUDGE_NAME, + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + proceedingType: 'In Person', + sessionStatus: 'Open', + sessionType: 'Regular', + showAlertForNOTTReminder: false, + startDate: '2020-11-25T05:00:00.000Z', + swingSession: false, + trialLocation: 'Birmingham, Alabama', + trialSessionId: '', + userIsAssignedToSession: false, + }, + ]); + }); + + it('should return all the trialSessions that meet the location filter', () => { + const TEST_LOCATION = 'TEST_LOCATION'; + const TEST_TRIAL_SESSIONS: TrialSessionInfoDTO[] = [ + createTrialSessionObject({ proceedingType: 'Remote' }), + createTrialSessionObject({ sessionType: 'Small' }), + createTrialSessionObject({ trialLocation: TEST_LOCATION }), + createTrialSessionObject({ + judge: { + name: 'Buch', + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + }), + ]; + + const { trialSessionRows, trialSessionsCount } = runCompute( + publicTrialSessionsHelper, + { + state: { + FetchedTrialSessions: TEST_TIME, + publicTrialSessionData: { + locations: { + [TEST_LOCATION]: TEST_LOCATION, + }, + }, + trialSessionsPage: { + trialSessions: TEST_TRIAL_SESSIONS, + }, + }, + }, + ); + + expect(trialSessionsCount).toEqual(1); + expect(trialSessionRows).toEqual([ + { + formattedSessionWeekStartDate: 'November 23, 2020', + sessionWeekStartDate: '2020-11-23T05:00:00.000+00:00', + }, + { + alertMessageForNOTT: '', + formattedEstimatedEndDate: '', + formattedNoticeIssuedDate: '', + formattedStartDate: '11/25/20', + judge: { + name: 'Ashford', + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + proceedingType: 'In Person', + sessionStatus: 'Open', + sessionType: 'Regular', + showAlertForNOTTReminder: false, + startDate: '2020-11-25T05:00:00.000Z', + swingSession: false, + trialLocation: TEST_LOCATION, + trialSessionId: '', + userIsAssignedToSession: false, + }, + ]); + }); + + it('should return all the trialSessions that meet the sessionType filter', () => { + const TEST_SESSION_TYPE = 'TEST_SESSION_TYPE'; + const TEST_TRIAL_SESSIONS: TrialSessionInfoDTO[] = [ + createTrialSessionObject({ proceedingType: 'Remote' }), + createTrialSessionObject({ sessionType: TEST_SESSION_TYPE }), + createTrialSessionObject({ trialLocation: 'Mobile, Alabama' }), + createTrialSessionObject({ + judge: { + name: 'Buch', + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + }), + ]; + + const { trialSessionRows, trialSessionsCount } = runCompute( + publicTrialSessionsHelper, + { + state: { + FetchedTrialSessions: TEST_TIME, + publicTrialSessionData: { + sessionTypes: { + [TEST_SESSION_TYPE]: TEST_SESSION_TYPE, + }, + }, + trialSessionsPage: { + trialSessions: TEST_TRIAL_SESSIONS, + }, + }, + }, + ); + + expect(trialSessionsCount).toEqual(1); + expect(trialSessionRows).toEqual([ + { + formattedSessionWeekStartDate: 'November 23, 2020', + sessionWeekStartDate: '2020-11-23T05:00:00.000+00:00', + }, + { + alertMessageForNOTT: '', + formattedEstimatedEndDate: '', + formattedNoticeIssuedDate: '', + formattedStartDate: '11/25/20', + judge: { + name: 'Ashford', + userId: 'dabbad01-18d0-43ec-bafb-654e83405416', + }, + proceedingType: 'In Person', + sessionStatus: 'Open', + sessionType: TEST_SESSION_TYPE, + showAlertForNOTTReminder: false, + startDate: '2020-11-25T05:00:00.000Z', + swingSession: false, + trialLocation: 'Birmingham, Alabama', + trialSessionId: '', + userIsAssignedToSession: false, + }, + ]); + }); + }); }); diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts index 24012b837ec..b074de2e0df 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts @@ -64,7 +64,6 @@ export const publicTrialSessionsHelper = ( } = get(state.publicTrialSessionData); const trialSessions = get(state.trialSessionsPage.trialSessions) || []; - console.log('sessionTypes', sessionTypes); const fetchedDateString = fetchedTrialSessions.toFormat( "MM/dd/yy hh:mm a 'Eastern'", From 74046a73c89e4c159034298c39fc53b03471e82c Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 24 Oct 2024 14:48:19 -0600 Subject: [PATCH 16/79] 10460: Added Reset Filters button; --- .../resetPublicTrialSessionDataAction.ts | 5 ++ web-client/src/presenter/presenter-public.ts | 2 + .../resetPublicTrialSessionDataSequence.ts | 5 ++ .../TrialsSessions/PublicTrialSessions.tsx | 57 +++++++++++++------ 4 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 web-client/src/presenter/actions/resetPublicTrialSessionDataAction.ts create mode 100644 web-client/src/presenter/sequences/resetPublicTrialSessionDataSequence.ts diff --git a/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.ts b/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.ts new file mode 100644 index 00000000000..f3282342c1d --- /dev/null +++ b/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.ts @@ -0,0 +1,5 @@ +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/presenter-public.ts b/web-client/src/presenter/presenter-public.ts index 2a803bae338..1100f1e7966 100644 --- a/web-client/src/presenter/presenter-public.ts +++ b/web-client/src/presenter/presenter-public.ts @@ -34,6 +34,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 { setCurrentPageErrorSequence } from './sequences/setCurrentPageErrorSequence'; import { showMaintenancePageDecorator } from './utilities/showMaintenancePageDecorator'; import { showMoreResultsSequence } from './sequences/showMoreResultsSequence'; @@ -107,6 +108,7 @@ export const presenterSequences = { redirectToCreatePetitionerAccountSequence, redirectToDashboardSequence, redirectToLoginSequence, + resetPublicTrialSessionDataSequence, showMoreResultsSequence, sortTodaysOrdersSequence, submitLoginSequence, diff --git a/web-client/src/presenter/sequences/resetPublicTrialSessionDataSequence.ts b/web-client/src/presenter/sequences/resetPublicTrialSessionDataSequence.ts new file mode 100644 index 00000000000..d0dd4f666ca --- /dev/null +++ b/web-client/src/presenter/sequences/resetPublicTrialSessionDataSequence.ts @@ -0,0 +1,5 @@ +import { resetPublicTrialSessionDataAction } from '@web-client/presenter/actions/resetPublicTrialSessionDataAction'; + +export const resetPublicTrialSessionDataSequence = [ + resetPublicTrialSessionDataAction, +] 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 4c8c7f9e22c..fe5798fdd5d 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -1,29 +1,50 @@ import { BigHeader } from '@web-client/views/BigHeader'; +import { Button } from '@web-client/ustc-ui/Button/Button'; import { PublicTrialSessionsFilters } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsFilters'; import { PublicTrialSessionsRemoteProceedingsCard } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard'; import { PublicTrialSessionsTable } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsTable'; import { connect } from '@web-client/presenter/shared.cerebral'; +import { sequences, state } from '@web-client/presenter/app-public.cerebral'; import React from 'react'; -export const PublicTrialSessions = connect({}, function () { - return ( - <> - -
-
-
- +export const PublicTrialSessions = connect( + { + publicTrialSessionsHelper: state.publicTrialSessionsHelper, + resetPublicTrialSessionDataSequence: + sequences.resetPublicTrialSessionDataSequence, + }, + function ({ + publicTrialSessionsHelper, + resetPublicTrialSessionDataSequence, + }) { + return ( + <> + +
+
+
+ +
+
+ +
-
- +
+
-
-
- -
-
- - ); -}); +
+ +
+
+ + ); + }, +); PublicTrialSessions.displayName = 'PublicTrialSessions'; From 6fb7d0ccbf02eec16511e1aee4ea15abf30926d4 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 24 Oct 2024 14:52:08 -0600 Subject: [PATCH 17/79] 10460: Fix links; --- .../PublicTrialSessionsRemoteProceedingsCard.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard.tsx index c496c75ec6d..3925b922b52 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard.tsx @@ -14,14 +14,18 @@ export const PublicTrialSessionsRemoteProceedingsCard = connect(
From c7ee41e09abb73e444187fff93e03190777040a2 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 24 Oct 2024 15:28:50 -0600 Subject: [PATCH 18/79] 10460: Fix Icons and delete console.log; --- web-client/src/appPublic.tsx | 3 +++ .../views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web-client/src/appPublic.tsx b/web-client/src/appPublic.tsx index 2abd1ae7174..ff7265f601b 100644 --- a/web-client/src/appPublic.tsx +++ b/web-client/src/appPublic.tsx @@ -37,8 +37,10 @@ import { faArrowAltCircleLeft as faArrowAltCircleLeftRegular } from '@fortawesom import { faExclamation } from '@fortawesome/free-solid-svg-icons/faExclamation'; import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons/faExclamationCircle'; import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons/faExclamationTriangle'; +import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes'; import { faTimesCircle as faTimesCircleRegular } from '@fortawesome/free-regular-svg-icons/faTimesCircle'; import { faUser } from '@fortawesome/free-regular-svg-icons/faUser'; + import { isFunction, mapValues } from 'lodash'; import { library } from '@fortawesome/fontawesome-svg-core'; import { presenter } from './presenter/presenter-public'; @@ -66,6 +68,7 @@ const appPublic = { faFileAltSolid, faLock, faLongArrowAltUp, + faTimes, faPrint, faFilePdf, faSearch, diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx index 4df58246286..a569e0f60e1 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx @@ -135,7 +135,6 @@ export const PublicTrialSessionsFilters = connect( root: ROOT, value: undefined, }); - console.log('sessionType', sessionTypeLabel); }} /> ))} From 41bc24e75dfda62b1b16888f10412532b144b9b9 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 25 Oct 2024 08:22:03 -0600 Subject: [PATCH 19/79] 10460: Fix Link Icon; --- web-client/src/appPublic.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web-client/src/appPublic.tsx b/web-client/src/appPublic.tsx index ff7265f601b..fac0c591bad 100644 --- a/web-client/src/appPublic.tsx +++ b/web-client/src/appPublic.tsx @@ -37,10 +37,10 @@ import { faArrowAltCircleLeft as faArrowAltCircleLeftRegular } from '@fortawesom import { faExclamation } from '@fortawesome/free-solid-svg-icons/faExclamation'; import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons/faExclamationCircle'; import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons/faExclamationTriangle'; +import { faLink } from '@fortawesome/free-solid-svg-icons/faLink'; import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes'; import { faTimesCircle as faTimesCircleRegular } from '@fortawesome/free-regular-svg-icons/faTimesCircle'; import { faUser } from '@fortawesome/free-regular-svg-icons/faUser'; - import { isFunction, mapValues } from 'lodash'; import { library } from '@fortawesome/fontawesome-svg-core'; import { presenter } from './presenter/presenter-public'; @@ -68,6 +68,7 @@ const appPublic = { faFileAltSolid, faLock, faLongArrowAltUp, + faLink, faTimes, faPrint, faFilePdf, From 191dc5eb159060d43b5a42a203baa7740992fdb8 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 25 Oct 2024 10:24:17 -0600 Subject: [PATCH 20/79] 10460: Create sequence to display progress spinner; --- web-client/src/presenter/presenter-public.ts | 2 ++ web-client/src/presenter/presenter.ts | 2 ++ .../presenter/sequences/displayProgressSpinnerSequence.ts | 8 ++++++++ 3 files changed, 12 insertions(+) create mode 100644 web-client/src/presenter/sequences/displayProgressSpinnerSequence.ts diff --git a/web-client/src/presenter/presenter-public.ts b/web-client/src/presenter/presenter-public.ts index 1100f1e7966..beba89178d1 100644 --- a/web-client/src/presenter/presenter-public.ts +++ b/web-client/src/presenter/presenter-public.ts @@ -9,6 +9,7 @@ import { clearPdfPreviewUrlSequence } from './sequences/clearPdfPreviewUrlSequen import { closeModalAndNavigateToMaintenanceSequence } from './sequences/closeModalAndNavigateToMaintenanceSequence'; import { confirmSignUpSequence } from '@web-client/presenter/sequences/Login/confirmSignUpSequence'; import { dismissModalSequence } from './sequences/dismissModalSequence'; +import { displayProgressSpinnerSequence } from '@web-client/presenter/sequences/displayProgressSpinnerSequence'; import { goToCreatePetitionerAccountSequence } from '@web-client/presenter/sequences/Public/goToCreatePetitionerAccountSequence'; import { gotoContactSequence } from './sequences/gotoContactSequence'; import { gotoHealthCheckSequence } from './sequences/gotoHealthCheckSequence'; @@ -72,6 +73,7 @@ export const presenterSequences = { closeModalAndNavigateToMaintenanceSequence, confirmSignUpSequence, dismissModalSequence, + displayProgressSpinnerSequence, goToCreatePetitionerAccountSequence, gotoContactSequence: showMaintenancePageDecorator(gotoContactSequence), gotoHealthCheckSequence: showMaintenancePageDecorator( diff --git a/web-client/src/presenter/presenter.ts b/web-client/src/presenter/presenter.ts index 6eb37a0226a..6babbca30f1 100644 --- a/web-client/src/presenter/presenter.ts +++ b/web-client/src/presenter/presenter.ts @@ -113,6 +113,7 @@ import { dismissAddEditCaseWorksheetModalSequence } from '@web-client/presenter/ import { dismissAlertSequence } from './sequences/dismissAlertSequence'; import { dismissModalSequence } from './sequences/dismissModalSequence'; import { dismissThirtyDayTrialAlertSequence } from './sequences/dismissThirtyDayTrialAlertSequence'; +import { displayProgressSpinnerSequence } from '@web-client/presenter/sequences/displayProgressSpinnerSequence'; import { downloadCsvFileSequence } from '@web-client/presenter/sequences/downloadCsvFileSequence'; import { editCorrespondenceDocumentSequence } from './sequences/editCorrespondenceDocumentSequence'; import { editUnsignedDraftDocumentSequence } from '@web-client/presenter/sequences/editUnsignedDraftDocumentSequence'; @@ -781,6 +782,7 @@ export const presenterSequences = { dismissModalSequence: dismissModalSequence as unknown as Function, dismissThirtyDayTrialAlertSequence: dismissThirtyDayTrialAlertSequence as unknown as Function, + displayProgressSpinnerSequence, downloadCsvFileSequence: downloadCsvFileSequence as unknown as Function, editCorrespondenceDocumentSequence: editCorrespondenceDocumentSequence as unknown as Function, diff --git a/web-client/src/presenter/sequences/displayProgressSpinnerSequence.ts b/web-client/src/presenter/sequences/displayProgressSpinnerSequence.ts new file mode 100644 index 00000000000..48a1f0fe4af --- /dev/null +++ b/web-client/src/presenter/sequences/displayProgressSpinnerSequence.ts @@ -0,0 +1,8 @@ +import { showProgressSequenceDecorator } from '@web-client/presenter/utilities/showProgressSequenceDecorator'; + +export const displayProgressSpinnerSequence = showProgressSequenceDecorator([ + async ({ props }: ActionProps<{ timeInSeconds: number }>) => + await new Promise(resolve => + setTimeout(() => resolve(null), props.timeInSeconds * 1000), + ), +]) as unknown as (props: { timeInSeconds: number }) => void; From cf4e53704a87f1607241609634cfabcdea7bc5de Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 25 Oct 2024 10:25:19 -0600 Subject: [PATCH 21/79] 10460: Fix typing on sequence; --- web-client/src/presenter/sequences/updateFormValueSequence.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-client/src/presenter/sequences/updateFormValueSequence.ts b/web-client/src/presenter/sequences/updateFormValueSequence.ts index 64c5aff587f..1a932854a4b 100644 --- a/web-client/src/presenter/sequences/updateFormValueSequence.ts +++ b/web-client/src/presenter/sequences/updateFormValueSequence.ts @@ -3,7 +3,7 @@ import { setFormValueAction } from '../actions/setFormValueAction'; export const updateFormValueSequence = [ setFormValueAction, ] as unknown as (props: { - index: number; + index?: number; root?: string; key: string; value: any; From b07cb7901ce84c375a7535de301c0cdba1d6bee7 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 25 Oct 2024 10:26:06 -0600 Subject: [PATCH 22/79] 10460: Type state for public trial session; --- web-client/src/presenter/state-public.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web-client/src/presenter/state-public.ts b/web-client/src/presenter/state-public.ts index bbc245c3936..8f3dfe207a9 100644 --- a/web-client/src/presenter/state-public.ts +++ b/web-client/src/presenter/state-public.ts @@ -71,7 +71,13 @@ export const baseState = { waitingForResponse: false, waitingForResponseRequests: 0, }, - publicTrialSessionData: {} as { [key: string]: any }, + 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: {}, From 35d36cd6c2af24e913415d4678562ef8f145a06e Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 25 Oct 2024 10:27:41 -0600 Subject: [PATCH 23/79] 10460: Implement pagination in the trial session helper; --- .../computeds/Public/publicTrialSessionsHelper.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts index b074de2e0df..b875b635b0e 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts @@ -26,6 +26,7 @@ export type PublicTrialSessionsHelperResults = { }; }[]; filtersHaveBeenModified: boolean; + totalPages: number; trialSessionsCount: number; trialSessionRows: (TrialSessionRow | TrialSessionWeek)[]; }; @@ -51,6 +52,8 @@ function areAnyFiltersModified( ); } +const PAGE_SIZE = 100; + export const publicTrialSessionsHelper = ( get: Get, ): PublicTrialSessionsHelperResults => { @@ -59,12 +62,12 @@ export const publicTrialSessionsHelper = ( const { judges = {}, locations = {}, + pageNumber = 0, proceedingType = 'All', sessionTypes = {}, } = get(state.publicTrialSessionData); const trialSessions = get(state.trialSessionsPage.trialSessions) || []; - const fetchedDateString = fetchedTrialSessions.toFormat( "MM/dd/yy hh:mm a 'Eastern'", ); @@ -106,17 +109,23 @@ export const publicTrialSessionsHelper = ( return sessionA.startDate.localeCompare(sessionB.startDate); }); + const paginatedTrialSessions = filteredTrialSessions.slice( + pageNumber * PAGE_SIZE, + pageNumber * PAGE_SIZE + PAGE_SIZE, + ); + const trialSessionRows = formatTrialSessions({ - trialSessions: filteredTrialSessions, + trialSessions: paginatedTrialSessions, }); return { fetchedDateString, filtersHaveBeenModified, sessionTypeOptions, + totalPages: Math.ceil(filteredTrialSessions.length / PAGE_SIZE), trialCitiesByState, trialSessionJudgeOptions, trialSessionRows, - trialSessionsCount: filteredTrialSessions.length, + trialSessionsCount: paginatedTrialSessions.length, }; }; From b7ec0cce77a27342387dccef8dd7af6cdb46d5aa Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 25 Oct 2024 10:30:16 -0600 Subject: [PATCH 24/79] 10460: Pass root value from parent component; Reset page number any time a filter is modified; Added pagination to table; --- .../TrialsSessions/PublicTrialSessions.tsx | 14 ++++- .../PublicTrialSessionsFilters.tsx | 51 ++++++++++++++----- .../PublicTrialSessionsTable.tsx | 43 ++++++++++++++-- 3 files changed, 87 insertions(+), 21 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index fe5798fdd5d..9e2b619ca82 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -7,13 +7,17 @@ import { connect } from '@web-client/presenter/shared.cerebral'; import { sequences, state } from '@web-client/presenter/app-public.cerebral'; import React from 'react'; +const ROOT = 'publicTrialSessionData'; + export const PublicTrialSessions = connect( { + publicTrialSessionData: state[ROOT], publicTrialSessionsHelper: state.publicTrialSessionsHelper, resetPublicTrialSessionDataSequence: sequences.resetPublicTrialSessionDataSequence, }, function ({ + publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, }) { @@ -23,7 +27,9 @@ export const PublicTrialSessions = connect(
- +
@@ -39,7 +45,11 @@ export const PublicTrialSessions = connect(
- +
diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx index a569e0f60e1..74e1c8331b8 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx @@ -2,23 +2,34 @@ import { FormGroup } from '@web-client/ustc-ui/FormGroup/FormGroup'; import { PillButton } from '@web-client/ustc-ui/Button/PillButton'; import { SelectSearch } from '@web-client/ustc-ui/Select/SelectSearch'; import { TRIAL_SESSION_PROCEEDING_TYPES } from '@shared/business/entities/EntityConstants'; +import { props as cerebralProps } from 'cerebral'; import { connect } from '@web-client/presenter/shared.cerebral'; -import { sequences } from '@web-client/presenter/app.cerebral'; -import { state } from '@web-client/presenter/app-public.cerebral'; +import { sequences, state } from '@web-client/presenter/app-public.cerebral'; import React from 'react'; -const ROOT = 'publicTrialSessionData'; -const props = { - publicTrialSessionData: state[ROOT], +type PublicTrialSessionsFiltersProps = { + ROOT: string; +}; + +const props = cerebralProps as unknown as PublicTrialSessionsFiltersProps; + +const PublicTrialSessionsFiltersDeps = { + displayProgressSpinnerSequence: sequences.displayProgressSpinnerSequence, + publicTrialSessionData: state[props.ROOT], publicTrialSessionsHelper: state.publicTrialSessionsHelper, updateFormValueSequence: sequences.updateFormValueSequence, }; -export const PublicTrialSessionsFilters = connect( - props, +export const PublicTrialSessionsFilters = connect< + PublicTrialSessionsFiltersProps, + typeof PublicTrialSessionsFiltersDeps +>( + PublicTrialSessionsFiltersDeps, function ({ + displayProgressSpinnerSequence, publicTrialSessionData, publicTrialSessionsHelper, + ROOT, updateFormValueSequence, }) { const PROCEEDING_TYPES = Object.entries({ @@ -33,6 +44,18 @@ export const PublicTrialSessionsFilters = connect( sessionTypes = {}, } = publicTrialSessionData; + const publicTrialsSessionUpdateFormValueSequence = ( + ...args: Parameters + ) => { + displayProgressSpinnerSequence({ timeInSeconds: 0.25 }); + updateFormValueSequence(...args); + updateFormValueSequence({ + key: 'pageNumber', + root: ROOT, + value: 0, + }); + }; + function proceedingTypeRadioOption(key: string, value: string) { return (
@@ -45,7 +68,7 @@ export const PublicTrialSessionsFilters = connect( type="radio" value={value} onChange={e => { - updateFormValueSequence({ + publicTrialsSessionUpdateFormValueSequence({ key: e.target.name, root: ROOT, value: e.target.value, @@ -111,7 +134,7 @@ export const PublicTrialSessionsFilters = connect( }} onChange={sessionType => { if (sessionType) { - updateFormValueSequence({ + publicTrialsSessionUpdateFormValueSequence({ key: `sessionTypes.${sessionType.value}`, root: ROOT, value: sessionType.label, @@ -130,7 +153,7 @@ export const PublicTrialSessionsFilters = connect( key={sessionTypeLabel} text={sessionTypeLabel} onRemove={() => { - updateFormValueSequence({ + publicTrialsSessionUpdateFormValueSequence({ key: `sessionTypes.${sessionTypeKey}`, root: ROOT, value: undefined, @@ -163,7 +186,7 @@ export const PublicTrialSessionsFilters = connect( }} onChange={location => { if (location) { - updateFormValueSequence({ + publicTrialsSessionUpdateFormValueSequence({ key: `locations.${location.value}`, root: ROOT, value: location.label, @@ -182,7 +205,7 @@ export const PublicTrialSessionsFilters = connect( key={locationLabel} text={locationLabel} onRemove={() => { - updateFormValueSequence({ + publicTrialsSessionUpdateFormValueSequence({ key: `locations.${locationKey}`, root: ROOT, value: undefined, @@ -214,7 +237,7 @@ export const PublicTrialSessionsFilters = connect( }} onChange={judgeInfo => { if (judgeInfo) { - updateFormValueSequence({ + publicTrialsSessionUpdateFormValueSequence({ key: `judges.${judgeInfo.value.name}`, root: ROOT, value: judgeInfo.value.name, @@ -230,7 +253,7 @@ export const PublicTrialSessionsFilters = connect( key={judgeKey} text={judgeLabel} onRemove={() => { - updateFormValueSequence({ + publicTrialsSessionUpdateFormValueSequence({ key: `judges.${judgeKey}`, root: ROOT, value: undefined, diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx index edc0cf760d7..20b9afa30b4 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx @@ -1,21 +1,54 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { Paginator } from '@web-client/ustc-ui/Pagination/Paginator'; import { connect } from '@web-client/presenter/shared.cerebral'; import { isTrialSessionRow, isTrialSessionWeek, } from '@web-client/presenter/computeds/trialSessionsHelper'; -import { state } from '@web-client/presenter/app-public.cerebral'; +import { sequences, state } from '@web-client/presenter/app-public.cerebral'; import React from 'react'; -const props = { +type PublicTrialSessionsTableProps = { + pageNumber: number; + totalPages: number; + ROOT: string; +}; + +const PublicTrialSessionsTableDeps = { publicTrialSessionsHelper: state.publicTrialSessionsHelper, + updateFormValueSequence: sequences.updateFormValueSequence, }; -export const PublicTrialSessionsTable = connect( - props, - function ({ publicTrialSessionsHelper }) { +export const PublicTrialSessionsTable = connect< + PublicTrialSessionsTableProps, + typeof PublicTrialSessionsTableDeps +>( + PublicTrialSessionsTableDeps, + function ({ + pageNumber, + publicTrialSessionsHelper, + ROOT, + totalPages, + updateFormValueSequence, + }) { return ( <> +
+
+ { + updateFormValueSequence({ + key: 'pageNumber', + root: ROOT, + value: selectedPage, + }); + }} + /> +
+
+
Count:{' '} From fe3511da1cd37ae57e332cce57da673a61fdb749 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 25 Oct 2024 10:50:59 -0600 Subject: [PATCH 25/79] 10460: Center paginator; --- .../views/Public/TrialsSessions/PublicTrialSessionsTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx index 20b9afa30b4..c2b6783a431 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx @@ -33,7 +33,7 @@ export const PublicTrialSessionsTable = connect< }) { return ( <> -
+
Date: Fri, 25 Oct 2024 10:59:05 -0600 Subject: [PATCH 26/79] 10460: Separate into NonMobile and Mobile; --- .../TrialsSessions/PublicTrialSessions.tsx | 103 +++++++++++++----- 1 file changed, 75 insertions(+), 28 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index 9e2b619ca82..3a6a2fc9a30 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -1,6 +1,8 @@ import { BigHeader } from '@web-client/views/BigHeader'; import { Button } from '@web-client/ustc-ui/Button/Button'; +import { Mobile, NonMobile } from '@web-client/ustc-ui/Responsive/Responsive'; import { PublicTrialSessionsFilters } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsFilters'; +import { PublicTrialSessionsHelperResults } from '@web-client/presenter/computeds/Public/publicTrialSessionsHelper'; import { PublicTrialSessionsRemoteProceedingsCard } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard'; import { PublicTrialSessionsTable } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsTable'; import { connect } from '@web-client/presenter/shared.cerebral'; @@ -9,6 +11,24 @@ import React from 'react'; const ROOT = 'publicTrialSessionData'; +type TrialsSessionsUiParams = { + publicTrialSessionsHelper: PublicTrialSessionsHelperResults; + resetPublicTrialSessionDataSequence: () => void; + publicTrialSessionData: { + judges?: { + [key: string]: string; + }; + locations?: { + [key: string]: string; + }; + sessionTypes?: { + [key: string]: string; + }; + pageNumber?: number; + proceedingType?: string; + }; +}; + export const PublicTrialSessions = connect( { publicTrialSessionData: state[ROOT], @@ -24,37 +44,64 @@ export const PublicTrialSessions = connect( return ( <> -
-
-
- -
-
- -
-
-
- -
-
- -
-
+ + {NonMobilePublicTrialsSessions({ + publicTrialSessionData, + publicTrialSessionsHelper, + resetPublicTrialSessionDataSequence, + })} + {MobilePublicTrialsSessions()} ); }, ); +function NonMobilePublicTrialsSessions({ + publicTrialSessionData, + publicTrialSessionsHelper, + resetPublicTrialSessionDataSequence, +}: TrialsSessionsUiParams) { + return ( + +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ ); +} +function MobilePublicTrialsSessions() { + return ( + +
+ John is testing mobile +
+
+ ); +} + PublicTrialSessions.displayName = 'PublicTrialSessions'; From 755f3217147ffd6b9084bfd324fd8d1150bf97f5 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 25 Oct 2024 15:13:38 -0600 Subject: [PATCH 27/79] 10363: Split between mobile and non mobile; --- .../TrialsSessions/PublicTrialSessions.tsx | 46 +++++++++++++++++-- .../PublicTrialSessionsFilters.tsx | 5 -- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index 3a6a2fc9a30..21e9a6b6496 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -1,3 +1,7 @@ +import { + Accordion, + AccordionItem, +} from '@web-client/ustc-ui/Accordion/Accordion'; import { BigHeader } from '@web-client/views/BigHeader'; import { Button } from '@web-client/ustc-ui/Button/Button'; import { Mobile, NonMobile } from '@web-client/ustc-ui/Responsive/Responsive'; @@ -50,7 +54,11 @@ export const PublicTrialSessions = connect( publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, })} - {MobilePublicTrialsSessions()} + {MobilePublicTrialsSessions({ + publicTrialSessionData, + publicTrialSessionsHelper, + resetPublicTrialSessionDataSequence, + })} ); }, @@ -66,6 +74,10 @@ function NonMobilePublicTrialsSessions({
+
+ Information on this page is current as of{' '} + {publicTrialSessionsHelper.fetchedDateString} +
@@ -94,14 +106,38 @@ function NonMobilePublicTrialsSessions({ ); } -function MobilePublicTrialsSessions() { +function MobilePublicTrialsSessions({ + publicTrialSessionData, + publicTrialSessionsHelper, + resetPublicTrialSessionDataSequence, +}: TrialsSessionsUiParams) { + console.log('publicTrialSessionData', publicTrialSessionData); return (
- John is testing mobile +
+ Information on this page is current as of{' '} + {publicTrialSessionsHelper.fetchedDateString} +
+
+ +
+ + + + + + +
); } - -PublicTrialSessions.displayName = 'PublicTrialSessions'; diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx index 74e1c8331b8..ef71ce70279 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsFilters.tsx @@ -90,11 +90,6 @@ export const PublicTrialSessionsFilters = connect< return ( <> -
- Information on this page is current as of{' '} - {publicTrialSessionsHelper.fetchedDateString} -
-
Date: Mon, 28 Oct 2024 10:18:41 -0600 Subject: [PATCH 28/79] 10460: implement mobile table view; --- .../Public/publicTrialSessionsHelper.ts | 32 ++++++ .../PublicMobileTrialSessionsDataRow.tsx | 62 ++++++++++++ .../PublicMobileTrialSessionsTable.tsx | 99 +++++++++++++++++++ .../TrialsSessions/PublicTrialSessions.tsx | 21 ++-- 4 files changed, 205 insertions(+), 9 deletions(-) create mode 100644 web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx create mode 100644 web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx diff --git a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts index b875b635b0e..46d1cb73b84 100644 --- a/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/Public/publicTrialSessionsHelper.ts @@ -4,6 +4,7 @@ import { TrialSessionRow, TrialSessionWeek, formatTrialSessions, + isTrialSessionWeek, } from '@web-client/presenter/computeds/trialSessionsHelper'; import { getTrialCitiesGroupedByState } from '@shared/business/utilities/trialSession/trialCitiesGroupedByState'; import { state } from '@web-client/presenter/app-public.cerebral'; @@ -29,6 +30,10 @@ export type PublicTrialSessionsHelperResults = { totalPages: number; trialSessionsCount: number; trialSessionRows: (TrialSessionRow | TrialSessionWeek)[]; + groupedTrialsSessions: { + header: TrialSessionWeek; + rows: TrialSessionRow[]; + }[]; }; function areAnyFiltersModified( @@ -52,6 +57,30 @@ function areAnyFiltersModified( ); } +function groupTrialSessions( + trialSessions: (TrialSessionRow | TrialSessionWeek)[], +): { header: TrialSessionWeek; rows: TrialSessionRow[] }[] { + const groupedTrialSessions: { + header: TrialSessionWeek; + rows: TrialSessionRow[]; + }[] = []; + + let counter = -1; + trialSessions.forEach(tsRow => { + if (isTrialSessionWeek(tsRow)) { + groupedTrialSessions.push({ + header: tsRow, + rows: [] as TrialSessionRow[], + }); + counter += 1; + } else { + groupedTrialSessions[counter].rows.push(tsRow); + } + }); + + return groupedTrialSessions; +} + const PAGE_SIZE = 100; export const publicTrialSessionsHelper = ( @@ -118,9 +147,12 @@ export const publicTrialSessionsHelper = ( trialSessions: paginatedTrialSessions, }); + const groupedTrialsSessions = groupTrialSessions(trialSessionRows); + return { fetchedDateString, filtersHaveBeenModified, + groupedTrialsSessions, sessionTypeOptions, totalPages: Math.ceil(filteredTrialSessions.length / PAGE_SIZE), trialCitiesByState, diff --git a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx new file mode 100644 index 00000000000..c83df0a9b86 --- /dev/null +++ b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx @@ -0,0 +1,62 @@ +import React from 'react'; + +type PublicMobileTrialSessionsDataRowProps = { + startDate: string; + trialSessionId: string; + judgeName: string; + proceedingType: string; + sessionType: string; + trialLocation: string; +}; + +export const PublicMobileTrialSessionsDataRow = function ({ + judgeName, + proceedingType, + sessionType, + startDate, + trialLocation, + trialSessionId, +}: PublicMobileTrialSessionsDataRowProps) { + return ( + <> +
+
+
+
+ Start Date +
+
{startDate}
+
+
+
+ Proceeding Type +
+
{proceedingType}
+
+
+
+ Judge +
+
{judgeName}
+
+
+
+
+
+ Start Date +
+ + {trialLocation} + +
+
+
+ Session Type +
+
{sessionType}
+
+
+
+ + ); +}; diff --git a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx new file mode 100644 index 00000000000..5b903e24491 --- /dev/null +++ b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx @@ -0,0 +1,99 @@ +import { Paginator } from '@web-client/ustc-ui/Pagination/Paginator'; +import { PublicMobileTrialSessionsDataRow } from '@web-client/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow'; +import { connect } from '@web-client/presenter/shared.cerebral'; +import { sequences, state } from '@web-client/presenter/app-public.cerebral'; +import React from 'react'; + +type PublicMobileTrialSessionsTableProps = { + pageNumber: number; + totalPages: number; + ROOT: string; +}; + +const PublicMobileTrialSessionsTableDeps = { + publicTrialSessionsHelper: state.publicTrialSessionsHelper, + updateFormValueSequence: sequences.updateFormValueSequence, +}; + +export const PublicMobileTrialSessionsTable = connect< + PublicMobileTrialSessionsTableProps, + typeof PublicMobileTrialSessionsTableDeps +>( + PublicMobileTrialSessionsTableDeps, + function ({ + pageNumber, + publicTrialSessionsHelper, + ROOT, + totalPages, + updateFormValueSequence, + }) { + const { groupedTrialsSessions } = publicTrialSessionsHelper; + return ( + <> +
+
+ { + updateFormValueSequence({ + key: 'pageNumber', + root: ROOT, + value: selectedPage, + }); + }} + /> +
+
+
+
+
+ Count:{' '} + + {publicTrialSessionsHelper.trialSessionsCount} + +
+
+ + + + + + + + + + {groupedTrialsSessions.map(tsGroup => { + return ( + + + {tsGroup.rows.map(tsRow => { + return ( + <> + + + ); + })} + + ); + })} + +
Document titleDescription
+ {tsGroup.header.formattedSessionWeekStartDate} + + +
+ + ); + }, +); diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index 21e9a6b6496..e763a5847ec 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -5,6 +5,7 @@ import { import { BigHeader } from '@web-client/views/BigHeader'; import { Button } from '@web-client/ustc-ui/Button/Button'; import { Mobile, NonMobile } from '@web-client/ustc-ui/Responsive/Responsive'; +import { PublicMobileTrialSessionsTable } from '@web-client/views/Public/TrialsSessions/PublicMobileTrialSessionsTable'; import { PublicTrialSessionsFilters } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsFilters'; import { PublicTrialSessionsHelperResults } from '@web-client/presenter/computeds/Public/publicTrialSessionsHelper'; import { PublicTrialSessionsRemoteProceedingsCard } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard'; @@ -78,12 +79,10 @@ function NonMobilePublicTrialsSessions({ Information on this page is current as of{' '} {publicTrialSessionsHelper.fetchedDateString}
- +
- +
@@ -100,7 +99,7 @@ function NonMobilePublicTrialsSessions({ ROOT={ROOT} pageNumber={publicTrialSessionData.pageNumber || 0} totalPages={publicTrialSessionsHelper.totalPages} - > + />
@@ -120,14 +119,12 @@ function MobilePublicTrialsSessions({ {publicTrialSessionsHelper.fetchedDateString}
- +
- +
- +
+
+ { + updateFormValueSequence({ + key: 'pageNumber', + root: ROOT, + value: selectedPage, + }); + }} + /> +
+
+
+ +
@@ -109,8 +135,8 @@ function MobilePublicTrialsSessions({ publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, + updateFormValueSequence, }: TrialsSessionsUiParams) { - console.log('publicTrialSessionData', publicTrialSessionData); return (
@@ -135,11 +161,24 @@ function MobilePublicTrialsSessions({ - +
+
+ { + updateFormValueSequence({ + key: 'pageNumber', + root: ROOT, + value: selectedPage, + }); + }} + /> +
+
+
+ +
); diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx index c2b6783a431..09ab6782a44 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx @@ -1,146 +1,113 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { Paginator } from '@web-client/ustc-ui/Pagination/Paginator'; import { connect } from '@web-client/presenter/shared.cerebral'; import { isTrialSessionRow, isTrialSessionWeek, } from '@web-client/presenter/computeds/trialSessionsHelper'; -import { sequences, state } from '@web-client/presenter/app-public.cerebral'; +import { state } from '@web-client/presenter/app-public.cerebral'; import React from 'react'; -type PublicTrialSessionsTableProps = { - pageNumber: number; - totalPages: number; - ROOT: string; -}; +type PublicTrialSessionsTableProps = {}; const PublicTrialSessionsTableDeps = { publicTrialSessionsHelper: state.publicTrialSessionsHelper, - updateFormValueSequence: sequences.updateFormValueSequence, }; export const PublicTrialSessionsTable = connect< PublicTrialSessionsTableProps, typeof PublicTrialSessionsTableDeps ->( - PublicTrialSessionsTableDeps, - function ({ - pageNumber, - publicTrialSessionsHelper, - ROOT, - totalPages, - updateFormValueSequence, - }) { - return ( - <> -
-
- { - updateFormValueSequence({ - key: 'pageNumber', - root: ROOT, - value: selectedPage, - }); - }} - /> -
-
-
-
-
- Count:{' '} - - {publicTrialSessionsHelper.trialSessionsCount} - -
-
- - - - - - - - - - - {publicTrialSessionsHelper.trialSessionRows.map(row => { - if (isTrialSessionWeek(row)) { - return ( - - - - - - ); - } - if (isTrialSessionRow(row)) { - return ( - - - - - + + + + + + ); + } + })} +
Start Date - LocationProceeding TypeSession TypeJudge
-

- {'Week of '} - {row.formattedSessionWeekStartDate} -

-
- {row.showAlertForNOTTReminder && ( - - )} - {row.formattedStartDate} - - {row.swingSession && ( - - )} - (PublicTrialSessionsTableDeps, function ({ publicTrialSessionsHelper }) { + return ( + <> +
+
+ Count:{' '} + + {publicTrialSessionsHelper.trialSessionsCount} + +
+
+ + + + + + + + + + + {publicTrialSessionsHelper.trialSessionRows.map(row => { + if (isTrialSessionWeek(row)) { + return ( + + + + + + ); + } + if (isTrialSessionRow(row)) { + return ( + + + + + - - - - - - ); - } - })} -
Start Date + LocationProceeding TypeSession TypeJudge
+

+ {'Week of '} + {row.formattedSessionWeekStartDate} +

+
+ {row.showAlertForNOTTReminder && ( + + )} + {row.formattedStartDate} + + {row.swingSession && ( + + )} + + - - {row.trialLocation} - - {row.proceedingType}{row.sessionType}{row.judge.name}
- {publicTrialSessionsHelper.trialSessionRows.length === 0 && ( -

There are no trial sessions for the selected filters.

- )} -
- - ); - }, -); + {row.trialLocation} + +
{row.proceedingType}{row.sessionType}{row.judge.name}
+ {publicTrialSessionsHelper.trialSessionRows.length === 0 && ( +

There are no trial sessions for the selected filters.

+ )} +
+ + ); +}); From 7a55a1b229c68617d56b038ac16df95f5d6b841b Mon Sep 17 00:00:00 2001 From: John Cruz Date: Mon, 28 Oct 2024 10:37:48 -0600 Subject: [PATCH 30/79] 10460: Fix font weight; --- .../PublicMobileTrialSessionsDataRow.tsx | 39 ++++++------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx index c83df0a9b86..07d60f4fcd8 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx @@ -21,40 +21,25 @@ export const PublicMobileTrialSessionsDataRow = function ({ <>
-
-
- Start Date -
-
{startDate}
-
-
-
- Proceeding Type -
-
{proceedingType}
-
-
-
- Judge -
-
{judgeName}
-
+
Start Date
+
{startDate}
+ +
Proceeding Type
+
{proceedingType}
+ +
Judge
+
{judgeName}
+
Location
-
- Start Date -
{trialLocation}
-
-
- Session Type -
-
{sessionType}
-
+ +
Session Type
+
{sessionType}
From e41ed04e2a3b99f44df17ea346514b2b47e18398 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Mon, 28 Oct 2024 10:49:30 -0600 Subject: [PATCH 31/79] 10460: Added bottom pagination for mobile and non mobile; --- .../TrialsSessions/PublicTrialSessions.tsx | 102 +++++++++++------- 1 file changed, 65 insertions(+), 37 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index 697e889544a..f124cde07d0 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -12,8 +12,9 @@ import { PublicTrialSessionsHelperResults } from '@web-client/presenter/computed import { PublicTrialSessionsRemoteProceedingsCard } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsRemoteProceedingsCard'; import { PublicTrialSessionsTable } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsTable'; import { connect } from '@web-client/presenter/shared.cerebral'; +import { focusPaginatorTop } from '@web-client/presenter/utilities/focusPaginatorTop'; import { sequences, state } from '@web-client/presenter/app-public.cerebral'; -import React from 'react'; +import React, { useRef } from 'react'; const ROOT = 'publicTrialSessionData'; @@ -108,24 +109,13 @@ function NonMobilePublicTrialsSessions({
-
-
- { - updateFormValueSequence({ - key: 'pageNumber', - root: ROOT, - value: selectedPage, - }); - }} - /> -
-
-
- - + + +
@@ -161,25 +151,63 @@ function MobilePublicTrialsSessions({ -
-
- { - updateFormValueSequence({ - key: 'pageNumber', - root: ROOT, - value: selectedPage, - }); - }} - /> -
-
-
- - + + + ); } + +function TablePagination({ + children, + pageNumber, + totalPages, + updateFormValueSequence, +}) { + const paginatorTop = useRef(null); + return ( + <> +
+
+ { + updateFormValueSequence({ + key: 'pageNumber', + root: ROOT, + value: selectedPage, + }); + focusPaginatorTop(paginatorTop); + }} + /> +
+
+
+ + {children} +
+
+ { + updateFormValueSequence({ + key: 'pageNumber', + root: ROOT, + value: selectedPage, + }); + focusPaginatorTop(paginatorTop); + }} + /> +
+
+
+ + ); +} From 89f33fe85dd37474bd6f913e0093565b69c3e309 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Mon, 28 Oct 2024 11:04:40 -0600 Subject: [PATCH 32/79] 10460: Display filter pills outside filter section on mobile; --- .../TrialsSessions/PublicTrialSessions.tsx | 81 +++++++++++++++++++ .../PublicTrialSessionsFilters.tsx | 13 +-- 2 files changed, 88 insertions(+), 6 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index f124cde07d0..d6caf77be8c 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -6,6 +6,7 @@ import { BigHeader } from '@web-client/views/BigHeader'; import { Button } from '@web-client/ustc-ui/Button/Button'; import { Mobile, NonMobile } from '@web-client/ustc-ui/Responsive/Responsive'; import { Paginator } from '@web-client/ustc-ui/Pagination/Paginator'; +import { PillButton } from '@web-client/ustc-ui/Button/PillButton'; import { PublicMobileTrialSessionsTable } from '@web-client/views/Public/TrialsSessions/PublicMobileTrialSessionsTable'; import { PublicTrialSessionsFilters } from '@web-client/views/Public/TrialsSessions/PublicTrialSessionsFilters'; import { PublicTrialSessionsHelperResults } from '@web-client/presenter/computeds/Public/publicTrialSessionsHelper'; @@ -41,10 +42,12 @@ type TrialsSessionsUiParams = { pageNumber?: number; proceedingType?: string; }; + displayProgressSpinnerSequence?: (props: { timeInSeconds: number }) => void; }; export const PublicTrialSessions = connect( { + displayProgressSpinnerSequence: sequences.displayProgressSpinnerSequence, publicTrialSessionData: state[ROOT], publicTrialSessionsHelper: state.publicTrialSessionsHelper, resetPublicTrialSessionDataSequence: @@ -52,6 +55,7 @@ export const PublicTrialSessions = connect( updateFormValueSequence: sequences.updateFormValueSequence, }, function ({ + displayProgressSpinnerSequence, publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, @@ -68,6 +72,7 @@ export const PublicTrialSessions = connect( updateFormValueSequence, })} {MobilePublicTrialsSessions({ + displayProgressSpinnerSequence, publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, @@ -121,12 +126,33 @@ function NonMobilePublicTrialsSessions({ ); } + function MobilePublicTrialsSessions({ + displayProgressSpinnerSequence, publicTrialSessionData, publicTrialSessionsHelper, resetPublicTrialSessionDataSequence, updateFormValueSequence, }: TrialsSessionsUiParams) { + const { + judges = {}, + locations = {}, + sessionTypes = {}, + } = publicTrialSessionData; + + const publicTrialsSessionUpdateFormValueSequence = ( + ...args: Parameters + ) => { + if (displayProgressSpinnerSequence) + displayProgressSpinnerSequence({ timeInSeconds: 0.25 }); + updateFormValueSequence(...args); + updateFormValueSequence({ + key: 'pageNumber', + root: ROOT, + value: 0, + }); + }; + return (
@@ -151,6 +177,61 @@ function MobilePublicTrialsSessions({ +
+ {Object.entries( + sessionTypes as { + [key: string]: string; + }, + ).map(([sessionTypeKey, sessionTypeLabel]) => ( + { + publicTrialsSessionUpdateFormValueSequence({ + key: `sessionTypes.${sessionTypeKey}`, + root: ROOT, + value: undefined, + }); + }} + /> + ))} + + {Object.entries( + locations as { + [key: string]: string; + }, + ).map(([sessionTypeKey, sessionTypeLabel]) => ( + { + publicTrialsSessionUpdateFormValueSequence({ + key: `locations.${sessionTypeKey}`, + root: ROOT, + value: undefined, + }); + }} + /> + ))} + + {Object.entries( + judges as { + [key: string]: string; + }, + ).map(([sessionTypeKey, sessionTypeLabel]) => ( + { + publicTrialsSessionUpdateFormValueSequence({ + key: `judges.${sessionTypeKey}`, + root: ROOT, + value: undefined, + }); + }} + /> + ))} +
-
+ {Object.entries( sessionTypes as { [key: string]: string; @@ -156,7 +157,7 @@ export const PublicTrialSessionsFilters = connect< }} /> ))} -
+
@@ -190,7 +191,7 @@ export const PublicTrialSessionsFilters = connect< }} />
-
+ {Object.entries( locations as { [key: string]: string; @@ -208,7 +209,7 @@ export const PublicTrialSessionsFilters = connect< }} /> ))} -
+
@@ -241,7 +242,7 @@ export const PublicTrialSessionsFilters = connect< }} />
-
+ {Object.entries(judges as { [key: string]: string }).map( ([judgeKey, judgeLabel]) => ( ), )} -
+
From b5e2a24b3914a7f11d3bb0b82e27f4964e642b09 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Mon, 28 Oct 2024 11:07:19 -0600 Subject: [PATCH 33/79] 10460: remove grey background on mobile filters; --- .../src/views/Public/TrialsSessions/PublicTrialSessions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index d6caf77be8c..64615920eeb 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -165,7 +165,7 @@ function MobilePublicTrialsSessions({
- + - - + + )}
{Object.entries( From b1788bb00093d76c0d64dcda349dc4744c7ec321 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Mon, 28 Oct 2024 14:17:01 -0600 Subject: [PATCH 35/79] 10460: WIP implement double line separator; --- .../TrialsSessions/PublicMobileTrialSessionsTable.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx index 3e0836c6774..14a0532b73e 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx @@ -42,10 +42,17 @@ export const PublicMobileTrialSessionsTable = connect< {tsGroup.header.formattedSessionWeekStartDate} - {tsGroup.rows.map(tsRow => { + {tsGroup.rows.map((tsRow, index) => { return ( <> - + Date: Mon, 28 Oct 2024 16:33:53 -0400 Subject: [PATCH 36/79] 10460: separate sessions in the same week with a double line; --- web-client/src/styles/custom.scss | 5 +++++ .../Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web-client/src/styles/custom.scss b/web-client/src/styles/custom.scss index 9e935c16770..aec2204ff4a 100644 --- a/web-client/src/styles/custom.scss +++ b/web-client/src/styles/custom.scss @@ -2427,3 +2427,8 @@ button.change-scanner-button { // This has higher importance than uwds padding-0 padding: 0; } + +.double-border { + border-bottom: 1px solid !important; + margin-bottom: 5px !important; +} \ No newline at end of file diff --git a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx index 14a0532b73e..8b970c13a51 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsTable.tsx @@ -48,7 +48,7 @@ export const PublicMobileTrialSessionsTable = connect< Date: Mon, 28 Oct 2024 16:41:09 -0400 Subject: [PATCH 37/79] 10460: remove log; --- web-client/src/presenter/computeds/trialSessionsHelper.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/web-client/src/presenter/computeds/trialSessionsHelper.ts b/web-client/src/presenter/computeds/trialSessionsHelper.ts index 7265b506ddc..28d361e1ec9 100644 --- a/web-client/src/presenter/computeds/trialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/trialSessionsHelper.ts @@ -121,8 +121,6 @@ export const trialSessionsHelper = ( trialSessions: trialSessionPage, }); - console.log('trialSessionRows', trialSessionRows); - return { endDateErrorMessage, isResetFiltersDisabled: !userHasSelectedAFilter, From 1436e16ab4a2e98b4dac5c2b11e8cfe306332b03 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 29 Oct 2024 08:19:59 -0600 Subject: [PATCH 38/79] 10460: Disable links to session details until 10461 is complete; --- .../TrialsSessions/PublicMobileTrialSessionsDataRow.tsx | 9 +++++---- .../Public/TrialsSessions/PublicTrialSessionsTable.tsx | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx index 07d60f4fcd8..40060997e6d 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicMobileTrialSessionsDataRow.tsx @@ -15,7 +15,7 @@ export const PublicMobileTrialSessionsDataRow = function ({ sessionType, startDate, trialLocation, - trialSessionId, + // trialSessionId, }: PublicMobileTrialSessionsDataRowProps) { return ( <> @@ -33,9 +33,10 @@ export const PublicMobileTrialSessionsDataRow = function ({
Location
- - {trialLocation} - + {/* TODO: ENABLE ONCE 10461 IS COMPLETE */} + {/* */} + {trialLocation} + {/* */}
Session Type
diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx index 09ab6782a44..94761292697 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx @@ -85,15 +85,16 @@ export const PublicTrialSessionsTable = connect< )} - - {row.trialLocation} - + > */} + {row.trialLocation} + {/* */} {row.proceedingType} {row.sessionType} From 22842f4e1582b779749cdbffcef9931aceaf1098 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 29 Oct 2024 08:58:18 -0600 Subject: [PATCH 39/79] 10363: Remove ternary; --- .../TrialsSessions/PublicTrialSessionsTable.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx index 94761292697..3c0029b0cbc 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx @@ -86,15 +86,9 @@ export const PublicTrialSessionsTable = connect< {/* TODO: ENABLE ONCE 10461 IS COMPLETE */} - {/* */} - {row.trialLocation} - {/* */} + {/* + {row.trialLocation} + */} {row.proceedingType} {row.sessionType} From 542f1089fd56439ff90a854bc120512cfb08730c Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Tue, 29 Oct 2024 12:16:43 -0400 Subject: [PATCH 40/79] 10460: add tests around getPublicTrialSessionsInteractor; --- .../getPublicTrialSessionsInteractor.test.ts | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 web-api/src/business/useCases/trialSessions/getPublicTrialSessionsInteractor.test.ts diff --git a/web-api/src/business/useCases/trialSessions/getPublicTrialSessionsInteractor.test.ts b/web-api/src/business/useCases/trialSessions/getPublicTrialSessionsInteractor.test.ts new file mode 100644 index 00000000000..d8bab02cb18 --- /dev/null +++ b/web-api/src/business/useCases/trialSessions/getPublicTrialSessionsInteractor.test.ts @@ -0,0 +1,79 @@ +import { applicationContext } from '../../../../../shared/src/business/test/createTestApplicationContext'; +import { getPublicTrialSessionsInteractor } from '@web-api/business/useCases/trialSessions/getPublicTrialSessionsInteractor'; + +describe('getPublicTrialSessionsInteractor', () => { + beforeEach(() => { + applicationContext + .getPersistenceGateway() + .getTrialSessions.mockReturnValue(MOCK_TRIAL_SESSIONS); + }); + + it('should return open trial sessions', async () => { + const result = await getPublicTrialSessionsInteractor(applicationContext); + expect(result.every(session => session.sessionStatus === 'Open')).toBe( + true, + ); + }); +}); + +const MOCK_TRIAL_SESSIONS = [ + { + caseOrder: [], + createdAt: '2019-11-02T05:00:00.000Z', + gsi1pk: 'trial-session-catalog', + isCalendared: true, + judge: { name: 'Cohen', userId: 'dabbad04-18d0-43ec-bafb-654e83405416' }, + maxCases: 30, + pk: 'trial-session|0d943468-bc2e-4631-84e3-b084cf5b1fbb', + proceedingType: 'In Person', + sessionStatus: 'Open', + sessionType: 'Special', + sk: 'trial-session|0d943468-bc2e-4631-84e3-b084cf5b1fbb', + startDate: '2019-12-02T05:00:00.000Z', + startTime: '21:00', + status: 'Closed', + term: 'Fall', + termYear: '2019', + trialLocation: 'Denver, Colorado', + trialSessionId: '0d943468-bc2e-4631-84e3-b084cf5b1fbb', + }, + { + caseOrder: [], + createdAt: '2020-10-25T05:00:00.000Z', + gsi1pk: 'trial-session-catalog', + isCalendared: true, + judge: { name: 'Colvin', userId: 'dabbad00-18d0-43ec-bafb-654e83405416' }, + maxCases: 100, + pk: 'trial-session|111ac21b-99f9-4321-98c8-b95db00af96b', + proceedingType: 'Remote', + sessionScope: 'Standalone Remote', + sessionStatus: 'Open', + sessionType: 'Special', + sk: 'trial-session|111ac21b-99f9-4321-98c8-b95db00af96b', + startDate: '2020-11-25T05:00:00.000Z', + startTime: '13:00', + term: 'Fall', + termYear: '2020', + trialLocation: 'Standalone Remote', + trialSessionId: '111ac21b-99f9-4321-98c8-b95db00af96b', + }, + { + caseOrder: [], + createdAt: '2020-10-02T05:00:00.000Z', + gsi1pk: 'trial-session-catalog', + isCalendared: false, + judge: { name: 'Cohen', userId: 'dabbad04-18d0-43ec-bafb-654e83405416' }, + maxCases: 8, + pk: 'trial-session|149159ca-f4a1-4b2b-bc24-bd1fbe6defdc', + proceedingType: 'In Person', + sessionStatus: 'New', + sessionType: 'Regular', + sk: 'trial-session|149159ca-f4a1-4b2b-bc24-bd1fbe6defdc', + startDate: '2020-12-02T05:00:00.000Z', + startTime: '09:00', + term: 'Fall', + termYear: '2020', + trialLocation: 'Birmingham, Alabama', + trialSessionId: '149159ca-f4a1-4b2b-bc24-bd1fbe6defdc', + }, +]; From 456f6605ee57e061dc8f6792138b0f4e67e24ca3 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Tue, 29 Oct 2024 12:51:34 -0400 Subject: [PATCH 41/79] 10460: add tests around setTimeStampAction; --- .../TrialSession/setTimeStampAction.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 web-client/src/presenter/actions/TrialSession/setTimeStampAction.test.ts diff --git a/web-client/src/presenter/actions/TrialSession/setTimeStampAction.test.ts b/web-client/src/presenter/actions/TrialSession/setTimeStampAction.test.ts new file mode 100644 index 00000000000..101dbf86ec7 --- /dev/null +++ b/web-client/src/presenter/actions/TrialSession/setTimeStampAction.test.ts @@ -0,0 +1,14 @@ +import { DateTime } from 'luxon'; +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 expectedDate = DateTime.now().setZone('America/New_York').toISODate(); + + expect(result.state[propertyName].toISODate()).toEqual(expectedDate); + }); +}); From cc613233b284d3de69ae1cb8bc9eca3a37776315 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Tue, 29 Oct 2024 12:57:14 -0400 Subject: [PATCH 42/79] 10460: add tests around resetPublicTrialSessionDataAction; --- .../resetPublicTrialSessionDataAction.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts diff --git a/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts b/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts new file mode 100644 index 00000000000..12a39a1cf98 --- /dev/null +++ b/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts @@ -0,0 +1,14 @@ +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({}); + }); +}); From 3330a82956cd4c198821a4b7cd41cf92117e7299 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 29 Oct 2024 11:07:51 -0600 Subject: [PATCH 43/79] 10363: display location; --- .../Public/TrialsSessions/PublicTrialSessionsTable.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx index 3c0029b0cbc..ce1aa4d2f4e 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessionsTable.tsx @@ -86,9 +86,9 @@ export const PublicTrialSessionsTable = connect< {/* TODO: ENABLE ONCE 10461 IS COMPLETE */} - {/* - {row.trialLocation} - */} + {/* */} + {row.trialLocation} + {/* */} {row.proceedingType} {row.sessionType} From 3e8c87432b3733434d34f307a45c09ba1e093d90 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 29 Oct 2024 11:23:39 -0600 Subject: [PATCH 44/79] 10460: Fix typing in unit test; --- .../resetPublicTrialSessionDataAction.test.ts | 12 ++++++++---- web-client/src/presenter/test.cerebral.ts | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts b/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts index 12a39a1cf98..43d00566f31 100644 --- a/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts +++ b/web-client/src/presenter/actions/resetPublicTrialSessionDataAction.test.ts @@ -1,13 +1,17 @@ +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 }, + const result = await runAction( + resetPublicTrialSessionDataAction, + { + state: { + publicTrialSessionData: { id: 123 }, + }, }, - }); + ); expect(result.state.publicTrialSessionData).toEqual({}); }); diff --git a/web-client/src/presenter/test.cerebral.ts b/web-client/src/presenter/test.cerebral.ts index 467360e2828..77f54f79436 100644 --- a/web-client/src/presenter/test.cerebral.ts +++ b/web-client/src/presenter/test.cerebral.ts @@ -10,8 +10,9 @@ type FakeRunComputeType = ( ) => T; export const runCompute = cerebralRunCompute as unknown as FakeRunComputeType; -type FakeRunActionType = ( +type FakeRunActionType = ( action: (actionProps: any) => Promise | T, fixtures: { modules?: { presenter: any }; props?: any; state?: any }, -) => { state: ClientState; props: any; output: T }; +) => { state: U; props: any; output: T }; + export const runAction = cerebralRunAction as unknown as FakeRunActionType; From e116f11d64a4057c45e76c63c3ee5ac796604efd Mon Sep 17 00:00:00 2001 From: John Cruz Date: Tue, 29 Oct 2024 11:34:07 -0600 Subject: [PATCH 45/79] 10460: WIP add cypress test; --- .../integration/public/trial-sessions.cy.ts | 18 ++++++++++++++++++ .../TrialsSessions/PublicTrialSessions.tsx | 2 ++ .../PublicTrialSessionsFilters.tsx | 17 +++++++++++++---- ...ublicTrialSessionsRemoteProceedingsCard.tsx | 2 +- 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 cypress/readonly/integration/public/trial-sessions.cy.ts diff --git a/cypress/readonly/integration/public/trial-sessions.cy.ts b/cypress/readonly/integration/public/trial-sessions.cy.ts new file mode 100644 index 00000000000..f7390b2c34c --- /dev/null +++ b/cypress/readonly/integration/public/trial-sessions.cy.ts @@ -0,0 +1,18 @@ +describe('Public Trial Sessions', () => { + it('should display table information correctly', () => { + cy.visit('/trial-sessions'); + cy.get('[data-testid="proceeding-type-filter"]').should('be.visible'); + cy.get('[data-testid="session-type-filter"]').should('be.visible'); + cy.get('[data-testid="location-filter"]').should('be.visible'); + cy.get('[data-testid="judge-filter"]').should('be.visible'); + + cy.get('[data-testid="remote-proceedings-card"]').should('be.visible'); + cy.get('[data-testid="remote-proceedings-card"]') + .find('a') + .should('have.length', 2); + + cy.get('[data-testid="trial-sessions-reset-filters-button"]').should( + 'be.disabled', + ); + }); +}); diff --git a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx index c334a3d3482..be84a2eadb0 100644 --- a/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx +++ b/web-client/src/views/Public/TrialsSessions/PublicTrialSessions.tsx @@ -107,6 +107,7 @@ function NonMobilePublicTrialsSessions({