eleven-solutions-common-website-unique-web 4.0.33 → 4.0.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -161,7 +161,6 @@ const TaxonomyForm = () => {
161
161
  setSubValue("");
162
162
  };
163
163
  const handleAddClick = () => {
164
- setIsAddingSubType(false);
165
164
  if (newCode === "" || newValue === "") {
166
165
  alert("Please fill in all required fields: Code, and Value.");
167
166
  return;
@@ -213,7 +212,6 @@ const TaxonomyForm = () => {
213
212
  setIsModalOpen(false);
214
213
  });
215
214
  const handleEditTaxClick = () => __awaiter(void 0, void 0, void 0, function* () {
216
- setIsAddingSubType(false);
217
215
  try {
218
216
  yield updateTaxonomyApi(selectedTaxonomyId, type, Number(newCode), newValue);
219
217
  alert("Taxonomy updated successfully");
@@ -272,16 +270,6 @@ const TaxonomyForm = () => {
272
270
  ? "Add SubType"
273
271
  : editTaxonomyItem || editTempTaxonomyItem
274
272
  ? "Edit Values"
275
- : "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(_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", {
276
- // onClick={editTaxonomyItem ? handleEditTaxClick : handleAddClick}
277
- onClick: isAddingSubType
278
- ? handleSubTypeClick
279
- : editTaxonomyItem
280
- ? handleEditTaxClick
281
- : 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: isAddingSubType
282
- ? "Add SubType"
283
- : editTaxonomyItem || editTempTaxonomyItem
284
- ? "Edit"
285
- : "Add" })] })] }) })] }));
273
+ : "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(_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" })] })] }))] }) })] }));
286
274
  };
287
275
  export default TaxonomyForm;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "4.0.33",
3
+ "version": "4.0.34",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -199,7 +199,6 @@ const TaxonomyForm = () => {
199
199
  };
200
200
 
201
201
  const handleAddClick = () => {
202
- setIsAddingSubType(false);
203
202
  if (newCode === "" || newValue === "") {
204
203
  alert("Please fill in all required fields: Code, and Value.");
205
204
  return;
@@ -266,7 +265,6 @@ const TaxonomyForm = () => {
266
265
  };
267
266
 
268
267
  const handleEditTaxClick = async () => {
269
- setIsAddingSubType(false);
270
268
  try {
271
269
  await updateTaxonomyApi(
272
270
  selectedTaxonomyId,
@@ -795,35 +793,25 @@ const TaxonomyForm = () => {
795
793
  placeholder="Enter Value"
796
794
  className="w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md"
797
795
  />
796
+
797
+ <div className="flex space-x-4 justify-end">
798
+ <button
799
+ onClick={handleCloseModal}
800
+ className="px-8 py-2.5 leading-5 bg-gray-300 rounded-md"
801
+ >
802
+ Cancel
803
+ </button>
804
+ <button
805
+ onClick={
806
+ editTaxonomyItem ? handleEditTaxClick : handleAddClick
807
+ }
808
+ 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"
809
+ >
810
+ {editTaxonomyItem || editTempTaxonomyItem ? "Edit" : "Add"}
811
+ </button>
812
+ </div>
798
813
  </>
799
814
  )}
800
-
801
- <div className="flex space-x-4 justify-end">
802
- <button
803
- onClick={handleCloseModal}
804
- className="px-8 py-2.5 leading-5 bg-gray-300 rounded-md"
805
- >
806
- Cancel
807
- </button>
808
- <button
809
- // onClick={editTaxonomyItem ? handleEditTaxClick : handleAddClick}
810
- onClick={
811
- isAddingSubType
812
- ? handleSubTypeClick
813
- : editTaxonomyItem
814
- ? handleEditTaxClick
815
- : handleAddClick
816
- }
817
- 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"
818
- >
819
- {/* {editTaxonomyItem || editTempTaxonomyItem ? "Edit" : "Add"} */}
820
- {isAddingSubType
821
- ? "Add SubType"
822
- : editTaxonomyItem || editTempTaxonomyItem
823
- ? "Edit"
824
- : "Add"}
825
- </button>
826
- </div>
827
815
  </div>
828
816
  </div>
829
817
  </div>