Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #360 package version shows on settings and main webui page #363

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cls/SourceControl/Git/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,13 @@ ClassMethod CheckInitialization()
}
}

ClassMethod GetPackageVersion() As %String
{
do ##class(%ZPM.PackageManager).GetVersion("git-source-control",.out)
set scVersion = out("git-source-control")
quit $LIST(scVersion, 2)
}

ClassMethod GetSourceControlInclude() As %String
{
quit $select(##class(%Library.EnsembleMgr).IsEnsembleInstalled():
Expand Down
9 changes: 9 additions & 0 deletions cls/SourceControl/Git/WebUIDriver.cls
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
set responseJSON = ..Uncommitted()
} elseif $extract(pagePath,6,*) = "settings" {
set responseJSON = ..GetSettingsURL(%request)
} elseif $extract(pagePath, 6, *) = "get-package-version"{
set responseJSON = ..GetPackageVersion()
} else {
set %response.Status = ##class(%CSP.REST).#HTTP404NOTFOUND
set responseJSON = {"error":("invalid URI: " _ pagePath)}
Expand Down Expand Up @@ -224,4 +226,11 @@ ClassMethod GetSettingsURL(%request As %CSP.Request) As %SystemBase
quit {"url": (settingsURL)}
}

ClassMethod GetPackageVersion() As %SystemBase
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ClassMethod GetPackageVersion() As %SystemBase
ClassMethod GetPackageVersion() As %Library.DynamicObject

{
set version = ##class(SourceControl.Git.Utils).GetPackageVersion()
quit {"version": (version)}
}

}

3 changes: 3 additions & 0 deletions csp/gitprojectsettings.csp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ body {
<body>
<server>
set namespace = $namespace
set version = ##class(SourceControl.Git.Utils).GetPackageVersion()
set webuiURL = "/isc/studio/usertemplates/gitsourcecontrol/webuidriver.csp/"_namespace_"/?CSPSHARE=1"
set webuiURL = ##class(SourceControl.Git.WebUIDriver).GetURLPrefix(%request, webuiURL)

Expand Down Expand Up @@ -105,7 +106,9 @@ body {
<div class="row">
<div class="offset-sm-1 col-sm-8">
<h1>Git Project Settings</h1>
<h3> Package version: #(version)# </h3>
</div>

<div class="col-sm-2">
<button class="btn btn-lg btn-outline-dark" id="goToWebUI">Go to WebUI
</button>
Expand Down
Loading
Loading