Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,25 @@ docker-down:
docker-compose -f ./app/docker-compose.yml down

cypress-open:
ifeq ($(CONTAINER), true)
xvfb-run -- npm --prefix ./app run cypress
else
npm --prefix ./app run cypress
endif

cypress-run:
ifeq ($(CONTAINER), true)
xvfb-run -- npm --prefix ./app run cypress-run
else
npm --prefix ./app run cypress-run
endif

cypress-report:
ifeq ($(CONTAINER), true)
xvfb-run -- npm --prefix ./app run cypress-report
else
npm --prefix ./app run cypress-report
endif

install-cypress:
npm install --save-dev cypress
3 changes: 2 additions & 1 deletion app/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": true }
]
],
"@typescript-eslint/explicit-function-return-type": "off"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ describe('GP Workflow: View Lloyd George record', () => {
statusCode: 200,
body: {
references: singleTestFile,
nextPageToken: 'abc'
nextPageToken: 'abc',
},
}).as('searchDocumentReferences');

Expand Down Expand Up @@ -360,7 +360,7 @@ describe('GP Workflow: View Lloyd George record', () => {
statusCode: 200,
body: { jobStatus: 'Pending' },
});
if (pendingCounts >= 3) {
if (pendingCounts >= 10) {
req.alias = 'documentManifestThirdTimePending';
}
});
Expand All @@ -372,7 +372,7 @@ describe('GP Workflow: View Lloyd George record', () => {
cy.getByTestId('toggle-selection-btn').click();
cy.getByTestId('download-selected-files-btn').click();

cy.wait('@documentManifestThirdTimePending');
cy.wait('@documentManifestThirdTimePending', { timeout: 20000 });

cy.title().should('have.string', 'Service error');
cy.url().should('have.string', '/server-error?encodedError=');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@
transform: rotate(90deg);
}
}

#failed-files-list {
p:not(:last-child) {
margin: 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,57 +62,76 @@ const DocumentUploadCompleteStage = ({ documents, documentConfig }: Props): Reac
</div>
</div>
{failedDocuments.length > 0 ? (
<div className="govuk-accordion mb-8 govuk-frontend-supported">
<h3>Some of your files failed to upload</h3>
<button
className="toggle-button govuk-accordion__section-button"
onClick={(): void => setShowFiles(!showFiles)}
data-testid="accordion-toggle-button"
aria-expanded={showFiles}
aria-controls="failed-files-list"
>
<span className="govuk-accordion__section-toggle">
<span className="accordion-toggle govuk-accordion__section-toggle-focus">
{showFiles ? (
<>
<ChevronLeftIcon className="accordion-toggle-icon" />
<span>Hide files</span>
</>
) : (
<>
<ChevronRightIcon className="accordion-toggle-icon" />
<span>View files</span>
</>
)}
</span>
</span>
</button>
{showFiles && (
<div id="failed-files-list" aria-hidden={!showFiles}>
{failedDocuments.map((doc) => (
<div key={doc.id}>
<span>{doc.file.name}</span>
<br />
</div>
))}
</div>
)}
<br />
<h3>What you need to do</h3>
<>
<p>
You must note which files uploaded successfully, then return to the
patient's record to upload any files that failed.
We uploaded {documents.length - failedDocuments.length} out of{' '}
{documents.length} files.
<br />
{failedDocuments.length} files could not be uploaded.
</p>
<Button
data-testid="patient-docs-btn"
type="button"
onClick={(): void => {
navigate(routes.PATIENT_DOCUMENTS, { replace: true });
}}
>
Go to Lloyd George records
</Button>
</div>
<p>There may be a problem with your files.</p>

<div className="govuk-accordion mb-8 govuk-frontend-supported">
<h3>Files that could not be uploaded</h3>
<button
className="toggle-button govuk-accordion__section-button"
onClick={(): void => setShowFiles(!showFiles)}
data-testid="accordion-toggle-button"
aria-expanded={showFiles}
aria-controls="failed-files-list"
>
<span className="govuk-accordion__section-toggle">
<span className="accordion-toggle govuk-accordion__section-toggle-focus">
{showFiles ? (
<>
<ChevronLeftIcon className="accordion-toggle-icon" />
<span>Hide files</span>
</>
) : (
<>
<ChevronRightIcon className="accordion-toggle-icon" />
<span>View files</span>
</>
)}
</span>
</span>
</button>

{showFiles && (
<div id="failed-files-list" aria-hidden={!showFiles}>
{failedDocuments.map((doc) => (
<div key={doc.id}>
<p>{doc.file.name}</p>
</div>
))}
</div>
)}

<h3>What you need to do</h3>
<p>You must note which files did not upload.</p>

<p>
Remove any passwords from files and check that all files open correctly.
Then return to the patient's record to upload them again.
</p>

<h3>Get help</h3>
<p>
Contact your local IT support desk to resolve the problems with these
files.
</p>

<Button
data-testid="patient-docs-btn"
type="button"
onClick={(): void => {
navigate(routes.PATIENT_DOCUMENTS, { replace: true });
}}
>
Go to Lloyd George records
</Button>
</div>
</>
) : (
<>
<h3>What happens next</h3>
Expand Down
Loading
Loading