Skip to content

Commit

Permalink
10472: PDF Preview in new Tab
Browse files Browse the repository at this point in the history
10472: open pdf previews in new tab

wip

wip, working irspractioner when opening pdf to new tab

wip, add functioning tab sequence

rm log statement

rm log statements

more cleanup

rm docstring

add check for reader

add test and some wip

add test for loadPDFForTabAction

add void return for promise, explicit

readerResult check

fix type errors

rm globals

ignore problematic type checks

oops

rm modal checks

rm from branch

add fix for docker compose invocation

creates compatibility for docker compose or docker-compose

10472: rm openCaseDocumentDownloadUrl

10472: remove unused code

10472: rm remaining loadPdf code

10472: rm call to removed sequence
  • Loading branch information
JayFlexy committed Dec 19, 2024
1 parent 030bda1 commit 4c05610
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 409 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ export const respondentRequestsAccessToCase = (cerebralTest, fakeFile) => {
);
expect(cerebralTest.getState('validationErrors')).toEqual({});

await cerebralTest.runSequence('openPdfPreviewModalSequence', {
file: fakeFile,
modalId: 'PDFPreviewModal-Entry of Appearance for Respondent',
});

await cerebralTest.runSequence('updateFormValueSequence', {
key: 'redactionAcknowledgement',
value: true,
Expand Down
147 changes: 0 additions & 147 deletions web-client/src/presenter/actions/PDFPreviewModal/loadPdfAction.test.ts

This file was deleted.

58 changes: 0 additions & 58 deletions web-client/src/presenter/actions/PDFPreviewModal/loadPdfAction.ts

This file was deleted.

11 changes: 0 additions & 11 deletions web-client/src/presenter/presenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,7 @@ import { leaveCaseForLaterServiceSequence } from './sequences/leaveCaseForLaterS
import { loadDefaultDocketViewerDocumentToDisplaySequence } from './sequences/DocketEntry/loadDefaultDocketViewerDocumentToDisplaySequence';
import { loadDefaultDraftViewerDocumentToDisplaySequence } from './sequences/DocketEntry/loadDefaultDraftViewerDocumentToDisplaySequence';
import { loadDefaultViewerCorrespondenceSequence } from './sequences/loadDefaultViewerCorrespondenceSequence';
import { loadMoreCaseDeadlinesSequence } from './sequences/loadMoreCaseDeadlinesSequence';
import { loadMorePendingItemsSequence } from './sequences/loadMorePendingItemsSequence';
import { loadPdfForTabSequence } from './sequences/PDFPreviewTab/loadPdfForTabSequence';
import { loadPdfSequence } from './sequences/PDFPreviewModal/loadPdfSequence';
import { navigateBackSequence } from './sequences/navigateBackSequence';
import { navigateToCaseDetailFromPaperServiceSequence } from './sequences/navigateToCaseDetailFromPaperServiceSequence';
import { navigateToCaseDetailSequence } from './sequences/navigateToCaseDetailSequence';
Expand Down Expand Up @@ -307,7 +304,6 @@ import { openEditOrderTitleModalSequence } from './sequences/openEditOrderTitleM
import { openForwardMessageModalSequence } from './sequences/openForwardMessageModalSequence';
import { openGainElectronicAccessToCaseModalSequence } from './sequences/openGainElectronicAccessToCaseModalSequence';
import { openItemizedPenaltiesModalSequence } from './sequences/openItemizedPenaltiesModalSequence';
import { openPdfPreviewModalSequence } from './sequences/openPdfPreviewModalSequence';
import { openPractitionerDocumentDownloadUrlSequence } from './sequences/openPractitionerDocumentDownloadUrlSequence';
import { openPrintGeneratedPaperServiceSequence } from '@web-client/presenter/sequences/openPrintGeneratedPaperServiceSequence';
import { openPrintableTrialSessionWorkingCopyModalSequence } from './sequences/openPrintableTrialSessionWorkingCopyModalSequence';
Expand Down Expand Up @@ -975,12 +971,7 @@ export const presenterSequences = {
loadDefaultDraftViewerDocumentToDisplaySequence as unknown as Function,
loadDefaultViewerCorrespondenceSequence:
loadDefaultViewerCorrespondenceSequence as unknown as Function,
loadMoreCaseDeadlinesSequence:
loadMoreCaseDeadlinesSequence as unknown as Function,
loadMorePendingItemsSequence:
loadMorePendingItemsSequence as unknown as Function,
loadPdfForTabSequence: loadPdfForTabSequence as unknown as Function,
loadPdfSequence: loadPdfSequence as unknown as Function,
navigateBackSequence: navigateBackSequence as unknown as Function,
navigateToCaseDetailFromPaperServiceSequence:
navigateToCaseDetailFromPaperServiceSequence as unknown as Function,
Expand Down Expand Up @@ -1111,8 +1102,6 @@ export const presenterSequences = {
openGainElectronicAccessToCaseModalSequence as unknown as Function,
openItemizedPenaltiesModalSequence:
openItemizedPenaltiesModalSequence as unknown as Function,
openPdfPreviewModalSequence:
openPdfPreviewModalSequence as unknown as Function,
openPractitionerDocumentDownloadUrlSequence:
openPractitionerDocumentDownloadUrlSequence as unknown as Function,
openPrintGeneratedPaperServiceSequence:
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions web-client/src/views/PDFPreviewButton.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import { Button } from '../ustc-ui/Button/Button';
import { Mobile, NonMobile } from '../ustc-ui/Responsive/Responsive';
import { PDFPreviewErrorModal } from './PDFPreviewErrorModal';
import { PDFPreviewModal } from './PDFPreviewModal';
import { connect } from '@web-client/presenter/shared.cerebral';
import { getStringAbbreviation } from '../utilities/getStringAbbreviation';
import { sequences } from '@web-client/presenter/app.cerebral';
import { state } from '@web-client/presenter/app.cerebral';
import React from 'react';

const pdfPreviewButtonDeps = {
loadPdfForTabSequence: sequences.loadPdfForTabSequence,
openCaseDocumentDownloadUrlSequence:
sequences.openCaseDocumentDownloadUrlSequence,
pdfPreviewModalHelper: state.pdfPreviewModalHelper,
showModal: state.modal.showModal,
};

export const PDFPreviewButton = connect<
Expand All @@ -33,15 +26,12 @@ export const PDFPreviewButton = connect<
file,
id,
loadPdfForTabSequence,
pdfPreviewModalHelper,
shouldAbbreviateTitle = false,
shouldWrapText = true,
showIcon = true,
showModal,
title,
...props
}) {
const modalId = `PDFPreviewModal-${title}`;
const fullTitle = file.name || file.documentType || title;
const abbrevTitle = getStringAbbreviation(fullTitle, 50);
const displayTitle = shouldAbbreviateTitle ? abbrevTitle : fullTitle;
Expand Down Expand Up @@ -80,12 +70,6 @@ export const PDFPreviewButton = connect<
{displayTitle}
</Button>
</NonMobile>
{showModal == modalId &&
(pdfPreviewModalHelper.displayErrorText ? (
<PDFPreviewErrorModal title={title} />
) : (
<PDFPreviewModal preventScrolling={true} title={title} />
))}
</>
);
},
Expand Down
Loading

0 comments on commit 4c05610

Please sign in to comment.