Skip to content

Commit 4e24584

Browse files
committed
Merge branch 'main' of https://github.com/isc-pbarton/git-source-control into hide-settings
2 parents 67e01d4 + b9ac45d commit 4e24584

File tree

3 files changed

+55
-42
lines changed

3 files changed

+55
-42
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Fixed
1414
- Studio export path doesn't get weird mixed slahes on Windows (#252)
15+
- Fixed bug with adding mappings through the Settings page (#270)
16+
- Pulling add/delete of multiple non-IRIS files no longer causes error (#273)
1517

1618
## [2.2.0] - 2023-06-05
1719

cls/SourceControl/Git/Utils.cls

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,15 @@ ClassMethod Pull(remote As %String = "origin", preview As %Boolean = 0) As %Stat
414414
while(key '= "") {
415415
set modification = files(key)
416416
if (modification.changeType = "D"){
417-
set deletedFiles = deletedFiles_","_modification.internalName
417+
if (modification.internalName '= "") {
418+
set deletedFiles = deletedFiles_","_modification.internalName
419+
}
418420
} elseif (modification.changeType = "A"){
419421
set modification.internalName = ##class(SourceControl.Git.Utils).NameToInternalName(modification.externalName,,0)
420-
set addedFiles = addedFiles_","_modification.internalName
421-
set files(key) = modification
422+
if (modification.internalName '= "") {
423+
set addedFiles = addedFiles_","_modification.internalName
424+
set files(key) = modification
425+
}
422426
}
423427
set key = $order(files(key))
424428
}

csp/gitprojectsettings.csp

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@ body {
7171
set param = "NoFolders"
7272
kill settings.Mappings
7373

74-
while ( $Get(%request.Data("MappingsExt",i)) '= "" ){
75-
if ($Get(%request.Data(param,i)) = "NoFolders"){
76-
set settings.Mappings($Get(%request.Data("MappingsExt",i)), $Get(%request.Data("MappingsCov",i)), $Get(%request.Data(param,i))) = 1
77-
}
78-
set settings.Mappings($Get(%request.Data("MappingsExt",i)), $Get(%request.Data("MappingsCov",i))) = $Get(%request.Data("MappingsPath",i))
74+
while ( $Data(%request.Data("MappingsExt",i)) ){
75+
if ($get(%request.Data("MappingsExt",i)) '= "") {
76+
if ($Get(%request.Data(param,i)) = "NoFolders"){
77+
set settings.Mappings($Get(%request.Data("MappingsExt",i)), $Get(%request.Data("MappingsCov",i)), $Get(%request.Data(param,i))) = 1
78+
}
79+
set settings.Mappings($Get(%request.Data("MappingsExt",i)), $Get(%request.Data("MappingsCov",i))) = $Get(%request.Data("MappingsPath",i))
80+
}
7981
set i = i+1
8082
}
8183
do settings.%Save()
@@ -260,7 +262,43 @@ body {
260262
</svg>
261263
</button>
262264
</div>
265+
<script language="cache" method="MakeMappingRow" arguments="extKey,covKey,mapPath,noFolders,checked,activated,tooltipTitle,idx,isTemplate">
266+
&html<<div class="voca col-sm-7" #($select(isTemplate:"hidden",1:""))#>
267+
<div class = "input-group mb-1">
268+
<input type="text" class="form-control required" id="MappingsExt" name="MappingsExt" value="#(extKey)#" placeholder="Extension" #($select(isTemplate:"",1:"required"))#>
269+
<input type="text" class="form-control required" id="MappingsCov" name="MappingsCov" value="#(covKey)#" placeholder="Coverage" #($select(isTemplate:"",1:"required"))#>
270+
<input type="text" class="form-control required" id="MappingsPath" name="MappingsPath" value="#(mapPath)#" placeholder="Relative path" #($select(isTemplate:"",1:"required"))#>
271+
<input type="text" class="form-control" id="NoFolders" name="NoFolders" value="#(noFolders)#" placeholder="To folder, or not to folder, that is the question." readonly>
272+
<div class="custom-control custom-switch" data-delay='{"show":"1000", "hide":"100"}' data-toggle="tooltip" data-placement="top" title="#(tooltipTitle)#">
273+
<input type="checkbox" class="#("custom-control-input"_activated)#" id="#("noFoldersSwitch"_idx)#" #(checked)#>
274+
<label class="custom-control-label" for="#("noFoldersSwitch"_idx)#">>
275+
276+
if (checked '= ""){
277+
&html<<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#007bff" class="bi bi-folder-fill" viewBox="0 0 16 16">
278+
<path d="M9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.825a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3zm-8.322.12C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139z"/>
279+
</svg>>
280+
} else{
281+
&html<<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-folder-x" viewBox="0 0 16 16">
282+
<path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H14.54l.265-2.91A1 1 0 0 0 13.81 4H2.19a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91H9v1H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zm6.339-1.577A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z"/>
283+
<path d="M11.854 10.146a.5.5 0 0 0-.707.708L12.293 12l-1.146 1.146a.5.5 0 0 0 .707.708L13 12.707l1.146 1.147a.5.5 0 0 0 .708-.708L13.707 12l1.147-1.146a.5.5 0 0 0-.707-.708L13 11.293l-1.146-1.147z"/>
284+
</svg>>
285+
}
286+
287+
&html<</label>
288+
</div>
289+
<div class="input-group-append">
290+
<button type="button" class="btn btn-remove" >
291+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#dc3545" class="bi bi-dash-circle-fill" viewBox="0 0 16 16">
292+
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-7z"></path>
293+
</svg>
294+
</button>
295+
</div>
296+
</div>
297+
</div>>
298+
</script>
263299
<script language="cache" runat=server>
300+
// make a hidden template row
301+
do ..MakeMappingRow("","","","","checked"," active","","",1)
264302
set extKey = ""
265303
set idx = 1
266304
for {
@@ -293,40 +331,7 @@ body {
293331
set noFolders = """"""
294332
set tooltipTitle = """Switch off to store files in a flat directory structure."""
295333
}
296-
297-
&html<<div class="voca col-sm-7">
298-
<div class = "input-group mb-1">
299-
<input type="text" class="form-control" id="MappingsExt" name="MappingsExt" value=#(extKey)# placeholder="Extension" required>
300-
<input type="text" class="form-control" id="MappingsCov" name="MappingsCov" value=#(covKey)# placeholder="Coverage" required>
301-
<input type="text" class="form-control" id="MappingsPath" name="MappingsPath" value=#(mapPath)# placeholder="Relative path" required>
302-
<input type="text" class="form-control" id="NoFolders" name="NoFolders" value=#(noFolders)# placeholder="To folder, or not to folder, that is the question." readonly>
303-
<div class="custom-control custom-switch" data-delay='{"show":"1000", "hide":"100"}' data-toggle="tooltip" data-placement="top" title=#(tooltipTitle)#>
304-
<input type="checkbox" class="#("custom-control-input"_activated)#" id=#("noFoldersSwitch"_idx)# #(checked)#>
305-
<label class="custom-control-label" for=#("noFoldersSwitch"_idx)#>>
306-
307-
if (checked '= ""){
308-
&html<<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#007bff" class="bi bi-folder-fill" viewBox="0 0 16 16">
309-
<path d="M9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.825a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3zm-8.322.12C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139z"/>
310-
</svg>>
311-
} else{
312-
&html<<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-folder-x" viewBox="0 0 16 16">
313-
<path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H14.54l.265-2.91A1 1 0 0 0 13.81 4H2.19a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91H9v1H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zm6.339-1.577A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z"/>
314-
<path d="M11.854 10.146a.5.5 0 0 0-.707.708L12.293 12l-1.146 1.146a.5.5 0 0 0 .707.708L13 12.707l1.146 1.147a.5.5 0 0 0 .708-.708L13.707 12l1.147-1.146a.5.5 0 0 0-.707-.708L13 11.293l-1.146-1.147z"/>
315-
</svg>>
316-
}
317-
318-
&html<</label>
319-
</div>
320-
<div class="input-group-append">
321-
<button type="button" class="btn btn-remove" >
322-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#dc3545" class="bi bi-dash-circle-fill" viewBox="0 0 16 16">
323-
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-7z"></path>
324-
</svg>
325-
</button>
326-
</div>
327-
</div>
328-
</div>>
329-
334+
do ..MakeMappingRow(extKey,covKey,mapPath,noFolders,checked,activated,tooltipTitle,idx,0)
330335
set idx = idx + 1
331336
}
332337
}
@@ -460,6 +465,8 @@ $(function()
460465
$(newEntry.children().children(".custom-control").children()[1]).attr("for", newID)
461466
newEntry.children().children(".custom-control").children()[0].id = newID
462467
newEntry.find('input').val('');
468+
newEntry.attr('hidden',false);
469+
newEntry.children().children(".required").attr("required","required");
463470

464471
newEntry.appendTo(controlForm);
465472
$(("#"+newID)).click(toggleNoFolders);

0 commit comments

Comments
 (0)