eleven-solutions-common-website-unique-web 7.0.1 → 7.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -229,6 +229,7 @@ const TaxonomyForm = () => {
|
|
229
229
|
const handleAddSubType = (index, id) => {
|
230
230
|
const item = similarTaxonomies[index];
|
231
231
|
setSelectedTaxonomyId(id);
|
232
|
+
setEditTaxonomyItem(null);
|
232
233
|
setNewCode(item.code);
|
233
234
|
setNewValue(item.value);
|
234
235
|
setIsModalOpen(true);
|
@@ -344,9 +345,7 @@ const TaxonomyForm = () => {
|
|
344
345
|
: "Add SubType"
|
345
346
|
: editTaxonomyItem
|
346
347
|
? "Edit Values"
|
347
|
-
: "Add Values" }), _jsx("button", { onClick: handleCloseModal, className: "text-xl text-gray-600 dark:text-gray-400 h-6 w-6", children: "\u00D7" })] }), isAddingSubType ? (_jsxs(_Fragment, { children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Type" }), _jsx("input", { type: "text", value: subType, onChange: (e) => setSubType(e.target.value), placeholder: "Enter Type", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Code" }), _jsx("input", { type: "number", value: subCode, onChange: (e) => setSubCode(e.target.value), placeholder: "Enter Code", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Value" }), _jsx("input", { type: "text", value: subValue, onChange: (e) => setSubValue(e.target.value), placeholder: "Enter Value", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsxs("div", { className: "flex space-x-4 justify-end", children: [_jsx("button", { onClick: handleCloseModal, className: "px-8 py-2.5 leading-5 bg-gray-300 rounded-md", children: "Cancel" }), _jsx("button", {
|
348
|
-
// onClick={handleSubTypeAddClick}
|
349
|
-
onClick: editTaxonomyItem
|
348
|
+
: "Add Values" }), _jsx("button", { onClick: handleCloseModal, className: "text-xl text-gray-600 dark:text-gray-400 h-6 w-6", children: "\u00D7" })] }), isAddingSubType ? (_jsxs(_Fragment, { children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Type" }), _jsx("input", { type: "text", value: subType, onChange: (e) => setSubType(e.target.value), placeholder: "Enter Type", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Code" }), _jsx("input", { type: "number", value: subCode, onChange: (e) => setSubCode(e.target.value), placeholder: "Enter Code", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Value" }), _jsx("input", { type: "text", value: subValue, onChange: (e) => setSubValue(e.target.value), placeholder: "Enter Value", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsxs("div", { className: "flex space-x-4 justify-end", children: [_jsx("button", { onClick: handleCloseModal, className: "px-8 py-2.5 leading-5 bg-gray-300 rounded-md", children: "Cancel" }), _jsx("button", { onClick: editTaxonomyItem
|
350
349
|
? handleSubTypeEditClick
|
351
350
|
: handleSubTypeAddClick, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: editTaxonomyItem ? "Edit SubType" : "Add SubType" })] })] })) : (_jsxs(_Fragment, { children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Code" }), _jsx("input", { type: "number", value: newCode, onChange: (e) => setNewCode(e.target.value), placeholder: "Enter Code", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Value" }), _jsx("input", { type: "text", value: newValue, onChange: (e) => setNewValue(e.target.value), placeholder: "Enter Value", className: "w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md" }), _jsxs("div", { className: "flex space-x-4 justify-end", children: [_jsx("button", { onClick: handleCloseModal, className: "px-8 py-2.5 leading-5 bg-gray-300 rounded-md", children: "Cancel" }), _jsx("button", { onClick: editTaxonomyItem ? handleEditTaxClick : handleAddClick, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: editTaxonomyItem || editTempTaxonomyItem ? "Edit" : "Add" })] })] }))] }) })] }));
|
352
351
|
};
|
package/package.json
CHANGED
@@ -280,6 +280,8 @@ const TaxonomyForm = () => {
|
|
280
280
|
const item = similarTaxonomies[index];
|
281
281
|
setSelectedTaxonomyId(id);
|
282
282
|
|
283
|
+
setEditTaxonomyItem(null);
|
284
|
+
|
283
285
|
setNewCode(item.code);
|
284
286
|
setNewValue(item.value);
|
285
287
|
setIsModalOpen(true);
|
@@ -929,11 +931,6 @@ const TaxonomyForm = () => {
|
|
929
931
|
<div className="p-6">
|
930
932
|
<div className="flex justify-between">
|
931
933
|
<h2 className="text-xl font-bold text-blue-600 mb-4 ">
|
932
|
-
{/* {isAddingSubType
|
933
|
-
? "Add SubType"
|
934
|
-
: editTaxonomyItem || editTempTaxonomyItem
|
935
|
-
? "Edit Values"
|
936
|
-
: "Add Values"} */}
|
937
934
|
{isAddingSubType
|
938
935
|
? editTaxonomyItem
|
939
936
|
? "Edit SubType"
|
@@ -990,7 +987,6 @@ const TaxonomyForm = () => {
|
|
990
987
|
Cancel
|
991
988
|
</button>
|
992
989
|
<button
|
993
|
-
// onClick={handleSubTypeAddClick}
|
994
990
|
onClick={
|
995
991
|
editTaxonomyItem
|
996
992
|
? handleSubTypeEditClick
|