Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10460 story #5542

Merged
merged 88 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
f64642c
10460: Created helper for public trial sessions;
Oct 22, 2024
45342be
10460: Register helper for public trial sessions;
Oct 22, 2024
27a8b78
10460: Create TSX files for Public Trial Session;
Oct 22, 2024
531644d
10460: Create component for Remote Proceedings Card;
Oct 22, 2024
ee0f269
10460: Text align left for Card;
Oct 22, 2024
a984b7a
10460: Increase padding;
Oct 23, 2024
2380949
10460: Added more properties to the helper;
Oct 23, 2024
a44fe2b
10460: Create component for trial sessions filters;
Oct 23, 2024
c3c234b
10460: Update default public state;
Oct 23, 2024
9792272
10460: Fix ids;
Oct 23, 2024
91077f9
10460: Added property to helper;
Oct 23, 2024
24ddfcc
10460: WIP setup API endpoints for Public Trials Sessions; WIP UI;
Oct 24, 2024
2b002d6
10460: Moved components to own folder;
Oct 24, 2024
c976c22
10460: Display trial sessions in table;
Oct 24, 2024
3967696
10460: Added test around filtering;
Oct 24, 2024
74046a7
10460: Added Reset Filters button;
Oct 24, 2024
6fb7d0c
10460: Fix links;
Oct 24, 2024
c7ee41e
10460: Fix Icons and delete console.log;
Oct 24, 2024
41bc24e
10460: Fix Link Icon;
Oct 25, 2024
191dc5e
10460: Create sequence to display progress spinner;
Oct 25, 2024
cf4e537
10460: Fix typing on sequence;
Oct 25, 2024
b07cb79
10460: Type state for public trial session;
Oct 25, 2024
35d36cd
10460: Implement pagination in the trial session helper;
Oct 25, 2024
b7ec0cc
10460: Pass root value from parent component; Reset page number any t…
Oct 25, 2024
fe3511d
10460: Center paginator;
Oct 25, 2024
932afcb
10460: Separate into NonMobile and Mobile;
Oct 25, 2024
755f321
10363: Split between mobile and non mobile;
Oct 25, 2024
4e98541
10460: implement mobile table view;
Oct 28, 2024
fe73457
10460: extract paginator;
Oct 28, 2024
7a55a1b
10460: Fix font weight;
Oct 28, 2024
e41ed04
10460: Added bottom pagination for mobile and non mobile;
Oct 28, 2024
89f33fe
10460: Display filter pills outside filter section on mobile;
Oct 28, 2024
b5e2a24
10460: remove grey background on mobile filters;
Oct 28, 2024
a7036e3
10460: fix filter dropdown getting cut off within accordion;
Oct 28, 2024
b1788bb
10460: WIP implement double line separator;
Oct 28, 2024
4e3ee03
10460: separate sessions in the same week with a double line;
nechama-krigsman Oct 28, 2024
7bd2783
10460: remove log;
nechama-krigsman Oct 28, 2024
1436e16
10460: Disable links to session details until 10461 is complete;
Oct 29, 2024
22842f4
10363: Remove ternary;
Oct 29, 2024
542f108
10460: add tests around getPublicTrialSessionsInteractor;
nechama-krigsman Oct 29, 2024
456f660
10460: add tests around setTimeStampAction;
nechama-krigsman Oct 29, 2024
cc61323
10460: add tests around resetPublicTrialSessionDataAction;
nechama-krigsman Oct 29, 2024
3330a82
10363: display location;
Oct 29, 2024
3501e7d
Merge branch '10460-story' of github.com:flexion/ef-cms into 10460-story
Oct 29, 2024
3e8c874
10460: Fix typing in unit test;
Oct 29, 2024
e116f11
10460: WIP add cypress test;
Oct 29, 2024
fd19056
10460: Extended cypress tests;
Oct 30, 2024
edbac9f
10460: Added period to markup;
Oct 30, 2024
8e28d16
10460: Remove extra element;
Oct 30, 2024
4c5a475
10460: Do not display empty pagination since it increases padding in …
Oct 30, 2024
d6142b1
10460: Added more spacing between proceeding type options;
Oct 30, 2024
8f25eb6
10460: Fix select dropdown width on mobile;
Oct 30, 2024
341a17f
10460: display total results for table counter; update font style;
nechama-krigsman Oct 30, 2024
6f3dd5a
10460: update tooltip text for swing session;
nechama-krigsman Oct 30, 2024
77b3883
10460: Display spinner when user resets filters;
Oct 30, 2024
9c24aa0
10460: Fix paginator spacing;
Oct 30, 2024
dfbdfa1
Merge branch '10460-story' of https://github.com/flexion/ef-cms into …
nechama-krigsman Oct 31, 2024
19378f8
10460: fix dropdowns display when resizing screen;
nechama-krigsman Oct 31, 2024
83f1d49
10460: Fix spacing between the icons and locations on desktop view;
Oct 31, 2024
bfa25ee
Merge branch '10460-story' of github.com:flexion/ef-cms into 10460-story
Oct 31, 2024
c7aa02e
10460: Fix padding on remote links card;
Oct 31, 2024
a183156
10460: Reduce width of card seperator;
Oct 31, 2024
f5e6f53
10460: display icon for swing session on mobile;
nechama-krigsman Oct 31, 2024
c6a82b3
10460: display empty state message on mobile;
nechama-krigsman Oct 31, 2024
a4862d6
10460: Use Phone element instead of mobile;
Oct 31, 2024
aabe036
10460: adjust padding for filter dropdowns on mobile;;
nechama-krigsman Nov 1, 2024
22a4679
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into 1…
nechama-krigsman Nov 1, 2024
f28c20b
10460: adjust padding on mobile;
nechama-krigsman Nov 3, 2024
dcf1d5e
10460: add aria-labels to swing session column;
nechama-krigsman Nov 4, 2024
9b6eadb
10460: create a custom select element for public trial session page m…
nechama-krigsman Nov 4, 2024
8c72887
10460: fix test and types;
nechama-krigsman Nov 4, 2024
512a10a
10460: Fix typing and use correct value from params;
Nov 5, 2024
75748c8
10460: Move cypress test;
Nov 5, 2024
5a90978
10460: Move cypress test;
Nov 5, 2024
381ae08
10460: create shared component for filter dropdowns; update cypress t…
nechama-krigsman Nov 5, 2024
a2f154c
Merge branch '10460-story' of https://github.com/flexion/ef-cms into …
nechama-krigsman Nov 5, 2024
7e16bf1
10460: Fix pills padding;
Nov 6, 2024
9574417
10460: Open links in same tab;
Nov 6, 2024
9ed5cab
10460: Always stack links on top of each other;
Nov 6, 2024
7171bb6
10460: Add label in mobile view;
Nov 6, 2024
dd6a4f7
10460: As the screen shrinks in width display proceeding links on top…
Nov 6, 2024
e7fd27c
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into 1…
nechama-krigsman Nov 8, 2024
43b8615
10460: Add trial session remote to options;
nechama-krigsman Nov 8, 2024
50ee122
10460: switch H1 to div for accessibility reasons from public header
nechama-krigsman Nov 8, 2024
975d673
10460: Fix cypress test selector for Public Header;
Nov 8, 2024
24c56b2
Merge branch 'staging' into 10460-story
jimlerza Nov 13, 2024
ffa0e93
Merge branch 'staging' into 10460-story
jimlerza Nov 15, 2024
6a54b31
Merge branch 'staging' into 10460-story
jimlerza Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/local-only/support/pages/public/advanced-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const searchForOrderByJudge = judge => {
};

