From 4b6395dafc8ac46a46c3f5c68da2b15bb4384cee Mon Sep 17 00:00:00 2001 From: mwigham <38520885+mwigham@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:14:35 +0200 Subject: [PATCH] form for sending to SANE --- .../projects/crud/ProjectExportView.jsx | 114 ++++++++++++++++-- app/workspace/projects/crud/ProjectTable.jsx | 1 - 2 files changed, 102 insertions(+), 13 deletions(-) diff --git a/app/workspace/projects/crud/ProjectExportView.jsx b/app/workspace/projects/crud/ProjectExportView.jsx index b031f6d..bf59f5b 100644 --- a/app/workspace/projects/crud/ProjectExportView.jsx +++ b/app/workspace/projects/crud/ProjectExportView.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import React, { useRef, useState, useEffect } from "react"; import { Link, useParams, useNavigate, useLocation } from "react-router-dom"; import PropTypes from "prop-types"; import IDUtil from "../../../util/IDUtil"; @@ -22,6 +22,13 @@ const ProjectExportView = ({ recipe, params, user, clientId }) => { const [exportType, setExportType] = useState('projectMetadata') const [project, setProject] = useState(null); + const nameExportRef = useRef(null); + const namePersonRef = useRef(null); + const emailRef = useRef(null); + const affiliationRef = useRef(null); + const collaborativeOrganisationRef = useRef(null); + const descRef = useRef(null); + // React hooks useEffect(() => { setBreadCrumbsFromMatch(location.pathname); @@ -46,7 +53,7 @@ const ProjectExportView = ({ recipe, params, user, clientId }) => { }); }; - const handleSubmit = (e, proj) => { + const handleProjectMetadataSubmit = (e, proj) => { e.preventDefault(); exportDataAsJSON(proj) @@ -54,6 +61,13 @@ const ProjectExportView = ({ recipe, params, user, clientId }) => { return false; }; + const handleCorpusSubmit = (e, proj) => { + e.preventDefault(); + alert("Need to implement sending \"" + nameExportRef.current?.value + "\" to the Set API and email data provider") + + return false; + }; + let cancelButton = null; if (cancelLink && cancelLink !== "") { cancelButton = ( @@ -75,6 +89,8 @@ const ProjectExportView = ({ recipe, params, user, clientId }) => { } else if (project) { contents = (
On this page you can export the metadata describing "{project.name}" or request to send your corpus, consisting of the metadata of the items in your bookmark groups and queries, to the SANE environment for analysis