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: Removed Sublevel remote link type & Pageloader CSS fixes. #120

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 13 additions & 40 deletions src/screens/HyperSwitch/Sidebar/Sidebar.res
Original file line number Diff line number Diff line change
Expand Up @@ -216,25 +216,6 @@ module NestedSidebarItem = {
</Link>
</UIUtils.RenderIf>
}

| SubLevelRemoteLink(tabOption) => {
let {name, link, access, ?remoteIcon} = tabOption
let (remoteUi, link) = if remoteIcon->Belt.Option.getWithDefault(false) {
(<Icon name="external-link-alt" size=14 className="ml-3" />, link)
} else {
(React.null, `${link}${getSearchParamByLink(link)}`)
}
<UIUtils.RenderIf condition={access !== NoAccess}>
<a
ref={nestedSidebarItemRef->ReactDOM.Ref.domRef}
href={link}
target="_blank"
className={`${textColor} relative overflow-hidden flex flex-row items-center cursor-pointer ${paddingClass} ${selectedClass} `}>
<SidebarSubOption name isSectionExpanded isSelected isSideBarExpanded />
remoteUi
</a>
</UIUtils.RenderIf>
}
}}
</UIUtils.RenderIf>
}
Expand Down Expand Up @@ -308,23 +289,18 @@ module NestedSectionItem = {
</UIUtils.RenderIf>
</div>
<UIUtils.RenderIf condition={isElementShown}>
{
let subSectionsArr =
section.links
->Array.mapWithIndex((subLevelItem, index) => {
let isSelected = subLevelItem->isSubLevelItemSelected
<NestedSidebarItem
key={string_of_int(index)}
isSelected
isSideBarExpanded
isSectionExpanded
tabInfo=subLevelItem
/>
})
->React.array

subSectionsArr
}
{section.links
->Array.mapWithIndex((subLevelItem, index) => {
let isSelected = subLevelItem->isSubLevelItemSelected
<NestedSidebarItem
key={string_of_int(index)}
isSelected
isSideBarExpanded
isSectionExpanded
tabInfo=subLevelItem
/>
})
->React.array}
</UIUtils.RenderIf>
</div>
}
Expand All @@ -341,9 +317,7 @@ module SidebarNestedSection = {
) => {
let isSubLevelItemSelected = tabInfo => {
switch tabInfo {
| SubLevelRemoteLink(item)
| SubLevelLink(item) =>
linkSelectionCheck(firstPart, item.link)
| SubLevelLink(item) => linkSelectionCheck(firstPart, item.link)
}
}

Expand Down Expand Up @@ -401,7 +375,6 @@ module SidebarNestedSection = {
acc &&
switch subLevelItem {
| SubLevelLink({access}) => access === NoAccess
| SubLevelRemoteLink({access}) => access === NoAccess
}
})
<UIUtils.RenderIf condition={!areAllSubLevelsHidden}>
Expand Down
4 changes: 1 addition & 3 deletions src/screens/HyperSwitch/Sidebar/SidebarTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ type nestedOption = {
iconSize?: int,
}

type subLevelItem =
| SubLevelRemoteLink(nestedOption)
| SubLevelLink(nestedOption)
type subLevelItem = SubLevelLink(nestedOption)

type sectionType = {
name: string,
Expand Down
3 changes: 1 addition & 2 deletions src/screens/HyperSwitch/Utils/HSwitchGlobalSearchBar.res
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ let make = () => {
[],
(insideAcc, item) => {
switch item {
| SubLevelLink(obj)
| SubLevelRemoteLink(obj) => {
| SubLevelLink(obj) => {
if (
checkStringStartsWithSubstring(~itemToCheck=sectionObj.name, ~searchText) ||
checkStringStartsWithSubstring(~itemToCheck=obj.name, ~searchText)
Expand Down
3 changes: 1 addition & 2 deletions src/screens/HyperSwitch/Utils/PageLoaderWrapper.res
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ let make = (
}
| Error(_err) =>
<DefaultLandingPage
height=sectionHeight
title="Oops, we hit a little bump on the road!"
customStyle={`py-16 !m-0 ${customStyleForDefaultLandingPage}`}
customStyle={`py-16 !m-0 ${customStyleForDefaultLandingPage} ${sectionHeight}`}
overriddingStylesTitle="text-2xl font-semibold"
buttonText="Refresh"
overriddingStylesSubtitle="!text-sm text-grey-700 opacity-50 !w-3/4"
Expand Down
Loading