Skip to content

Commit

Permalink
Merge pull request #46 from isc-egabhart/main
Browse files Browse the repository at this point in the history
Fixed .js file handling during RunAll
  • Loading branch information
isc-tleavitt authored Jul 30, 2024
2 parents d770820 + 7830f06 commit 44bef82
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 23 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.6] - 2024-07-29

### Fixed
-Fixed .js files in other namespaces' /itemsetsourcelink web app being editing during ##class(pkg.isc.codetidy.Utils).RunAll (#45)
-Fixed .js files being re-exported without edit during ##class(pkg.isc.codetidy.Utils).RunAll() even though ESLint is disabled so no reason to export (#44)

## [1.1.5] - 2023-02-23

### Fixed
Expand Down
46 changes: 24 additions & 22 deletions cls/pkg/isc/codetidy/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -159,30 +159,32 @@ ClassMethod RunAll(pOnlyIfInSourceControl As %Boolean = 1) As %Status

// Run all .js files
// Build the spec for StudioOpenDialog
set spec = ""
set codeNamespace = $namespace
set $namespace = "%SYS"
set result = ##class(%SQL.Statement).%ExecDirect(,"select * from Security.Applications where NameSpace = ?", codeNamespace)
while result.%Next() {
// Exclude anything from the itemsetsourcelink web application
if result.ID '= "/itemsetsourcelink" {
set entry = $extract(result.ID, 2, *)_"/*.js"
if spec = "" {
set spec = entry
} else {
set spec = spec_","_entry
if ..GetESLintEnabled() {
set spec = ""
set codeNamespace = $namespace
set $namespace = "%SYS"
set result = ##class(%SQL.Statement).%ExecDirect(,"select * from Security.Applications where NameSpace = ?", codeNamespace)
while result.%Next() {
// Exclude anything from the itemsetsourcelink web application
if $Extract(result.ID, 1, 18) '= "/itemsetsourcelink" {
set entry = $extract(result.ID, 2, *)_"/*.js"
if spec = "" {
set spec = entry
} else {
set spec = spec_","_entry
}
}
}
}
set $namespace = codeNamespace

// Run StudioOpenDialog to get the .js files
set resultSet = ##class(%Library.ResultSet).%New("%RoutineMgr:StudioOpenDialog")
$$$ThrowOnError(resultSet.Prepare())
$$$ThrowOnError(resultSet.Execute(spec, 1, 1, 0, 1, 0, 0, ""))
while resultSet.Next() {
set name = resultSet.Data("Name")
$$$ThrowOnError(##class(pkg.isc.codetidy.Utils).Run(name, pOnlyIfInSourceControl))
set $namespace = codeNamespace

// Run StudioOpenDialog to get the .js files
set resultSet = ##class(%Library.ResultSet).%New("%RoutineMgr:StudioOpenDialog")
$$$ThrowOnError(resultSet.Prepare())
$$$ThrowOnError(resultSet.Execute(spec, 1, 1, 0, 1, 0, 0, ""))
while resultSet.Next() {
set name = resultSet.Data("Name")
$$$ThrowOnError(##class(pkg.isc.codetidy.Utils).Run(name, pOnlyIfInSourceControl))
}
}
} catch e {
set sc = e.AsStatus()
Expand Down
2 changes: 1 addition & 1 deletion module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Export generator="IRIS" version="26">
<Document name="isc.codetidy.ZPM"><Module>
<Name>isc.codetidy</Name>
<Version>1.1.5</Version>
<Version>1.1.6</Version>
<Packaging>module</Packaging>
<Resource Name="pkg.isc.codetidy.PKG" Directory="cls" />
<Resource Name="pkg.isc.codetidy.CodeTidy.INC" Directory="inc" />
Expand Down

0 comments on commit 44bef82

Please sign in to comment.