Skip to content

Commit 3a375f0

Browse files
committed
enh: partial support for editing decomposed production from IDE
1 parent 7df8d2c commit 3a375f0

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

cls/SourceControl/Git/Production.cls

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ ClassMethod GetModifiedItemsBeforeSave(internalName, Location, Output modifiedIt
211211
{
212212
kill modifiedItems
213213
set productionName = $piece(internalName,".",1,*-1)
214+
set productionConfig = ##class(Ens.Config.Production).%OpenId(productionName)
214215
if ..IsEnsPortal() {
215216
// If editing from SMP, get the modified items by looking at %IsModified on the items in the production in memory.
216217
// No way to know if an item has been added or deleted, so ignore it.
217-
set productionConfig = ##class(Ens.Config.Production).%OpenId(productionName)
218218
if $isobject(productionConfig) {
219219
set modifiedItem = $$$NULLOREF
220220
for i=1:1:productionConfig.Items.Count() {
@@ -244,8 +244,15 @@ ClassMethod GetModifiedItemsBeforeSave(internalName, Location, Output modifiedIt
244244
set modifiedItems(modifiedInternalName) = "M"
245245
}
246246
} else {
247-
// If editing/adding/deleting from Studio, get the modified items by comparing the XDATA in Location with the XDATA in the compiled class.
248-
// FUTURE: implement this to support Studio
247+
// FUTURE: get the actually modified items by comparing the XDATA in Location with the XDATA in the compiled class
248+
// If making changes from Studio, list every item in the production.
249+
if $isobject(productionConfig) {
250+
set modifiedItems(..CreateInternalName(productionName,,,1)) = "M"
251+
for i=1:1:productionConfig.Items.Count() {
252+
set item = productionConfig.Items.GetAt(i)
253+
set modifiedItems(..CreateInternalName(productionName, item.Name, item.ClassName, 0)) = "M"
254+
}
255+
}
249256
}
250257
// populate data for use in OnAfterSave
251258
kill ^IRIS.Temp("sscProd",$job,"modifiedItems")
@@ -290,8 +297,16 @@ ClassMethod GetModifiedItemsAfterSave(internalName, Output modifiedItems)
290297
merge modifiedItems = ^IRIS.Temp("sscProd",$job,"modifiedItems")
291298
}
292299
} else {
293-
// If editing/adding/deleting from Studio, get the modified items from a percent variable set in OnBeforeSave.
294-
// FUTURE: implement this to support Studio.
300+
// If editing in the IDE, list every item in the production.
301+
// FUTURE: get the actually modified items using the temp global set in OnBeforeSave
302+
set productionConfig = ##class(Ens.Config.Production).%OpenId(productionName)
303+
if $isobject(productionConfig) {
304+
set modifiedItems(..CreateInternalName(productionName,,,1)) = "M"
305+
for i=1:1:productionConfig.Items.Count() {
306+
set item = productionConfig.Items.GetAt(i)
307+
set modifiedItems(..CreateInternalName(productionName, item.Name, item.ClassName, 0)) = "M"
308+
}
309+
}
295310
}
296311
}
297312

0 commit comments

Comments
 (0)