diff --git a/CHANGELOG.md b/CHANGELOG.md index d4d1020b..020f3f94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Import of decomposed production items now has a brief timeout in case another deploy is in progress (#949) - Option to view an individual file's history in the source control menu (#960) +- Change context menu now lists IPM packages from all Git-enabled namespaces, prefixed with the namespace name (#952) ### Fixed - Changes to % routines mapped to the current namespace may now be added to source control and committed (#944) diff --git a/cls/SourceControl/Git/Utils.cls b/cls/SourceControl/Git/Utils.cls index 7330ca09..f9ba156a 100644 --- a/cls/SourceControl/Git/Utils.cls +++ b/cls/SourceControl/Git/Utils.cls @@ -2813,18 +2813,28 @@ ClassMethod GetContexts(onlyNamespaces As %Boolean) As %DynamicArray set name = "" - // Using embedded for backwards compatability + // Using embedded instead of ExecDirectNoPriv() for backwards compatability if '(onlyNamespaces) { &sql(DECLARE C1 CURSOR FOR SELECT name into :name from %Library.RoutineMgr_StudioOpenDialog('*.ZPM')) - &sql(OPEN C1) - throw:SQLCODE<0 ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE, %msg) - &sql(FETCH C1) - while(SQLCODE = 0) { - set package = name - do contexts.%Push(package) - &sql(FETCH C1) + new $namespace + set ptr = 0 + while $listnext(namespaces,ptr,ns) { + if '($FIND(ns,"^^")) { + try { + set $NAMESPACE = ns + &sql(OPEN C1) + throw:(SQLCODE<0) ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE, %msg) + &sql(FETCH C1) + while (SQLCODE = 0) { + do contexts.%Push(ns_":"_name) + &sql(FETCH C1) + } + &sql(CLOSE C1) + } catch e { + // skip inaccessible namespaces + } + } } - &sql(CLOSE C1) } return contexts @@ -3397,3 +3407,4 @@ ClassMethod IsSchemaStandard(pName As %String = "") As %Boolean [ Internal ] } } + diff --git a/git-webui/release/share/git-webui/webui/js/git-webui.js b/git-webui/release/share/git-webui/webui/js/git-webui.js index fe51b83a..63601d2c 100644 --- a/git-webui/release/share/git-webui/webui/js/git-webui.js +++ b/git-webui/release/share/git-webui/webui/js/git-webui.js @@ -724,10 +724,11 @@ webui.SideBarView = function(mainView, noEventHandlers) { } self.getCurrentContext = function() { + // URL pattern here is like webuidriver.csp// var args = window.location.href.split("webuidriver.csp/")[1].split("?")[0].split("/"); var context = args[0]; if (args[1] && (args[1].indexOf(".ZPM") != -1)) { - context = args[1]; + context = args[0] + ":" + args[1]; } return context; } @@ -737,7 +738,9 @@ webui.SideBarView = function(mainView, noEventHandlers) { var args = urlParts[1].split("?")[0].split("/"); var querySuffix = window.location.search || ""; if (context.indexOf(".ZPM") != -1) { - args[1] = context; + var parts = context.split(":"); + args[0] = parts[0]; + args[1] = parts[1]; } else { args[0] = context; args[1] = ""; diff --git a/git-webui/src/share/git-webui/webui/js/git-webui.js b/git-webui/src/share/git-webui/webui/js/git-webui.js index fe51b83a..63601d2c 100644 --- a/git-webui/src/share/git-webui/webui/js/git-webui.js +++ b/git-webui/src/share/git-webui/webui/js/git-webui.js @@ -724,10 +724,11 @@ webui.SideBarView = function(mainView, noEventHandlers) { } self.getCurrentContext = function() { + // URL pattern here is like webuidriver.csp// var args = window.location.href.split("webuidriver.csp/")[1].split("?")[0].split("/"); var context = args[0]; if (args[1] && (args[1].indexOf(".ZPM") != -1)) { - context = args[1]; + context = args[0] + ":" + args[1]; } return context; } @@ -737,7 +738,9 @@ webui.SideBarView = function(mainView, noEventHandlers) { var args = urlParts[1].split("?")[0].split("/"); var querySuffix = window.location.search || ""; if (context.indexOf(".ZPM") != -1) { - args[1] = context; + var parts = context.split(":"); + args[0] = parts[0]; + args[1] = parts[1]; } else { args[0] = context; args[1] = "";