Skip to content

Commit

Permalink
Merge pull request #309 from intersystems/longBranchName
Browse files Browse the repository at this point in the history
Show Longer Branch Name in Web UI's "More ..." View
  • Loading branch information
isc-tleavitt authored Jan 4, 2024
2 parents 8b1b391 + 284b0a9 commit 3d000b3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

## [2.3.0] - 2023-12-06
Expand Down
6 changes: 5 additions & 1 deletion git-webui/release/share/git-webui/webui/css/git-webui.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ body {
border: none;
}
.modal .card-header {
padding: 1% 2% 0% 14%;
padding: 0;
background-color: #fff;
color: inherit !important;
border: none !important;
Expand All @@ -277,6 +277,10 @@ body {
padding-bottom: 1%;
margin: 0%;
border: none !important;
overflow: visible;
}
.modal .modal-content {
min-width: fit-content;
}
#main-view {
display: flex;
Expand Down
12 changes: 11 additions & 1 deletion git-webui/release/share/git-webui/webui/js/git-webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
var itemId = refname + idPostfix;
var cardHeader = $('<div class="card-header" id="heading-' + itemId +'">').appendTo(cardDiv);
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 + '">'
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
+ '</button>').appendTo(cardHeader)

var collapseDiv = $('<div id="collapse-' + itemId + '" class="collapse" aria-labelledby="heading-' + itemId + '" data-parent="#accordion-'+id+'-'+idPostfix+'">').appendTo(cardDiv);
Expand All @@ -377,6 +377,16 @@ webui.SideBarView = function(mainView, noEventHandlers) {
self.selectRef(event.target.innerHTML);
});
}

if (id === "remote-branches" && idPostfix === "popup") {
const remoteBranchBtns = $("#accordion-remote-branches-popup button").filter((i, span) => jQuery.inArray($(span).text(),refs) != -1);
const widest = Math.max(...remoteBranchBtns.map((i, span) => $(span).width()));
if (remoteBranchBtns.length > 0) {
remoteBranchBtns.css("padding", ".25rem .5rem");
remoteBranchBtns.css("border", 0);
remoteBranchBtns.width(widest);
}
}
return accordionDiv;
}

Expand Down
6 changes: 5 additions & 1 deletion git-webui/src/share/git-webui/webui/css/git-webui.less
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ body {

.modal {
.card-header {
padding: 1% 2% 0% 14%;
padding: 0;
background-color: #fff;
color: inherit !important;
border:none !important;
Expand All @@ -372,6 +372,10 @@ body {
padding-bottom:1%;
margin: 0%;
border: none !important;
overflow: visible;
}
.modal-content {
min-width: fit-content;
}
}

Expand Down
12 changes: 11 additions & 1 deletion git-webui/src/share/git-webui/webui/js/git-webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
var itemId = refname + idPostfix;
var cardHeader = $('<div class="card-header" id="heading-' + itemId +'">').appendTo(cardDiv);
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 + '">'
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
+ ref //IMPORTANT: This has to be the original ref for selectRef to work
+ '</button>').appendTo(cardHeader)

var collapseDiv = $('<div id="collapse-' + itemId + '" class="collapse" aria-labelledby="heading-' + itemId + '" data-parent="#accordion-'+id+'-'+idPostfix+'">').appendTo(cardDiv);
Expand All @@ -377,6 +377,16 @@ webui.SideBarView = function(mainView, noEventHandlers) {
self.selectRef(event.target.innerHTML);
});
}

if (id === "remote-branches" && idPostfix === "popup") {
const remoteBranchBtns = $("#accordion-remote-branches-popup button").filter((i, span) => jQuery.inArray($(span).text(),refs) != -1);
const widest = Math.max(...remoteBranchBtns.map((i, span) => $(span).width()));
if (remoteBranchBtns.length > 0) {
remoteBranchBtns.css("padding", ".25rem .5rem");
remoteBranchBtns.css("border", 0);
remoteBranchBtns.width(widest);
}
}
return accordionDiv;
}

Expand Down

0 comments on commit 3d000b3

Please sign in to comment.