-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/intersystems/git-source-con…
…trol into map-expand-env
- Loading branch information
Showing
6 changed files
with
164 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Class %zpkg.isc.sc.git.Defaults | ||
{ | ||
|
||
ClassMethod GetDefaults() As %Library.DynamicObject [ NotInheritable, Private ] | ||
{ | ||
set defaults = {} | ||
set storage = "^%SYS(""SourceControl"",""Git"",""defaults"")" | ||
$$$AddAllRoleTemporary | ||
|
||
set key = $order(@storage@("")) | ||
while key '= "" { | ||
do defaults.%Set(key, $get(@storage@(key))) | ||
set key = $order(@storage@(key)) | ||
} | ||
return defaults | ||
} | ||
|
||
ClassMethod GetDefaultSettings(ByRef defaults As %Library.DynamicObject) As %Status | ||
{ | ||
try { | ||
set defaults = ..GetDefaults() | ||
} catch e { | ||
return e.AsStatus() | ||
} | ||
return $$$OK | ||
} | ||
|
||
ClassMethod SetDefaults(defaults As %Library.DynamicObject) As %Status [ NotInheritable, Private ] | ||
{ | ||
|
||
$$$AddAllRoleTemporary | ||
set storage = "^%SYS(""SourceControl"",""Git"",""defaults"")" | ||
k @storage | ||
set iterator = defaults.%GetIterator() | ||
|
||
while iterator.%GetNext(.key, .value) { | ||
set @storage@(key) = value | ||
} | ||
|
||
return $$$OK | ||
} | ||
|
||
ClassMethod SetDefaultSettings(defaults As %Library.DynamicObject) As %Status [ NotInheritable ] | ||
{ | ||
|
||
set newDefaults = {} | ||
|
||
set iterator = defaults.%GetIterator() | ||
|
||
while iterator.%GetNext(.key, .value) { | ||
do newDefaults.%Set(key, value) | ||
} | ||
|
||
try { | ||
do ..SetDefaults(newDefaults) | ||
} catch e { | ||
return e.AsStatus() | ||
} | ||
return $$$OK | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,6 +165,10 @@ body { | |
} | ||
|
||
set settings.favoriteNamespaces = contexts | ||
|
||
if ($get(%request.Data("proxySubmitButton",1)) = "saveDefaults") { | ||
do settings.SaveDefaults() | ||
} | ||
} | ||
set err = "" | ||
try { | ||
|
@@ -226,7 +230,7 @@ body { | |
|
||
<fieldset id="namespaceSettings"> | ||
<div class="form-group row mb-3"> | ||
<label for="gitBinPath" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Absolute path to the Git executable">Path to git.exe</label> | ||
<label for="gitBinPath" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Absolute path to the Git executable"><b>Path to git.exe</b></label> | ||
<div class="col-sm-7"> | ||
<server> | ||
set exists = ##class(SourceControl.Git.Utils).GitBinExists(.version) | ||
|
@@ -345,7 +349,7 @@ body { | |
</server> | ||
|
||
<div class="form-group row mb-3"> | ||
<label for="pullEventClass" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Handler class for git pull">Pull Event Class</label> | ||
<label for="pullEventClass" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Handler class for git pull"><b>Pull Event Class</b></label> | ||
<div class="col-sm-7"> | ||
<select class="form-control" id="pullEventClass" name="pullEventClass"> | ||
<server> | ||
|
@@ -361,7 +365,7 @@ body { | |
</div> | ||
|
||
<div class="form-group row mb-3"> | ||
<label for="environmentName" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Environment Name">Environment Name</label> | ||
<label for="environmentName" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Environment Name"><b>Environment Name</b></label> | ||
<div class="col-sm-7"> | ||
<select class="form-control" id="environmentName" name="environmentName"> | ||
<server> | ||
|
@@ -375,14 +379,14 @@ body { | |
</div> | ||
|
||
<div class="form-group row mb-3"> | ||
<label for="percentClassReplace" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Character(s) to replace '%' with for percent classes while exporting them out to the filesystem. By default, the '%' is removed.">'%' Replacement on Export</label> | ||
<label for="percentClassReplace" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Character(s) to replace '%' with for percent classes while exporting them out to the filesystem. By default, the '%' is removed."><b>'%' Replacement on Export</b></label> | ||
<div class="col-sm-7"> | ||
<input type="text" class="form-control" id="percentClassReplace" name="percentClassReplace" value='#(..EscapeHTML(settings.percentClassReplace))#' placeholder="_, __, <empty>, etc."/> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group row mb-3"> | ||
<label for="systemBasicMode" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Enable basic mode for all users, which reduces the number of menu options and requires less knowledge of git. This is suitable for a single-developer (non-shared) namespace."> Basic Mode as System Default</label> | ||
<label for="systemBasicMode" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Enable basic mode for all users, which reduces the number of menu options and requires less knowledge of git. This is suitable for a single-developer (non-shared) namespace."><b> Basic Mode as System Default</b></label> | ||
<div class="col-sm-7"> | ||
|
||
<div class="custom-control custom-switch custom-switch-no-border"> | ||
|
@@ -403,14 +407,14 @@ body { | |
</div> | ||
|
||
<div class="form-group row mb-3"> | ||
<label for="defaultMergeBranch" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="In basic mode, the Sync operation will merge changes from this remote branch (leave blank for no branch)">Default merge branch</label> | ||
<label for="defaultMergeBranch" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="In basic mode, the Sync operation will merge changes from this remote branch (leave blank for no branch)"><b>Default merge branch</b></label> | ||
<div class="col-sm-7"> | ||
<input type="text" class="form-control" id="defaultMergeBranch" name="defaultMergeBranch" value='#(..EscapeHTML(settings.defaultMergeBranch))#' placeholder="sample-remote-branch"> | ||
</div> | ||
</div> | ||
|
||
<div 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">Remote Repository</label> | ||
<label for="remoteRepo" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Url to Remote repository"><b>Remote Repository</b></label> | ||
<div class="col-sm-7"> | ||
<input type="text" class="form-control" id="remoteRepo" name="remoteRepo" value='#(..EscapeHTML(remote))#' placeholder="ex. [email protected]:User/UserRepo.git"/> | ||
<div class = "neutral-feedback"> | ||
|
@@ -420,7 +424,7 @@ body { | |
</div> | ||
|
||
<div class="form-group row mb-3"> | ||
<label for="mappedItemsReadOnly" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Whether items mapped from a database other than this namespace's default routine database should be read-only. If enabled, mapped items won't be saved to source control or exported. NOTE: These are different from the mappings configured in this settings page"> Treat Mapped Items as Read-only</label> | ||
<label for="mappedItemsReadOnly" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Whether items mapped from a database other than this namespace's default routine database should be read-only. If enabled, mapped items won't be saved to source control or exported. NOTE: These are different from the mappings configured in this settings page"><b> Treat Mapped Items as Read-only</b></label> | ||
<div class="col-sm-7"> | ||
|
||
<div class="custom-control custom-switch custom-switch-no-border"> | ||
|
@@ -440,7 +444,7 @@ body { | |
|
||
</div> | ||
<div class="form-group row mb-3"> | ||
<label for="compileOnImport" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="If true, the Import All options will compile imported options using the configured pull event handler">Compile Items on Import</label> | ||
<label for="compileOnImport" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="If true, the Import All options will compile imported options using the configured pull event handler"><b>Compile Items on Import</b></label> | ||
<div class="col-sm-7"> | ||
<div class="custom-control custom-switch custom-switch-no-border"> | ||
<input class="custom-control-input" name="compileOnImport" type="checkbox" | ||
|
@@ -586,7 +590,7 @@ body { | |
</div> | ||
|
||
<div class="form-group row mb-3"> | ||
<label for="gitUserEmail" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="<git-username-on-remote>@remote.com">Git Committer Email </label> | ||
<label for="gitUserEmail" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="<git-username-on-remote>@remote.com">Git Committer Email</label> | ||
<div class="col-sm-7"> | ||
<input type="email" class="form-control" id="gitUserEmail" name="gitUserEmail" value='#(..EscapeHTML(settings.gitUserEmail))#'/> | ||
</div> | ||
|
@@ -649,7 +653,7 @@ body { | |
</div> | ||
|
||
<div class="form-group row mb-3"> | ||
<label for="addToFav" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Favorite namespaces for user to add link on Home page.">Favorite Namespaces</label> | ||
<label for="addToFav" class="offset-sm-1 col-sm-3 col-form-label" data-toggle="tooltip" data-placement="top" title="Favorite namespaces for user to add link on Home page.">*Favorite Namespaces</label> | ||
<div class="col-sm-7"> | ||
<select multiple class="form-control" id="addToFav" name="favNamespace"> | ||
<server> | ||
|
@@ -674,7 +678,12 @@ body { | |
|
||
<div class="form-group row mb-3"> | ||
<div class="col-sm-12 text-center"> | ||
<input type='submit' class="btn-lg btn-primary" value = 'Save'/> | ||
<input type="hidden" id="proxySubmitButton" name="proxySubmitButton" value="Save"> | ||
<input type='submit' class="btn-lg btn-primary" value = 'Save' name="Save"/> | ||
<input type="submit" class="btn-lg btn-primary" id="saveDefaults" value = 'Save as Instance Defaults' title="Save these settings as default for new instances" name="saveDefaults"/> | ||
<div> | ||
<small> Settings saved as default are <b>bolded </b> </small> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
@@ -701,6 +710,17 @@ function getSocket(urlPostfix) { | |
return new WebSocket(socketURL); | ||
} | ||
|
||
var submitForm = function(e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
var proxySubmitButton = document.getElementById('proxySubmitButton'); | ||
proxySubmitButton.value = "saveDefaults"; | ||
var form = document.getElementById('settingsForm'); | ||
form.submit(); | ||
} | ||
|
||
document.getElementById('saveDefaults').addEventListener('click',submitForm,false); | ||
|
||
function init() { | ||
disableActionButtons(); | ||
var root = document.getElementById("namespaceTemp").value; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters