jett.admin.npmpackage 1.0.93 → 1.0.94

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.
package/dist/index.js CHANGED
@@ -836,19 +836,6 @@ var AppSideBar = ({
836
836
  if (!menuUrlData || !currentPath) return false;
837
837
  const normalizedMenuPath = menuUrlData.pathname.replace(/\/$/, "") || "/";
838
838
  const normalizedCurrentPath = currentPath.replace(/\/$/, "") || "/";
839
- if (normalizedMenuPath === "/orgselector" && normalizedCurrentPath === "/orgselector") {
840
- const menuPathParam = new URLSearchParams(menuUrlData.search).get("path");
841
- const currentPathParam = new URLSearchParams(currentSearch).get("path");
842
- if (menuPathParam && currentPathParam) {
843
- return menuPathParam === currentPathParam;
844
- }
845
- if (menuPathParam && !currentPathParam) {
846
- return false;
847
- }
848
- if (!menuPathParam && currentPathParam) {
849
- return false;
850
- }
851
- }
852
839
  if (normalizedMenuPath === "/users/users" && normalizedCurrentPath === "/users/users") {
853
840
  const menuParams = new URLSearchParams(menuUrlData.search);
854
841
  const currentParams = new URLSearchParams(currentSearch);
@@ -862,6 +849,46 @@ var AppSideBar = ({
862
849
  }
863
850
  return true;
864
851
  }
852
+ if (normalizedMenuPath === "/corporate" && normalizedCurrentPath.startsWith("/org/organizations")) {
853
+ return true;
854
+ }
855
+ if (normalizedMenuPath === "/trips") {
856
+ if (normalizedCurrentPath.startsWith("/tripdetails") || normalizedCurrentPath.startsWith("/offline")) {
857
+ return true;
858
+ }
859
+ }
860
+ if (normalizedMenuPath === "/orgselector" && menuUrlData.search) {
861
+ const menuPathParam = new URLSearchParams(menuUrlData.search).get("path");
862
+ if (menuPathParam) {
863
+ const pathRouteMap = {
864
+ "offer": "/offer/offer",
865
+ "voucher": "/voucher/voucher",
866
+ "tag": "/tags/tags",
867
+ "special-requests": "/corporate/special-requests",
868
+ "pricing-policy": "/policies/pricing-policy",
869
+ "users": "/users/users"
870
+ // Consumer Ecosystem Users (no role param)
871
+ };
872
+ const expectedRoute = pathRouteMap[menuPathParam];
873
+ if (expectedRoute) {
874
+ if (normalizedCurrentPath === expectedRoute || normalizedCurrentPath.startsWith(expectedRoute + "/")) {
875
+ if (menuPathParam === "users") {
876
+ const currentParams = new URLSearchParams(currentSearch);
877
+ const currentRole = currentParams.get("role");
878
+ return currentRole !== "admin";
879
+ }
880
+ return true;
881
+ }
882
+ }
883
+ }
884
+ if (normalizedCurrentPath === "/orgselector") {
885
+ const menuPathParam2 = new URLSearchParams(menuUrlData.search).get("path");
886
+ const currentPathParam = new URLSearchParams(currentSearch).get("path");
887
+ if (menuPathParam2 && currentPathParam) {
888
+ return menuPathParam2 === currentPathParam;
889
+ }
890
+ }
891
+ }
865
892
  if (normalizedMenuPath === normalizedCurrentPath) {
866
893
  if (menuUrlData.search) {
867
894
  const menuParams = new URLSearchParams(menuUrlData.search);
package/dist/index.mjs CHANGED
@@ -807,19 +807,6 @@ var AppSideBar = ({
807
807
  if (!menuUrlData || !currentPath) return false;
808
808
  const normalizedMenuPath = menuUrlData.pathname.replace(/\/$/, "") || "/";
809
809
  const normalizedCurrentPath = currentPath.replace(/\/$/, "") || "/";
810
- if (normalizedMenuPath === "/orgselector" && normalizedCurrentPath === "/orgselector") {
811
- const menuPathParam = new URLSearchParams(menuUrlData.search).get("path");
812
- const currentPathParam = new URLSearchParams(currentSearch).get("path");
813
- if (menuPathParam && currentPathParam) {
814
- return menuPathParam === currentPathParam;
815
- }
816
- if (menuPathParam && !currentPathParam) {
817
- return false;
818
- }
819
- if (!menuPathParam && currentPathParam) {
820
- return false;
821
- }
822
- }
823
810
  if (normalizedMenuPath === "/users/users" && normalizedCurrentPath === "/users/users") {
824
811
  const menuParams = new URLSearchParams(menuUrlData.search);
825
812
  const currentParams = new URLSearchParams(currentSearch);
@@ -833,6 +820,46 @@ var AppSideBar = ({
833
820
  }
834
821
  return true;
835
822
  }
823
+ if (normalizedMenuPath === "/corporate" && normalizedCurrentPath.startsWith("/org/organizations")) {
824
+ return true;
825
+ }
826
+ if (normalizedMenuPath === "/trips") {
827
+ if (normalizedCurrentPath.startsWith("/tripdetails") || normalizedCurrentPath.startsWith("/offline")) {
828
+ return true;
829
+ }
830
+ }
831
+ if (normalizedMenuPath === "/orgselector" && menuUrlData.search) {
832
+ const menuPathParam = new URLSearchParams(menuUrlData.search).get("path");
833
+ if (menuPathParam) {
834
+ const pathRouteMap = {
835
+ "offer": "/offer/offer",
836
+ "voucher": "/voucher/voucher",
837
+ "tag": "/tags/tags",
838
+ "special-requests": "/corporate/special-requests",
839
+ "pricing-policy": "/policies/pricing-policy",
840
+ "users": "/users/users"
841
+ // Consumer Ecosystem Users (no role param)
842
+ };
843
+ const expectedRoute = pathRouteMap[menuPathParam];
844
+ if (expectedRoute) {
845
+ if (normalizedCurrentPath === expectedRoute || normalizedCurrentPath.startsWith(expectedRoute + "/")) {
846
+ if (menuPathParam === "users") {
847
+ const currentParams = new URLSearchParams(currentSearch);
848
+ const currentRole = currentParams.get("role");
849
+ return currentRole !== "admin";
850
+ }
851
+ return true;
852
+ }
853
+ }
854
+ }
855
+ if (normalizedCurrentPath === "/orgselector") {
856
+ const menuPathParam2 = new URLSearchParams(menuUrlData.search).get("path");
857
+ const currentPathParam = new URLSearchParams(currentSearch).get("path");
858
+ if (menuPathParam2 && currentPathParam) {
859
+ return menuPathParam2 === currentPathParam;
860
+ }
861
+ }
862
+ }
836
863
  if (normalizedMenuPath === normalizedCurrentPath) {
837
864
  if (menuUrlData.search) {
838
865
  const menuParams = new URLSearchParams(menuUrlData.search);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jett.admin.npmpackage",
3
- "version": "1.0.93",
3
+ "version": "1.0.94",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "exports": {