Skip to content

Commit

Permalink
fix(website): Add ENA-required NO-PII acknowledgements to our submiss…
Browse files Browse the repository at this point in the history
…ion acknowledgements (#2333)


---------
Co-authored-by: Theo Sanderson <[email protected]>
Co-authored-by: Fabian Engelniederhammer <[email protected]>
Co-authored-by: Loculus bot <[email protected]>
  • Loading branch information
anna-parker authored Jul 30, 2024
1 parent 96b6124 commit a34eed8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
27 changes: 26 additions & 1 deletion website/src/components/Submission/DataUploadForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ const InnerDataUploadForm = ({

const [agreedToINSDCUploadTerms, setAgreedToINSDCUploadTerms] = useState(false);

const [confirmedNoPII, setConfirmedNoPII] = useState(false);

const isClient = useClientFlag();

const handleLoadExampleData = async () => {
Expand All @@ -305,6 +307,13 @@ const InnerDataUploadForm = ({
return;
}

if (!confirmedNoPII) {
onError(
'Please confirm the data you submitted does not include restricted or personally identifiable information.',
);
return;
}

if (!metadataFile) {
onError('Please select metadata file');
return;
Expand Down Expand Up @@ -437,7 +446,23 @@ const InnerDataUploadForm = ({
databases (ENA, DDBJ, NCBI).
</p>
)}
<div className='mb-4 mt-3 py-5'>
<div className='mt-2 py-5'>
<label className='flex items-center'>
<input
type='checkbox'
name='confirmation-no-pii'
className='mr-3 ml-1 h-5 w-5 rounded border-gray-300 text-blue focus:ring-blue'
checked={confirmedNoPII}
onChange={() => setConfirmedNoPII(!confirmedNoPII)}
/>
<div>
<p className='text-xs pl-4 text-gray-500'>
I confirm that the data submitted is not sensitive or human-identifiable
</p>
</div>
</label>
</div>
<div className='mb-4 py-3'>
<label className='flex items-center'>
<input
type='checkbox'
Expand Down
6 changes: 6 additions & 0 deletions website/src/components/Submission/SubmissionForm.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ describe('SubmitForm', () => {
await userEvent.click(
getByLabelText(/I confirm I have not and will not submit this data independently to INSDC/i),
);
await userEvent.click(
getByLabelText(/I confirm that the data submitted is not sensitive or human-identifiable/i),
);

const submitButton = getByText('Submit sequences');
await userEvent.click(submitButton);
Expand Down Expand Up @@ -141,6 +144,9 @@ describe('SubmitForm', () => {
await userEvent.click(
getByLabelText(/I confirm I have not and will not submit this data independently to INSDC/i),
);
await userEvent.click(
getByLabelText(/I confirm that the data submitted is not sensitive or human-identifiable/i),
);

const submitButton = getByText('Submit sequences');
await userEvent.click(submitButton);
Expand Down
1 change: 1 addition & 0 deletions website/tests/pages/revise/revise.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class RevisePage {
await this.setSequenceFile();
await this.setRevisedMetadataFile(accessions);
await this.page.getByText('I confirm I have not and will not submit this data independently to INSDC').click();
await this.page.getByText('I confirm that the data submitted is not sensitive or human-identifiable').click();
await this.page.getByRole('button', { name: 'Submit' }).click();
}

Expand Down
3 changes: 3 additions & 0 deletions website/tests/pages/submission/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ test.describe('The submit page', () => {
await Promise.all([submitPage.uploadSequenceData(), submitPage.uploadMetadata()]);

await submitPage.confirmationINSDCTerms.click();
await submitPage.confirmationNoPII.click();
await submitPage.submitButton.click();

await submitPage.page.waitForURL(`${baseUrl}${routes.userSequenceReviewPage(dummyOrganism.key, groupId)}`);
Expand All @@ -31,6 +32,7 @@ test.describe('The submit page', () => {
await Promise.all([submitPage.uploadCompressedSequenceData(), submitPage.uploadCompressedMetadata()]);

await submitPage.confirmationINSDCTerms.click();
await submitPage.confirmationNoPII.click();
await submitPage.submitButton.click();

await submitPage.page.waitForURL(`${baseUrl}${routes.userSequenceReviewPage(dummyOrganism.key, groupId)}`);
Expand All @@ -44,6 +46,7 @@ test.describe('The submit page', () => {
await Promise.all([submitPage.uploadSequenceData(), submitPage.uploadMetadata()]);
await submitPage.selectRestrictedDataUseTerms();
await submitPage.confirmationINSDCTerms.click();
await submitPage.confirmationNoPII.click();
await submitPage.submitButton.click();
await expect(submitPage.page.getByText('Response Sequence Headers')).toBeVisible();

Expand Down
4 changes: 4 additions & 0 deletions website/tests/pages/submission/submit.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
export class SubmitPage {
public readonly submitButton: Locator;
public readonly confirmationINSDCTerms: Locator;
public readonly confirmationNoPII: Locator;
public readonly dataUseTermsDropdown: Locator;
public readonly loginButton: Locator;

Expand All @@ -21,6 +22,9 @@ export class SubmitPage {
this.confirmationINSDCTerms = page.getByText(
'I confirm I have not and will not submit this data independently to INSDC',
);
this.confirmationNoPII = page.getByText(
'I confirm that the data submitted is not sensitive or human-identifiable',
);
this.dataUseTermsDropdown = page.locator('#dataUseTermsDropdown');
this.loginButton = page.locator('a', { hasText: 'Login or register' });
}
Expand Down

0 comments on commit a34eed8

Please sign in to comment.