Skip to content

Commit d36c11b

Browse files
committed
Added context switching to pull page
1 parent b8bc46d commit d36c11b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

cls/_zpkg/isc/sc/git/Socket.cls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ClassMethod Run()
1313
{
1414
If %request.Get("method") = "preview" {
1515
Set branchName = ##class(SourceControl.Git.Utils).GetCurrentBranch()
16+
Write !,"Current namespace: ",$NAMESPACE
1617
Write !,"Current branch: ",branchName
1718
Do ##class(SourceControl.Git.Utils).RunGitWithArgs(.errStream, .outStream, "fetch")
1819
Kill errStream, outStream

csp/pull.csp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@
99
<link rel="stylesheet" type="text/css" href="css/git-webui.css" />
1010
</head>
1111
<body>
12+
<pre for="contextSelect" style="padding-top: 2em;white-space: pre-wrap;">Change Context: <select id="newContext" onchange="updateContext()">
13+
<server>
14+
set contextList = ##class(SourceControl.Git.Utils).GetContexts(1)
15+
set iterator = contextList.%GetIterator()
16+
&html<<option>Select</option>>
17+
while iterator.%GetNext(.key, .value) {
18+
&html<<option value=#(value)#>#(value)#</option>>
19+
}
20+
</server>
21+
</select>
22+
</pre>
1223
<pre id="preview" style="white-space: pre-wrap;">
1324
</pre>
1425
<button id="execute" onclick="execute()" disabled="true">Pull and Load Changes</button>
@@ -45,6 +56,13 @@ function execute() {
4556
}
4657
}
4758

59+
function updateContext() {
60+
const contextSelect = document.getElementById('newContext');
61+
const selectedContext = contextSelect.value;
62+
63+
window.location.href = "/isc/studio/usertemplates/gitsourcecontrol/pull.csp?$NAMESPACE=" + selectedContext;
64+
}
65+
4866
preview();
4967
</script>
5068
</body>

0 commit comments

Comments
 (0)