Skip to content

Commit 3d000b3

Browse files
authored
Merge pull request #309 from intersystems/longBranchName
Show Longer Branch Name in Web UI's "More ..." View
2 parents 8b1b391 + 284b0a9 commit 3d000b3

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111
- Support for git submodules in package manager-aware setting (#305)
12+
- Web UI's 'More ...' view shows longer branch names (#294)
1213
- Deletion of files in locked environment is now suppressed (#302)
1314

1415
## [2.3.0] - 2023-12-06

git-webui/release/share/git-webui/webui/css/git-webui.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ body {
265265
border: none;
266266
}
267267
.modal .card-header {
268-
padding: 1% 2% 0% 14%;
268+
padding: 0;
269269
background-color: #fff;
270270
color: inherit !important;
271271
border: none !important;
@@ -277,6 +277,10 @@ body {
277277
padding-bottom: 1%;
278278
margin: 0%;
279279
border: none !important;
280+
overflow: visible;
281+
}
282+
.modal .modal-content {
283+
min-width: fit-content;
280284
}
281285
#main-view {
282286
display: flex;

git-webui/release/share/git-webui/webui/js/git-webui.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
362362
var itemId = refname + idPostfix;
363363
var cardHeader = $('<div class="card-header" id="heading-' + itemId +'">').appendTo(cardDiv);
364364
var button = $('<button class="btn btn-sm btn-default btn-branch text-left" type="button" data-toggle="collapse" data-target="#collapse-' + itemId + '" aria-expanded="true" aria-controls="collapse-' + itemId + '">'
365-
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
365+
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
366366
+ '</button>').appendTo(cardHeader)
367367

368368
var collapseDiv = $('<div id="collapse-' + itemId + '" class="collapse" aria-labelledby="heading-' + itemId + '" data-parent="#accordion-'+id+'-'+idPostfix+'">').appendTo(cardDiv);
@@ -377,6 +377,16 @@ webui.SideBarView = function(mainView, noEventHandlers) {
377377
self.selectRef(event.target.innerHTML);
378378
});
379379
}
380+
381+
if (id === "remote-branches" && idPostfix === "popup") {
382+
const remoteBranchBtns = $("#accordion-remote-branches-popup button").filter((i, span) => jQuery.inArray($(span).text(),refs) != -1);
383+
const widest = Math.max(...remoteBranchBtns.map((i, span) => $(span).width()));
384+
if (remoteBranchBtns.length > 0) {
385+
remoteBranchBtns.css("padding", ".25rem .5rem");
386+
remoteBranchBtns.css("border", 0);
387+
remoteBranchBtns.width(widest);
388+
}
389+
}
380390
return accordionDiv;
381391
}
382392

git-webui/src/share/git-webui/webui/css/git-webui.less

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ body {
361361

362362
.modal {
363363
.card-header {
364-
padding: 1% 2% 0% 14%;
364+
padding: 0;
365365
background-color: #fff;
366366
color: inherit !important;
367367
border:none !important;
@@ -372,6 +372,10 @@ body {
372372
padding-bottom:1%;
373373
margin: 0%;
374374
border: none !important;
375+
overflow: visible;
376+
}
377+
.modal-content {
378+
min-width: fit-content;
375379
}
376380
}
377381

git-webui/src/share/git-webui/webui/js/git-webui.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
362362
var itemId = refname + idPostfix;
363363
var cardHeader = $('<div class="card-header" id="heading-' + itemId +'">').appendTo(cardDiv);
364364
var button = $('<button class="btn btn-sm btn-default btn-branch text-left" type="button" data-toggle="collapse" data-target="#collapse-' + itemId + '" aria-expanded="true" aria-controls="collapse-' + itemId + '">'
365-
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
365+
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
366366
+ '</button>').appendTo(cardHeader)
367367

368368
var collapseDiv = $('<div id="collapse-' + itemId + '" class="collapse" aria-labelledby="heading-' + itemId + '" data-parent="#accordion-'+id+'-'+idPostfix+'">').appendTo(cardDiv);
@@ -377,6 +377,16 @@ webui.SideBarView = function(mainView, noEventHandlers) {
377377
self.selectRef(event.target.innerHTML);
378378
});
379379
}
380+
381+
if (id === "remote-branches" && idPostfix === "popup") {
382+
const remoteBranchBtns = $("#accordion-remote-branches-popup button").filter((i, span) => jQuery.inArray($(span).text(),refs) != -1);
383+
const widest = Math.max(...remoteBranchBtns.map((i, span) => $(span).width()));
384+
if (remoteBranchBtns.length > 0) {
385+
remoteBranchBtns.css("padding", ".25rem .5rem");
386+
remoteBranchBtns.css("border", 0);
387+
remoteBranchBtns.width(widest);
388+
}
389+
}
380390
return accordionDiv;
381391
}
382392

0 commit comments

Comments
 (0)