Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unauthorised page issue #1588

Merged
merged 19 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
70079f1
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Sep 18, 2024
780a799
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Sep 19, 2024
24ac760
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Sep 24, 2024
2883deb
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Sep 25, 2024
047c6c5
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Sep 25, 2024
0365e91
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Sep 25, 2024
5eeb7af
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Sep 26, 2024
7ff97cf
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Sep 27, 2024
b594e3f
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Oct 1, 2024
639886c
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Oct 1, 2024
8c4fb4e
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Oct 1, 2024
789553d
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Oct 2, 2024
451a667
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Oct 3, 2024
6bff9ac
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Oct 4, 2024
cecb863
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Oct 9, 2024
5d9f00f
Merge branch 'main' of github.com:juspay/hyperswitch-control-center
JeevaRamu0104 Oct 10, 2024
ef32216
fix: unauthorized page issue
JeevaRamu0104 Oct 10, 2024
21d0fd2
fix: pageloader changes
Riddhiagrawal001 Oct 14, 2024
b5009bb
fix: loader fix
Riddhiagrawal001 Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/components/SelectBox.res
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
69 changes: 35 additions & 34 deletions src/entryPoints/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ 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
setScreenState(_ => PageLoaderWrapper.Loading)
setuserGroupACL(_ => None)
Window.connectorWasmInit()->ignore
let _ = await fetchUserGroupACL()
Expand All @@ -49,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("/")
Expand All @@ -76,18 +74,21 @@ let make = () => {
}, [userGroupACL])

<>
<PageLoaderWrapper screenState={screenState} sectionHeight="!h-screen" showLogoutButton=true>
<div>
{switch dashboardPageState {
| #AUTO_CONNECTOR_INTEGRATION => <HSwitchSetupAccount />
// INTEGRATION_DOC Need to be removed
| #INTEGRATION_DOC => <UserOnboarding />
| #HOME =>
<div className="relative" key={renderKey}>
// TODO: Change the key to only profileId once the userInfo starts sending profileId
<div className={`h-screen flex flex-col`}>
<div className="flex relative overflow-auto h-screen ">
<Sidebar path={url.path} sidebars={hyperSwitchAppSidebars} />
<div>
{switch dashboardPageState {
| #AUTO_CONNECTOR_INTEGRATION => <HSwitchSetupAccount />
// INTEGRATION_DOC Need to be removed
| #INTEGRATION_DOC => <UserOnboarding />
| #HOME =>
<div className="relative">
// TODO: Change the key to only profileId once the userInfo starts sending profileId
<div className={`h-screen flex flex-col`}>
<div className="flex relative overflow-auto h-screen ">
<Sidebar
path={url.path} sidebars={hyperSwitchAppSidebars} key={(screenState :> string)}
/>
<PageLoaderWrapper
screenState={screenState} sectionHeight="!h-screen w-full" showLogoutButton=true>
<div
className="flex relative flex-col flex-1 bg-hyperswitch_background dark:bg-black overflow-scroll md:overflow-x-hidden">
<div className="border-b shadow hyperswitch_box_shadow ">
Expand Down Expand Up @@ -275,25 +276,25 @@ let make = () => {
</div>
</div>
</div>
</div>
<RenderIf condition={showFeedbackModal && featureFlagDetails.feedback}>
<HSwitchFeedBackModal
modalHeading="We'd love to hear from you!"
showModal={showFeedbackModal}
setShowModal={setShowFeedbackModal}
/>
</RenderIf>
<RenderIf condition={!featureFlagDetails.isLiveMode || featureFlagDetails.quickStart}>
<ProdIntentForm />
</RenderIf>
</PageLoaderWrapper>
</div>
<RenderIf condition={showFeedbackModal && featureFlagDetails.feedback}>
<HSwitchFeedBackModal
modalHeading="We'd love to hear from you!"
showModal={showFeedbackModal}
setShowModal={setShowFeedbackModal}
/>
</RenderIf>
<RenderIf condition={!featureFlagDetails.isLiveMode || featureFlagDetails.quickStart}>
<ProdIntentForm />
</RenderIf>
</div>
| #DEFAULT =>
<div className="h-screen flex justify-center items-center">
<Loader />
</div>
}}
</div>
</PageLoaderWrapper>
</div>
| #DEFAULT =>
<div className="h-screen flex justify-center items-center">
<Loader />
</div>
}}
</div>
</>
}
1 change: 1 addition & 0 deletions src/screens/Helpers/PageLoaderWrapper.res
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@unboxed
type viewType = Loading | Error(string) | Success | Custom

module ScreenLoader = {
Expand Down
Loading