diff --git a/apps/digitaltwins/src/App.tsx b/apps/digitaltwins/src/App.tsx index 19e5319..fc7a993 100644 --- a/apps/digitaltwins/src/App.tsx +++ b/apps/digitaltwins/src/App.tsx @@ -1,4 +1,4 @@ -import { Suspense, useState } from "react"; +import { Suspense /*useState*/ } from "react"; import { BrowserRouter, Routes, Route } from "react-router-dom"; import Skeleton from "@mui/material/Skeleton"; import Box from "@mui/material/Box"; @@ -24,13 +24,13 @@ import languages from "./config/languages"; import authProvider from "./config/auth"; import form from "./config/form"; import { FileMapper } from "@dans-framework/file-mapper"; -import type { FormConfig } from "@dans-framework/deposit"; +// import type { FormConfig } from "@dans-framework/deposit"; const App = () => { const { i18n } = useTranslation(); // Must keep a parent state for the form mapper component, // otherwise the app will not know of any API response from the FileMapper component - const [mappedForm, setMappedForm] = useState(); + // const [ mappedForm, setMappedForm ] = useState(); return ( @@ -79,13 +79,17 @@ const App = () => { element={ page.template === "deposit" ? - + : page.template === "mapper" ? : diff --git a/apps/digitaltwins/src/config/formsections/coverage.ts b/apps/digitaltwins/src/config/formsections/coverage.ts index ab08e4b..1932c26 100644 --- a/apps/digitaltwins/src/config/formsections/coverage.ts +++ b/apps/digitaltwins/src/config/formsections/coverage.ts @@ -36,7 +36,7 @@ const section: InitialSectionType = { { type: "autocomplete", label: { - en: "Species", + en: "Species covered", nl: "Soorten", }, name: "species", @@ -46,7 +46,8 @@ const section: InitialSectionType = { en: "Something here", nl: "Iets hier", }, - options: "biodiversity", + multiApiValue: "biodiversity_species_scientific", + options: [ "biodiversity_species_scientific", "biodiversity_species_vernacular" ], }, { type: "group", diff --git a/apps/digitaltwins/src/config/pages.ts b/apps/digitaltwins/src/config/pages.ts index 7e3dcc2..c11d183 100644 --- a/apps/digitaltwins/src/config/pages.ts +++ b/apps/digitaltwins/src/config/pages.ts @@ -18,15 +18,15 @@ const depositPage: Page = { const advisorPage: Page = { id: "mapper", name: { - en: "Map your data", - nl: "Map your data", + en: "Start mapping terms", + nl: "Start mapping terms", }, slug: "map", template: "mapper", inMenu: true, menuTitle: { - en: "Map data", - nl: "Map data", + en: "Term mapping", + nl: "Term mapping", }, }; diff --git a/packages/deposit/lib/index.tsx b/packages/deposit/lib/index.tsx index a77026a..cdd3292 100644 --- a/packages/deposit/lib/index.tsx +++ b/packages/deposit/lib/index.tsx @@ -7,6 +7,7 @@ export type { } from "../src/types/MetadataFields"; export type { AutocompleteAPIFieldProps } from "../src/types/MetadataProps"; export type { QueryReturnType } from "../src/types/Api"; +export type { FileLocation } from "../src/types/Files"; // export some api's for other redux stores export { @@ -17,3 +18,9 @@ export { rorApi, useFetchRorByNameQuery, } from "../src/features/metadata/api/ror"; +// same for slices +export { addFiles } from "../src/features/files/filesSlice"; +export { initForm } from "../src/features/metadata/metadataSlice"; + +// expose the store +export { store as depositStore } from "../src/redux/store"; \ No newline at end of file diff --git a/packages/deposit/src/features/files/FilesTable.tsx b/packages/deposit/src/features/files/FilesTable.tsx index 25909a7..acf683c 100644 --- a/packages/deposit/src/features/files/FilesTable.tsx +++ b/packages/deposit/src/features/files/FilesTable.tsx @@ -31,6 +31,7 @@ import LinearProgress from "@mui/material/LinearProgress"; import CircularProgress from "@mui/material/CircularProgress"; import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; +import Chip from "@mui/material/Chip"; import { getSingleFileSubmitStatus, setFilesSubmitStatus, @@ -96,7 +97,7 @@ const FilesTable = () => { {selectedFiles.map((file) => ( - + ))} @@ -312,6 +313,25 @@ const FileTableRow = ({ file }: FileItemProps) => { )} {file.name} + {file.mapping && ( + + {Object.entries(file.mapping).map(([key, value], i) => ( + + {key}: {value.label} + + ))} + + } + > + + + )} @@ -370,7 +390,7 @@ const FileTableRow = ({ file }: FileItemProps) => { exit={{ opacity: 0 }} > - + diff --git a/packages/deposit/src/features/files/filesSlice.ts b/packages/deposit/src/features/files/filesSlice.ts index c9ac060..c67328c 100644 --- a/packages/deposit/src/features/files/filesSlice.ts +++ b/packages/deposit/src/features/files/filesSlice.ts @@ -10,6 +10,8 @@ export const filesSlice = createSlice({ reducers: { // keep track of file selection addFiles: (state, action: PayloadAction) => { + console.log("adding"); + console.log(action); state.push(...action.payload); }, removeFile: (state, action: PayloadAction) => { diff --git a/packages/deposit/src/features/metadata/MetadataFields.tsx b/packages/deposit/src/features/metadata/MetadataFields.tsx index ec8155b..f068383 100644 --- a/packages/deposit/src/features/metadata/MetadataFields.tsx +++ b/packages/deposit/src/features/metadata/MetadataFields.tsx @@ -160,9 +160,13 @@ const SingleField = memo(({ field, sectionIndex }: SingleFieldProps) => { return ( ); - case "biodiversity": + case "biodiversity_species_vernacular": return ( - + + ); + case "biodiversity_species_scientific": + return ( + ); default: return ( diff --git a/packages/deposit/src/features/metadata/api/biodiversity.ts b/packages/deposit/src/features/metadata/api/biodiversity.ts index 9309bf4..325c287 100644 --- a/packages/deposit/src/features/metadata/api/biodiversity.ts +++ b/packages/deposit/src/features/metadata/api/biodiversity.ts @@ -7,23 +7,25 @@ export const biodiversityApi = createApi({ baseQuery: fetchBaseQuery({ baseUrl: "https://api.biodiversitydata.nl/v2" }), endpoints: (build) => ({ fetchSpecies: build.query({ - query: (keyword) => { + query: ({ value, variant }) => { // Format a query to search both for scientific as well as more common matches const formattedQuery = encodeURIComponent( JSON.stringify({ conditions: [ { - field: "acceptedName.fullScientificName", + field: variant === "scientific" ? "acceptedName.fullScientificName" : "vernacularNames.name", operator: "CONTAINS", - value: keyword, + value: value, }, + // For now, Dutch species registry only (NSR) + // Catalog of life is code COL { - field: "vernacularNames.name", - operator: "CONTAINS", - value: keyword, - }, + field: "sourceSystem.code", + operator: "EQUALS", + value: "NSR", + } ], - logicalOperator: "OR", + logicalOperator: "AND", size: 1000, }), ); @@ -40,7 +42,7 @@ export const biodiversityApi = createApi({ console.log(response); return response.resultSet?.length > 0 ? { - arg: arg, + arg: arg.value, response: response.resultSet.map((result) => ({ label: result.item.acceptedName.fullScientificName, value: result.item.recordURI, @@ -48,7 +50,7 @@ export const biodiversityApi = createApi({ extraContent: result.item.vernacularNames ?.filter( (item) => - item.language === "English" || item.language === "Dutch", + item.language === "English" || item.language === "Dutch" || item.language === "Flemish", ) .map((item) => item.name) .join(", "), diff --git a/packages/deposit/src/features/metadata/fields/AutocompleteAPIField.tsx b/packages/deposit/src/features/metadata/fields/AutocompleteAPIField.tsx index f45c782..0c59a1a 100644 --- a/packages/deposit/src/features/metadata/fields/AutocompleteAPIField.tsx +++ b/packages/deposit/src/features/metadata/fields/AutocompleteAPIField.tsx @@ -179,15 +179,18 @@ export const DatastationsField = ({ export const BiodiversityField = ({ field, sectionIndex, + variant }: AutocompleteFieldProps) => { const [inputValue, setInputValue] = useState(""); const debouncedInputValue = useDebounce(inputValue, 500)[0]; // Fetch data on input change const { data, isFetching, isLoading } = useFetchSpeciesQuery( - debouncedInputValue, + { value: debouncedInputValue, variant: variant }, { skip: debouncedInputValue === "" }, ); + console.log(data) + return ( )} + {field.multiApiValue === "biodiversity_species_vernacular" && ( + + )} + {field.multiApiValue === "biodiversity_species_scientific" && ( + + )} ); }; diff --git a/packages/deposit/src/features/metadata/fields/Map.tsx b/packages/deposit/src/features/metadata/fields/Map.tsx index 6ac476c..0c7ba91 100644 --- a/packages/deposit/src/features/metadata/fields/Map.tsx +++ b/packages/deposit/src/features/metadata/fields/Map.tsx @@ -114,7 +114,6 @@ const DrawMap = ({ field, sectionIndex }: DrawMapFieldProps) => { ); const [getConvertedCoordinates] = useLazyTransformCoordinatesQuery(); const [hiddenLayers, setHiddenLayers] = useState([]); - const mapRef = useRef(null); const [fetchWmsFeature] = useLazyFetchFeatureQuery(); diff --git a/packages/deposit/src/languages/locales/en/files.json b/packages/deposit/src/languages/locales/en/files.json index 73dd6d0..28ef5cd 100644 --- a/packages/deposit/src/languages/locales/en/files.json +++ b/packages/deposit/src/languages/locales/en/files.json @@ -47,5 +47,6 @@ "dateInvalid": "Invalid date", "fileTooLarge": "Files over {{ size }} GB cannot be processed by the target repository", "fileNoSize": "Cannot upload files of 0 bytes", - "fileForbiddenCharacters": "File name contains forbidden characters: /:*?\"<>|;#" + "fileForbiddenCharacters": "File name contains forbidden characters: /:*?\"<>|;#", + "termsMapped": "Terms mapped" } \ No newline at end of file diff --git a/packages/deposit/src/languages/locales/en/metadata.json b/packages/deposit/src/languages/locales/en/metadata.json index 0c3d550..13ddb85 100644 --- a/packages/deposit/src/languages/locales/en/metadata.json +++ b/packages/deposit/src/languages/locales/en/metadata.json @@ -15,11 +15,15 @@ "orcid": "ORCID", "multi-orcid": "Person", "ror": "RoR", + "biodiversity_species_scientific": "the Naturalis Dutch species registry (scientific names)", + "biodiversity_species_vernacular": "the Naturalis Dutch species registry (vernacular names)", "multi-ror": "Organisation", "multi-domains": "Domain", "multi-pathways": "Pathway", "multi-rdaworkinggroups": "Working Groups", "multi-interest groups": "Interest Groups", + "multi-biodiversity_species_scientific": "Scientific name", + "multi-biodiversity_species_vernacular": "Vernacular name", "getty": "Getty AAT", "geonames": "GeoNames", "elsst": "ELSST Thesaurus", diff --git a/packages/deposit/src/languages/locales/nl/files.json b/packages/deposit/src/languages/locales/nl/files.json index 5f1f1dc..e298dee 100644 --- a/packages/deposit/src/languages/locales/nl/files.json +++ b/packages/deposit/src/languages/locales/nl/files.json @@ -47,5 +47,6 @@ "dateInvalid": "Ongeldige datum", "fileTooLarge": "Bestanden groter dan {{ size }} GB kunnen niet worden verwerkt door het doelrepository", "fileNoSize": "Kan geen bestanden van 0 bytes uploaden", - "fileForbiddenCharacters": "Bestandsnaam bevat tekens die niet zijn toegestaan: /:*?\"<>|;#" + "fileForbiddenCharacters": "Bestandsnaam bevat tekens die niet zijn toegestaan: /:*?\"<>|;#", + "termsMapped": "Terms mapped" } \ No newline at end of file diff --git a/packages/deposit/src/types/Files.ts b/packages/deposit/src/types/Files.ts index 75210cf..609d8ef 100644 --- a/packages/deposit/src/types/Files.ts +++ b/packages/deposit/src/types/Files.ts @@ -42,6 +42,10 @@ export interface SelectedFile { submittedFile?: boolean; errors?: never; file?: never; + // for translating xls/csv file columns + mapping?: { + [key: string]: any; + }; } interface FileError { diff --git a/packages/deposit/src/types/MetadataFields.ts b/packages/deposit/src/types/MetadataFields.ts index b96eb2c..47a2be6 100644 --- a/packages/deposit/src/types/MetadataFields.ts +++ b/packages/deposit/src/types/MetadataFields.ts @@ -224,7 +224,8 @@ export type TypeaheadAPI = | Datastations | "sshLicences" | "languageList" - | "biodiversity"; + | "biodiversity_species_scientific" + | "biodiversity_species_vernacular"; // Options that should be specified if Google Sheet API is used in Autocomplete interface SheetOptions { diff --git a/packages/deposit/src/types/MetadataProps.ts b/packages/deposit/src/types/MetadataProps.ts index cbf4c25..3a3f6d9 100644 --- a/packages/deposit/src/types/MetadataProps.ts +++ b/packages/deposit/src/types/MetadataProps.ts @@ -57,6 +57,7 @@ export interface AutocompleteFieldProps field: AutocompleteFieldType; onOpen?: () => void; isLoading?: boolean; + variant?: string; } export interface AutocompleteAPIFieldProps extends AutocompleteFieldProps { diff --git a/packages/file-mapper/package.json b/packages/file-mapper/package.json index 1cb4a84..ac36e94 100644 --- a/packages/file-mapper/package.json +++ b/packages/file-mapper/package.json @@ -5,6 +5,7 @@ "private": true, "version": "1.0.0", "dependencies": { + "@dans-framework/deposit": "workspace:*", "@dans-framework/utils": "workspace:*", "@mui/icons-material": "^5.14.3", "@mui/material": "^5.16.7", @@ -17,12 +18,14 @@ "react-dropzone": "^14.2.3", "react-i18next": "^13.0.3", "react-redux": "^8.1.2", + "react-router-dom": "^6.14.2", + "uuid": "^9.0.0", "xlsx": "^0.18.5" }, "devDependencies": { - "@dans-framework/deposit": "workspace:*", "@dans-framework/pages": "workspace:*", "@types/react": "^18.2.15", - "@types/react-dom": "^18.2.7" + "@types/react-dom": "^18.2.7", + "@types/uuid": "^9.0.2" } } diff --git a/packages/file-mapper/src/features/FileMapper.tsx b/packages/file-mapper/src/features/FileMapper.tsx index 44a266b..372ee8f 100644 --- a/packages/file-mapper/src/features/FileMapper.tsx +++ b/packages/file-mapper/src/features/FileMapper.tsx @@ -1,8 +1,8 @@ -import { useEffect, type Dispatch, type SetStateAction } from "react"; +import { useEffect /*type Dispatch, type SetStateAction*/ } from "react"; import Container from "@mui/material/Container"; import Grid from "@mui/material/Unstable_Grid2"; import Box from "@mui/material/Box"; -import Stack from "@mui/material/Stack"; +// import Stack from "@mui/material/Stack"; import Paper from "@mui/material/Paper"; import Button from "@mui/material/Button"; import Stepper from "@mui/material/Stepper"; @@ -19,22 +19,34 @@ import { getSavedMap, getMapping, getFileError, + reset, } from "./fileMapperSlice"; -import { useSubmitMapMutation } from "./fileMapperApi"; +// import { useSubmitMapMutation } from './fileMapperApi'; import { useAppSelector, useAppDispatch } from "../redux/hooks"; -import CircularProgress from "@mui/material/CircularProgress"; +// import CircularProgress from '@mui/material/CircularProgress'; import { useSiteTitle, setSiteTitle } from "@dans-framework/utils/sitetitle"; import { lookupLanguageString } from "@dans-framework/utils/language"; -import { type Page } from "@dans-framework/pages"; -import type { FormConfig } from "@dans-framework/deposit"; +import type { Page } from "@dans-framework/pages"; +import { + addFiles, + initForm, + depositStore, + type FormConfig, + type FileLocation, +} from "@dans-framework/deposit"; import { steps } from "./Steps"; +import { v4 as uuidv4 } from "uuid"; +import { useNavigate } from "react-router-dom"; const FileMapper = ({ - setMappedForm, - page, + config, + /*setMappedForm,*/ page, + depositPageSlug, }: { - setMappedForm: Dispatch>; + config: FormConfig; + // setMappedForm?: Dispatch>; page: Page; + depositPageSlug?: string; }) => { const dispatch = useAppDispatch(); const siteTitle = useSiteTitle(); @@ -44,31 +56,58 @@ const FileMapper = ({ const savedMap = useAppSelector(getSavedMap); const mapping = useAppSelector(getMapping); const fileError = useAppSelector(getFileError); - const [submitMap, { isLoading, data }] = useSubmitMapMutation(); + const navigate = useNavigate(); + + // submit to server, disabled for now + // const [ submitMap, { isLoading, data } ] = useSubmitMapMutation(); // set page title useEffect(() => { setSiteTitle(siteTitle, lookupLanguageString(page.name, i18n.language)); }, [siteTitle, page.name]); - useEffect(() => { - // save server return data to state - setMappedForm(data); - }, [data]); + // useEffect(() => { + // // save server returned data to state + // setMappedForm(data); + // }, [data]); const handleNext = () => { if (activeStep !== steps.length - 1 && (!file || !savedMap)) { dispatch(setActiveStep(activeStep + 1)); } else if (file) { - (async () => { - const fetchedFile = await fetch(file.url); - const blob = await fetchedFile.blob(); - submitMap({ - savedMap: savedMap, - newMap: mapping, - file: blob, - }); - })(); + // submit to server + // let's disable this for now, and just load the file and the selected mapping into the Deposit package redux store + // (async () => { + // const fetchedFile = await fetch(file.url); + // const blob = await fetchedFile.blob(); + // submitMap({ + // savedMap: savedMap, + // newMap: mapping, + // file: blob, + // }); + // })(); + + // add file to deposit form directly + const serializedFile = { + id: uuidv4(), + name: file.name, + size: file.size, + type: file.name.substring(file.name.lastIndexOf(".") + 1), + location: "local" as FileLocation, + url: file.url, + private: false, + lastModified: 0, + mapping: mapping, + }; + + // must initialize the form here, otherwise files will get overwritten + depositStore.dispatch(initForm(config.form)); + // add files to initialized form + depositStore.dispatch(addFiles([serializedFile])); + // navigate to form + depositPageSlug && navigate(depositPageSlug); + // reset file mapper + dispatch(reset()); } }; @@ -115,23 +154,26 @@ const FileMapper = ({ diff --git a/packages/file-mapper/src/features/SetMapping.tsx b/packages/file-mapper/src/features/SetMapping.tsx index f48770f..abec4c5 100644 --- a/packages/file-mapper/src/features/SetMapping.tsx +++ b/packages/file-mapper/src/features/SetMapping.tsx @@ -14,6 +14,7 @@ import Autocomplete from "@mui/material/Autocomplete"; import CircularProgress from "@mui/material/CircularProgress"; import IconButton from "@mui/material/IconButton"; import Collapse from "@mui/material/Collapse"; +import Tooltip from "@mui/material/Tooltip"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; import type { DarwinOptions, FileError, SheetData } from "../types"; @@ -29,6 +30,8 @@ import { import { useFetchDarwinTermsQuery } from "./fileMapperApi"; import { useAppSelector, useAppDispatch } from "../redux/hooks"; import { StepWrap, maxRows } from "./Steps"; +import LaunchIcon from "@mui/icons-material/Launch"; +import InputAdornment from "@mui/material/InputAdornment"; export const SetMapping = () => { const { t } = useTranslation("steps"); @@ -124,7 +127,6 @@ const Row = ({ rowKey, row }: { rowKey: string; row: string }) => { const fileData = useAppSelector(getFileData); const columnData = fileData && fileData.slice(1).map((data) => data[rowKey]); const [open, setOpen] = useState(false); - console.log(columnData); const { data, isLoading } = useFetchDarwinTermsQuery(""); @@ -165,7 +167,19 @@ const Row = ({ rowKey, row }: { rowKey: string; row: string }) => { groupBy={(option) => option.header} sx={{ width: 300 }} renderInput={(params) => ( - + + + + : undefined, + }} + /> )} onChange={(_e, value) => selectValue(row, value)} value={(mapping.hasOwnProperty(row) && mapping[row]) || null} @@ -178,6 +192,12 @@ const Row = ({ rowKey, row }: { rowKey: string; row: string }) => { }} loading={isLoading} size="small" + renderOption={(props, option) => ( +
  • + + {option.label} +
  • + )} /> @@ -188,7 +208,7 @@ const Row = ({ rowKey, row }: { rowKey: string; row: string }) => { {t("dataHeader")} {columnData.map((item, i) => ( - + {item} ))} @@ -199,3 +219,23 @@ const Row = ({ rowKey, row }: { rowKey: string; row: string }) => { ); }; + +const InfoLink = ({ url, margin }: { url: string; margin?: boolean }) => { + const { t } = useTranslation("steps"); + + return ( + + + + + + ); +}; diff --git a/packages/file-mapper/src/features/Steps.tsx b/packages/file-mapper/src/features/Steps.tsx index 64f3dca..ae48822 100644 --- a/packages/file-mapper/src/features/Steps.tsx +++ b/packages/file-mapper/src/features/Steps.tsx @@ -4,7 +4,7 @@ import Typography from "@mui/material/Typography"; // some fake placeholder saves. todo. export const saves = [ - { + /*{ name: "Fake save #1", date: "8-8-2024", id: "someUniqueId1", @@ -13,14 +13,14 @@ export const saves = [ name: "Fake save #2", date: "7-8-2024", id: "someUniqueId2", - }, + },*/ ]; // define max number of rows a file selected for processing can contain export const maxRows = 10; // define steps -export const steps = ["selectFile", "createMapping", "finish"]; +export const steps = ["selectFile", "createMapping" /*'finish'*/]; // wrapper for individual steps export const StepWrap = ({ diff --git a/packages/file-mapper/src/features/fileMapperApi.ts b/packages/file-mapper/src/features/fileMapperApi.ts index 941435b..9711d5e 100644 --- a/packages/file-mapper/src/features/fileMapperApi.ts +++ b/packages/file-mapper/src/features/fileMapperApi.ts @@ -29,6 +29,7 @@ export const darwinCoreApi = createApi({ ...d, header: d.tdwgutility_organizedInClass?.split("/").pop() || "Dataset", + url: `https://dwc.tdwg.org/list/#dwc_${d.term_localName}`, })) .sort((a, b) => a.header?.localeCompare(b.header)); diff --git a/packages/file-mapper/src/features/fileMapperSlice.ts b/packages/file-mapper/src/features/fileMapperSlice.ts index d0ba2bd..8d440dd 100644 --- a/packages/file-mapper/src/features/fileMapperSlice.ts +++ b/packages/file-mapper/src/features/fileMapperSlice.ts @@ -55,6 +55,7 @@ export const fileMapperSlice = createSlice({ resetFileError: (state) => { state.fileError = initialState.fileError; }, + reset: () => initialState, }, }); @@ -69,6 +70,7 @@ export const { resetFileData, setFileError, resetFileError, + reset, } = fileMapperSlice.actions; export const getActiveStep = (state: RootState) => state.fileMapper.activeStep; diff --git a/packages/file-mapper/src/index.tsx b/packages/file-mapper/src/index.tsx index 68f3ca7..ccebf8a 100644 --- a/packages/file-mapper/src/index.tsx +++ b/packages/file-mapper/src/index.tsx @@ -1,4 +1,4 @@ -import { type Dispatch, type SetStateAction } from "react"; +// import { type Dispatch, type SetStateAction } from "react"; import { I18nextProvider } from "react-i18next"; import i18nProvider from "./languages/i18n"; import FileMapper from "./features/FileMapper"; @@ -8,15 +8,22 @@ import type { Page } from "@dans-framework/pages"; import type { FormConfig } from "@dans-framework/deposit"; export const MapWrapper = ({ - setMappedForm, - page, + config, + /*setMappedForm,*/ page, + depositPageSlug, }: { - setMappedForm: Dispatch>; + config: FormConfig; + // setMappedForm?: Dispatch>; page: Page; + depositPageSlug?: string; }) => ( - + ); diff --git a/packages/file-mapper/src/languages/locales/en/steps.json b/packages/file-mapper/src/languages/locales/en/steps.json index ce1f5bd..8fe35a4 100644 --- a/packages/file-mapper/src/languages/locales/en/steps.json +++ b/packages/file-mapper/src/languages/locales/en/steps.json @@ -19,5 +19,6 @@ "saveMappingExtra": "You can save your mapping for future datasets for easy reference. Please enter a name below.", "isLoading": "Loading...", "tooManyRows": "Your data file contains too many rows to process using this tool. Make sure your file has less than {{max}} rows.", - "dataHeader": "Sheet data for this column" + "dataHeader": "Sheet data for this column", + "moreInfo": "Read more about this term" } \ No newline at end of file diff --git a/packages/file-mapper/src/languages/locales/nl/steps.json b/packages/file-mapper/src/languages/locales/nl/steps.json index fbac756..3a720f4 100644 --- a/packages/file-mapper/src/languages/locales/nl/steps.json +++ b/packages/file-mapper/src/languages/locales/nl/steps.json @@ -19,5 +19,6 @@ "saveMappingExtra": "You can save your mapping for future datasets for easy reference. Please enter a name below.", "isLoading": "Loading...", "tooManyRows": "Je data file contains too many rows to process using this tool. Make sure your file has less than {{max}} rows.", - "dataHeader": "Sheet data for this column" + "dataHeader": "Sheet data for this column", + "moreInfo": "Read more about this term" } \ No newline at end of file diff --git a/packages/file-mapper/src/types/index.ts b/packages/file-mapper/src/types/index.ts index 25a39e9..8839f7e 100644 --- a/packages/file-mapper/src/types/index.ts +++ b/packages/file-mapper/src/types/index.ts @@ -3,7 +3,10 @@ export type DarwinTerms = | "tdwgutility_organizedInClass" | "label" | "header" - | "term_deprecated"; + | "term_deprecated" + | "term_isDefinedBy" + | "term_localName" + | "url"; export type DarwinOptions = { [key in DarwinTerms]: string; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1c413f8..9e10e46 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -668,6 +668,9 @@ importers: packages/file-mapper: dependencies: + '@dans-framework/deposit': + specifier: workspace:* + version: link:../deposit '@dans-framework/utils': specifier: workspace:* version: link:../utils @@ -704,13 +707,16 @@ importers: react-redux: specifier: ^8.1.2 version: 8.1.2(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(redux@4.2.1) + react-router-dom: + specifier: ^6.14.2 + version: 6.14.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + uuid: + specifier: ^9.0.0 + version: 9.0.0 xlsx: specifier: ^0.18.5 version: 0.18.5 devDependencies: - '@dans-framework/deposit': - specifier: workspace:* - version: link:../deposit '@dans-framework/pages': specifier: workspace:* version: link:../pages @@ -720,6 +726,9 @@ importers: '@types/react-dom': specifier: ^18.2.7 version: 18.2.7 + '@types/uuid': + specifier: ^9.0.2 + version: 9.0.2 packages/freshdesk: dependencies: @@ -832,7 +841,7 @@ importers: specifier: ^5.14.3 version: 5.14.3(@mui/material@5.16.7(@emotion/react@11.11.1(@types/react@18.2.15)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.15)(react@18.2.0))(@types/react@18.2.15)(react@18.2.0))(@types/react@18.2.15)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.2.15)(react@18.2.0) '@mui/material': - specifier: ^5.14.3 + specifier: ^5.16.7 version: 5.16.7(@emotion/react@11.11.1(@types/react@18.2.15)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.15)(react@18.2.0))(@types/react@18.2.15)(react@18.2.0))(@types/react@18.2.15)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) clsx: specifier: ^2.0.0