Skip to content

Commit 90c5df0

Browse files
committed
WIP
1 parent aa113b9 commit 90c5df0

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

DataWarehouseAutomation/DataWarehouseAutomation/Utils/HandleBarsHelpers.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -404,21 +404,28 @@ public static void RegisterHandleBarsHelpers()
404404

405405
try
406406
{
407-
var test = parameters[0];
407+
var classificationsParameter = parameters[0];
408408

409-
var classifications = JsonSerializer.Deserialize<List<DataClassification>>(parameters[0].ToString() ?? string.Empty);
410-
var classificationName = (string)parameters[1];
411-
var result = classifications?.Find(i => i.Classification.ToString().Equals(classificationName, StringComparison.OrdinalIgnoreCase)).Classification;
412-
413-
if (result != null && result !="")
409+
if (classificationsParameter.ToString() == "classifications")
414410
{
415-
// Regular block, a classification has been found
416-
options.Template(output, context);
411+
// Skip, it's really null.
417412
}
418413
else
419414
{
420-
// Else block, no classification with the input name has been found.
421-
options.Inverse(output, context);
415+
var classifications = JsonSerializer.Deserialize<List<DataClassification>>(classificationsParameter.ToString() ?? string.Empty);
416+
var classificationName = (string)parameters[1];
417+
var result = classifications?.Find(i => i.Classification.ToString().Equals(classificationName, StringComparison.OrdinalIgnoreCase)).Classification;
418+
419+
if (result != null && result != "")
420+
{
421+
// Regular block, a classification has been found
422+
options.Template(output, context);
423+
}
424+
else
425+
{
426+
// Else block, no classification with the input name has been found.
427+
options.Inverse(output, context);
428+
}
422429
}
423430
}
424431
catch (Exception exception)

DataWarehouseAutomation/Sample_Templates/TemplateSampleCustomFunctions.Handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ The lookup value for 'type' is '{{lookupExtension sourceDataObjects.0.extensions
5151
The lookup value for 'type' is '{{lookupExtension extensions "first key"}}'.
5252

5353
-- End of mapping
54-
{{/each}}
54+
{{/each}}

0 commit comments

Comments
 (0)