Skip to content

Commit a7d4179

Browse files
committed
addressing pull request requested changes
1 parent 6e798ed commit a7d4179

File tree

4 files changed

+43
-38
lines changed

4 files changed

+43
-38
lines changed

cls/SourceControl/Git/Settings.cls

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ Property gitUserEmail As %String(MAXLEN = 255) [ InitialExpression = {##class(So
3232
/// Attribution: Whether mapped items should be read-only, preventing them from being added to source control
3333
Property mappedItemsReadOnly As %Boolean [ InitialExpression = {##class(SourceControl.Git.Utils).MappedItemsReadOnly()} ];
3434

35-
/// Attribution: Whether basic mode should be enabled for user ${username}, greatly simplifying the functionality of the package, requiring no knowledge of git
35+
/// Whether basic mode should be enabled for user ${username}, greatly simplifying the functionality of the package, requiring no knowledge of git
3636
Property basicMode As %String [ InitialExpression = {##class(SourceControl.Git.Utils).BasicMode()} ];
3737

38-
/// This does not map to a setting on the screen but is used to select the value to be displayed for the user's basic mode setting
38+
/// A read-only setting used to display the basic mode setting that is chosen in the settings page
3939
Property userBasicMode As %String [ InitialExpression = {##class(SourceControl.Git.Utils).UserBasicMode()} ];
4040

4141
/// The system's default mode. If true, the system defaults to basic mode
@@ -125,6 +125,7 @@ ClassMethod Configure() As %Boolean [ CodeMode = objectgenerator ]
125125
for {
126126
set sequence = $order(orderedProperties(sequence),1,property)
127127
quit:sequence=""
128+
continue:property="userBasicMode"
128129
do %code.WriteLine(" set value = inst."_property)
129130
set prompt = $$$comMemberKeyGet(%class.Name,$$$cCLASSproperty,property,$$$cPROPdescription)
130131
set promptQuoted = $$$QUOTE(prompt_":")

cls/SourceControl/Git/Utils.cls

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,14 @@ ClassMethod SwitchBranch(targetBranchName As %String) As %Status
349349

350350
ClassMethod PreSync() As %String
351351
{
352-
set uncommittedFilesWithAction = ##class(SourceControl.Git.WebUIDriver).UncommittedWithAction().%Get("user")
352+
set uncommittedFilesWithAction = ##class(SourceControl.Git.Utils).UncommittedWithAction().%Get("user")
353353
quit ..GenerateCommitMessageFromFiles(uncommittedFilesWithAction)
354354
}
355355

356356
/// Commits all the files as needed by the Sync operation
357357
ClassMethod SyncCommit(Msg As %String) As %Status
358358
{
359-
set uncommittedFilesWithAction = ##class(SourceControl.Git.WebUIDriver).UncommittedWithAction().%Get("user")
359+
set uncommittedFilesWithAction = ##class(SourceControl.Git.Utils).UncommittedWithAction().%Get("user")
360360
set username = ..GitUserName()
361361
set email = ..GitUserEmail()
362362
set author = username_" <"_email_">"
@@ -370,7 +370,7 @@ ClassMethod SyncCommit(Msg As %String) As %Status
370370
/// Goes through all the added files and stages them
371371
ClassMethod StageAddedFiles()
372372
{
373-
set uncommittedFilesWithAction = ##class(SourceControl.Git.WebUIDriver).UncommittedWithAction().%Get("user")
373+
set uncommittedFilesWithAction = ##class(SourceControl.Git.Utils).UncommittedWithAction().%Get("user")
374374
set iterator = uncommittedFilesWithAction.%GetIterator()
375375
while iterator.%GetNext(,.value,) {
376376
set file = value.%Get("file")
@@ -2073,6 +2073,41 @@ ClassMethod GetSourceControlInclude() As %String
20732073
1: "")
20742074
}
20752075

2076+
ClassMethod UncommittedWithAction() As %Library.DynamicObject
2077+
{
2078+
do ##class(SourceControl.Git.Change).RefreshUncommitted()
2079+
do ##class(SourceControl.Git.Utils).GitStatus(.files, 1)
2080+
set output = ""
2081+
set key = ""
2082+
2083+
set editedByCurrentUser = []
2084+
set fileToOtherDevelopers = {}
2085+
for {
2086+
set key = $order(files(key), 1, fileData)
2087+
quit:key=""
2088+
2089+
set filename = ##class(SourceControl.Git.Utils).FullExternalName(key)
2090+
if (($ISVALIDNUM(key)) && (files(key) '= "")) {
2091+
set edit = {}
2092+
do edit.%Set("file", $listget(fileData, 2))
2093+
do edit.%Set("action", $listget(fileData, 1))
2094+
do editedByCurrentUser.%Push(edit)
2095+
} else {
2096+
set sc=##class(SourceControl.Git.Change).GetUncommitted(filename, .tAction, .tInternalName, .UncommittedUser, .tSource, .UncommittedLastUpdated)
2097+
if ($$$ISOK(sc)) && ($data(tAction)&&(UncommittedUser=$username)) {
2098+
set edit = {}
2099+
do edit.%Set("file", $listget(fileData, 2))
2100+
do edit.%Set("action", $listget(fileData, 1))
2101+
do editedByCurrentUser.%Push(edit)
2102+
}
2103+
}
2104+
}
2105+
2106+
do fileToOtherDevelopers.%Set("user", editedByCurrentUser)
2107+
do fileToOtherDevelopers.%Set("other", ##class(SourceControl.Git.Change).GetOtherDeveloperChanges())
2108+
quit fileToOtherDevelopers
2109+
}
2110+
20762111
ClassMethod BuildCEInstallationPackage(ByRef destination As %String) As %Status
20772112
{
20782113
#define sourcedir $System.Util.InstallDirectory()_"devuser/studio/templates/gitsourcecontrol/"

cls/SourceControl/Git/WebUIDriver.cls

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -208,37 +208,8 @@ ClassMethod Uncommitted() As %SystemBase
208208

209209
ClassMethod UncommittedWithAction() As %SystemBase
210210
{
211-
do ##class(SourceControl.Git.Change).RefreshUncommitted()
212-
do ##class(SourceControl.Git.Utils).GitStatus(.files, 1)
213-
set output = ""
214-
set key = ""
215-
216-
set editedByCurrentUser = []
217-
set fileToOtherDevelopers = {}
218-
for {
219-
set key = $order(files(key), 1, fileData)
220-
quit:key=""
221-
222-
set filename = ##class(SourceControl.Git.Utils).FullExternalName(key)
223-
if (($ISVALIDNUM(key)) && (files(key) '= "")) {
224-
set edit = {}
225-
do edit.%Set("file", $listget(fileData, 2))
226-
do edit.%Set("action", $listget(fileData, 1))
227-
do editedByCurrentUser.%Push(edit)
228-
} else {
229-
set sc=##class(SourceControl.Git.Change).GetUncommitted(filename, .tAction, .tInternalName, .UncommittedUser, .tSource, .UncommittedLastUpdated)
230-
if ($$$ISOK(sc)) && ($data(tAction)&&(UncommittedUser=$username)) {
231-
set edit = {}
232-
do edit.%Set("file", $listget(fileData, 2))
233-
do edit.%Set("action", $listget(fileData, 1))
234-
do editedByCurrentUser.%Push(edit)
235-
}
236-
}
237-
}
238-
239-
do fileToOtherDevelopers.%Set("user", editedByCurrentUser)
240-
do fileToOtherDevelopers.%Set("other", ##class(SourceControl.Git.Change).GetOtherDeveloperChanges())
241-
quit fileToOtherDevelopers
211+
set uncomittedWithAction = ##class(SourceControl.Git.Utils).UncommittedWithAction()
212+
quit uncomittedWithAction
242213
}
243214

244215
ClassMethod GetURLPrefix(%request As %CSP.Request, URL As %String) As %String

git-webui/release/share/git-webui/webui/js/git-webui.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,9 +2147,7 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
21472147
var col = type == "working-copy" ? 1 : 0;
21482148
webui.git("status -u --porcelain", function(data) {
21492149
$.get("api/uncommitted", function (uncommitted) {
2150-
console.log(uncommitted);
21512150
var uncommittedItems = JSON.parse(uncommitted)["current user's changes"];
2152-
console.log(uncommittedItems);
21532151
var otherDeveloperUncommittedItems = JSON.parse(uncommitted)["other users' changes"];
21542152
self.filesCount = 0;
21552153
function addItemToFileList(fileList, otherDeveloperUsername, model) {

0 commit comments

Comments
 (0)