Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions csp/gitprojectsettings.csp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ body {
for param="gitUserName","gitUserEmail" {
set $Property(settings,param) = $Get(%request.Data(param,1))
}

// Users may set basicMode even if settingsUIReadOnly is true
if ($Get(%request.Data("basicMode", 1)) = 1) {
set settings.basicMode = 1
} elseif ($Get(%request.Data("basicMode", 1)) = "system"){
set settings.basicMode = "system"
} else {
set settings.basicMode = 0
}

if ('settings.settingsUIReadOnly) {
for param="gitBinPath","namespaceTemp","privateKeyFile","pullEventClass","percentClassReplace", "defaultMergeBranch","environmentName","mappingsToken" {
set $Property(settings,param) = $Get(%request.Data(param,1))
Expand All @@ -125,14 +135,6 @@ body {
set settings.decomposeProdAllowIDE = ($Get(%request.Data("decomposeProdAllowIDE", 1)) = 1)
set settings.lockBranch = ($Get(%request.Data("lockBranch", 1)) = 1)

if ($Get(%request.Data("basicMode", 1)) = 1) {
set settings.basicMode = 1
} elseif ($Get(%request.Data("basicMode", 1)) = "system"){
set settings.basicMode = "system"
} else {
set settings.basicMode = 0
}

if ($Get(%request.Data("systemBasicMode", 1)) = 1) {
set settings.systemBasicMode = 1
} else {
Expand Down Expand Up @@ -183,12 +185,16 @@ body {
kill buffer
throw err
}
set newRemote = $Get(%request.Data("remoteRepo",1))
// If entry was modified and git repo is initialized, set new remote repo
set dir = ##class(%File).NormalizeDirectory(settings.namespaceTemp)
if (settings.namespaceTemp '= "") && ##class(%File).DirectoryExists(dir_".git") {
if (newRemote '= ##class(SourceControl.Git.Utils).GetRedactedRemote()) {
do ##class(SourceControl.Git.Utils).SetConfiguredRemote(newRemote)
// Do not attempt to set a new remote repo if 'remoteRepo' is not actually present in the request
// This may occur for example when settingsUIReadOnly is true where 'remoteRepo' is not user editable
if ($data(%request.Data("remoteRepo",1)) '= 0) {
set newRemote = $Get(%request.Data("remoteRepo",1))
// If entry was modified and git repo is initialized, set new remote repo
set dir = ##class(%File).NormalizeDirectory(settings.namespaceTemp)
if (settings.namespaceTemp '= "") && ##class(%File).DirectoryExists(dir_".git") {
if (newRemote '= ##class(SourceControl.Git.Utils).GetRedactedRemote()) {
do ##class(SourceControl.Git.Utils).SetConfiguredRemote(newRemote)
}
}
}
set successfullySavedSettings = 1
Expand Down
4 changes: 2 additions & 2 deletions git-webui/release/share/git-webui/webui/js/git-webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1350,12 +1350,12 @@ webui.LogView = function(historyView) {
if (type == 'revert') {
webui.git_command(["revert", "--no-commit","HEAD"], function(output) {
webui.showSuccess(output);
workspaceView.update();
updateSideBar();;
});
} else if (type == 'hardReset') {
webui.git_command(["reset", "--hard", "HEAD~1"], function(output) {
webui.showSuccess(output);
workspaceView.update();
updateSideBar();;
});
}

Expand Down
4 changes: 2 additions & 2 deletions git-webui/src/share/git-webui/webui/js/git-webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1350,12 +1350,12 @@ webui.LogView = function(historyView) {
if (type == 'revert') {
webui.git_command(["revert", "--no-commit","HEAD"], function(output) {
webui.showSuccess(output);
workspaceView.update();
updateSideBar();
});
} else if (type == 'hardReset') {
webui.git_command(["reset", "--hard", "HEAD~1"], function(output) {
webui.showSuccess(output);
workspaceView.update();
updateSideBar();
});
}

Expand Down
Loading