diff --git a/.env.prod b/.env.prod index 0eab70a..5359554 100644 --- a/.env.prod +++ b/.env.prod @@ -1,3 +1,4 @@ +EXTEND_ESLINT=true # Prod config # # Note: the contents of this file must be copied to .env for diff --git a/.env.staging b/.env.staging index 0785e68..facf42b 100644 --- a/.env.staging +++ b/.env.staging @@ -1,3 +1,4 @@ +EXTEND_ESLINT=true # Staging config # # Note: the contents of this file must be copied to .env for diff --git a/package.json b/package.json index af08d13..96bede5 100644 --- a/package.json +++ b/package.json @@ -98,5 +98,11 @@ ">0.2%", "not ie <= 11", "not op_mini all" - ] + ], + "eslintConfig": { + "extends": "react-app", + "rules": { + "@typescript-eslint/no-unused-vars": "off" + } + } } diff --git a/src/components/identity/Register.test.tsx b/src/components/identity/Register.test.tsx index 91181bd..6718405 100644 --- a/src/components/identity/Register.test.tsx +++ b/src/components/identity/Register.test.tsx @@ -15,7 +15,7 @@ it("renders nothing when no auth data has loaded", () => { expect(queryByText(/sign up for the cidc portal/i)).not.toBeInTheDocument(); }); -it("works as expected when auth data is provided", async () => { +it.skip("works as expected when auth data is provided", async () => { const idToken = "test-token"; const user = { first_n: "John", diff --git a/src/components/identity/Register.tsx b/src/components/identity/Register.tsx index 7aff9da..31a130e 100644 --- a/src/components/identity/Register.tsx +++ b/src/components/identity/Register.tsx @@ -99,114 +99,7 @@ const Register: React.FC = ({ history }) => { return ( - - - - - - If you are interested in accessing the - CIMAC-CIDC Portal, please complete your account - request below. - - - - - - - handleChange("first_n", e)} - margin="normal" - variant="outlined" - required - error={state.firstNameError} - /> - - - handleChange("last_n", e)} - margin="normal" - variant="outlined" - required - error={state.lastNameError} - /> - - - - Organization - - - - - - - - - - - - - - - + ); diff --git a/src/components/manifests/ManifestUpload.test.tsx b/src/components/manifests/ManifestUpload.test.tsx index 1db55de..c6851f3 100644 --- a/src/components/manifests/ManifestUpload.test.tsx +++ b/src/components/manifests/ManifestUpload.test.tsx @@ -27,7 +27,7 @@ function renderWithMockedAuthContext() { ); } -test("manifest validation", async () => { +test.skip("manifest validation", async () => { const renderResult = renderWithMockedAuthContext(); const { queryByTestId, @@ -90,7 +90,7 @@ test("manifest validation", async () => { expect(submitButton.disabled).toBe(false); }); -test("manifest submission", async () => { +test.skip("manifest submission", async () => { const renderResult = renderWithMockedAuthContext(); const { findByTestId, diff --git a/src/components/manifests/ManifestUpload.tsx b/src/components/manifests/ManifestUpload.tsx index 632e257..f8961bf 100644 --- a/src/components/manifests/ManifestUpload.tsx +++ b/src/components/manifests/ManifestUpload.tsx @@ -158,112 +158,11 @@ const ManifestUpload: React.FunctionComponent<{ token: string }> = ({ avatar={} title={ - Upload a shipping / receiving manifest + Uploading a shipping / receiving manifest has been + temporarily disabled } /> - -
- - - - - Manifest Type - - - onValueChange(setManifestType)(e) - } - row - > - {info && - info.supportedTemplates.manifests.map( - name => ( - } - disabled={ - status === "loading" - } - data-testid={`radio-${name}`} - /> - ) - )} - - - - - - - Select a manifest to upload - - { - // Clear the file input onClick to ensure onChange - // fires on every selection, even if the same file - // is selected twice. - if (fileInput.current) { - fileInput.current.value = ""; - } - // Also, reset the form state. - setStatus("unset"); - setErrors([]); - setFile(undefined); - }} - disabled={ - !manifestType || - manifestType === "" || - status === "loading" - } - onChange={() => { - if (fileInput.current) { - const files = - fileInput.current.files; - if (files && files.length > 0) { - setFile(files[0]); - } - } - }} - inputProps={{ - ref: fileInput, - accept: XLSX_MIMETYPE, - "data-testid": "manifest-file-input" - }} - type="file" - /> - - - - - - -
- -
- - {feedbackDisplay[status]} - -
-
); }; diff --git a/src/components/profile/AdminTrialManager.test.tsx b/src/components/profile/AdminTrialManager.test.tsx index 97a9e15..61b6672 100644 --- a/src/components/profile/AdminTrialManager.test.tsx +++ b/src/components/profile/AdminTrialManager.test.tsx @@ -71,7 +71,7 @@ it("renders available trials and trial creation button", async () => { expect(queryByText(/test-trial-1/i)).toBeInTheDocument(); }); -it("handles trial creation", async () => { +it.skip("handles trial creation", async () => { const newTrialId = "new-trial-name"; apiCreate .mockRejectedValueOnce({ @@ -136,7 +136,7 @@ it("handles trial creation", async () => { expect(apiFetch.mock.calls.length).toBeGreaterThan(1); }); -it("handles trial editing and updates", async () => { +it.skip("handles trial editing and updates", async () => { mockFetch([trial1]); const updatedTrial = { ...trial1, @@ -216,7 +216,7 @@ it("handles trial editing and updates", async () => { expect(ongoingRadio.checked).toBe(true); }); -it("handles discarding trial edits", async () => { +it.skip("handles discarding trial edits", async () => { mockFetch([trial1]); const { @@ -261,7 +261,7 @@ it("handles discarding trial edits", async () => { expect(discardButton).not.toBeInTheDocument(); }); -it("displays API errors produced while editing trials", async () => { +it.skip("displays API errors produced while editing trials", async () => { mockFetch([trial1]); const errorMessage = "uh oh"; apiUpdate.mockRejectedValue({ response: { data: errorMessage } }); diff --git a/src/components/profile/AdminTrialManager.tsx b/src/components/profile/AdminTrialManager.tsx index 4cd8b12..c2a1d3e 100644 --- a/src/components/profile/AdminTrialManager.tsx +++ b/src/components/profile/AdminTrialManager.tsx @@ -422,6 +422,7 @@ const CreateNewTrial = withIdToken( color="primary" startIcon={} onClick={() => setIsCreating(true)} + disabled > create a new trial @@ -438,7 +439,12 @@ const TrialManager: React.FC<{ token: string }> = ({ token }) => { } - title={Manage Trials} + title={ + + Manage Trials{" "} + (creating/editing has been temporarily disabled) + + } /> diff --git a/src/components/profile/AdminUserManager.tsx b/src/components/profile/AdminUserManager.tsx index 17d8a23..b546ed2 100644 --- a/src/components/profile/AdminUserManager.tsx +++ b/src/components/profile/AdminUserManager.tsx @@ -297,7 +297,10 @@ const AdminUserManager: React.FC<{ token: string }> = ({ token }) => { avatar={} title={ - Manage Users + + Manage Users ( + Editing has been temporarily disabled) + diff --git a/src/components/transer-data/TransferDataPage.test.tsx b/src/components/transer-data/TransferDataPage.test.tsx index c0d8b9f..312d46c 100644 --- a/src/components/transer-data/TransferDataPage.test.tsx +++ b/src/components/transer-data/TransferDataPage.test.tsx @@ -26,7 +26,7 @@ const renderWithInfoContext = () => ); -it("works as expected", async () => { +it.skip("works as expected", async () => { global.open = jest.fn(); // mock window.open apiFetch.mockResolvedValue({ _items: trials }); apiCreate.mockImplementation( diff --git a/src/components/transer-data/TransferDataPage.tsx b/src/components/transer-data/TransferDataPage.tsx index 7331c6a..fcde3d2 100644 --- a/src/components/transer-data/TransferDataPage.tsx +++ b/src/components/transer-data/TransferDataPage.tsx @@ -56,322 +56,7 @@ const TransferDataForm: React.FC = withIdToken(({ token }) => { return ( - - - - Select the trial and assay type you wish to transfer data - for to generate a Google Cloud Storage transfer destination. - - - If you have already initiated a data transfer and need to - upload additional data or submit a new metadata spreadsheet - for it, simply re-enter the trial and upload type relevant - to that data transfer. - - {noTrialPermissions && ( - - - You don't have permission to upload to any CIMAC - trials. Please to request - permissions. - - - )} -
{ - setUrlInfo(undefined); - setTrialId(formData.trialId); - setUploadType(formData.uploadType); - apiCreate( - "/ingestion/intake_bucket", - token, - { - data: { - trial_id: formData.trialId, - upload_type: formData.uploadType - } - } - ).then(urlInfoRes => setUrlInfo(urlInfoRes)); - })} - > - - - - - Protocol Identifier - - - - - - - - Upload Type - - - - - - - - - - {(trialIds === undefined || isLoadingURL) && ( - - - - )} - - - - - {urlInfo && trialId && uploadType && ( - <> - - - - - Your transfer destination is{" "} - - {urlInfo.gs_url} - - . - - - Before proceeding with your data transfer, please - ensure your data and metadata do not contain PHI. In - particular, please include only CIMAC IDs as - identifiers for participants and samples, since - identifiers specific to the{" "} - {trialId} trial may contain PHI. - Please if you need - assistance. - - - - - - 1. Upload your data. - - - Upload data to your transfer destination - directly from your browser using the{" "} - Google Cloud Storage web interface. - Ensure that files are not compressed in - any way, and retain the formats - specified in the metadata spreadsheet.{" "} - Note: be sure to log in - using the Google email associated with - your CIDC account. - - - - - - If you are comfortable using your - computer's terminal, you can also use - GCS's command-line tool{" "} - - gsutil - - to perform uploads. This method may be - faster for large uploads. From the root - of the directory containing the data you - wish to upload, run a command like: - - - gsutil -m cp -r{" "} - {""}{" "} - {urlInfo.gs_url} - - - - - 2. Download an empty metadata template - and populate it with your upload info. - - - Please ensure all filepaths that you - provide are relative to the root of your - local upload directory. - - } - /> - - - - 3. Upload your metadata spreadsheet, - along with a brief description of the - upload. - - - Filling out this form sends your - metadata spreadsheet directly to CIDC - Admins for review. Data included in this - upload will not appear in the CIDC until - CIDC Admins finalize its ingestion. - Admins may reach out via email for - clarification or feedback during this - process. - -
setUploadSuccess(false)} - onSubmit={e => { - const formData = new FormData( - e.currentTarget - ); - formData.append( - "trial_id", - trialId - ); - formData.append( - "assay_type", - uploadType - ); - apiCreate( - "/ingestion/intake_metadata", - token, - { data: formData } - ).then(() => - setUploadSuccess(true) - ); - e.preventDefault(); - }} - > - - - - Metadata Spreadsheet - - - - - - - - Description of this upload - - - - - - - - - -
-
-
-
- - )} -
+
); });