From 2279afd331e88d16aa0d7b903cbd54f5498fcd53 Mon Sep 17 00:00:00 2001 From: isc-hwojnick Date: Tue, 2 Jul 2024 10:41:36 -0400 Subject: [PATCH 1/3] now not checking sql privileges and properly gets files from other user --- cls/SourceControl/Git/Change.cls | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cls/SourceControl/Git/Change.cls b/cls/SourceControl/Git/Change.cls index 947add8d..c39231ee 100644 --- a/cls/SourceControl/Git/Change.cls +++ b/cls/SourceControl/Git/Change.cls @@ -83,17 +83,24 @@ ClassMethod GetOtherDeveloperChanges() As %Boolean { set numEntries = 0 set fileToOtherDevelopers = {} - set query = "Select ItemFile, ChangedBy FROM SourceControl_Git.Change WHERE CHARINDEX('SourceControl.Git', Name)>0 AND Committed = '0' AND ChangedBy <> ?" + set query = "Select ItemFile, ChangedBy FROM SourceControl_Git.Change WHERE Committed = '0' AND ChangedBy <> ?" set statement = ##class(%SQL.Statement).%New() - set status = statement.%Prepare(query) + set status = statement.%Prepare(query, 0) $$$ThrowOnError(status) set rset = statement.%Execute($username) if (rset.%SQLCODE < 0) { throw ##class(%Exception.SQL).CreateFromSQLCODE(rset.%SQLCODE,rset.%Message) } + set tempFolder = ##class(SourceControl.Git.Utils).TempFolder() while rset.%Next(.sc) { $$$ThrowOnError(sc) - set filePath = "cls\"_$EXTRACT(rset.ItemFile, $FIND(rset.ItemFile,"cls\"),$LENGTH(rset.ItemFile)) + + if $FIND(rset.ItemFile, tempFolder) { + set filePath = $PIECE(rset.ItemFile, tempFolder, 2) + } else { + continue + } + set otherDevelopers = fileToOtherDevelopers.%Get(filePath, []) do otherDevelopers.%Push(rset.ChangedBy) do fileToOtherDevelopers.%Set(filePath, otherDevelopers) From a982e6048ee40b1bc11905f515593c92921cf66c Mon Sep 17 00:00:00 2001 From: isc-hwojnick Date: Tue, 2 Jul 2024 10:43:03 -0400 Subject: [PATCH 2/3] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7fce0b4..126f62db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Menu items names are properly translated from internal name in VSCode, Management Portal (#372) - Now has proper locking behavior in `##class(SourceControl.Git.WebUIDriver).HandleRequest()`(#385) - Git operations from the WebUI now don't unlock the session if they aren't read-only +- Now able to properly SELECT files that were edited by other users (#365) ## [2.3.1] - 2024-04-30 From 50526e414dc4574e93dc0f7e9f8fa113e40bce35 Mon Sep 17 00:00:00 2001 From: Tim Leavitt <73311181+isc-tleavitt@users.noreply.github.com> Date: Tue, 2 Jul 2024 10:51:58 -0400 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 126f62db..b5dde105 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Menu items names are properly translated from internal name in VSCode, Management Portal (#372) - Now has proper locking behavior in `##class(SourceControl.Git.WebUIDriver).HandleRequest()`(#385) - Git operations from the WebUI now don't unlock the session if they aren't read-only -- Now able to properly SELECT files that were edited by other users (#365) +- WebUI works properly for users with %Developer without needing to add further SQL privileges (#365) ## [2.3.1] - 2024-04-30