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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.14.0] - Unreleased

### Added
- Option to lock/unlock namespace is now available on the settings page (#650)

## [2.13.1] - 2025-09-16

### Fixed
Expand Down
28 changes: 27 additions & 1 deletion csp/gitprojectsettings.csp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ body {
}

if ('settings.settingsUIReadOnly) {
do ##class(SourceControl.Git.Utils).Locked($get(%request.Data("lockNamespace",1)))
for param="gitBinPath","namespaceTemp","privateKeyFile","pullEventClass","percentClassReplace", "defaultMergeBranch","environmentName","mappingsToken" {
set $Property(settings,param) = $Get(%request.Data(param,1))
}
Expand Down Expand Up @@ -215,7 +216,7 @@ body {
<strong>Success!</strong> Your changes have been saved.
</div>
</csp:if>
<form id="settingsForm" method='post'>
<form id="settingsForm" method='post' onsubmit="return validateForm();">
<input type="hidden" name="Namespace" value="#(..EscapeHTML(namespace))#" />
<input type="hidden" name="gitsettings" value="1" />
<div class="col-sm-12"><br></div>
Expand Down Expand Up @@ -515,6 +516,18 @@ body {
</div>
</div>
</div>
<div class="form-group row mb-3">
<label for="lockNamespace" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top"
title="If true, any source-controlled code or configuration may not be directly edited in this namespace">
Lock Edits in Namespace</label>
<div class="col-sm-7">
<div class="custom-control custom-switch custom-switch-no-border">
<input class="custom-control-input" name="lockNamespace" type="checkbox"
id="lockNamespace" #($select(##class(SourceControl.Git.Utils).Locked():"checked",1:""))# value="1">
<label class="custom-control-label" for="lockNamespace"></label>
</div>
</div>
</div>
<div class="form-group row mb-3">
<label for="mappingsToken" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="(Optional) A namespace-specific string that may be included in mapping configurations as <token> to support multi-namespace repositories">Mappings Token</label>
<div class="col-sm-7">
Expand Down Expand Up @@ -806,6 +819,19 @@ function showOutput(target) {
}
}

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.";
}
return confirmText ? confirm(confirmText) : true;
}

$(function () {
$('[data-toggle="tooltip"]').tooltip({
trigger: 'hover'
Expand Down
2 changes: 1 addition & 1 deletion module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Document name="git-source-control.ZPM">
<Module>
<Name>git-source-control</Name>
<Version>2.13.1</Version>
<Version>2.14.0</Version>
<Description>Server-side source control extension for use of Git on InterSystems platforms</Description>
<Keywords>git source control studio vscode</Keywords>
<Packaging>module</Packaging>
Expand Down
Loading