Skip to content

Commit

Permalink
Merge branch 'staging' into 10556-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jimlerza authored Nov 22, 2024
2 parents f9231c3 + 65f0d37 commit 5908c5f
Show file tree
Hide file tree
Showing 66 changed files with 1,358 additions and 923 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
orbs:
git-shallow-clone: guitarrapc/git-shallow-clone@2.8.0

efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.17
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.18

parameters:
run_build_and_deploy:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN apt-get install -y build-essential
RUN apt-get install -y libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.19.2.zip" -o "awscliv2.zip" && \
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.21.0.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('File a petition: Step 1 - Petitioner Information', () => {
cy.get('[data-testid="filing-type-0"]').click();
cy.get('[data-testid="contact-primary-name-label"]').should(
'have.text',
'Full Name',
'Full name',
);
});

Expand Down
1,221 changes: 605 additions & 616 deletions package-lock.json

Large diffs are not rendered by default.

84 changes: 42 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,46 @@
"dependencies": {
"@18f/us-federal-holidays": "4.0.0",
"@aws-crypto/sha256-browser": "5.2.0",
"@aws-sdk/client-api-gateway": "3.686.0",
"@aws-sdk/client-apigatewaymanagementapi": "3.686.0",
"@aws-sdk/client-apigatewayv2": "3.686.0",
"@aws-sdk/client-batch": "3.686.0",
"@aws-sdk/client-cloudfront": "3.686.0",
"@aws-sdk/client-cloudwatch": "3.686.0",
"@aws-sdk/client-cloudwatch-logs": "3.686.0",
"@aws-sdk/client-cognito-identity-provider": "3.686.0",
"@aws-sdk/client-dynamodb": "3.686.0",
"@aws-sdk/client-dynamodb-streams": "3.686.0",
"@aws-sdk/client-glue": "3.686.0",
"@aws-sdk/client-lambda": "3.686.0",
"@aws-sdk/client-opensearch": "3.686.0",
"@aws-sdk/client-route-53": "3.686.0",
"@aws-sdk/client-s3": "3.686.0",
"@aws-sdk/client-ses": "3.686.0",
"@aws-sdk/client-sns": "3.686.0",
"@aws-sdk/client-sqs": "3.686.0",
"@aws-sdk/client-ssm": "3.686.0",
"@aws-sdk/credential-provider-node": "3.686.0",
"@aws-sdk/lib-dynamodb": "3.686.0",
"@aws-sdk/lib-storage": "3.686.0",
"@aws-sdk/client-api-gateway": "3.687.0",
"@aws-sdk/client-apigatewaymanagementapi": "3.687.0",
"@aws-sdk/client-apigatewayv2": "3.687.0",
"@aws-sdk/client-batch": "3.688.0",
"@aws-sdk/client-cloudfront": "3.690.0",
"@aws-sdk/client-cloudwatch": "3.687.0",
"@aws-sdk/client-cloudwatch-logs": "3.687.0",
"@aws-sdk/client-cognito-identity-provider": "3.687.0",
"@aws-sdk/client-dynamodb": "3.687.0",
"@aws-sdk/client-dynamodb-streams": "3.687.0",
"@aws-sdk/client-glue": "3.687.0",
"@aws-sdk/client-lambda": "3.689.0",
"@aws-sdk/client-opensearch": "3.689.0",
"@aws-sdk/client-route-53": "3.687.0",
"@aws-sdk/client-s3": "3.689.0",
"@aws-sdk/client-ses": "3.687.0",
"@aws-sdk/client-sns": "3.687.0",
"@aws-sdk/client-sqs": "3.689.0",
"@aws-sdk/client-ssm": "3.687.0",
"@aws-sdk/credential-provider-node": "3.687.0",
"@aws-sdk/lib-dynamodb": "3.689.0",
"@aws-sdk/lib-storage": "3.689.0",
"@aws-sdk/node-http-handler": "3.374.0",
"@aws-sdk/protocol-http": "3.374.0",
"@aws-sdk/rds-signer": "3.686.0",
"@aws-sdk/s3-presigned-post": "3.686.0",
"@aws-sdk/s3-request-presigner": "3.686.0",
"@aws-sdk/rds-signer": "3.687.0",
"@aws-sdk/s3-presigned-post": "3.689.0",
"@aws-sdk/s3-request-presigner": "3.689.0",
"@aws-sdk/signature-v4": "3.374.0",
"@aws-sdk/util-dynamodb": "3.686.0",
"@aws-sdk/util-dynamodb": "3.689.0",
"@cerebral/react": "4.2.1",
"@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-regular-svg-icons": "5.15.4",
"@fortawesome/free-solid-svg-icons": "5.15.4",
"@fortawesome/react-fontawesome": "0.2.2",
"@joi/date": "2.1.1",
"@opensearch-project/opensearch": "2.12.0",
"@opensearch-project/opensearch": "2.13.0",
"@sparticuz/chromium": "127.0.0",
"@uswds/uswds": "3.7.1",
"aws-lambda": "1.0.7",
"aws-xray-sdk": "3.10.1",
"aws-xray-sdk": "3.10.2",
"axios": "1.7.7",
"broadcast-channel": "7.0.0",
"canvas": "2.11.2",
Expand All @@ -75,7 +75,7 @@
"jwk-to-pem": "2.0.6",
"kysely": "0.27.4",
"lodash": "4.17.21",
"logform": "2.6.1",
"logform": "2.7.0",
"luxon": "3.5.0",
"moize": "6.1.6",
"npm-run-all": "4.1.5",
Expand All @@ -94,17 +94,17 @@
"react-number-format": "5.4.2",
"react-quill": "2.0.0",
"react-responsive": "10.0.0",
"react-select": "5.8.2",
"react-select": "5.8.3",
"riot-route": "3.1.4",
"sanitize-filename": "1.6.3",
"servor": "4.0.2",
"supports-color": "9.4.0",
"tmp": "0.2.3",
"util": "0.12.5",
"uuid": "11.0.2",
"uuid": "11.0.3",
"websocket": "1.0.35",
"wicg-inert": "3.1.3",
"winston": "3.16.0"
"winston": "3.17.0"
},
"scripts": {
"admin:become-user": "npx ts-node --transpile-only scripts/user/become-user.ts",
Expand Down Expand Up @@ -253,10 +253,10 @@
"ejs": "3.1.10"
},
"devDependencies": {
"@aws-sdk/client-iam": "3.686.0",
"@aws-sdk/client-rds": "3.686.0",
"@aws-sdk/client-secrets-manager": "3.686.0",
"@aws-sdk/client-sts": "3.686.0",
"@aws-sdk/client-iam": "3.687.0",
"@aws-sdk/client-rds": "3.690.0",
"@aws-sdk/client-secrets-manager": "3.687.0",
"@aws-sdk/client-sts": "3.687.0",
"@babel/cli": "7.25.9",
"@babel/core": "7.26.0",
"@babel/eslint-parser": "7.25.9",
Expand All @@ -277,8 +277,8 @@
"@types/react": "18.3.12",
"@types/uuid": "10.0.0",
"@types/websocket": "1.0.10",
"@typescript-eslint/eslint-plugin": "8.13.0",
"@typescript-eslint/parser": "8.13.0",
"@typescript-eslint/eslint-plugin": "8.14.0",
"@typescript-eslint/parser": "8.14.0",
"@vendia/serverless-express": "4.12.6",
"autoprefixer": "10.4.20",
"aws-sdk-client-mock": "4.1.0",
Expand All @@ -292,7 +292,7 @@
"cypress-axe": "1.5.0",
"cypress-file-upload": "5.0.8",
"decimal.js": "10.4.3",
"dynamodb-admin": "4.6.1",
"dynamodb-admin": "4.6.2",
"dynamodb-streams-readable": "3.0.0",
"esbuild": "0.24.0",
"esbuild-css-modules-plugin": "3.1.2",
Expand Down Expand Up @@ -331,14 +331,14 @@
"pdf2pic": "3.1.3",
"pixelmatch": "6.0.0",
"pngjs": "7.0.0",
"postcss": "8.4.47",
"postcss-preset-env": "10.0.9",
"postcss": "8.4.49",
"postcss-preset-env": "10.1.0",
"prettier": "3.3.3",
"puppeteer": "23.0.0",
"puppeteer-core": "23.0.0",
"readline": "1.3.0",
"s3rver": "github:20minutes/s3rver",
"sass": "1.80.6",
"sass": "1.80.7",
"sass-loader": "16.0.3",
"shuffle-seed": "1.1.6",
"stream-browserify": "3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion shared/admin-tools/glue/glue_migrations/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}

required_providers {
aws = "5.74.0"
aws = "5.75.1"
}
}

