Skip to content

Commit 9b7cb13

Browse files
committed
Fixed GetContexts utils function to return namespaces for WebUI
1 parent d36c11b commit 9b7cb13

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111
- Added 'git push --force' in expert mode (#527)
1212
- Add remote repository to settings page (#448)
13+
- Added change context option to pull page (#468)
1314

1415
### Fixed
1516
- Fixed display of other users' username in workspace view on Unix (#530)
17+
- Fixed GetContexts utils function to return namespaces for WebUI(#468)
1618

1719
## [2.6.0] - 2024-10-07
1820

cls/SourceControl/Git/Utils.cls

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,28 +2475,32 @@ ClassMethod Localize()
24752475
}
24762476
}
24772477

2478-
ClassMethod GetContexts() As %DynamicArray
2478+
ClassMethod GetContexts(onlyNamespaces As %Boolean) As %DynamicArray
24792479
{
24802480
set contexts = []
24812481
set namespaces = ..GetGitEnabledNamespaces()
24822482
set ptr = 0
24832483
while $listnext(namespaces,ptr,value) {
2484-
do contexts.%Push(value)
2484+
if '($FIND(value,"^^")){
2485+
do contexts.%Push(value)
2486+
}
24852487
}
24862488

24872489
set name = ""
24882490

24892491
// Using embedded for backwards compatability
2490-
&sql(DECLARE C1 CURSOR FOR SELECT name into :name from %Library.RoutineMgr_StudioOpenDialog('*.ZPM'))
2491-
&sql(OPEN C1)
2492-
throw:SQLCODE<0 ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE, %msg)
2493-
&sql(FETCH C1)
2494-
while(SQLCODE = 0) {
2495-
set package = name
2496-
do contexts.%Push(package)
2492+
if '(onlyNamespaces) {
2493+
&sql(DECLARE C1 CURSOR FOR SELECT name into :name from %Library.RoutineMgr_StudioOpenDialog('*.ZPM'))
2494+
&sql(OPEN C1)
2495+
throw:SQLCODE<0 ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE, %msg)
24972496
&sql(FETCH C1)
2497+
while(SQLCODE = 0) {
2498+
set package = name
2499+
do contexts.%Push(package)
2500+
&sql(FETCH C1)
2501+
}
2502+
&sql(CLOSE C1)
24982503
}
2499-
&sql(CLOSE C1)
25002504

25012505
return contexts
25022506
}

cls/SourceControl/Git/WebUIDriver.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
148148
do discardsInBranch.%ToJSON(%data)
149149
set handled = 1
150150
} elseif (pathStart = "contexts") {
151-
set contexts = ##class(SourceControl.Git.Utils).GetContexts()
151+
set contexts = ##class(SourceControl.Git.Utils).GetContexts(1)
152152
do contexts.%ToJSON(%data)
153153
set handled = 1
154154
}

0 commit comments

Comments
 (0)