aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/app
diff options
context:
space:
mode:
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>2023-07-24 12:18:42 +0200
committersonartech <sonartech@sonarsource.com>2023-07-24 20:03:21 +0000
commit6f8389602a9957bebb0d569f927a429da676473e (patch)
tree30e555a19e9150cb88773f2f2acca16327ca1454 /server/sonar-web/src/main/js/app
parent2f9bcaa9ef14dc86c5216d7cd22b2c1d2d041dcf (diff)
downloadsonarqube-6f8389602a9957bebb0d569f927a429da676473e.tar.gz
sonarqube-6f8389602a9957bebb0d569f927a429da676473e.zip
SONAR-19989 Remove extra separator in branch/PR menu
Diffstat (limited to 'server/sonar-web/src/main/js/app')
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx32
1 files changed, 16 insertions, 16 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx
index c91f6b744b7..6d76c7ae1a7 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx
@@ -56,6 +56,8 @@ export function MenuItemList(props: MenuItemListProps) {
/>
);
+ const branches = [branchLikeTree.mainBranchTree, ...branchLikeTree.branchTree];
+
return (
<ul className="item-list sw-overflow-y-auto sw-overflow-x-hidden">
{!hasResults && (
@@ -65,22 +67,20 @@ export function MenuItemList(props: MenuItemListProps) {
)}
{/* BRANCHES & PR */}
- {[branchLikeTree.mainBranchTree, ...branchLikeTree.branchTree]
- .filter(isDefined)
- .map((tree) => (
- <React.Fragment key={getBranchLikeKey(tree.branch)}>
- {renderItem(tree.branch)}
- {tree.pullRequests.length > 0 && (
- <>
- <ItemDivider />
- <ItemHeader>{translate('branch_like_navigation.pull_requests')}</ItemHeader>
- <ItemDivider />
- {tree.pullRequests.map((pr) => renderItem(pr, true))}
- {tree.pullRequests.length > 0 && <ItemDivider />}
- </>
- )}
- </React.Fragment>
- ))}
+ {branches.filter(isDefined).map((tree, treeIndex) => (
+ <React.Fragment key={getBranchLikeKey(tree.branch)}>
+ {renderItem(tree.branch)}
+ {tree.pullRequests.length > 0 && (
+ <>
+ <ItemDivider />
+ <ItemHeader>{translate('branch_like_navigation.pull_requests')}</ItemHeader>
+ <ItemDivider />
+ {tree.pullRequests.map((pr) => renderItem(pr, true))}
+ {tree.pullRequests.length > 0 && treeIndex !== branches.length - 1 && <ItemDivider />}
+ </>
+ )}
+ </React.Fragment>
+ ))}
{/* PARENTLESS PR (for display during search) */}
{branchLikeTree.parentlessPullRequests.length > 0 && (