From 1bbe396ab5517ec510365d2924a088a5cef22b83 Mon Sep 17 00:00:00 2001 From: isc-egabhart Date: Tue, 30 Jul 2024 09:20:11 -0400 Subject: [PATCH 1/2] Fixed .js file handling during RunAll -Fixed RunAll queueing js files under secondary /itemsetsourcelink web apps -Fixed .js files being re-exported even though ESLint is disabled --- CHANGELOG.md | 6 +++++ cls/pkg/isc/codetidy/Utils.cls | 46 ++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa221e5..f8c4d0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/cls/pkg/isc/codetidy/Utils.cls b/cls/pkg/isc/codetidy/Utils.cls index f4f7efc..ba7502b 100644 --- a/cls/pkg/isc/codetidy/Utils.cls +++ b/cls/pkg/isc/codetidy/Utils.cls @@ -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() From 7830f06c2e9565ede268712d7c4afe8adc3d1101 Mon Sep 17 00:00:00 2001 From: isc-egabhart Date: Tue, 30 Jul 2024 09:38:45 -0400 Subject: [PATCH 2/2] Update module.xml bump version number to 1.1.6 --- module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.xml b/module.xml index 64a1cbf..3cd461a 100644 --- a/module.xml +++ b/module.xml @@ -2,7 +2,7 @@ isc.codetidy - 1.1.5 + 1.1.6 module