Skip to content

Commit 1674191

Browse files
committed
enh: namespace switcher on settings page
1 parent 30d96bf commit 1674191

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111
- Option to lock/unlock namespace is now available on the settings page (#650)
1212
- Settings page now warns if Embedded Git is not the configured source control extension (#857)
13+
- Settings page now has option to switch namespace (#856)
1314

1415
### Fixed
1516
- When cloning a repo with Configure, that repo's embedded-git-config file will overwrite previous settings (#819)

csp/gitprojectsettings.csp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,30 @@ body {
229229
<input type="hidden" name="gitsettings" value="1" />
230230
<div class="col-sm-12"><br></div>
231231
<div class="row">
232-
<div class="offset-sm-1 col-sm-7" id="settingsTitle">
232+
<div class="offset-sm-1 col-sm-6" id="settingsTitle">
233233
<h1>Git Project Settings</h1>
234234
<h3> Package version: #(version)# </h3>
235235
</div>
236236

237-
<div class="col-sm-4" id="settingsNavBtn">
237+
<div class="col-sm-5" id="settingsNavBtn">
238+
<button class="btn btn-lg btn-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false" title="Switch Namespace">
239+
#(..EscapeHTML($namespace))#
240+
</button>
241+
<div class="dropdown-menu">
242+
<script language="cache" runat=server>
243+
try {
244+
kill allNamespaces
245+
$$$ThrowOnError(##class(%SYS.Namespace).ListAll(.allNamespaces))
246+
set key = $order(allNamespaces(""))
247+
while key'="" {
248+
&html<<a class="dropdown-item" href="?Namespace=#(..EscapeHTML(key))#">#(..EscapeHTML(key))#</a>>
249+
set key = $order(allNamespaces(key))
250+
}
251+
} catch err {
252+
do err.Log()
253+
}
254+
</script>
255+
</div>
238256
<button class="btn btn-lg btn-outline-dark" id="goToHome">Home
239257
</button>
240258
<div id="homeURL">

0 commit comments

Comments
 (0)