eleven-solutions-common-website-unique-web 3.0.26 → 3.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,9 +58,24 @@ const Taxionomies = () => {
58
58
  window.history.pushState({}, "", path);
59
59
  window.dispatchEvent(new PopStateEvent("popstate"));
60
60
  };
61
+ // const handleViewClick = (
62
+ // event: React.MouseEvent,
63
+ // path: string,
64
+ // id: string,
65
+ // type: string
66
+ // ) => {
67
+ // event.preventDefault();
68
+ // window.history.pushState({ id, type }, "", path);
69
+ // window.dispatchEvent(new PopStateEvent("popstate"));
70
+ // };
61
71
  const handleViewClick = (event, path, id, type) => {
62
72
  event.preventDefault();
63
- window.history.pushState({ id, type }, "", path);
73
+ // Add id and type as query parameters to the path
74
+ const queryParams = new URLSearchParams({ id, type });
75
+ const fullPath = `${path}${queryParams.toString()}`;
76
+ // Push the updated URL with the state
77
+ window.history.pushState({ id, type }, "", fullPath);
78
+ // Trigger popstate event to simulate navigation
64
79
  window.dispatchEvent(new PopStateEvent("popstate"));
65
80
  };
66
81
  return (_jsxs("div", { className: "container px-4 mx-auto mt-6", children: [_jsx("div", { className: "w-3/4", children: _jsx("h1", { className: "text-3xl font-bold text-blue-600 mb-5", children: "Taxonomy" }) }), _jsx("div", { className: "flex-grow ml-0 w-full mt-10", children: _jsxs("form", { className: "w-full ", children: [_jsx("label", { htmlFor: "default-search", className: "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white", children: "Search" }), _jsxs("div", { className: "relative w-full", children: [_jsx("div", { className: "absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none", children: _jsx("svg", { className: "w-4 h-4 text-gray-500 dark:text-gray-400", "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", children: _jsx("path", { stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z" }) }) }), _jsx("input", { type: "search", id: "default-search", className: "inline-block min-w-full p-3 ps-10 outline-none text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", placeholder: "Search Taxonomies", required: true }), _jsx("button", { type: "submit", className: "text-white absolute end-1.5 bottom-1.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800", children: "Search" })] })] }) }), _jsx("div", { className: "flex-grow ml-0 w-3/4", children: _jsx("form", { className: "w-auto" }) }), _jsxs("div", { className: "flex-grow ml-0 mt-4 w-full h-full", children: [_jsx("div", { className: "overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Actions" }), _jsx("th", { scope: "col", className: "py-3.5 px-4 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Type" })] }) }), _jsx("tbody", { className: "bg-white divide-y divide-gray-200 dark:divide-gray-700 dark:bg-gray-900", children: paginatedTaxonomies.map((taxonomy, index) => (_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsx("div", { className: "flex items-center gap-x-6", children: taxonomy.isEdit ? (_jsx("button", { type: "button", onClick: (event) => {
@@ -35,6 +35,7 @@ const TaxonomyForm = () => {
35
35
  };
36
36
  const queryParams = new URLSearchParams(window.location.search);
37
37
  const id = queryParams.get("id");
38
+ console.log(id);
38
39
  // Fetch taxonomy data if id exists
39
40
  useEffect(() => {
40
41
  if (id) {
@@ -82,9 +83,9 @@ const TaxonomyForm = () => {
82
83
  if (window.location.pathname === "/taxonomy/taxonomyform") {
83
84
  setIsSimilarTaxonomyOpen(true);
84
85
  }
85
- else {
86
- setIsSimilarTaxonomyOpen(false);
87
- }
86
+ // else {
87
+ // setIsSimilarTaxonomyOpen(false);
88
+ // }
88
89
  };
89
90
  handleLocationChange();
90
91
  window.addEventListener("popstate", handleLocationChange);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "3.0.26",
3
+ "version": "3.0.28",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -69,6 +69,17 @@ const Taxionomies = () => {
69
69
  window.dispatchEvent(new PopStateEvent("popstate"));
70
70
  };
71
71
 
72
+ // const handleViewClick = (
73
+ // event: React.MouseEvent,
74
+ // path: string,
75
+ // id: string,
76
+ // type: string
77
+ // ) => {
78
+ // event.preventDefault();
79
+ // window.history.pushState({ id, type }, "", path);
80
+ // window.dispatchEvent(new PopStateEvent("popstate"));
81
+ // };
82
+
72
83
  const handleViewClick = (
73
84
  event: React.MouseEvent,
74
85
  path: string,
@@ -76,7 +87,15 @@ const Taxionomies = () => {
76
87
  type: string
77
88
  ) => {
78
89
  event.preventDefault();
79
- window.history.pushState({ id, type }, "", path);
90
+
91
+ // Add id and type as query parameters to the path
92
+ const queryParams = new URLSearchParams({ id, type });
93
+ const fullPath = `${path}${queryParams.toString()}`;
94
+
95
+ // Push the updated URL with the state
96
+ window.history.pushState({ id, type }, "", fullPath);
97
+
98
+ // Trigger popstate event to simulate navigation
80
99
  window.dispatchEvent(new PopStateEvent("popstate"));
81
100
  };
82
101
 
@@ -57,6 +57,8 @@ const TaxonomyForm = () => {
57
57
  const queryParams = new URLSearchParams(window.location.search);
58
58
  const id = queryParams.get("id");
59
59
 
60
+ console.log(id);
61
+
60
62
  // Fetch taxonomy data if id exists
61
63
  useEffect(() => {
62
64
  if (id) {
@@ -111,9 +113,10 @@ const TaxonomyForm = () => {
111
113
  const handleLocationChange = () => {
112
114
  if (window.location.pathname === "/taxonomy/taxonomyform") {
113
115
  setIsSimilarTaxonomyOpen(true);
114
- } else {
115
- setIsSimilarTaxonomyOpen(false);
116
116
  }
117
+ // else {
118
+ // setIsSimilarTaxonomyOpen(false);
119
+ // }
117
120
  };
118
121
 
119
122
  handleLocationChange();