Skip to content

Commit c8315c3

Browse files
authored
Merge pull request #421 from intersystems/changed-file-user-tooltip
tooltip now shows user who made uncommitted change
2 parents 1fb253f + 9206c98 commit c8315c3

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
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
- Fixed JS errors in Studio on certain operations (#416)
12+
- Tooltip in workspace now shows user who made uncommitted change if not current user (#411)
1213
- Files are added to source control upon creation properly (#404)
1314
- Files show in uncommitted queue when automatically added (#407)
1415
- WebUI workspace view now works properly for filenames with spaces (#423)

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
}
@@ -2237,7 +2238,8 @@ webui.NewChangedFilesView = function(workspaceView) {
22372238
if (isForCurrentUser) {
22382239
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, false);
22392240
} else {
2240-
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true);
2241+
var otherUser = otherUserUncommittedItems[model.replace(/\//g, '\\')];
2242+
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true, otherUser);
22412243
}
22422244

22432245
});

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
}
@@ -2237,7 +2238,8 @@ webui.NewChangedFilesView = function(workspaceView) {
22372238
if (isForCurrentUser) {
22382239
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, false);
22392240
} else {
2240-
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true);
2241+
var otherUser = otherUserUncommittedItems[model.replace(/\//g, '\\')];
2242+
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true, otherUser);
22412243
}
22422244

22432245
});

0 commit comments

Comments
 (0)