export const publicHeader = () => {
return cy.get('h1.header-welcome-public');
return cy.get('div.header-welcome-public');
};

export const petitionHyperlink = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { selectTypeaheadInput } from '../../../../../helpers/components/typeAhead/select-typeahead-input';

describe('Public Trial Sessions', () => {
beforeEach(() => {
cy.visit('/trial-sessions');
});

it('should display table filters correctly', () => {
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',
);
});

it('should enable the reset filters button if there are any filters aplied', () => {
cy.get('[data-testid="trial-sessions-reset-filters-button"]').should(
'be.disabled',
);

cy.get('[data-testid="In Person-proceeding-label"]').click();

cy.get('[data-testid="trial-sessions-reset-filters-button"]').should(
'be.enabled',
);
});

it('should display Pill Button for every dropdown filter selected', () => {
const SESSION_TYPE = 'Regular';
selectTypeaheadInput('sessionTypes-filter-select', SESSION_TYPE);
cy.get(`[data-testid="sessionTypes-${SESSION_TYPE}-pill-button"]`);

const LOCATION = 'Mobile, Alabama';
selectTypeaheadInput('locations-filter-select', LOCATION);
cy.get(`[data-testid="locations-${LOCATION}-pill-button"]`);

const JUDGE = 'Buch';
selectTypeaheadInput('judges-filter-select', JUDGE);
cy.get(`[data-testid="judges-${JUDGE}-pill-button"]`);

cy.get(`[data-testid="sessionTypes-${SESSION_TYPE}-pill-button"]`)
.find('button')
.click();
cy.get(`[data-testid="sessionTypes-${SESSION_TYPE}-pill-button"]`).should(
'not.exist',
);

cy.get(`[data-testid="locations-${LOCATION}-pill-button"]`)
.find('button')
.click();
cy.get(`[data-testid="locations-${LOCATION}-pill-button"]`).should(
'not.exist',
);

cy.get(`[data-testid="judges-${JUDGE}-pill-button"]`)
.find('button')
.click();
cy.get(`[data-testid="judges-${JUDGE}-pill-button"]`).should('not.exist');
});
});
11 changes: 11 additions & 0 deletions shared/src/proxies/trialSessions/getPublicTrialSessionsProxy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { TrialSessionInfoDTO } from '@shared/business/dto/trialSessions/TrialSessionInfoDTO';
import { get } from '@shared/proxies/requests';

