- {countsResult
+ {getFilteredItems(searchText)
?.sort((a, b) => {
const aValue = Object.values(a)[0];
const bValue = Object.values(b)[0];
diff --git a/src/components/Nav/Breadcrumbs.jsx b/src/components/Nav/Breadcrumbs.jsx
index f6b29ee..245d2f0 100644
--- a/src/components/Nav/Breadcrumbs.jsx
+++ b/src/components/Nav/Breadcrumbs.jsx
@@ -1,30 +1,34 @@
-import { Breadcrumb } from "antd"
+import { Breadcrumb } from 'antd';
import { useLocation, Link } from 'react-router-dom';
// import { Link } from 'react-router';
export const Breadcrumbs = () => {
- const location = useLocation();
- const pathParts = location.pathname.split('/').filter(Boolean);
- const pathArr = []
- pathParts.forEach(path => {
- pathArr.push({ title: path, path: path });
- });
-
- console.log(location,'location');
-
+ const location = useLocation();
+ const pathParts = location.pathname.split('/').filter(Boolean);
+ const pathArr = [];
+ pathParts.forEach(path => {
+ pathArr.push({ title: path, path: path });
+ });
- return
- Home {location.pathname != '/' && / }
+ return (
+
+
+ Home{' '}
+ {location.pathname != '/' && / }
+
-
-}
+
+ );
+};
function itemRender(currentRoute, params, items, pathArr) {
- const isLast = currentRoute?.path === items[items.length - 1]?.path;
+ const isLast = currentRoute?.path === items[items.length - 1]?.path;
- return <>
- {isLast ? (
-
{currentRoute.title}
- ) : (
-
{currentRoute.title}
- )}
- >
-}
\ No newline at end of file
+ return (
+ <>
+ {isLast ? (
+
{currentRoute.title}
+ ) : (
+
{currentRoute.title}
+ )}
+ >
+ );
+}
diff --git a/src/components/Projects/Tables/TableDetails.jsx b/src/components/Projects/Tables/TableDetails.jsx
index ca17c9d..327a105 100644
--- a/src/components/Projects/Tables/TableDetails.jsx
+++ b/src/components/Projects/Tables/TableDetails.jsx
@@ -42,7 +42,8 @@ export const TableDetails = () => {
const [load, setLoad] = useState(false);
const [pageSize, setPageSize] = useState(
- parseInt(localStorage.getItem('pageSize'), 10) || 10);
+ parseInt(localStorage.getItem('pageSize'), 10) || 10
+ );
const handleTableChange = (current, size) => {
setPageSize(size);
};
@@ -54,21 +55,17 @@ export const TableDetails = () => {
const login = RequiredLogin({ handleSuccess: handleSuccess });
useEffect(() => {
-
setDataSource(tableData(table));
localStorage.setItem('pageSize', pageSize);
}, [table, mapping, pageSize]);
-
- const updateMappings = (mapArr,mappingCode ) => {
-
+ const updateMappings = (mapArr, mappingCode) => {
// setLoading(true);
const mappingsDTO = {
mappings: mapArr,
editor: user.email,
};
- console.log(mappingsDTO,"mappingsDTO");
-
+
fetch(`${vocabUrl}/Table/${tableId}/mapping/${mappingCode}`, {
method: 'PUT',
headers: {
@@ -87,11 +84,11 @@ export const TableDetails = () => {
setMapping(data.codes);
setEditMappings(null);
form.resetFields();
- notification.success({ description:'Mapping removed.'});
+ notification.success({ description: 'Mapping removed.' });
})
.catch(error => {
- console.log(error,'error');
-
+ console.log(error, 'error');
+
if (error) {
notification.error({
message: 'Error',
@@ -103,7 +100,6 @@ export const TableDetails = () => {
.finally(() => setLoading(false));
};
-
const alphabetizeOntologies = ontologies => {
// Sort the keys alphabetically
const sortedKeys = Object.keys(ontologies).sort();
@@ -131,8 +127,8 @@ export const TableDetails = () => {
.then(data => setMapping(data.codes))
.catch(error => {
if (error) {
- console.log(error,"error");
-
+ console.log(error, 'error');
+
notification.error({
message: 'Error',
description: 'An error occurred loading mappings.',
@@ -236,37 +232,52 @@ variable in the table, AND the mappings array length for the variable is > 0, th
and returns the length of the mapping array (i.e. returns the number of variables mapped to the table variable).
It then shows the mappings as table data and alows the user to delete a mapping from the table.*/
const noMapping = variable => {
- return
- }
+ return (
+
+ );
+ };
const matchCode = variable => {
-
-
if (!mapping?.length) {
return noMapping(variable);
}
- const variableMappings = mapping.find(item => item?.code === variable?.code);
+ const variableMappings = mapping.find(
+ item => item?.code === variable?.code
+ );
if (variableMappings && variableMappings.mappings?.length) {
- return variableMappings.mappings.map(code =>
{code.display} handleRemoveMapping(variableMappings,code)}>
);
+ return variableMappings.mappings.map(code => (
+
+ {code.display}
+ handleRemoveMapping(variableMappings, code)}
+ >
+
+
+
+ ));
} else {
return noMapping(variable);
}
};
- const handleRemoveMapping = (variableMappings,code) => {
- // console.log(variableMappings,"variableMappings");
+ const handleRemoveMapping = (variableMappings, code) => {
const mappingToRemove = variableMappings.mappings.indexOf(code);
//remove mapping from mappings
- {mappingToRemove !== -1 && variableMappings.mappings.splice(mappingToRemove,1)}
- updateMappings(variableMappings?.mappings,variableMappings?.code);
-
- }
-
-
+ {
+ mappingToRemove !== -1 &&
+ variableMappings.mappings.splice(mappingToRemove, 1);
+ }
+ updateMappings(variableMappings?.mappings, variableMappings?.code);
+ };
// data for the table columns. Each table has an array of variables. Each variable has a name, description, and data type.
// The integer and quantity data types include additional details.
@@ -285,9 +296,11 @@ It then shows the mappings as table data and alows the user to delete a mapping
max: variable.max,
units: variable.units,
enumeration: variable.data_type === 'ENUMERATION' && (
- console.log(variable.enumerations.reference,"variable.enumerations.reference"),
-
-
View/Edit
+
+ View/Edit
+
),
mapped_terms: matchCode(variable),
};
diff --git a/src/components/Projects/Terminologies/Terminology.jsx b/src/components/Projects/Terminologies/Terminology.jsx
index 5316c5f..b3c4709 100644
--- a/src/components/Projects/Terminologies/Terminology.jsx
+++ b/src/components/Projects/Terminologies/Terminology.jsx
@@ -55,7 +55,6 @@ export const Terminology = () => {
mappings: mapArr,
editor: user.email,
};
- console.log(tableId, 'tableId');
fetch(`${vocabUrl}/Terminology/${terminologyId}/mapping/${mappingCode}`, {
method: 'PUT',
@@ -139,7 +138,6 @@ It then shows the mappings as table data and alows the user to delete a mapping
};
const handleRemoveMapping = (variableMappings, code) => {
- // console.log(variableMappings,"variableMappings");
const mappingToRemove = variableMappings.mappings.indexOf(code);
//remove mapping from mappings
{