From 08165f39447994fc9e2f7931cfbb05f65bc5202d Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Tue, 1 Dec 2020 13:10:36 +0200 Subject: [PATCH 01/88] Draft object reducer --- src/rootReducer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rootReducer.js b/src/rootReducer.js index 239f3df3..9dbb4ab2 100644 --- a/src/rootReducer.js +++ b/src/rootReducer.js @@ -3,6 +3,7 @@ import { combineReducers } from "@reduxjs/toolkit" import draftStatusReducer from "features/draftStatusSlice" +import draftObjectReducer from "features/wizardDraftObjectSlice" import wizardErrorMessageReducer from "features/wizardErrorMessageSlice" import objectTypeReducer from "features/wizardObjectTypeSlice" import wizardStepReducer from "features/wizardStepSlice" @@ -16,6 +17,7 @@ const rootReducer = combineReducers({ submissionFolder: submissionFolderReducer, submissionType: submissionTypeReducer, draftStatus: draftStatusReducer, + draftObject: draftObjectReducer, }) export default rootReducer From 669e82e8763e5962c6b4ad41e9d6d8440c972de4 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Tue, 1 Dec 2020 13:22:35 +0200 Subject: [PATCH 02/88] Method for adding object into drafts --- src/features/wizardSubmissionFolderSlice.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/features/wizardSubmissionFolderSlice.js b/src/features/wizardSubmissionFolderSlice.js index 1c63e150..9129b74c 100644 --- a/src/features/wizardSubmissionFolderSlice.js +++ b/src/features/wizardSubmissionFolderSlice.js @@ -38,12 +38,12 @@ type ObjectInFolder = { accessionId: string, schema: string, } - type FolderNoId = { name: string, description: string, published: boolean, metadataObjects: Array, + drafts: Array, } type Folder = FolderNoId & { id: string } @@ -53,6 +53,7 @@ export const createNewDraftFolder = (folderDetails: FolderFromForm) => async (di ...folderDetails, published: false, metadataObjects: [], + drafts: [], } const response = await folderAPIService.createNewFolder(folderForBackend) return new Promise((resolve, reject) => { @@ -79,6 +80,7 @@ export const updateNewDraftFolder = (folderDetails: FolderFromForm) => async (di export const addObjectToFolder = (folderID: string, objectDetails: ObjectInFolder) => async (dispatch: any => void) => { const changes = [{ op: "add", path: "/metadataObjects/-", value: objectDetails }] + console.log(changes) const response = await folderAPIService.patchFolderById(folderID, changes) return new Promise((resolve, reject) => { if (response.ok) { @@ -90,6 +92,17 @@ export const addObjectToFolder = (folderID: string, objectDetails: ObjectInFolde }) } +export const addObjectToDrafts = (objectType: string, folderID: string, objectDetails: ObjectInFolder) => async () => { + console.log(objectDetails) + const response = await objectAPIService.createFromJSON(objectType, objectDetails) + console.log(response) + + // const changes = [{ op: "add", path: "/drafts/-", value: objectDetails }] + // // console.log(changes) + // const response = await folderAPIService.patchFolderById(folderID, changes) + // console.log(response) +} + export const deleteObjectFromFolder = (objectId: string, objectType: string) => async (dispatch: any => void) => { const response = await objectAPIService.deleteObjectByAccessionId(objectType, objectId) return new Promise((resolve, reject) => { From 5c0c505e26c927146516d9d72568b8fcbed117b1 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Tue, 1 Dec 2020 13:25:51 +0200 Subject: [PATCH 03/88] Pass current form values to state --- .../WizardForms/WizardFillObjectDetailsForm.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js b/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js index 5e7b8563..07cfa484 100644 --- a/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js +++ b/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js @@ -18,6 +18,7 @@ import JSONSchemaParser from "./WizardJSONSchemaParser" import WizardStatusMessageHandler from "./WizardStatusMessageHandler" import { setDraftStatus, resetDraftStatus } from "features/draftStatusSlice" +import { setDraftObject } from "features/wizardDraftObjectSlice" import objectAPIService from "services/objectAPI" import schemaAPIService from "services/schemaAPI" @@ -79,10 +80,21 @@ const FormContent = ({ resolver, formSchema, onSubmit }: FormContentProps) => { methods.reset() } + const { dirtyFields } = methods.formState + useEffect(() => { methods.formState.isDirty ? dispatch(setDraftStatus("notSaved")) : dispatch(setDraftStatus("")) }, [methods.formState.isDirty, dispatch]) + useEffect(() => { + if (Object.keys(dirtyFields).length > 0) { + // console.log(dirtyFields) + const cleanedValues = JSONSchemaParser.cleanUpFormValues(methods.getValues()) + console.log(cleanedValues) + dispatch(setDraftObject(cleanedValues)) + } + }, [methods.formState]) + return (
From d56f4c0af8b7f67b382773a802bc47d8beb25bcc Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Tue, 1 Dec 2020 13:32:55 +0200 Subject: [PATCH 04/88] Save draft functionality --- .../WizardComponents/WizardAlert.js | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/NewDraftWizard/WizardComponents/WizardAlert.js b/src/components/NewDraftWizard/WizardComponents/WizardAlert.js index d1e6fe33..e182a78c 100644 --- a/src/components/NewDraftWizard/WizardComponents/WizardAlert.js +++ b/src/components/NewDraftWizard/WizardComponents/WizardAlert.js @@ -7,7 +7,9 @@ import DialogActions from "@material-ui/core/DialogActions" import DialogContent from "@material-ui/core/DialogContent" import DialogContentText from "@material-ui/core/DialogContentText" import DialogTitle from "@material-ui/core/DialogTitle" -import { useSelector } from "react-redux" +import { useDispatch, useSelector } from "react-redux" + +import { addObjectToDrafts } from "features/wizardSubmissionFolderSlice" /* * Dialog contents are rendered based on parent component location and alert type @@ -23,6 +25,14 @@ const CancelFormDialog = ({ parentLocation: string, currentSubmissionType: string, }) => { + const submissionFolder = useSelector(state => state.submissionFolder) + const draftObject = useSelector(state => state.draftObject) + const currentObjectType = useSelector(state => state.objectType) + const dispatch = useDispatch() + const saveDraft = () => { + dispatch(addObjectToDrafts(currentObjectType, submissionFolder.id, draftObject)) + } + let [dialogTitle, dialogContent] = ["", ""] let dialogActions const formContent = "If you save form as a draft, you can continue filling it later." @@ -59,7 +69,14 @@ const CancelFormDialog = ({ - From 4b3a8be4f1e79d47019836e2d5702a87f9cb66f7 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Tue, 1 Dec 2020 13:38:17 +0200 Subject: [PATCH 05/88] Draft object slice & updated packages --- package-lock.json | 33 ++++++++++++++++++++++++-- src/features/wizardDraftObjectSlice.js | 16 +++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/features/wizardDraftObjectSlice.js diff --git a/package-lock.json b/package-lock.json index 8038f804..28f39fc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4395,6 +4395,15 @@ "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "optional": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -7637,6 +7646,12 @@ } } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, "filesize": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz", @@ -12214,6 +12229,12 @@ "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "optional": true + }, "nanoid": { "version": "3.1.18", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.18.tgz", @@ -17963,7 +17984,11 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0", @@ -18299,7 +18324,11 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0", diff --git a/src/features/wizardDraftObjectSlice.js b/src/features/wizardDraftObjectSlice.js new file mode 100644 index 00000000..ce244fa3 --- /dev/null +++ b/src/features/wizardDraftObjectSlice.js @@ -0,0 +1,16 @@ +//@flow +import { createSlice } from "@reduxjs/toolkit" + +const initialState = {} + +const wizardDraftObjectSlice = createSlice({ + name: "draftObject", + initialState, + reducers: { + setDraftObject: (state, action) => action.payload, + resetDraftObject: () => initialState, + }, +}) + +export const { setDraftObject, resetDraftObject } = wizardDraftObjectSlice.actions +export default wizardDraftObjectSlice.reducer From f745c2a99e544015274016c20c4ebf2ab033f582 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Tue, 1 Dec 2020 16:06:37 +0200 Subject: [PATCH 06/88] Show all message types in snachbar. Top level logic for hiding message --- .../WizardForms/WizardStatusMessageHandler.js | 61 +++++++++++++------ 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/src/components/NewDraftWizard/WizardForms/WizardStatusMessageHandler.js b/src/components/NewDraftWizard/WizardForms/WizardStatusMessageHandler.js index 7b40eb09..29e48cf4 100644 --- a/src/components/NewDraftWizard/WizardForms/WizardStatusMessageHandler.js +++ b/src/components/NewDraftWizard/WizardForms/WizardStatusMessageHandler.js @@ -7,8 +7,16 @@ import Alert from "@material-ui/lab/Alert" /* * Error messages */ -const ErrorHandler = ({ response, prefixText }: { response: any, prefixText: string }) => { - const [openStatus, setOpenStatus] = useState(true) +const ErrorHandler = ({ + response, + prefixText, + handleClose, +}: { + response: any, + prefixText: string, + handleClose: boolean => void, +}) => { + // const [openStatus, setOpenStatus] = useState(true) let message = "" switch (response.status) { case 504: @@ -22,33 +30,34 @@ const ErrorHandler = ({ response, prefixText }: { response: any, prefixText: str } return (
- - { - setOpenStatus(false) - }} - > - {message} - - + handleClose(false)}> + {message} +
) } // Info messages -const InfoHandler = () => { +const InfoHandler = ({ handleClose }: { handleClose: boolean => void }) => { const message = `For some reason, your file is still being saved to our database, please wait. If saving doesn't go through in two minutes, please try saving the file again.` - return {message} + return ( + handleClose(false)} severity="info"> + {message} + + ) } // Success messages -const SuccessHandler = ({ response }: { response: any }) => { +const SuccessHandler = ({ response, handleClose }: { response: any, handleClose: boolean => void }) => { const message = `Submitted with accessionid ${response.data.accessionId}` - return {message} + return ( + handleClose(false)} severity="success"> + {message} + + ) } const WizardStatusMessageHandler = ({ @@ -60,20 +69,32 @@ const WizardStatusMessageHandler = ({ response: any, prefixText: string, }) => { + const [openStatus, setOpenStatus] = useState(true) + const messageTemplate = status => { switch (status) { case "success": - return + return case "info": - return + return case "error": - return + return default: return } } - return
{!Array.isArray(response) && messageTemplate(successStatus)}
+ const handleClose = status => { + setOpenStatus(status) + } + + return ( +
+ setOpenStatus(false)}> + {!Array.isArray(response) && messageTemplate(successStatus)} + +
+ ) } export default WizardStatusMessageHandler From f09d45c4a131ccdff329d511922d3a0c5b9615c1 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Tue, 1 Dec 2020 16:09:57 +0200 Subject: [PATCH 07/88] Reset successStatus on start of submit, this makes notification to rerender --- .../NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js b/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js index 5e7b8563..2771a1d3 100644 --- a/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js +++ b/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js @@ -126,6 +126,7 @@ const WizardFillObjectDetailsForm = () => { * Submit form with cleaned values and check for response errors */ const onSubmit = async data => { + setSuccessStatus(undefined) setSubmitting(true) const waitForServertimer = setTimeout(() => { setSuccessStatus("info") From f3a6456d7fbc3b7fa87d079f554139074b8d924a Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Tue, 1 Dec 2020 16:14:37 +0200 Subject: [PATCH 08/88] Reset successStatus on start of submit, this makes notification to rerender --- .../NewDraftWizard/WizardForms/WizardUploadObjectXMLForm.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/NewDraftWizard/WizardForms/WizardUploadObjectXMLForm.js b/src/components/NewDraftWizard/WizardForms/WizardUploadObjectXMLForm.js index e93f7af1..6bc849a4 100644 --- a/src/components/NewDraftWizard/WizardForms/WizardUploadObjectXMLForm.js +++ b/src/components/NewDraftWizard/WizardForms/WizardUploadObjectXMLForm.js @@ -62,6 +62,7 @@ const WizardUploadObjectXMLForm = () => { const watchFile = watch("fileUpload") const onSubmit = async data => { + setSuccessStatus(undefined) setSubmitting(true) const file = data.fileUpload[0] || {} const waitForServertimer = setTimeout(() => { From c5ccfcbea821925cb59022650bb767349ad807cf Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Wed, 2 Dec 2020 09:41:37 +0200 Subject: [PATCH 09/88] Reset connection error status when handling removal --- .eslintcache | 1 + .../NewDraftWizard/WizardComponents/WizardSavedObjectsList.js | 1 + 2 files changed, 2 insertions(+) create mode 100644 .eslintcache diff --git a/.eslintcache b/.eslintcache new file mode 100644 index 00000000..3e2c59b4 --- /dev/null +++ b/.eslintcache @@ -0,0 +1 @@ +[{"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\index.js":"1","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\rootReducer.js":"2","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\views\\Home.js":"3","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\views\\ErrorPages\\Page500.js":"4","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\draftStatusSlice.js":"5","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\wizardObjectTypeSlice.js":"6","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\wizardSubmissionFolderSlice.js":"7","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardSteps\\WizardAddObjectStep.js":"8","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardHeader.js":"9","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardForms\\WizardStatusMessageHandler.js":"10","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardSavedObjectsList.js":"11","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\services\\folderAPI.js":"12","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardAlert.js":"13","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardForms\\WizardAjvResolver.js":"14"},{"size":819,"mtime":1605008259556,"results":"15","hashOfConfig":"16"},{"size":780,"mtime":1606825913186,"results":"17","hashOfConfig":"16"},{"size":4476,"mtime":1601985497844,"results":"18","hashOfConfig":"16"},{"size":855,"mtime":1601985497844,"results":"19","hashOfConfig":"16"},{"size":412,"mtime":1606724488894,"results":"20","hashOfConfig":"16"},{"size":422,"mtime":1602152074508,"results":"21","hashOfConfig":"16"},{"size":4295,"mtime":1606825913185,"results":"22","hashOfConfig":"16"},{"size":2087,"mtime":1606821883932,"results":"23","hashOfConfig":"16"},{"size":733,"mtime":1604479804810,"results":"24","hashOfConfig":"16"},{"size":2579,"mtime":1606831491618,"results":"25","hashOfConfig":"16"},{"size":3918,"mtime":1606894859783,"results":"26","hashOfConfig":"16"},{"size":612,"mtime":1605262614813,"results":"27","hashOfConfig":"16"},{"size":6806,"mtime":1606825913182,"results":"28","hashOfConfig":"16"},{"size":1941,"mtime":1602679813302,"results":"29","hashOfConfig":"16"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"16iblvo",{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\index.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\rootReducer.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\views\\Home.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\views\\ErrorPages\\Page500.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\draftStatusSlice.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\wizardObjectTypeSlice.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\wizardSubmissionFolderSlice.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardSteps\\WizardAddObjectStep.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardHeader.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardForms\\WizardStatusMessageHandler.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardSavedObjectsList.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\services\\folderAPI.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardAlert.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardForms\\WizardAjvResolver.js",[]] \ No newline at end of file diff --git a/src/components/NewDraftWizard/WizardComponents/WizardSavedObjectsList.js b/src/components/NewDraftWizard/WizardComponents/WizardSavedObjectsList.js index 3bb048c9..69b5994b 100644 --- a/src/components/NewDraftWizard/WizardComponents/WizardSavedObjectsList.js +++ b/src/components/NewDraftWizard/WizardComponents/WizardSavedObjectsList.js @@ -74,6 +74,7 @@ const WizardSavedObjectsList = ({ submissionType, submissions }: { submissionTyp const newObject = submissions.filter(x => !ref.current?.includes(x)) const handleObjectDelete = objectId => { + setConnError(false) dispatch(deleteObjectFromFolder(objectId, objectType)).catch(error => { setConnError(true) setResponseError(JSON.parse(error)) From 09f81797e88e7c2c6ae0da6edd5063e2988e8499 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Wed, 2 Dec 2020 09:48:56 +0200 Subject: [PATCH 10/88] Removed eslint cache and added into gitignore --- .eslintcache | 1 - .gitignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 .eslintcache diff --git a/.eslintcache b/.eslintcache deleted file mode 100644 index 3e2c59b4..00000000 --- a/.eslintcache +++ /dev/null @@ -1 +0,0 @@ -[{"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\index.js":"1","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\rootReducer.js":"2","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\views\\Home.js":"3","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\views\\ErrorPages\\Page500.js":"4","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\draftStatusSlice.js":"5","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\wizardObjectTypeSlice.js":"6","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\wizardSubmissionFolderSlice.js":"7","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardSteps\\WizardAddObjectStep.js":"8","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardHeader.js":"9","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardForms\\WizardStatusMessageHandler.js":"10","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardSavedObjectsList.js":"11","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\services\\folderAPI.js":"12","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardAlert.js":"13","D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardForms\\WizardAjvResolver.js":"14"},{"size":819,"mtime":1605008259556,"results":"15","hashOfConfig":"16"},{"size":780,"mtime":1606825913186,"results":"17","hashOfConfig":"16"},{"size":4476,"mtime":1601985497844,"results":"18","hashOfConfig":"16"},{"size":855,"mtime":1601985497844,"results":"19","hashOfConfig":"16"},{"size":412,"mtime":1606724488894,"results":"20","hashOfConfig":"16"},{"size":422,"mtime":1602152074508,"results":"21","hashOfConfig":"16"},{"size":4295,"mtime":1606825913185,"results":"22","hashOfConfig":"16"},{"size":2087,"mtime":1606821883932,"results":"23","hashOfConfig":"16"},{"size":733,"mtime":1604479804810,"results":"24","hashOfConfig":"16"},{"size":2579,"mtime":1606831491618,"results":"25","hashOfConfig":"16"},{"size":3918,"mtime":1606894859783,"results":"26","hashOfConfig":"16"},{"size":612,"mtime":1605262614813,"results":"27","hashOfConfig":"16"},{"size":6806,"mtime":1606825913182,"results":"28","hashOfConfig":"16"},{"size":1941,"mtime":1602679813302,"results":"29","hashOfConfig":"16"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"16iblvo",{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\index.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\rootReducer.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\views\\Home.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\views\\ErrorPages\\Page500.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\draftStatusSlice.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\wizardObjectTypeSlice.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\features\\wizardSubmissionFolderSlice.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardSteps\\WizardAddObjectStep.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardHeader.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardForms\\WizardStatusMessageHandler.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardSavedObjectsList.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\services\\folderAPI.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardComponents\\WizardAlert.js",[],"D:\\Code\\csc\\allas\\metadata-submitter-frontend\\src\\components\\NewDraftWizard\\WizardForms\\WizardAjvResolver.js",[]] \ No newline at end of file diff --git a/.gitignore b/.gitignore index 50f8b481..00d833fb 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ .env.development.local .env.test.local .env.production.local +.eslintcache npm-debug.log* yarn-debug.log* From 4222f3b9f08297b8ded318fb67ab2153997e4dc5 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Wed, 2 Dec 2020 14:48:16 +0200 Subject: [PATCH 11/88] Basic e2e test --- cypress/integration/app.spec.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 cypress/integration/app.spec.js diff --git a/cypress/integration/app.spec.js b/cypress/integration/app.spec.js new file mode 100644 index 00000000..5a0323bf --- /dev/null +++ b/cypress/integration/app.spec.js @@ -0,0 +1,29 @@ +describe("Basic e2e", function () { + it("should navigate to home with click of login button", () => { + cy.visit("http://localhost:3000/") + cy.get('[alt="CSC Login"]').click() + }) + + it("should create new folder", () => { + cy.visit("http://localhost:3000/newdraft") + + // Navigate to folder creation + cy.get("button[type=button]").contains("New folder").click() + + // Add folder name & description, navigate to submissions + cy.get('input[name="name"]').type("Test name") + cy.get('textarea[name="description"]').type("Test description") + cy.get("button[type=button]").contains("Next").click() + + // Fill a study form and save object + cy.get("div[role=button]").contains("Study").click() + cy.get("div[role=button]").contains("Fill Form").click() + cy.get('input[name="descriptor.studyTitle"]').type("Test title") + cy.get('select[name="descriptor.studyType"]').select("Metagenomics") + cy.get("button[type=submit]").contains("Save").click() + + // Navigate to summary and publish + cy.get("button[type=button]").contains("Next").click() + cy.get("button[type=button]").contains("Publish").click() + }) +}) From 96e9a474cbd10259a6e461706dfe75d4e509ddc0 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Wed, 2 Dec 2020 14:49:29 +0200 Subject: [PATCH 12/88] Added Cypress cy to globals --- .eslintrc.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 743cab49..2fe0d8e9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -52,5 +52,8 @@ } ] }, - "ignorePatterns": ["node_modules/*", "build/*"] + "ignorePatterns": ["node_modules/*", "build/*"], + "globals": { + "cy": true + } } From fddf1ad031066662d805d1d7d558a9521df931bd Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Wed, 2 Dec 2020 14:50:45 +0200 Subject: [PATCH 13/88] Installed cypress --- cypress.json | 1 + cypress/fixtures/example.json | 5 + cypress/plugins/index.js | 22 + cypress/support/commands.js | 25 + cypress/support/index.js | 20 + debug.log | 2 + package-lock.json | 1056 +++++++++++++++++++++++++++++++++ package.json | 1 + 8 files changed, 1132 insertions(+) create mode 100644 cypress.json create mode 100644 cypress/fixtures/example.json create mode 100644 cypress/plugins/index.js create mode 100644 cypress/support/commands.js create mode 100644 cypress/support/index.js create mode 100644 debug.log diff --git a/cypress.json b/cypress.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/cypress.json @@ -0,0 +1 @@ +{} diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json new file mode 100644 index 00000000..02e42543 --- /dev/null +++ b/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js new file mode 100644 index 00000000..e14aec77 --- /dev/null +++ b/cypress/plugins/index.js @@ -0,0 +1,22 @@ +/// +// *********************************************************** +// This example plugins/index.js can be used to load plugins +// +// You can change the location of this file or turn off loading +// the plugins file with the 'pluginsFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/plugins-guide +// *********************************************************** + +// This function is called when a project is opened or re-opened (e.g. due to +// the project's config changing) + +/** + * @type {Cypress.PluginConfig} + */ +module.exports = (on, config) => { + console.log(on, config) + // `on` is used to hook into various events Cypress emits + // `config` is the resolved Cypress config +} diff --git a/cypress/support/commands.js b/cypress/support/commands.js new file mode 100644 index 00000000..ca4d256f --- /dev/null +++ b/cypress/support/commands.js @@ -0,0 +1,25 @@ +// *********************************************** +// This example commands.js shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add("login", (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/cypress/support/index.js b/cypress/support/index.js new file mode 100644 index 00000000..a80764cb --- /dev/null +++ b/cypress/support/index.js @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import "./commands" + +// Alternatively you can use CommonJS syntax: +// require('./commands') diff --git a/debug.log b/debug.log new file mode 100644 index 00000000..687a0c7e --- /dev/null +++ b/debug.log @@ -0,0 +1,2 @@ +[1202/112117.469:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) +[1202/142655.509:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) diff --git a/package-lock.json b/package-lock.json index 8038f804..3f8a9a23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1504,6 +1504,115 @@ "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-10.1.0.tgz", "integrity": "sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==" }, + "@cypress/listr-verbose-renderer": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@cypress/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz", + "integrity": "sha1-p3SS9LEdzHxEajSz4ochr9M8ZCo=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "cli-cursor": "^1.0.2", + "date-fns": "^1.27.2", + "figures": "^1.7.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "date-fns": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz", + "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "@cypress/request": { + "version": "2.88.5", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.5.tgz", + "integrity": "sha512-TzEC1XMi1hJkywWpRfD2clreTa/Z+lOrXDCxxBTBPEcY5azdPi56A6Xw+O4tWJnaJH3iIE7G5aDXZC6JgRZLcA==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "@cypress/xvfb": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", + "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "lodash.once": "^4.1.1" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, "@emotion/hash": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", @@ -2439,6 +2548,15 @@ } } }, + "@samverschueren/stream-to-observable": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz", + "integrity": "sha512-c/qwwcHyafOQuVQJj0IlBjf5yYgBI7YPJ77k4fOJYesb41jio65eaJODRUmfYKhTOFBrIZ66kgvGPlNbjuoRdQ==", + "dev": true, + "requires": { + "any-observable": "^0.3.0" + } + }, "@sinonjs/commons": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.1.tgz", @@ -2983,6 +3101,18 @@ "@types/node": "*" } }, + "@types/sinonjs__fake-timers": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz", + "integrity": "sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg==", + "dev": true + }, + "@types/sizzle": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", + "integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==", + "dev": true + }, "@types/source-list-map": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz", @@ -3537,6 +3667,12 @@ "color-convert": "^1.9.0" } }, + "any-observable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz", + "integrity": "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==", + "dev": true + }, "anymatch": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", @@ -3560,6 +3696,12 @@ "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, + "arch": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -4395,6 +4537,12 @@ "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "optional": true }, + "blob-util": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", + "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", + "dev": true + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -4615,6 +4763,12 @@ "isarray": "^1.0.0" } }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -4700,6 +4854,12 @@ "unset-value": "^1.0.0" } }, + "cachedir": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.3.0.tgz", + "integrity": "sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==", + "dev": true + }, "call-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", @@ -4805,6 +4965,12 @@ "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==" }, + "check-more-types": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", + "integrity": "sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA=", + "dev": true + }, "check-types": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/check-types/-/check-types-11.1.2.tgz", @@ -4950,6 +5116,113 @@ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "cli-table3": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.0.tgz", + "integrity": "sha512-gnB85c3MGC7Nm9I/FkiasNBOKjOiO1RNuXXarQms37q4QMpWdlbBgD/VnOStA2faG1dpXMv31RFApjX1/QdgWQ==", + "dev": true, + "requires": { + "colors": "^1.1.2", + "object-assign": "^4.1.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "cli-truncate": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz", + "integrity": "sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ=", + "dev": true, + "requires": { + "slice-ansi": "0.0.4", + "string-width": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, "cliui": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", @@ -5019,6 +5292,12 @@ "q": "^1.1.2" } }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, "collect-v8-coverage": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", @@ -5069,6 +5348,13 @@ "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==" }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "optional": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -5771,6 +6057,197 @@ "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=" }, + "cypress": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-6.0.1.tgz", + "integrity": "sha512-3xtQZ0YM65soLgKQUgn2wg2IbWsM6A2yBg6L4RF31mZHr5LNKdO2/9sgiwxEVMKu2C2m6+IQ75zHP41kZP5rPg==", + "dev": true, + "requires": { + "@cypress/listr-verbose-renderer": "^0.4.1", + "@cypress/request": "^2.88.5", + "@cypress/xvfb": "^1.2.4", + "@types/sinonjs__fake-timers": "^6.0.1", + "@types/sizzle": "^2.3.2", + "arch": "^2.1.2", + "blob-util": "2.0.2", + "bluebird": "^3.7.2", + "cachedir": "^2.3.0", + "chalk": "^4.1.0", + "check-more-types": "^2.24.0", + "cli-table3": "~0.6.0", + "commander": "^5.1.0", + "common-tags": "^1.8.0", + "debug": "^4.1.1", + "eventemitter2": "^6.4.2", + "execa": "^4.0.2", + "executable": "^4.1.1", + "extract-zip": "^1.7.0", + "fs-extra": "^9.0.1", + "getos": "^3.2.1", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.3.2", + "lazy-ass": "^1.6.0", + "listr": "^0.14.3", + "lodash": "^4.17.19", + "log-symbols": "^4.0.0", + "minimist": "^1.2.5", + "moment": "^2.27.0", + "ospath": "^1.2.2", + "pretty-bytes": "^5.4.1", + "ramda": "~0.26.1", + "request-progress": "^3.0.0", + "supports-color": "^7.2.0", + "tmp": "~0.2.1", + "untildify": "^4.0.0", + "url": "^0.11.0", + "yauzl": "^2.10.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "ramda": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz", + "integrity": "sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -6261,6 +6738,12 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.603.tgz", "integrity": "sha512-J8OHxOeJkoSLgBXfV9BHgKccgfLMHh+CoeRo6wJsi6m0k3otaxS/5vrHpMNSEYY4MISwewqanPOuhAtuE8riQQ==" }, + "elegant-spinner": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", + "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=", + "dev": true + }, "elliptic": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", @@ -7198,6 +7681,12 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "eventemitter2": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.3.tgz", + "integrity": "sha512-t0A2msp6BzOf+QAcI6z9XMktLj52OjGQg+8SJH6v5+3uxNpWYRR3wQmfA+6xtMU9kOC59qk9licus5dYcrYkMQ==", + "dev": true + }, "eventemitter3": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", @@ -7244,11 +7733,34 @@ "strip-eof": "^1.0.0" } }, + "executable": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", + "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", + "dev": true, + "requires": { + "pify": "^2.2.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, "exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -7495,6 +8007,35 @@ } } }, + "extract-zip": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", + "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==", + "dev": true, + "requires": { + "concat-stream": "^1.6.2", + "debug": "^2.6.9", + "mkdirp": "^0.5.4", + "yauzl": "^2.10.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -7598,11 +8139,30 @@ "bser": "2.1.1" } }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, "figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==" }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, "file-entry-cache": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", @@ -7999,6 +8559,23 @@ "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" }, + "getos": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", + "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", + "dev": true, + "requires": { + "async": "^3.2.0" + }, + "dependencies": { + "async": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", + "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "dev": true + } + } + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -8028,6 +8605,15 @@ "is-glob": "^4.0.1" } }, + "global-dirs": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz", + "integrity": "sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A==", + "dev": true, + "requires": { + "ini": "^1.3.5" + } + }, "global-modules": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", @@ -8130,6 +8716,23 @@ "function-bind": "^1.1.1" } }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -9045,6 +9648,24 @@ "resolved": "https://registry.npmjs.org/is-in-browser/-/is-in-browser-1.1.3.tgz", "integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU=" }, + "is-installed-globally": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", + "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", + "dev": true, + "requires": { + "global-dirs": "^2.0.1", + "is-path-inside": "^3.0.1" + }, + "dependencies": { + "is-path-inside": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", + "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "dev": true + } + } + }, "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", @@ -9068,6 +9689,15 @@ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" }, + "is-observable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz", + "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==", + "dev": true, + "requires": { + "symbol-observable": "^1.1.0" + } + }, "is-path-cwd": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", @@ -9107,6 +9737,12 @@ "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz", "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=" }, + "is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "dev": true + }, "is-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", @@ -11692,6 +12328,12 @@ "webpack-sources": "^1.1.0" } }, + "lazy-ass": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", + "integrity": "sha1-eZllXoZGwX8In90YfRUNMyTVRRM=", + "dev": true + }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -11711,6 +12353,173 @@ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" }, + "listr": { + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz", + "integrity": "sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA==", + "dev": true, + "requires": { + "@samverschueren/stream-to-observable": "^0.3.0", + "is-observable": "^1.1.0", + "is-promise": "^2.1.0", + "is-stream": "^1.1.0", + "listr-silent-renderer": "^1.1.1", + "listr-update-renderer": "^0.5.0", + "listr-verbose-renderer": "^0.5.0", + "p-map": "^2.0.0", + "rxjs": "^6.3.3" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "listr-silent-renderer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz", + "integrity": "sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4=", + "dev": true + }, + "listr-update-renderer": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz", + "integrity": "sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "cli-truncate": "^0.2.1", + "elegant-spinner": "^1.0.1", + "figures": "^1.7.0", + "indent-string": "^3.0.0", + "log-symbols": "^1.0.2", + "log-update": "^2.3.0", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "dev": true, + "requires": { + "chalk": "^1.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "listr-verbose-renderer": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz", + "integrity": "sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "cli-cursor": "^2.1.0", + "date-fns": "^1.27.2", + "figures": "^2.0.0" + }, + "dependencies": { + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "date-fns": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz", + "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + } + } + }, "loader-runner": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", @@ -11756,6 +12565,12 @@ "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=" }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", + "dev": true + }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -11783,6 +12598,154 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "log-update": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz", + "integrity": "sha1-iDKP19HOeTiykoN0bwsbwSayRwg=", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "cli-cursor": "^2.0.0", + "wrap-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz", + "integrity": "sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo=", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0" + } + } + } + }, "loglevel": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.7.0.tgz", @@ -12182,6 +13145,12 @@ "minimist": "^1.2.5" } }, + "moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", + "dev": true + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -12467,6 +13436,12 @@ "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=" }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", @@ -12738,6 +13713,12 @@ "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" }, + "ospath": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", + "integrity": "sha1-EnZjl3Sj+O8lcvf+QoDg6kVQwHs=", + "dev": true + }, "p-each-series": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", @@ -12950,6 +13931,12 @@ "sha.js": "^2.4.8" } }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -15126,6 +16113,15 @@ "uuid": "^3.3.2" } }, + "request-progress": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", + "integrity": "sha1-TKdUCBx/7GP1BeT6qCWqBs1mnb4=", + "dev": true, + "requires": { + "throttleit": "^1.0.0" + } + }, "request-promise-core": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", @@ -15267,6 +16263,24 @@ } } }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + }, + "dependencies": { + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + } + } + }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -17343,6 +18357,12 @@ "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==" }, + "throttleit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", + "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", + "dev": true + }, "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -17404,6 +18424,26 @@ "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "requires": { + "rimraf": "^3.0.0" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -17702,6 +18742,12 @@ } } }, + "untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true + }, "upath": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", @@ -18961,6 +20007,16 @@ "camelcase": "^5.0.0", "decamelize": "^1.2.0" } + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } } } } diff --git a/package.json b/package.json index 492ad97a..1da6e2f9 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "devDependencies": { "@testing-library/user-event": "^12.2.0", "concurrently": "^5.3.0", + "cypress": "^6.0.1", "eslint-config-prettier": "^6.15.0", "eslint-plugin-flowtype": "^5.2.0", "eslint-plugin-import": "^2.22.1", From e2fc5236ddce2df7b5359c9f4c63e0a53023197d Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Wed, 2 Dec 2020 16:15:31 +0200 Subject: [PATCH 14/88] Covered more steps --- cypress/integration/app.spec.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cypress/integration/app.spec.js b/cypress/integration/app.spec.js index 5a0323bf..8a582442 100644 --- a/cypress/integration/app.spec.js +++ b/cypress/integration/app.spec.js @@ -4,26 +4,30 @@ describe("Basic e2e", function () { cy.get('[alt="CSC Login"]').click() }) - it("should create new folder", () => { + it("should create new folder, add study form and publish folder", () => { cy.visit("http://localhost:3000/newdraft") // Navigate to folder creation cy.get("button[type=button]").contains("New folder").click() // Add folder name & description, navigate to submissions - cy.get('input[name="name"]').type("Test name") - cy.get('textarea[name="description"]').type("Test description") + cy.get("input[name='name']").type("Test name") + cy.get("textarea[name='description']").type("Test description") cy.get("button[type=button]").contains("Next").click() // Fill a study form and save object cy.get("div[role=button]").contains("Study").click() cy.get("div[role=button]").contains("Fill Form").click() - cy.get('input[name="descriptor.studyTitle"]').type("Test title") - cy.get('select[name="descriptor.studyType"]').select("Metagenomics") + cy.get("input[name='descriptor.studyTitle']").type("Test title") + cy.get("select[name='descriptor.studyType']").select("Metagenomics") cy.get("button[type=submit]").contains("Save").click() + // Saved objects list should have newly added item + cy.get(".MuiListItem-container").should("have.length", 1) + // Navigate to summary and publish cy.get("button[type=button]").contains("Next").click() cy.get("button[type=button]").contains("Publish").click() + cy.get('button[aria-label="Publish folder contents and move to frontpage"]').contains("Publish").click() }) }) From 57096ae0e342c74540e9333185303c63c4ee1a54 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Thu, 3 Dec 2020 09:51:15 +0200 Subject: [PATCH 15/88] Timeout for submitted items list --- cypress/integration/app.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/integration/app.spec.js b/cypress/integration/app.spec.js index 8a582442..010c1a5f 100644 --- a/cypress/integration/app.spec.js +++ b/cypress/integration/app.spec.js @@ -23,9 +23,9 @@ describe("Basic e2e", function () { cy.get("button[type=submit]").contains("Save").click() // Saved objects list should have newly added item - cy.get(".MuiListItem-container").should("have.length", 1) + cy.get(".MuiListItem-container", { timeout: 10000 }).should("have.length", 1) - // Navigate to summary and publish + // // Navigate to summary and publish cy.get("button[type=button]").contains("Next").click() cy.get("button[type=button]").contains("Publish").click() cy.get('button[aria-label="Publish folder contents and move to frontpage"]').contains("Publish").click() From f9cf7da32a211d7b4ad4a6fc5d0cf38e43c589b5 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Thu, 3 Dec 2020 09:52:50 +0200 Subject: [PATCH 16/88] Deleted debug file and added into gitignore --- .gitignore | 1 + debug.log | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 debug.log diff --git a/.gitignore b/.gitignore index 50f8b481..67d1efab 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # testing /coverage +debug.log # production /build diff --git a/debug.log b/debug.log deleted file mode 100644 index 687a0c7e..00000000 --- a/debug.log +++ /dev/null @@ -1,2 +0,0 @@ -[1202/112117.469:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) -[1202/142655.509:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) From 12310bc8ce2f384ae234e891212dcffbf9dfd1ee Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Fri, 4 Dec 2020 10:39:01 +0200 Subject: [PATCH 17/88] Added onSubmit method to form root. Helps with e2e testing --- .../WizardForms/WizardUploadObjectXMLForm.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/NewDraftWizard/WizardForms/WizardUploadObjectXMLForm.js b/src/components/NewDraftWizard/WizardForms/WizardUploadObjectXMLForm.js index 6bc849a4..0b5c0807 100644 --- a/src/components/NewDraftWizard/WizardForms/WizardUploadObjectXMLForm.js +++ b/src/components/NewDraftWizard/WizardForms/WizardUploadObjectXMLForm.js @@ -53,7 +53,7 @@ const WizardUploadObjectXMLForm = () => { const dispatch = useDispatch() const classes = useStyles() - const { register, errors, watch, handleSubmit, formState } = useForm({ mode: "onChange" }) + const { register, errors, watch, handleSubmit, formState } = useForm<{ watchFile: any }>({ mode: "onChange" }) useEffect(() => { formState.isDirty && formState.isValid ? dispatch(setDraftStatus("notSaved")) : dispatch(resetDraftStatus()) @@ -90,20 +90,21 @@ const WizardUploadObjectXMLForm = () => { const handleButton = () => { const fileSelect = document && document.getElementById("file-select-button") - if (fileSelect && fileSelect.click()) { fileSelect.click() } } + console.log(watchFile) + return (
{/* React Hook Form */} - +
- From 5b53f9a1b605b1d2f4c47c2ce6a1c18a7fcb4c58 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Fri, 11 Dec 2020 14:26:29 +0200 Subject: [PATCH 49/88] Added '/publish' endpoint --- src/setupProxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/setupProxy.js b/src/setupProxy.js index 885049a4..cb3d9bec 100644 --- a/src/setupProxy.js +++ b/src/setupProxy.js @@ -7,7 +7,7 @@ const proxy = process.env.REACT_APP_BACKEND_PROXY || "localhost:5430" module.exports = function (app) { app.use( - ["/objects", "/schemas", "/validate", "/submit", "/folders", "/drafts", "/aai", "/callback", "/logout"], + ["/objects", "/schemas", "/validate", "/submit", "/folders", "/publish", "/drafts", "/aai", "/callback", "/logout"], createProxyMiddleware({ target: `http://${proxy}`, changeOrigin: true, From 8a0a9d43e7272cc077de1fa1639536282a2a6dca Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Fri, 11 Dec 2020 14:31:38 +0200 Subject: [PATCH 50/88] Reducer for alert status --- src/rootReducer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rootReducer.js b/src/rootReducer.js index 2c53ab7b..75a5b587 100644 --- a/src/rootReducer.js +++ b/src/rootReducer.js @@ -3,6 +3,7 @@ import { combineReducers } from "@reduxjs/toolkit" import draftStatusReducer from "features/draftStatusSlice" +import wizardAlertReducer from "features/wizardAlertSlice" import draftObjectReducer from "features/wizardDraftObjectSlice" import objectTypeReducer from "features/wizardObjectTypeSlice" import wizardStatusMessageReducer from "features/wizardStatusMessageSlice" @@ -11,6 +12,7 @@ import submissionFolderReducer from "features/wizardSubmissionFolderSlice" import submissionTypeReducer from "features/wizardSubmissionTypeSlice" const rootReducer = combineReducers({ + alert: wizardAlertReducer, statusDetails: wizardStatusMessageReducer, objectType: objectTypeReducer, wizardStep: wizardStepReducer, From 7ee0cc95f97fbde53f9a6dfcea64513e2a1efbbd Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Fri, 11 Dec 2020 14:33:02 +0200 Subject: [PATCH 51/88] Publish folder with new endpoint --- src/features/wizardSubmissionFolderSlice.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/features/wizardSubmissionFolderSlice.js b/src/features/wizardSubmissionFolderSlice.js index 52746e32..7594cb2e 100644 --- a/src/features/wizardSubmissionFolderSlice.js +++ b/src/features/wizardSubmissionFolderSlice.js @@ -6,6 +6,7 @@ import _reject from "lodash/reject" import objectAPIService from "../services/objectAPI" import folderAPIService from "services/folderAPI" +import publishAPIService from "services/publishAPI" const initialState = null @@ -133,9 +134,7 @@ export const deleteObjectFromFolder = (objectId: string, objectType: string) => } export const publishFolderContent = (folder: Folder) => async () => { - const changes = [{ op: "replace", path: "/published", value: true }] - const response = await folderAPIService.patchFolderById(folder.id, changes) - + const response = await publishAPIService.publishFolderById(folder.id) return new Promise((resolve, reject) => { if (response.ok) { resolve(response) From 80034ba604f0ba2250828212892313401cbe21e6 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Fri, 11 Dec 2020 14:34:37 +0200 Subject: [PATCH 52/88] Stop timer if alert dialog is open --- .../NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js b/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js index d676278a..33a295f5 100644 --- a/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js +++ b/src/components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm.js @@ -82,6 +82,7 @@ const FormContent = ({ resolver, formSchema, onSubmit, objectType, folderId }: F const [cleanedValues, setCleanedValues] = useState({}) const [timer, setTimer] = useState(0) const increment = useRef(null) + const alert = useSelector(state => state.alert) const resetForm = () => { methods.reset() @@ -158,6 +159,9 @@ const FormContent = ({ resolver, formSchema, onSubmit, objectType, folderId }: F } useEffect(() => { + if (alert) { + clearInterval(increment.current) + } if (timer >= 5) { saveDraft() clearInterval(increment.current) From ea30b0d4259b5ddb62658c304bfbe1c2b37f2c1e Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Fri, 11 Dec 2020 14:37:05 +0200 Subject: [PATCH 53/88] Mention that drafts will be lost on publish. Set alert state when dialog opens --- .../NewDraftWizard/WizardComponents/WizardAlert.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/NewDraftWizard/WizardComponents/WizardAlert.js b/src/components/NewDraftWizard/WizardComponents/WizardAlert.js index e82aa3c8..98648a01 100644 --- a/src/components/NewDraftWizard/WizardComponents/WizardAlert.js +++ b/src/components/NewDraftWizard/WizardComponents/WizardAlert.js @@ -1,5 +1,5 @@ //@flow -import React, { useState } from "react" +import React, { useState, useEffect } from "react" import Button from "@material-ui/core/Button" import Dialog from "@material-ui/core/Dialog" @@ -10,6 +10,7 @@ import DialogTitle from "@material-ui/core/DialogTitle" import Alert from "@material-ui/lab/Alert" import { useDispatch, useSelector } from "react-redux" +import { setAlert, resetAlert } from "features/wizardAlertSlice" import { resetDraftObject } from "features/wizardDraftObjectSlice" import { updateStatus } from "features/wizardStatusMessageSlice" import { addObjectToDrafts } from "features/wizardSubmissionFolderSlice" @@ -251,7 +252,15 @@ const WizardAlert = ({ alertType: string, }) => { const currentSubmissionType = useSelector(state => state.submissionType) + + const dispatch = useDispatch() + + useEffect(() => { + dispatch(setAlert()) + }, []) + const handleDialog = (action: boolean) => { + dispatch(resetAlert()) onAlert(action) } From b14caf45556a06a3151ed47d8343b72d7cab5645 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Fri, 11 Dec 2020 14:41:10 +0200 Subject: [PATCH 54/88] Slice for alert dialog status --- src/features/wizardAlertSlice.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/features/wizardAlertSlice.js diff --git a/src/features/wizardAlertSlice.js b/src/features/wizardAlertSlice.js new file mode 100644 index 00000000..f94b5181 --- /dev/null +++ b/src/features/wizardAlertSlice.js @@ -0,0 +1,16 @@ +//@flow +import { createSlice } from "@reduxjs/toolkit" + +const initialState = false + +const wizardAlertSlice = createSlice({ + name: "draftStatus", + initialState, + reducers: { + setAlert: () => true, + resetAlert: () => initialState, + }, +}) + +export const { setAlert, resetAlert } = wizardAlertSlice.actions +export default wizardAlertSlice.reducer From f8f0493ad6e4c779cce79029383177f398420a88 Mon Sep 17 00:00:00 2001 From: saulipurhonen Date: Fri, 11 Dec 2020 14:44:17 +0200 Subject: [PATCH 55/88] API service for publishing --- src/services/publishAPI.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/services/publishAPI.js diff --git a/src/services/publishAPI.js b/src/services/publishAPI.js new file mode 100644 index 00000000..da2ce19d --- /dev/null +++ b/src/services/publishAPI.js @@ -0,0 +1,12 @@ +//@flow +import { create } from "apisauce" + +const api = create({ baseURL: "/publish" }) + +const publishFolderById = async (folderId: string) => { + return await api.patch(`/${folderId}`) +} + +export default { + publishFolderById, +} From bec7f4e8ae84e202a6029a3a51aedcaadbb4cc56 Mon Sep 17 00:00:00 2001 From: HangLe Date: Tue, 8 Dec 2020 13:32:33 +0200 Subject: [PATCH 56/88] Create handling page for error 401 --- src/App.js | 4 +++ src/views/ErrorPages/Page401.js | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/views/ErrorPages/Page401.js diff --git a/src/App.js b/src/App.js index dd6db412..dad2425c 100644 --- a/src/App.js +++ b/src/App.js @@ -7,6 +7,7 @@ import { makeStyles } from "@material-ui/core/styles" import { BrowserRouter as Router, Switch, Route } from "react-router-dom" import Nav from "components/Nav" +import Page401 from "views/ErrorPages/Page401" import Page404 from "views/ErrorPages/Page404" import Page500 from "views/ErrorPages/Page500" import Home from "views/Home" @@ -52,6 +53,9 @@ const App = () => { + + + diff --git a/src/views/ErrorPages/Page401.js b/src/views/ErrorPages/Page401.js new file mode 100644 index 00000000..e6e237eb --- /dev/null +++ b/src/views/ErrorPages/Page401.js @@ -0,0 +1,50 @@ +//@flow +import React, { useState, useEffect } from "react" + +import { Button } from "@material-ui/core" +import Card from "@material-ui/core/Card" +import CardContent from "@material-ui/core/CardContent" +import CardHeader from "@material-ui/core/CardHeader" +import Grid from "@material-ui/core/Grid" +import Typography from "@material-ui/core/Typography" +import { Redirect } from "react-router-dom" + +const Page401 = () => { + const [countdownTime, setCountdownTime] = useState(10) + const [redirect, setRedirect] = useState(false) + + useEffect(() => { + let timer + if (countdownTime > 0) { + timer = setInterval(() => setCountdownTime(countdownTime - 1), 1000) + return () => clearInterval(timer) + } + if (countdownTime === 0) { + setRedirect(true) + } + }, [countdownTime]) + + const RedirectToMainPage = + const ButtonToMainPage = + + return redirect ? ( + RedirectToMainPage + ) : ( + + + + + + You have attempted to access a page for which you are not authorized. + + You can go back to the main page by clicking this {ButtonToMainPage} or it will automatically redirect in{" "} + {countdownTime}s. + + + + + + ) +} + +export default Page401 From b38add28f10fdae120f2917a48c454edb09b6cf5 Mon Sep 17 00:00:00 2001 From: HangLe Date: Tue, 8 Dec 2020 15:59:25 +0200 Subject: [PATCH 57/88] Create handling page for error 403 --- src/App.js | 22 ++++++++++++--- src/views/ErrorPages/Page401.js | 9 +++---- src/views/ErrorPages/Page403.js | 47 +++++++++++++++++++++++++++++++++ src/views/ErrorPages/Page404.js | 3 ++- 4 files changed, 71 insertions(+), 10 deletions(-) create mode 100644 src/views/ErrorPages/Page403.js diff --git a/src/App.js b/src/App.js index dad2425c..4097c863 100644 --- a/src/App.js +++ b/src/App.js @@ -8,6 +8,7 @@ import { BrowserRouter as Router, Switch, Route } from "react-router-dom" import Nav from "components/Nav" import Page401 from "views/ErrorPages/Page401" +import Page403 from "views/ErrorPages/Page403" import Page404 from "views/ErrorPages/Page404" import Page500 from "views/ErrorPages/Page500" import Home from "views/Home" @@ -34,6 +35,10 @@ const useStyles = makeStyles(theme => ({ flexDirection: "column", height: "100%", }, + errorContent: { + width: "100%", + marginTop: theme.spacing(10), + }, })) /** @@ -54,10 +59,19 @@ const App = () => { - + + + + + + + + - + + + @@ -70,7 +84,9 @@ const App = () => { - + + + diff --git a/src/views/ErrorPages/Page401.js b/src/views/ErrorPages/Page401.js index e6e237eb..6e913e71 100644 --- a/src/views/ErrorPages/Page401.js +++ b/src/views/ErrorPages/Page401.js @@ -24,11 +24,10 @@ const Page401 = () => { } }, [countdownTime]) - const RedirectToMainPage = const ButtonToMainPage = return redirect ? ( - RedirectToMainPage + ) : ( @@ -36,10 +35,8 @@ const Page401 = () => { You have attempted to access a page for which you are not authorized. - - You can go back to the main page by clicking this {ButtonToMainPage} or it will automatically redirect in{" "} - {countdownTime}s. - + You can go back to {ButtonToMainPage} + Automatically redirect in {countdownTime}s. diff --git a/src/views/ErrorPages/Page403.js b/src/views/ErrorPages/Page403.js new file mode 100644 index 00000000..c12421bb --- /dev/null +++ b/src/views/ErrorPages/Page403.js @@ -0,0 +1,47 @@ +//@flow +import React, { useState, useEffect } from "react" + +import { Button } from "@material-ui/core" +import Card from "@material-ui/core/Card" +import CardContent from "@material-ui/core/CardContent" +import CardHeader from "@material-ui/core/CardHeader" +import Grid from "@material-ui/core/Grid" +import Typography from "@material-ui/core/Typography" +import { Redirect } from "react-router-dom" + +const Page403 = () => { + const [countdownTime, setCountdownTime] = useState(10) + const [redirect, setRedirect] = useState(false) + + useEffect(() => { + let timer + if (countdownTime > 0) { + timer = setInterval(() => setCountdownTime(countdownTime - 1), 1000) + return () => clearInterval(timer) + } + if (countdownTime === 0) { + setRedirect(true) + } + }, [countdownTime]) + + const ButtonToHomePage = + + return redirect ? ( + + ) : ( + + + + + + Sorry, this page is currently not valid. + Please go back to {ButtonToHomePage} + Automatically redirect in {countdownTime}s. + + + + + ) +} + +export default Page403 diff --git a/src/views/ErrorPages/Page404.js b/src/views/ErrorPages/Page404.js index 70af386c..58c839d7 100644 --- a/src/views/ErrorPages/Page404.js +++ b/src/views/ErrorPages/Page404.js @@ -9,8 +9,9 @@ import { useLocation } from "react-router-dom" const Page404 = () => { const location = useLocation() + return ( - + From 3092310b4ddce2aa8a8b7a168437de837b7dfd41 Mon Sep 17 00:00:00 2001 From: HangLe Date: Fri, 11 Dec 2020 19:34:22 +0200 Subject: [PATCH 58/88] Create Container for Error Pages --- src/App.js | 28 +++++++------------- src/components/ErrorPageContainer.js | 39 ++++++++++++++++++++++++++++ src/views/ErrorPages/Page401.js | 23 +++++----------- src/views/ErrorPages/Page403.js | 23 +++++----------- src/views/ErrorPages/Page404.js | 19 ++++---------- src/views/ErrorPages/Page500.js | 20 ++++---------- 6 files changed, 73 insertions(+), 79 deletions(-) create mode 100644 src/components/ErrorPageContainer.js diff --git a/src/App.js b/src/App.js index 4097c863..93b44c79 100644 --- a/src/App.js +++ b/src/App.js @@ -58,21 +58,6 @@ const App = () => { - - - - - - - - - - - - - - - @@ -83,10 +68,17 @@ const App = () => { + + + + + + + + + - - - + diff --git a/src/components/ErrorPageContainer.js b/src/components/ErrorPageContainer.js new file mode 100644 index 00000000..92c0a0d0 --- /dev/null +++ b/src/components/ErrorPageContainer.js @@ -0,0 +1,39 @@ +//@flow +import React from "react" + +import Card from "@material-ui/core/Card" +import CardContent from "@material-ui/core/CardContent" +import CardHeader from "@material-ui/core/CardHeader" +// import Container from "@material-ui/core/Container" +import Grid from "@material-ui/core/Grid" +// import { makeStyles } from "@material-ui/core/styles" + +type ErrorPageProps = { + children: any, + title: string, +} + +// const useStyles = makeStyles(theme => ({ +// errorContent: { +// width: "100%", +// marginTop: theme.spacing(10), +// }, +// })) + +const ErrorPage = ({ title, children }: ErrorPageProps) => { + // const classes = useStyles() + return ( + // + + + + + {children} + + + + // + ) +} + +export default ErrorPage diff --git a/src/views/ErrorPages/Page401.js b/src/views/ErrorPages/Page401.js index 6e913e71..bf6f0e46 100644 --- a/src/views/ErrorPages/Page401.js +++ b/src/views/ErrorPages/Page401.js @@ -2,13 +2,11 @@ import React, { useState, useEffect } from "react" import { Button } from "@material-ui/core" -import Card from "@material-ui/core/Card" -import CardContent from "@material-ui/core/CardContent" -import CardHeader from "@material-ui/core/CardHeader" -import Grid from "@material-ui/core/Grid" import Typography from "@material-ui/core/Typography" import { Redirect } from "react-router-dom" +import ErrorPageContainer from "../../components/ErrorPageContainer" + const Page401 = () => { const [countdownTime, setCountdownTime] = useState(10) const [redirect, setRedirect] = useState(false) @@ -29,18 +27,11 @@ const Page401 = () => { return redirect ? ( ) : ( - - - - - - You have attempted to access a page for which you are not authorized. - You can go back to {ButtonToMainPage} - Automatically redirect in {countdownTime}s. - - - - + + You have attempted to access a page for which you are not authorized. + You can go back to {ButtonToMainPage} + Automatically redirect in {countdownTime}s. + ) } diff --git a/src/views/ErrorPages/Page403.js b/src/views/ErrorPages/Page403.js index c12421bb..c0f10492 100644 --- a/src/views/ErrorPages/Page403.js +++ b/src/views/ErrorPages/Page403.js @@ -2,13 +2,11 @@ import React, { useState, useEffect } from "react" import { Button } from "@material-ui/core" -import Card from "@material-ui/core/Card" -import CardContent from "@material-ui/core/CardContent" -import CardHeader from "@material-ui/core/CardHeader" -import Grid from "@material-ui/core/Grid" import Typography from "@material-ui/core/Typography" import { Redirect } from "react-router-dom" +import ErrorPageContainer from "../../components/ErrorPageContainer" + const Page403 = () => { const [countdownTime, setCountdownTime] = useState(10) const [redirect, setRedirect] = useState(false) @@ -29,18 +27,11 @@ const Page403 = () => { return redirect ? ( ) : ( - - - - - - Sorry, this page is currently not valid. - Please go back to {ButtonToHomePage} - Automatically redirect in {countdownTime}s. - - - - + + Sorry, this page is currently not valid. + Please go back to {ButtonToHomePage} + Automatically redirect in {countdownTime}s. + ) } diff --git a/src/views/ErrorPages/Page404.js b/src/views/ErrorPages/Page404.js index 58c839d7..fba342ce 100644 --- a/src/views/ErrorPages/Page404.js +++ b/src/views/ErrorPages/Page404.js @@ -1,26 +1,17 @@ //@flow import React from "react" -import Card from "@material-ui/core/Card" -import CardContent from "@material-ui/core/CardContent" -import CardHeader from "@material-ui/core/CardHeader" -import Grid from "@material-ui/core/Grid" import { useLocation } from "react-router-dom" +import ErrorPageContainer from "../../components/ErrorPageContainer" + const Page404 = () => { const location = useLocation() return ( - - - - - - Oops! Page {location.pathname} could not be found. - - - - + + Oops! Page {location.pathname} could not be found. + ) } diff --git a/src/views/ErrorPages/Page500.js b/src/views/ErrorPages/Page500.js index a859f730..81f43991 100644 --- a/src/views/ErrorPages/Page500.js +++ b/src/views/ErrorPages/Page500.js @@ -1,25 +1,15 @@ //@flow import React from "react" -import Card from "@material-ui/core/Card" -import CardContent from "@material-ui/core/CardContent" -import CardHeader from "@material-ui/core/CardHeader" -import Grid from "@material-ui/core/Grid" +import ErrorPageContainer from "../../components/ErrorPageContainer" const Page500 = () => { const errorLink = "https://github.com/CSCfi/metadata-submitter/issues" return ( - - - - - - Oops, this means our server caused some sort of error we have not thought of. We would like to fix the - error, so could you maybe drop us a line in our github repo? - - - - + + Oops, this means our server caused some sort of error we have not thought of. We would like to fix the error, so + could you maybe drop us a line in our github repo? + ) } From 35fa1d88d3becc9fad209dcf86563ccd08976f10 Mon Sep 17 00:00:00 2001 From: HangLe Date: Mon, 14 Dec 2020 16:20:10 +0200 Subject: [PATCH 59/88] Update Unit tests for Error Pages --- src/App.js | 70 ++++++++++++------------ src/__tests__/Page401.test.js | 44 +++++++++++++++ src/__tests__/Page403.test.js | 44 +++++++++++++++ src/__tests__/Page404.test.js | 24 ++++++++ src/__tests__/Page500.test.js | 15 +++++ src/__tests__/index.test.js | 5 +- src/components/ErrorPageContainer.js | 36 ++++++------ src/index.js | 5 +- src/views/ErrorPages/ErrorPagesHelper.js | 13 +++++ src/views/ErrorPages/Page401.js | 12 ++-- src/views/ErrorPages/Page403.js | 12 ++-- src/views/ErrorPages/Page404.js | 2 +- src/views/ErrorPages/Page500.js | 2 +- 13 files changed, 212 insertions(+), 72 deletions(-) create mode 100644 src/__tests__/Page401.test.js create mode 100644 src/__tests__/Page403.test.js create mode 100644 src/__tests__/Page404.test.js create mode 100644 src/__tests__/Page500.test.js create mode 100644 src/views/ErrorPages/ErrorPagesHelper.js diff --git a/src/App.js b/src/App.js index 93b44c79..9b52527a 100644 --- a/src/App.js +++ b/src/App.js @@ -4,7 +4,7 @@ import React from "react" import Container from "@material-ui/core/Container" import CssBaseline from "@material-ui/core/CssBaseline" import { makeStyles } from "@material-ui/core/styles" -import { BrowserRouter as Router, Switch, Route } from "react-router-dom" +import { Switch, Route } from "react-router-dom" import Nav from "components/Nav" import Page401 from "views/ErrorPages/Page401" @@ -48,41 +48,39 @@ const useStyles = makeStyles(theme => ({ const App = () => { const classes = useStyles() return ( - - - -