eleven-solutions-common-website-unique-web 4.0.35 → 4.0.37

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;
@@ -187,6 +186,7 @@ const TaxonomyForm = () => {
187
186
  setIsModalOpen(true);
188
187
  };
189
188
  const handleEditClick = (index, id) => {
189
+ setIsAddingSubType(false);
190
190
  const item = similarTaxonomies[index];
191
191
  setSelectedTaxonomyId(id);
192
192
  setEditTaxonomyItem(item);
@@ -213,7 +213,6 @@ const TaxonomyForm = () => {
213
213
  setIsModalOpen(false);
214
214
  });
215
215
  const handleEditTaxClick = () => __awaiter(void 0, void 0, void 0, function* () {
216
- setIsAddingSubType(false);
217
216
  try {
218
217
  yield updateTaxonomyApi(selectedTaxonomyId, type, Number(newCode), newValue);
219
218
  alert("Taxonomy updated successfully");
@@ -272,6 +271,6 @@ const TaxonomyForm = () => {
272
271
  ? "Add SubType"
273
272
  : editTaxonomyItem || editTempTaxonomyItem
274
273
  ? "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", { 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" })] })] }))] }) })] }));
274
+ : "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: handleSubTypeClick, 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: "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" })] })] }))] }) })] }));
276
275
  };
277
276
  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.35",
3
+ "version": "4.0.37",
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;
@@ -231,6 +230,8 @@ const TaxonomyForm = () => {
231
230
  };
232
231
 
233
232
  const handleEditClick = (index: number, id: string) => {
233
+ setIsAddingSubType(false);
234
+
234
235
  const item = similarTaxonomies[index];
235
236
  setSelectedTaxonomyId(id);
236
237
 
@@ -266,7 +267,6 @@ const TaxonomyForm = () => {
266
267
  };
267
268
 
268
269
  const handleEditTaxClick = async () => {
269
- setIsAddingSubType(false);
270
270
  try {
271
271
  await updateTaxonomyApi(
272
272
  selectedTaxonomyId,
@@ -772,6 +772,20 @@ const TaxonomyForm = () => {
772
772
  placeholder="Enter Value"
773
773
  className="w-full px-4 py-2 mt-2 mb-4 border border-gray-300 rounded-md"
774
774
  />
775
+ <div className="flex space-x-4 justify-end">
776
+ <button
777
+ onClick={handleCloseModal}
778
+ className="px-8 py-2.5 leading-5 bg-gray-300 rounded-md"
779
+ >
780
+ Cancel
781
+ </button>
782
+ <button
783
+ onClick={handleSubTypeClick}
784
+ 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"
785
+ >
786
+ Add SubType
787
+ </button>
788
+ </div>
775
789
  </>
776
790
  ) : (
777
791
  <>