-
- setIsUpdated((prev) => !prev)
- },
- {
- isLink: false,
- label: t("delete_object", { ns: "item" }),
- icon: faTrash,
- action: () => notDevelopedFeature()
- },
- ]}/>
-
+
+ {showButtonsAndOptions &&
+
+ setIsUpdated((prev) => !prev)
+ },
+ {
+ isLink: false,
+ label: t("delete_object", { ns: "item" }),
+ icon: faTrash,
+ action: () => notDevelopedFeature()
+ },
+ ]}/>
+
+ }
{
if(!editExemplarFunction)
@@ -68,26 +69,28 @@ const ItemDetailedCard = ({
)}
>
- editExemplarFunction(item)
- },
- {
- isLink: false,
- label: t("delete_exemplar", { ns: "item" }),
- icon: faTrash,
- action: () => notDevelopedFeature()
- }
- ]}/>
+ {showButtonsAndOptions &&
+ editExemplarFunction(item)
+ },
+ {
+ isLink: false,
+ label: t("delete_exemplar", { ns: "item" }),
+ icon: faTrash,
+ action: () => notDevelopedFeature()
+ }
+ ]}/>
+ }
@@ -152,33 +155,35 @@ const ItemDetailedCard = ({
-
- {item.loan_state !== loanStates[0]?.name ? (
-
- {t("return_loan", { ns: "item" })}
-
- ) : (
-
- {t("add_loan", { ns: "item" })}
-
- )}
-
-
- {t("add_control", { ns: "item" })}
-
-
+ {showButtonsAndOptions &&
+
+ {item.loan_state !== loanStates[0]?.name ? (
+
+ {t("return_loan", { ns: "item" })}
+
+ ) : (
+
+ {t("add_loan", { ns: "item" })}
+
+ )}
+
+
+ {t("add_control", { ns: "item" })}
+
+
+ }
)
}
diff --git a/frontend/src/modules/ItemsList.jsx b/frontend/src/modules/ItemsList.jsx
index f97bd83..ac1d743 100644
--- a/frontend/src/modules/ItemsList.jsx
+++ b/frontend/src/modules/ItemsList.jsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from "react";
+import React from "react";
import NoResults from "../ui/NoResults";
diff --git a/frontend/src/pages/Home.jsx b/frontend/src/pages/Home.jsx
index d4a7ea2..c5fa1e6 100644
--- a/frontend/src/pages/Home.jsx
+++ b/frontend/src/pages/Home.jsx
@@ -8,7 +8,6 @@ import { getAllGroups } from "../services/api/groups";
import { getAllItemConditions } from "../services/api/item_conditions";
import { getAllStockingPlaces } from "../services/api/stocking_places";
-
import Loading from "../ui/Loading";
import Filters from "../modules/Filters";
@@ -202,11 +201,7 @@ const Home = () =>
/**
* Filters the list of items common when a filter is updated.
*/
- useEffect(() => {
- //debugFilters();
- filterItems();
-
- }, [displayMode, searchBar, selectedObjectTypes,
+ useEffect(() => filterItems(), [displayMode, searchBar, selectedObjectTypes,
selectedLoanStates, selectedExemplarConditions,
selectedGroups, selectedStockingPlaces,
selectedFilterOption, filterByAscOrder
diff --git a/frontend/src/pages/ItemCommonCreation.jsx b/frontend/src/pages/ItemCommonCreation.jsx
new file mode 100644
index 0000000..68b9ccb
--- /dev/null
+++ b/frontend/src/pages/ItemCommonCreation.jsx
@@ -0,0 +1,73 @@
+import React from "react";
+import { useTranslation } from "react-i18next";
+import { useNavigate } from "react-router-dom";
+
+import ItemCommonForm from "../modules/ItemCommonForm";
+import ItemForm from "../modules/ItemForm";
+
+import Heading from "../ui/Heading";
+import HTMLLink from "../ui/HTMLLink";
+
+const ItemCommonCreation = () =>
+{
+ const { t } = useTranslation(["buttons", "item", "titles"]);
+ const navigate = useNavigate()
+
+ const handleNewObjectForm = (event) =>
+ {
+ event.preventDefault();
+
+ const formData = Object.fromEntries(new FormData(event.target).entries());
+ console.log(formData);
+
+ // ============================================== //
+ // Future POST request to backend will go here... //
+ // ============================================== //
+
+ navigate("/objects/1/exemplars");
+ }
+
+ return (
+ <>
+