Skip to content

Commit de431d8

Browse files
authored
Merge branch 'main' into webui-new-repo-bugs
2 parents c80fffe + b398d5d commit de431d8

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ 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+
- Fixed issue where selecting different item in stash list didn't update diff view (#265)
13+
- Tooltip in workspace now shows user who made uncommitted change if not current user (#411)
14+
- Files are added to source control upon creation properly (#404)
15+
- Files show in uncommitted queue when automatically added (#407)
16+
- WebUI workspace view now works properly for filenames with spaces (#423)
17+
- Fixed error popups in interop editors in Studio on 2024.1 (#417)
1218

1319
## [2.4.0] - 2024-07-08
1420

cls/SourceControl/Git/Utils.cls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,10 @@ ClassMethod AddToSourceControl(InternalName As %String) As %Status
672672
do ..RunGitCommand("add",.errStream,.outStream,filenames(i),"--intent-to-add")
673673
write !, "Added ", FileInternalName, " to source control."
674674
do ..PrintStreams(outStream, errStream)
675+
675676
}
676677
}
678+
do ##class(SourceControl.Git.Change).RefreshUncommitted(,,,1)
677679
quit ec
678680
}
679681

csp/gitprojectsettings.csp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,8 @@ $('[id^=noFoldersSwitch]').click(toggleNoFolders);
670670
</html>
671671
<script method='OnPreHTTP' language='cache' runat='server' returntype='%Boolean'>
672672
try {
673+
set %session.UseSessionCookie = 1 // Always set back to autodetect
674+
set %session.CookiePath = "" // Always clear
673675
if (%request.UserAgent [ " Code/") {
674676
// Workaround for VSCode webview
675677
set %session.SessionScope = 0 // none; allowed because...

csp/webuidriver.csp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
set %namespace = namespace
1212

1313
try {
14+
set %session.UseSessionCookie = 1 // Always set back to autodetect
15+
set %session.CookiePath = "" // Always clear
1416
if (%request.UserAgent [ " Code/") {
1517
// Workaround for VSCode webview
1618
set %session.SessionScope = 0 // none; allowed because...

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,11 +1256,7 @@ webui.StashCommitView = function(stashView) {
12561256
var self = this;
12571257

12581258
self.update = function(entry) {
1259-
if (currentCommit == entry.commit) {
1260-
// We already display the right data. No need to update.
1261-
return;
12621259

1263-
}
12641260
currentCommit = entry.commit;
12651261
self.showDiff();
12661262
diffView.update("stash show -p stash@{"+entry.stashIndex+"}");
@@ -1304,8 +1300,8 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
13041300
right.webuiPrevScrollTop = 0;
13051301
right.webuiPrevScrollLeft = 0;
13061302
}
1307-
webui.git("ls-files "+file, function(path){
1308-
self.gitFile = file;
1303+
webui.git("ls-files \""+file+"\"", function(path){
1304+
self.gitFile = "\"" + file + "\"";
13091305
self.noIndex = ""
13101306
if(path.length == 0 && file != undefined){
13111307
self.gitFile = " /dev/null " + file;
@@ -2063,11 +2059,6 @@ webui.CommitView = function(historyView) {
20632059
var self = this;
20642060

20652061
self.update = function(entry) {
2066-
if (currentCommit == entry.commit) {
2067-
// We already display the right data. No need to update.
2068-
return;
2069-
2070-
}
20712062
currentCommit = entry.commit;
20722063
self.showDiff();
20732064
buttonBox.select(0);
@@ -2175,9 +2166,10 @@ webui.NewChangedFilesView = function(workspaceView) {
21752166
webui.git("status -u --porcelain", function(data) {
21762167
$.get("api/uncommitted", function (uncommitted) {
21772168
var uncommittedItems = JSON.parse(uncommitted)["current user's changes"];
2169+
var otherUserUncommittedItems = JSON.parse(uncommitted)["other users' changes"];
21782170
self.filesCount = 0;
21792171

2180-
function addItemToFileList(fileList, indexStatus, workingTreeStatus, model, isOtherUserChange) {
2172+
function addItemToFileList(fileList, indexStatus, workingTreeStatus, model, isOtherUserChange, otherUser) {
21812173
var formCheck;
21822174
if (isOtherUserChange) {
21832175
formCheck = $('<div class="form-check changes-check other-user"></div>');
@@ -2204,7 +2196,7 @@ webui.NewChangedFilesView = function(workspaceView) {
22042196

22052197
var checkboxLabel;
22062198
if (isOtherUserChange) {
2207-
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);
2199+
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);
22082200
} else {
22092201
checkboxLabel = $('<label class="form-check-label file-item-label"></label>').text(model);
22102202
}
@@ -2227,6 +2219,7 @@ webui.NewChangedFilesView = function(workspaceView) {
22272219
} else {
22282220
model = line;
22292221
}
2222+
model = model.replace(/^"(.*)"$/g,'$1');
22302223

22312224
++self.filesCount;
22322225
var isForCurrentUser;
@@ -2239,7 +2232,8 @@ webui.NewChangedFilesView = function(workspaceView) {
22392232
if (isForCurrentUser) {
22402233
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, false);
22412234
} else {
2242-
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true);
2235+
var otherUser = otherUserUncommittedItems[model.replace(/\//g, '\\')];
2236+
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true, otherUser);
22432237
}
22442238

22452239
});

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,11 +1256,7 @@ webui.StashCommitView = function(stashView) {
12561256
var self = this;
12571257

12581258
self.update = function(entry) {
1259-
if (currentCommit == entry.commit) {
1260-
// We already display the right data. No need to update.
1261-
return;
12621259

1263-
}
12641260
currentCommit = entry.commit;
12651261
self.showDiff();
12661262
diffView.update("stash show -p stash@{"+entry.stashIndex+"}");
@@ -1304,8 +1300,8 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
13041300
right.webuiPrevScrollTop = 0;
13051301
right.webuiPrevScrollLeft = 0;
13061302
}
1307-
webui.git("ls-files "+file, function(path){
1308-
self.gitFile = file;
1303+
webui.git("ls-files \""+file+"\"", function(path){
1304+
self.gitFile = "\"" + file + "\"";
13091305
self.noIndex = ""
13101306
if(path.length == 0 && file != undefined){
13111307
self.gitFile = " /dev/null " + file;
@@ -2063,11 +2059,6 @@ webui.CommitView = function(historyView) {
20632059
var self = this;
20642060

20652061
self.update = function(entry) {
2066-
if (currentCommit == entry.commit) {
2067-
// We already display the right data. No need to update.
2068-
return;
2069-
2070-
}
20712062
currentCommit = entry.commit;
20722063
self.showDiff();
20732064
buttonBox.select(0);
@@ -2175,9 +2166,10 @@ webui.NewChangedFilesView = function(workspaceView) {
21752166
webui.git("status -u --porcelain", function(data) {
21762167
$.get("api/uncommitted", function (uncommitted) {
21772168
var uncommittedItems = JSON.parse(uncommitted)["current user's changes"];
2169+
var otherUserUncommittedItems = JSON.parse(uncommitted)["other users' changes"];
21782170
self.filesCount = 0;
21792171

2180-
function addItemToFileList(fileList, indexStatus, workingTreeStatus, model, isOtherUserChange) {
2172+
function addItemToFileList(fileList, indexStatus, workingTreeStatus, model, isOtherUserChange, otherUser) {
21812173
var formCheck;
21822174
if (isOtherUserChange) {
21832175
formCheck = $('<div class="form-check changes-check other-user"></div>');
@@ -2204,7 +2196,7 @@ webui.NewChangedFilesView = function(workspaceView) {
22042196

22052197
var checkboxLabel;
22062198
if (isOtherUserChange) {
2207-
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);
2199+
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);
22082200
} else {
22092201
checkboxLabel = $('<label class="form-check-label file-item-label"></label>').text(model);
22102202
}
@@ -2227,6 +2219,7 @@ webui.NewChangedFilesView = function(workspaceView) {
22272219
} else {
22282220
model = line;
22292221
}
2222+
model = model.replace(/^"(.*)"$/g,'$1');
22302223

22312224
++self.filesCount;
22322225
var isForCurrentUser;
@@ -2239,7 +2232,8 @@ webui.NewChangedFilesView = function(workspaceView) {
22392232
if (isForCurrentUser) {
22402233
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, false);
22412234
} else {
2242-
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true);
2235+
var otherUser = otherUserUncommittedItems[model.replace(/\//g, '\\')];
2236+
addItemToFileList(fileList, indexStatus, workingTreeStatus, model, true, otherUser);
22432237
}
22442238

22452239
});

0 commit comments

Comments
 (0)