export const getPublicTrialSessionsInteractor = (
applicationContext,
): Promise<TrialSessionInfoDTO[]> => {
return get({
applicationContext,
endpoint: '/public-api/trial-sessions',
});
};
12 changes: 12 additions & 0 deletions shared/src/proxies/users/getPublicUsersInSectionProxy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { RawUser } from '@shared/business/entities/User';
import { get } from '../requests';

export const getPublicUsersInSectionInteractor = (
applicationContext,
{ section }: { section: string },
): Promise<RawUser[]> => {
return get({
applicationContext,
endpoint: `/public-api/sections/${section}/users`,
});
};
13 changes: 13 additions & 0 deletions web-api/src/app-public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ import { getPublicCaseExistsLambda } from './lambdas/public-api/getPublicCaseExi
import { getPublicCaseLambda } from './lambdas/public-api/getPublicCaseLambda';
import { getPublicDocumentDownloadUrlLambda } from './lambdas/public-api/getPublicDocumentDownloadUrlLambda';
import { getPublicJudgesLambda } from './lambdas/public-api/getPublicJudgesLambda';
import { getPublicTrialSessionsLambda } from '@web-api/lambdas/trialSessions/getPublicTrialSessionsLambda';
import { getUsersInSectionLambda } from '@web-api/lambdas/users/getUsersInSectionLambda';
import { ipLimiter } from './middleware/ipLimiter';
import { opinionPublicSearchLambda } from './lambdas/public-api/opinionPublicSearchLambda';
import { orderPublicSearchLambda } from './lambdas/public-api/orderPublicSearchLambda';
Expand Down Expand Up @@ -178,6 +180,17 @@ app.get('/public-api/judges', lambdaWrapper(getPublicJudgesLambda));
);
}

{
app.get(
'/public-api/trial-sessions',
lambdaWrapper(getPublicTrialSessionsLambda),
);
app.get(
'/public-api/sections/:section/users',
lambdaWrapper(getUsersInSectionLambda),
);
}

