From ef322164704762de1c35d6202e8fa61551dddf8c Mon Sep 17 00:00:00 2001 From: Jeeva Ramachandran Date: Thu, 10 Oct 2024 15:48:27 +0530 Subject: [PATCH 1/3] fix: unauthorized page issue --- src/components/SelectBox.res | 14 ------- src/entryPoints/HyperSwitchApp.res | 62 +++++++++++++++--------------- 2 files changed, 32 insertions(+), 44 deletions(-) diff --git a/src/components/SelectBox.res b/src/components/SelectBox.res index 6bf6ba731..707983493 100644 --- a/src/components/SelectBox.res +++ b/src/components/SelectBox.res @@ -1105,20 +1105,6 @@ module RenderListItemInBaseRadio = { ~selectClass="", ~customScrollStyle=?, ) => { - let decodedValue = value->JSON.Decode.string - switch decodedValue { - | Some(str) => - newOptions->Array.sort((item1, item2) => { - if item1.value == str { - -1. - } else if item2.value == str { - 1. - } else { - 0. - } - }) - | None => () - } let dropdownList = newOptions ->Array.mapWithIndex((option, i) => { diff --git a/src/entryPoints/HyperSwitchApp.res b/src/entryPoints/HyperSwitchApp.res index a66276da1..4462d2ebc 100644 --- a/src/entryPoints/HyperSwitchApp.res +++ b/src/entryPoints/HyperSwitchApp.res @@ -41,6 +41,7 @@ let make = () => { let setUpDashboard = async () => { try { // NOTE: Treat groupACL map similar to screenstate + setScreenState(_ => PageLoaderWrapper.Loading) setuserGroupACL(_ => None) Window.connectorWasmInit()->ignore let _ = await fetchUserGroupACL() @@ -76,18 +77,19 @@ let make = () => { }, [userGroupACL]) <> - -
- {switch dashboardPageState { - | #AUTO_CONNECTOR_INTEGRATION => - // INTEGRATION_DOC Need to be removed - | #INTEGRATION_DOC => - | #HOME => -
- // TODO: Change the key to only profileId once the userInfo starts sending profileId -
-
- +
+ {switch dashboardPageState { + | #AUTO_CONNECTOR_INTEGRATION => + // INTEGRATION_DOC Need to be removed + | #INTEGRATION_DOC => + | #HOME => +
+ // TODO: Change the key to only profileId once the userInfo starts sending profileId +
+
+ +
@@ -275,25 +277,25 @@ let make = () => {
-
- - - - - - +
+ + + + + +
- | #DEFAULT => -
- -
- }} -
- +
+ | #DEFAULT => +
+ +
+ }} +
} From 21d0fd2e944ad80aba858e2c7910f0c03afd7a2a Mon Sep 17 00:00:00 2001 From: Riddhiagrawal001 Date: Mon, 14 Oct 2024 16:19:32 +0530 Subject: [PATCH 2/3] fix: pageloader changes --- src/entryPoints/HyperSwitchApp.res | 11 +++++------ src/screens/Helpers/PageLoaderWrapper.res | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/entryPoints/HyperSwitchApp.res b/src/entryPoints/HyperSwitchApp.res index 4462d2ebc..c41aef58a 100644 --- a/src/entryPoints/HyperSwitchApp.res +++ b/src/entryPoints/HyperSwitchApp.res @@ -36,8 +36,6 @@ let make = () => { let hyperSwitchAppSidebars = SidebarValues.useGetSidebarValues(~isReconEnabled) sessionExpired := false - let (renderKey, setRenderkey) = React.useState(_ => "") - let setUpDashboard = async () => { try { // NOTE: Treat groupACL map similar to screenstate @@ -50,9 +48,8 @@ let make = () => { | _ => () } setDashboardPageState(_ => #HOME) - setRenderkey(_ => profileId) } catch { - | _ => setScreenState(_ => PageLoaderWrapper.Error("")) + | _ => setScreenState(_ => PageLoaderWrapper.Error("Failed to setup dashboard!")) } } let path = url.path->List.toArray->Array.joinWith("/") @@ -83,11 +80,13 @@ let make = () => { // INTEGRATION_DOC Need to be removed | #INTEGRATION_DOC => | #HOME => -
+
// TODO: Change the key to only profileId once the userInfo starts sending profileId
- + string)} + />
Date: Mon, 14 Oct 2024 16:22:31 +0530 Subject: [PATCH 3/3] fix: loader fix --- src/entryPoints/HyperSwitchApp.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entryPoints/HyperSwitchApp.res b/src/entryPoints/HyperSwitchApp.res index c41aef58a..bf06ff8ec 100644 --- a/src/entryPoints/HyperSwitchApp.res +++ b/src/entryPoints/HyperSwitchApp.res @@ -88,7 +88,7 @@ let make = () => { path={url.path} sidebars={hyperSwitchAppSidebars} key={(screenState :> string)} /> + screenState={screenState} sectionHeight="!h-screen w-full" showLogoutButton=true>