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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Option to lock/unlock namespace is now available on the settings page (#650)
- Settings page now warns if Embedded Git is not the configured source control extension (#857)
- Settings page now has option to switch namespace (#856)

### Fixed
- When cloning a repo with Configure, that repo's embedded-git-config file will overwrite previous settings (#819)
- Settings page no longer removes remote when saving after cloning (#858)

## [2.13.1] - 2025-09-16

Expand Down
57 changes: 48 additions & 9 deletions csp/gitprojectsettings.csp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ body {
}
</server>
<div class = 'container'>
<csp:if condition='$case(##class(%Studio.SourceControl.Interface).SourceControlClassGet(),"SourceControl.Git.Extension":0,:1)'>
<div class="error alert-danger">
<span class="closebtn" onclick="this.parentElement.style.display='none';">&times;</span>
Embedded Git is not the configured source control extension for this namespace. To change, modify the
<a href="#($Piece(%request.Application,%request.AppMatch)_"/csp/sys/mgr/%25CSP.UI.Portal.SourceControl.zen?$NAMESPACE="_$namespace)#">
Source Control Settings</a>.
</div>
</csp:if>
<csp:if condition='$get(successfullySavedSettings) && (##class(SourceControl.Git.Utils).NeedSettings() = 0)'>
<div class = "alert">
<span class="closebtn" onclick="this.parentElement.style.display='none';">&times;</span>
Expand All @@ -221,12 +229,30 @@ body {
<input type="hidden" name="gitsettings" value="1" />
<div class="col-sm-12"><br></div>
<div class="row">
<div class="offset-sm-1 col-sm-7" id="settingsTitle">
<div class="offset-sm-1 col-sm-6" id="settingsTitle">
<h1>Git Project Settings</h1>
<h3> Package version: #(version)# </h3>
</div>

<div class="col-sm-4" id="settingsNavBtn">
<div class="col-sm-5" id="settingsNavBtn">
<button class="btn btn-lg btn-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false" title="Switch Namespace">
#(..EscapeHTML($namespace))#
</button>
<div class="dropdown-menu">
<script language="cache" runat=server>
try {
kill allNamespaces
$$$ThrowOnError(##class(%SYS.Namespace).ListAll(.allNamespaces))
set key = $order(allNamespaces(""))
while key'="" {
&html<<a class="dropdown-item" href="?Namespace=#(..EscapeHTML(key))#">#(..EscapeHTML(key))#</a>>
set key = $order(allNamespaces(key))
}
} catch err {
do err.Log()
}
</script>
</div>
<button class="btn btn-lg btn-outline-dark" id="goToHome">Home
</button>
<div id="homeURL">
Expand Down Expand Up @@ -434,7 +460,7 @@ body {
</div>
</div>

<div class="form-group row mb-3">
<div id="formGroupRemoteRepo" class="form-group row mb-3">
<label for="remoteRepo" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Url to Remote repository (origin)"><b>Remote Repository</b></label>
<div class="col-sm-7">
<input type="text" class='form-control #($select($get(remote)="":"",$get(remoteConnectionError)="":"is-valid",1:"is-invalid"))#' id="remoteRepo" name="remoteRepo" value='#(..EscapeHTML($get(remote)))#' placeholder="e.g. git@github.com:User/UserRepo.git"/>
Expand Down Expand Up @@ -791,6 +817,11 @@ function clone() {
return;
}
disableActionButtons();
var formGroupRemoteRepo = document.getElementById("formGroupRemoteRepo");
var namespaceSettings = document.getElementById("namespaceSettings");
if (formGroupRemoteRepo && settingsForm) {
namespaceSettings.removeChild(formGroupRemoteRepo);
}
var ws = getSocket("method=clone&remote=" + encodeURIComponent(remote));
ws.onmessage = showOutput('initOutput');
}
Expand Down Expand Up @@ -823,13 +854,21 @@ function validateForm() {
var confirmText = "";
var lockNamespaceInitValue = #(''##class(SourceControl.Git.Utils).Locked())#;
var cbLockNamespace = document.getElementById("lockNamespace");
if (!cbLockNamespace) return true;
if (cbLockNamespace.checked && (lockNamespaceInitValue !== 1)) {
confirmText = "Are you sure? This will lock any source-controlled items from being edited in this namespace.";
} else if (!cbLockNamespace.checked && (lockNamespaceInitValue == 1)) {
confirmText = "Are you sure? This will allow edits of source-controlled items in this namespace.";
if (cbLockNamespace) {
if (cbLockNamespace.checked && (lockNamespaceInitValue !== 1)) {
confirmText = "\nThis will lock any source-controlled items from being edited in this namespace.";
} else if (!cbLockNamespace.checked && (lockNamespaceInitValue == 1)) {
confirmText = "\nThis will allow edits of source-controlled items in this namespace.";
}
}
var remoteInitValue = "#(##class(SourceControl.Git.Utils).GetRedactedRemote())#";
var inputRemote = document.getElementById("remoteRepo");
if (inputRemote) {
if ((inputRemote.value == "") && (remoteInitValue !== "")) {
confirmText += "\nThis will remove the origin remote from the repository."
}
}
return confirmText ? confirm(confirmText) : true;
return confirmText ? confirm("Are you sure?" + confirmText) : true;
}

$(function () {
Expand Down
Loading