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

9788: Add Icons to Printable Version of Trial Session Information Screen #4011

Merged
merged 22 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dc29e74
9788: WIP reduce margins to match working copy printable
rachelschneiderman Sep 25, 2023
db904ca
9788: WIP display consolidated icons
rachelschneiderman Sep 26, 2023
e6c226a
9788 - WIP - corrected data for populating formatted trial session wi…
Absolutestunna Sep 26, 2023
9d281b3
9788: Vertical align consolidated case icon
rachelschneiderman Sep 26, 2023
732d2b9
9788 - corrected styling for cases for trial session pdf generation
rachelschneiderman Sep 26, 2023
c6ae527
9788: Remove console log
rachelschneiderman Sep 26, 2023
4f34a4b
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into 9…
rachelschneiderman Sep 27, 2023
673038e
9788: Member consolidated cases are indented
rachelschneiderman Sep 27, 2023
96270cd
9788: Cleanup duplicated styles
rachelschneiderman Sep 27, 2023
91a095b
9788: Dry up html generator styles, add new file for grouping styling…
rachelschneiderman Sep 27, 2023
b097563
Merge branch '9788-consolidation-icon-printable-trial-session-copy' i…
rachelschneiderman Sep 27, 2023
28d4055
9788: Add new visual pdf test for when session notes is undefined, ad…
rachelschneiderman Sep 27, 2023
5dfbd15
9788: WIP updating visual testing
rachelschneiderman Sep 27, 2023
80de562
9778: Updating visual tests
rachelschneiderman Sep 27, 2023
798ff2c
Merge branch 'test' of https://github.com/ustaxcourt/ef-cms into 9788…
rachelschneiderman Sep 27, 2023
81e23cd
Merge branch '9788-consolidation-icon-printable-trial-session-copy' i…
rachelschneiderman Sep 27, 2023
c26a422
9788 - adding types
Absolutestunna Sep 27, 2023
d90253e
Merge branch '9788-consolidation-icon-printable-trial-session-copy' o…
Absolutestunna Sep 27, 2023
ddbe0ea
Merge branch '9788-consolidation-icon-printable-trial-session-copy' i…
Absolutestunna Sep 27, 2023
10c17f7
9788: Make styles more specific to fix failing visual tests
rachelschneiderman Sep 27, 2023
9afe78e
9788 - corrected font-size
rachelschneiderman Sep 27, 2023
4470e92
Merge branch '9788-consolidation-icon-printable-trial-session-copy' i…
rachelschneiderman Sep 27, 2023
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
14 changes: 4 additions & 10 deletions shared/src/business/useCaseHelper/saveFileAndGenerateUrl.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/**
*
* Save provided file to temp s3 bucket and return file url
*
* @param {object} providers the providers object
* @param {object} providers.applicationContext the application context
* @param {string} providers.file the file to save
* @returns {string} the url to the file
*/
export const saveFileAndGenerateUrl = async ({
applicationContext,
file,
Expand All @@ -18,7 +9,10 @@ export const saveFileAndGenerateUrl = async ({
useTempBucket?: boolean;
// time to live of link in seconds
URLTTL?: number;
}) => {
}): Promise<{
fileId: string;
url: string;
}> => {
const fileId = applicationContext.getUniqueId();

await applicationContext.getPersistenceGateway().saveDocumentFromLambda({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,35 @@
import { compareCasesByDocketNumber } from '../../utilities/getFormattedTrialSessionDetails';
import { saveFileAndGenerateUrl } from '../../useCaseHelper/saveFileAndGenerateUrl';

/**
* generateTrialCalendarPdfInteractor
*
* @param {object} applicationContext the application context
* @param {object} providers the providers object
* @param {string} providers.trialSessionId the id for the trial session
* @returns {string} trial session calendar pdf url
*/
export const generateTrialCalendarPdfInteractor = async (
applicationContext: IApplicationContext,
{ trialSessionId }: { trialSessionId: string },
) => {
): Promise<{ fileId: string; url: string }> => {
const trialSession = await applicationContext
.getPersistenceGateway()
.getTrialSessionById({
applicationContext,
trialSessionId,
});

const formattedTrialSession = applicationContext
.getUtilities()
.getFormattedTrialSessionDetails({
applicationContext,
trialSession,
});

const calendaredCases = await applicationContext
.getPersistenceGateway()
.getCalendaredCasesForTrialSession({
applicationContext,
trialSessionId,
});

const formattedOpenCases = formatCases({
applicationContext,
calendaredCases,
});
const formattedTrialSession = applicationContext
.getUtilities()
.getFormattedTrialSessionDetails({
applicationContext,
trialSession: {
...trialSession,
calendaredCases,
},
});

const formattedOpenCases = formattedTrialSession.openCases;

formattedTrialSession.caseOrder.forEach(aCase => {
if (aCase.calendarNotes) {
Expand Down
179 changes: 179 additions & 0 deletions shared/src/business/utilities/documentGenerators/trialCalendar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,150 @@ describe('trialCalendar', () => {
caseTitle: 'Paul Simon',
docketNumber: '123-45S',
docketNumberWithSuffix: '123-45S',
inConsolidatedGroup: false,
petitionerCounsel: ['Ben Matlock', 'Atticus Finch'],
respondentCounsel: ['Sonny Crockett', 'Ricardo Tubbs'],
},
{
caseTitle: 'Art Garfunkel',
docketNumber: '234-56',
docketNumberWithSuffix: '234-56',
inConsolidatedGroup: true,
isLeadCase: true,
leadDocketNumber: '234-56',
petitionerCounsel: ['Mick Haller'],
respondentCounsel: ['Joy Falotico'],
},
{
calendarNotes:
'When you`re down and troubled, And you need a helping hand.',
caseTitle: 'Lyle Lovett',
docketNumber: '235-56',
docketNumberWithSuffix: '235-56',
inConsolidatedGroup: true,
isLeadCase: false,
leadDocketNumber: '234-56',
petitionerCounsel: ['Alicia Keys', 'James Taylor'],
respondentCounsel: ['Stevie Nicks'],
},
{
caseTitle: 'Bob Marley',
docketNumber: '236-56',
docketNumberWithSuffix: '236-56',
inConsolidatedGroup: true,
isLeadCase: false,
leadDocketNumber: '234-56',
petitionerCounsel: undefined,
respondentCounsel: ['Billy Joel'],
},
{
calendarNotes:
'Tumble out of bed and I stumble to the kitchen, Pour myself a cup of ambition, And yawn and stretch and try to come to life',
caseTitle: 'Carlos Santana',
docketNumber: '103-22',
docketNumberWithSuffix: '103-22L',
inConsolidatedGroup: false,
petitionerCounsel: ['Bruce Springsteen', 'Dolly Parton'],
respondentCounsel: undefined,
},
{
caseTitle: 'Aretha Franklin',
docketNumber: '110-23',
docketNumberWithSuffix: '110-23',
inConsolidatedGroup: false,
petitionerCounsel: undefined,
respondentCounsel: undefined,
},
],
sessionDetail: {
address1: '123 Some Street',
address2: 'Suite B',
courtReporter:
'Lois Lane\n louise.lesley.lane@super_long_email_should_wrap.gov\n Phone: (123) 456-7890',
courthouseName: 'Test Courthouse',
formattedCityStateZip: 'New York, NY 10108',
irsCalendarAdministrator:
'Alexandria Ocasio-Cortez\n alexandria.ocasio.cortez@this_email_should_wrap_too.gov \n Phone: (098) 765-4321',
judge: 'Joseph Dredd',
notes:
'The one with the velour shirt is definitely looking at me funny.',
sessionType: 'Hybrid',
startDate: 'May 1, 2020',
startTime: '10:00am',
trialClerk: 'Clerky McGee',
trialLocation: 'New York City, New York',
},
},
}),
testDescription: 'generates a Trial Calendar document',
});

generateAndVerifyPdfDiff({
fileName: 'Trial_Calendar.pdf',
pageNumber: 2,
pdfGenerateFunction: () =>
trialCalendar({
applicationContext,
data: {
cases: [
{
caseTitle: 'Paul Simon',
docketNumber: '123-45S',
docketNumberWithSuffix: '123-45S',
inConsolidatedGroup: false,
petitionerCounsel: ['Ben Matlock', 'Atticus Finch'],
respondentCounsel: ['Sonny Crockett', 'Ricardo Tubbs'],
},
{
caseTitle: 'Art Garfunkel',
docketNumber: '234-56',
docketNumberWithSuffix: '234-56',
inConsolidatedGroup: true,
isLeadCase: true,
leadDocketNumber: '234-56',
petitionerCounsel: ['Mick Haller'],
respondentCounsel: ['Joy Falotico'],
},
{
calendarNotes:
'When you`re down and troubled, And you need a helping hand.',
caseTitle: 'Lyle Lovett',
docketNumber: '235-56',
docketNumberWithSuffix: '235-56',
inConsolidatedGroup: true,
isLeadCase: false,
leadDocketNumber: '234-56',
petitionerCounsel: ['Alicia Keys', 'James Taylor'],
respondentCounsel: ['Stevie Nicks'],
},
{
caseTitle: 'Bob Marley',
docketNumber: '236-56',
docketNumberWithSuffix: '236-56',
inConsolidatedGroup: true,
isLeadCase: false,
leadDocketNumber: '234-56',
petitionerCounsel: undefined,
respondentCounsel: ['Billy Joel'],
},
{
calendarNotes:
'Tumble out of bed and I stumble to the kitchen, Pour myself a cup of ambition, And yawn and stretch and try to come to life',
caseTitle: 'Carlos Santana',
docketNumber: '103-22',
docketNumberWithSuffix: '103-22L',
inConsolidatedGroup: false,
petitionerCounsel: ['Bruce Springsteen', 'Dolly Parton'],
respondentCounsel: undefined,
},
{
caseTitle: 'Aretha Franklin',
docketNumber: '110-23',
docketNumberWithSuffix: '110-23',
inConsolidatedGroup: false,
petitionerCounsel: undefined,
respondentCounsel: undefined,
},
],
sessionDetail: {
address1: '123 Some Street',
Expand All @@ -48,4 +182,49 @@ describe('trialCalendar', () => {
}),
testDescription: 'generates a Trial Calendar document',
});

generateAndVerifyPdfDiff({
fileName: 'Trial_Calendar_No_Session_Notes.pdf',
pageNumber: 1,
pdfGenerateFunction: () =>
trialCalendar({
applicationContext,
data: {
cases: [
{
caseTitle: 'Paul Simon',
docketNumber: '123-45S',
docketNumberWithSuffix: '123-45S',
petitionerCounsel: ['Ben Matlock', 'Atticus Finch'],
respondentCounsel: ['Sonny Crockett', 'Ricardo Tubbs'],
},
{
caseTitle: 'Art Garfunkel',
docketNumber: '234-56',
docketNumberWithSuffix: '234-56',
petitionerCounsel: ['Mick Haller'],
respondentCounsel: ['Joy Falotico'],
},
],
sessionDetail: {
address1: '123 Some Street',
address2: 'Suite B',
courtReporter:
'Lois Lane\n louise.lesley.lane@super_long_email_should_wrap.gov\n Phone: (123) 456-7890',
courthouseName: 'Test Courthouse',
formattedCityStateZip: 'New York, NY 10108',
irsCalendarAdministrator:
'Alexandria Ocasio-Cortez\n alexandria.ocasio.cortez@this_email_should_wrap_too.gov \n Phone: (098) 765-4321',
judge: 'Joseph Dredd',
notes: undefined,
sessionType: 'Hybrid',
startDate: 'May 1, 2020',
startTime: '10:00am',
trialClerk: 'Clerky McGee',
trialLocation: 'New York City, New York',
},
},
}),
testDescription: 'generates a Trial Calendar document',
});
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { generateHTMLTemplateForPDF } from '../generateHTMLTemplateForPDF/generateHTMLTemplateForPDF';
import { reactTemplateGenerator } from '../generateHTMLTemplateForPDF/reactTemplateGenerator';

export const trialCalendar = async ({ applicationContext, data }) => {
export const trialCalendar = async ({
applicationContext,
data,
}): Promise<Buffer> => {
const { cases, sessionDetail } = data;

const trialCalendarTemplate = reactTemplateGenerator({
Expand Down
19 changes: 19 additions & 0 deletions shared/src/business/utilities/htmlGenerator/cards.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.card {
border: 1px solid #ccc;
margin: 12px 0 12px 0;
font-size: 13px;
}

.card-header {
padding: 10px;
border-bottom: 1px solid #ccc;
background: #f0f0f0;
font-size: 13px;
font-weight: bold;
}

.card-content {
display: flex;
align-items: flex-start;
padding: 10px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
.card {
border: 1px solid #ccc;
margin: 12px 0 12px 0;
font-size: 14px;
}

.internal-card-content {
display: flex;
align-items: flex-start;
padding: 10px;
font-size: 16px;
}

.card-header {
Expand Down
Loading
Loading