Skip to content

Commit caeb46b

Browse files
authored
Merge pull request #561 from intersystems/fix-544
feat: support export of system default settings
2 parents f2ef459 + c4c351e commit caeb46b

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Added change context option to pull page (#468)
1414
- Added favorite namespaces setting for a user (#468, #510)
1515
- Added environment awareness in configuration, and showing of environment name in UI (#124)
16+
- Added "Export System Default Settings" menu item (#544)
1617

1718
### Fixed
1819
- Fixed display of other users' username in workspace view on Unix (#530)

cls/SourceControl/Git/Extension.cls

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ XData Menu
2929
<MenuItem Name="NewBranch" />
3030
<MenuItem Name="SwitchBranch" />
3131
<MenuItem Separator="true"/>
32+
<MenuItem Name="ExportSystemDefaults" />
3233
<MenuItem Name="Export" />
3334
<MenuItem Name="ExportForce" />
3435
<MenuItem Name="Import" />
@@ -125,6 +126,7 @@ Method LocalizeName(name As %String) As %String
125126
"Settings":$$$Text("@Settings@Settings"),
126127
"Init":$$$Text("@Init@Initialize"),
127128
"GitWebUI":$$$Text("@GitWebUI@Launch Git UI"),
129+
"ExportSystemDefaults":$$$Text("@ExportSystemDefaults@Export System Default Settings"),
128130
"Export":$$$Text("@Export@Export All"),
129131
"ExportForce":$$$Text("@ExportForce@Export All (Force)"),
130132
"Import":$$$Text("@Import@Import All"),
@@ -160,6 +162,11 @@ Method OnSourceMenuItem(name As %String, ByRef Enabled As %String, ByRef Display
160162
quit ..OnSourceMenuContextItem(InternalName,name,.Enabled,.DisplayName)
161163
}
162164

165+
if name = "ExportSystemDefaults" {
166+
set Enabled = ##class(%Library.EnsembleMgr).IsEnsembleNamespace()
167+
quit $$$OK
168+
}
169+
163170
if ##class(SourceControl.Git.Utils).BasicMode() {
164171
set Enabled = $CASE(name,
165172
"Status": 1,
@@ -171,7 +178,6 @@ Method OnSourceMenuItem(name As %String, ByRef Enabled As %String, ByRef Display
171178
"Sync": 1,
172179
"": 1,
173180
:-1
174-
175181
)
176182
} else {
177183
set Enabled = $CASE(name,

cls/SourceControl/Git/Utils.cls

+9
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ ClassMethod UserAction(InternalName As %String, MenuName As %String, ByRef Targe
258258
if ec {
259259
write !,"==export done==",!
260260
}
261+
} elseif (menuItemName = "ExportSystemDefaults") {
262+
set ec = ..ExportSystemDefaults()
261263
} elseif (menuItemName = "Import") {
262264
set ec = ..ImportAll()
263265
set Reload = 1
@@ -1622,6 +1624,13 @@ ClassMethod ExportAll(force As %Boolean = 0) As %Status
16221624
quit ..ExportRoutines(force)
16231625
}
16241626

1627+
ClassMethod ExportSystemDefaults() As %Status
1628+
{
1629+
new %SourceControl
1630+
do ##class(%Studio.SourceControl.Interface).SourceControlCreate()
1631+
quit %SourceControl.OnAfterSave("Ens.Config.DefaultSettings.ESD")
1632+
}
1633+
16251634
/// if <var>force</var> = 1 then we import item even if timestamp in system is newer
16261635
ClassMethod ImportAll(force As %Boolean = 0) As %Status
16271636
{

0 commit comments

Comments
 (0)