/**
* Feature flags
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
},
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ServerApplicationContext } from '@web-api/applicationContext';
import { TrialSession } from '@shared/business/entities/trialSessions/TrialSession';
import { TrialSessionInfoDTO } from '../../../../../shared/src/business/dto/trialSessions/TrialSessionInfoDTO';

export const getPublicTrialSessionsInteractor = async (
applicationContext: ServerApplicationContext,
): Promise<TrialSessionInfoDTO[]> => {
const trialSessions = await applicationContext
.getPersistenceGateway()
.getTrialSessions({
applicationContext,
});

return trialSessions
.map(t => new TrialSession(t).toRawObject())
.map(trialSession => new TrialSessionInfoDTO(trialSession))
.filter(trialSession => trialSession.sessionStatus === 'Open');
};
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const getUsersInSectionInteractor = async (
rolePermission = ROLE_PERMISSIONS.GET_USERS_IN_SECTION;
}

if (!isAuthorized(authorizedUser, rolePermission)) {
if (!!authorizedUser && !isAuthorized(authorizedUser, rolePermission)) {
throw new UnauthorizedError('Unauthorized');
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { genericHandler } from '@web-api/genericHandler';
import { getPublicTrialSessionsInteractor } from '@web-api/business/useCases/trialSessions/getPublicTrialSessionsInteractor';

export const getPublicTrialSessionsLambda = event =>
genericHandler(event, async ({ applicationContext }) => {
return await getPublicTrialSessionsInteractor(applicationContext);
});
4 changes: 4 additions & 0 deletions web-client/src/appPublic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ 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';
Expand Down Expand Up @@ -66,6 +68,8 @@ const appPublic = {
faFileAltSolid,
faLock,
faLongArrowAltUp,
faLink,
faTimes,
faPrint,
faFilePdf,
faSearch,
Expand Down
4 changes: 4 additions & 0 deletions web-client/src/applicationContextPublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ import { getPublicCaseInteractor } from '../../shared/src/proxies/getPublicCaseP
import { getPublicJudgesInteractor } from '../../shared/src/proxies/public/getPublicJudgesProxy';
import { getPublicPractitionerByBarNumberInteractor } from '@shared/proxies/public/getPublicPractitionerByBarNumberProxy';
import { getPublicPractitionersByNameInteractor } from '@shared/proxies/public/getPublicPractitionersByNameProxy';
import { getPublicTrialSessionsInteractor } from '@shared/proxies/trialSessions/getPublicTrialSessionsProxy';
import { getPublicUsersInSectionInteractor } from '@shared/proxies/users/getPublicUsersInSectionProxy';
import { getSealedDocketEntryTooltip } from '../../shared/src/business/utilities/getSealedDocketEntryTooltip';
import { getTodaysOpinionsInteractor } from '../../shared/src/proxies/public/getTodaysOpinionsProxy';
import { getTodaysOrdersInteractor } from '../../shared/src/proxies/public/getTodaysOrdersProxy';
Expand Down Expand Up @@ -115,6 +117,8 @@ const allUseCases = {
getPublicJudgesInteractor,
getTodaysOpinionsInteractor,
getTodaysOrdersInteractor,
getTrialSessionsInteractor: getPublicTrialSessionsInteractor,
getUsersInSectionInteractor: getPublicUsersInSectionInteractor,
opinionPublicSearchInteractor,
orderPublicSearchInteractor,
removeItemInteractor,
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
cruzjone-flexion marked this conversation as resolved.
Show resolved Hide resolved

expect(result.state[propertyName].toISODate()).toEqual(expectedDate);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { DateTime } from 'luxon';
import { state } from '@web-client/presenter/app.cerebral';

export const setTimeStampAction =
({ propertyName }: { propertyName: string }) =>
({ store }: ActionProps) => {
store.set(state[propertyName], DateTime.now().setZone('America/New_York'));
cruzjone-flexion marked this conversation as resolved.
Show resolved Hide resolved
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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<void, PublicClientState>(
resetPublicTrialSessionDataAction,
{
state: {
publicTrialSessionData: { id: 123 },
},
},
);

expect(result.state.publicTrialSessionData).toEqual({});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { state } from '@web-client/presenter/app-public.cerebral';

export const resetPublicTrialSessionDataAction = ({ store }: ActionProps) => {
store.set(state.publicTrialSessionData, {});
};
Loading
Loading