Expand Down
2 changes: 1 addition & 1 deletion shared/admin-tools/glue/remote_role/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}

required_providers {
aws = "5.74.0"
aws = "5.75.1"
}
}

Expand Down
14 changes: 14 additions & 0 deletions shared/src/business/entities/trialSessions/SpecialTrialSessions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type SpecialTrialSession = {
userId: string;
trialSessionId: string;
};

export type SpecialTrialSessionKey = {
pk: string;
sk: string;
};

export type TrialSessionWorkingCopyNotes = {
sessionNotes: string;
trialSessionId: string;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
SpecialTrialSession,
TrialSessionWorkingCopyNotes,
} from '@shared/business/entities/trialSessions/SpecialTrialSessions';
import { post } from '../requests';

export const getBulkSpecialTrialSessionCopyNotesInteractor = (
applicationContext,
{
specialTrialSessions,
}: {
specialTrialSessions: Array<SpecialTrialSession>;
},
): Array<TrialSessionWorkingCopyNotes> =>
post({
applicationContext,
body: { specialTrialSessions },
endpoint: '/trial-sessions/bulk-copy-notes',
});
17 changes: 8 additions & 9 deletions web-api/runtimes/puppeteer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web-api/runtimes/puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@sparticuz/chromium": "127.0.0",
"pug": "3.0.3",
"puppeteer-core": "23.0.0",
"sass": "1.80.6"
"sass": "1.80.7"
},
"scripts": {},
"main": "index.js",
Expand Down
5 changes: 5 additions & 0 deletions web-api/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import { generateTrialCalendarPdfLambda } from './lambdas/trialSessions/generate
import { getAllFeatureFlagsLambda } from './lambdas/featureFlag/getAllFeatureFlagsLambda';
import { getAllUsersByRoleLambda } from '@web-api/lambdas/users/getAllUsersByRoleLambda';
import { getBlockedCasesLambda } from './lambdas/reports/getBlockedCasesLambda';
import { getBulkTrialSessionCopyNotesLambda } from './lambdas/trialSessions/getBulkTrialSessionCopyNotesLambda';
import { getCalendaredCasesForTrialSessionLambda } from './lambdas/trialSessions/getCalendaredCasesForTrialSessionLambda';
import { getCaseDeadlinesForCaseLambda } from './lambdas/caseDeadline/getCaseDeadlinesForCaseLambda';
import { getCaseDeadlinesLambda } from './lambdas/caseDeadline/getCaseDeadlinesLambda';
Expand Down Expand Up @@ -921,6 +922,10 @@ app.delete(
'/trial-sessions/:trialSessionId/working-copy',
lambdaWrapper(getTrialSessionWorkingCopyLambda),
);
app.post(
'/trial-sessions/bulk-copy-notes',
lambdaWrapper(getBulkTrialSessionCopyNotesLambda),
);
app.put(
'/trial-sessions/:trialSessionId/working-copy',
lambdaWrapper(updateTrialSessionWorkingCopyLambda),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { UnauthorizedError } from '@web-api/errors/errors';
import { applicationContext } from '../../../../../shared/src/business/test/createTestApplicationContext';
import { getBulkTrialSessionCopyNotesInteractor } from './getBulkTrialSessionCopyNotesInteractor';
import { mockAdminUser, mockJudgeUser } from '@shared/test/mockAuthUsers';

const MOCK_WORKING_COPY_NOTES = [
{
sessionNotes: 'Test notes',
trialSessionId: '123',
},
{
sessionNotes: 'Test notes 2',
trialSessionId: '456',
},
];
describe('getBulkTrialSessionCopyNotesInteractor', () => {
beforeEach(() => {
applicationContext
.getPersistenceGateway()
.getBulkTrialSessionWorkingCopyNotes.mockReturnValue(
MOCK_WORKING_COPY_NOTES,
);
});
it('should throw an error if the user is unauthorized', async () => {
await expect(
getBulkTrialSessionCopyNotesInteractor(
applicationContext,
{ specialTrialSessions: [] },
mockAdminUser,
),
).rejects.toThrow(UnauthorizedError);
});

it('should return session notes for multiple trial sessions', async () => {
const result = await getBulkTrialSessionCopyNotesInteractor(
applicationContext,
{
specialTrialSessions: [
{ trialSessionId: '123', userId: '123' },
{ trialSessionId: '456', userId: '456' },
],
},
mockJudgeUser,
);
expect(result).toEqual(MOCK_WORKING_COPY_NOTES);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {
ROLE_PERMISSIONS,
isAuthorized,
} from '../../../../../shared/src/authorization/authorizationClientService';
import { ServerApplicationContext } from '@web-api/applicationContext';
import {
SpecialTrialSession,
SpecialTrialSessionKey,
TrialSessionWorkingCopyNotes,
} from '@shared/business/entities/trialSessions/SpecialTrialSessions';
import { UnauthorizedError } from '@web-api/errors/errors';
import { UnknownAuthUser } from '@shared/business/entities/authUser/AuthUser';

export const getBulkTrialSessionCopyNotesInteractor = async (
applicationContext: ServerApplicationContext,
{ specialTrialSessions }: { specialTrialSessions: SpecialTrialSession[] },
authorizedUser: UnknownAuthUser,
): Promise<Array<TrialSessionWorkingCopyNotes>> => {
if (!isAuthorized(authorizedUser, ROLE_PERMISSIONS.TRIAL_SESSIONS)) {
throw new UnauthorizedError('Unauthorized');
}

const specialTrialSessionKeys: Array<SpecialTrialSessionKey> =
specialTrialSessions.map(
(t: SpecialTrialSession): SpecialTrialSessionKey => ({
pk: `trial-session-working-copy|${t.trialSessionId}`,
sk: `user|${t.userId}`,
}),
);

return await applicationContext
.getPersistenceGateway()
.getBulkTrialSessionWorkingCopyNotes({
applicationContext,
specialTrialSessions: specialTrialSessionKeys,
});
};
Loading

0 comments on commit 5908c5f

Please sign in to comment.