Skip to content

Commit 8681578

Browse files
committed
tooltip now shows user who made uncommitted change
1 parent 2af43b5 commit 8681578

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,9 +2172,10 @@ webui.NewChangedFilesView = function(workspaceView) {
21722172
webui.git("status -u --porcelain", function(data) {
21732173
$.get("api/uncommitted", function (uncommitted) {
21742174
var uncommittedItems = JSON.parse(uncommitted)["current user's changes"];
2175+
var otherUserUncommittedItems = JSON.parse(uncommitted)["other users' changes"];
21752176
self.filesCount = 0;
21762177

2177-
function addItemToFileList(fileList, indexStatus, workingTreeStatus, model, isOtherUserChange) {
2178+
function addItemToFileList(fileList, indexStatus, workingTreeStatus, model, isOtherUserChange, otherUser) {
21782179
var formCheck;
21792180
if (isOtherUserChange) {
21802181
formCheck = $('<div class="form-check changes-check other-user"></div>');
@@ -2201,7 +2202,7 @@ webui.NewChangedFilesView = function(workspaceView) {
22012202

22022203
var checkboxLabel;
22032204
if (isOtherUserChange) {
2204-
checkboxLabel = $('<label class="form-check-label file-item-label other-user-label" data-toggle="tooltip" title="File changed by another user">' + webui.peopleIcon +'</label>').append(model);
2205+
checkboxLabel = $('<label class="form-check-label file-item-label other-user-label" data-toggle="tooltip" data-placement="top" title="File changed by: ' + otherUser + '">' + webui.peopleIcon +'</label>').append(model);
22052206
} else {
22062207
checkboxLabel = $('<label class="form-check-label file-item-label"></label>').text(model);
22072208
}
@@ -2236,7 +2237,8 @@ webui.NewChangedFilesView = function(workspaceView) {
22362237
if (isForCurrentUser) {
22372238
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, false);
22382239
} else {
2239-
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true);
2240+
var otherUser = otherUserUncommittedItems[model.replace(/\//g, '\\')];
2241+
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true, otherUser);
22402242
}
22412243

22422244
});

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,9 +2172,10 @@ webui.NewChangedFilesView = function(workspaceView) {
21722172
webui.git("status -u --porcelain", function(data) {
21732173
$.get("api/uncommitted", function (uncommitted) {
21742174
var uncommittedItems = JSON.parse(uncommitted)["current user's changes"];
2175+
var otherUserUncommittedItems = JSON.parse(uncommitted)["other users' changes"];
21752176
self.filesCount = 0;
21762177

2177-
function addItemToFileList(fileList, indexStatus, workingTreeStatus, model, isOtherUserChange) {
2178+
function addItemToFileList(fileList, indexStatus, workingTreeStatus, model, isOtherUserChange, otherUser) {
21782179
var formCheck;
21792180
if (isOtherUserChange) {
21802181
formCheck = $('<div class="form-check changes-check other-user"></div>');
@@ -2201,7 +2202,7 @@ webui.NewChangedFilesView = function(workspaceView) {
22012202

22022203
var checkboxLabel;
22032204
if (isOtherUserChange) {
2204-
checkboxLabel = $('<label class="form-check-label file-item-label other-user-label" data-toggle="tooltip" title="File changed by another user">' + webui.peopleIcon +'</label>').append(model);
2205+
checkboxLabel = $('<label class="form-check-label file-item-label other-user-label" data-toggle="tooltip" data-placement="top" title="File changed by: ' + otherUser + '">' + webui.peopleIcon +'</label>').append(model);
22052206
} else {
22062207
checkboxLabel = $('<label class="form-check-label file-item-label"></label>').text(model);
22072208
}
@@ -2236,7 +2237,8 @@ webui.NewChangedFilesView = function(workspaceView) {
22362237
if (isForCurrentUser) {
22372238
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, false);
22382239
} else {
2239-
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true);
2240+
var otherUser = otherUserUncommittedItems[model.replace(/\//g, '\\')];
2241+
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true, otherUser);
22402242
}
22412243

22422244
});

0 commit comments

Comments
 (0)