Skip to content

Commit 77ca4e6

Browse files
authored
Fix tree view (#211)
* Fixes for tree view Includes new versions of dependencies for release folder Fixed module.xml for new package manager versions
1 parent 3307e01 commit 77ca4e6

File tree

11 files changed

+1442
-22
lines changed

11 files changed

+1442
-22
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.vscode/
22
.gitattributes
3-
*.code-workspace
4-
package-lock.json
3+
*.code-workspace

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.0.5] - Unreleased
9+
10+
### Fixed
11+
- Tree/Commit links don't navigate
12+
- Slashes present in tree view
13+
14+
### Security
15+
- File contents are properly escaped in tree view
16+
817
## [2.0.4] - 2022-10-05
918

1019
### Fixed

cls/SourceControl/Git/WebUIDriver.cls

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,29 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
3737
*/
3838
if (pathStart = "git") {
3939
if $piece(pagePath,"/",3) = "cat-file" {
40-
set file = $piece(pagePath,"/",4,*)
41-
do ##class(SourceControl.Git.Utils).RunGitCommand("-c",,.%data,"color.ui=false","cat-file","-p",file)
42-
do ##class(SourceControl.Git.Change).RefreshUncommitted()
40+
set blob = $piece(pagePath,"/",4)
41+
set name = $Piece(pagePath,"/",*)
42+
do ##class(SourceControl.Git.Utils).RunGitCommand("-c",,.rawData,"color.ui=false","cat-file","-p",blob)
43+
// TODO: Support binary file types properly. This will need some deeper client-side changes.
44+
/*
45+
do ##class(%CSP.StreamServer).FileClassify($Piece(name,".",*),.type,.bin,.charset)
46+
set %response.ContentType = type
47+
if ($Get(charset) = "") {
48+
set %response.NoCharSetConvert = 1
49+
}
50+
if bin {
51+
set %data = rawData
52+
} else {
53+
*/
54+
// Render HTML stream in a <pre> with text file contents HTML-escaped.
55+
set %data = ##class(%Stream.TmpBinary).%New()
56+
do %data.Write("<html><body><pre>")
57+
do rawData.Rewind()
58+
while 'rawData.AtEnd {
59+
do %data.Write($ZConvert(rawData.Read(),"O","HTML"))
60+
}
61+
do %data.Write("</pre></body></html>")
62+
//}
4363
set handled = 1
4464
}
4565
} elseif (pathStart = "hostname") {
@@ -198,3 +218,4 @@ ClassMethod GetSettingsURL(%request As %CSP.Request) As %SystemBase
198218
}
199219

200220
}
221+

0 commit comments

Comments
 (0)