Skip to content

Commit c5ddc3d

Browse files
louisjrdevbergmania
authored andcommitted
Change template helper to use async partials (#11243)
1 parent f3f6744 commit c5ddc3d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Umbraco.Web.UI.Client/src/common/services/templatehelper.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
partialViewName = parentId + "/" + partialViewName;
1717
}
1818

19-
return "@Html.Partial(\"" + partialViewName + "\")";
19+
return "@await Html.PartialAsync(\"" + partialViewName + "\")";
2020
}
2121

2222
function getQuerySnippet(queryExpression) {

src/Umbraco.Web.UI.Client/test/unit/common/services/template-helper.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ describe('service: templateHelper', function () {
2626
it('should return the snippet for inserting a partial from the root', function () {
2727
var parentId = "";
2828
var nodeName = "Footer.cshtml";
29-
var snippet = '@Html.Partial("Footer")';
29+
var snippet = '@await Html.PartialAsync("Footer")';
3030
expect(templateHelper.getInsertPartialSnippet(parentId, nodeName)).toBe(snippet);
3131
});
3232

3333
it('should return the snippet for inserting a partial from a folder', function () {
3434
var parentId = "Folder";
3535
var nodeName = "Footer.cshtml";
36-
var snippet = '@Html.Partial("Folder/Footer")';
36+
var snippet = '@await Html.PartialAsync("Folder/Footer")';
3737
expect(templateHelper.getInsertPartialSnippet(parentId, nodeName)).toBe(snippet);
3838
});
3939

4040
it('should return the snippet for inserting a partial from a nested folder', function () {
4141
var parentId = "Folder/NestedFolder";
4242
var nodeName = "Footer.cshtml";
43-
var snippet = '@Html.Partial("Folder/NestedFolder/Footer")';
43+
var snippet = '@await Html.PartialAsync("Folder/NestedFolder/Footer")';
4444
expect(templateHelper.getInsertPartialSnippet(parentId, nodeName)).toBe(snippet);
4545
});
4646

4747
it('should return the snippet for inserting a partial from a folder with spaces in its name', function () {
4848
var parentId = "Folder with spaces";
4949
var nodeName = "Footer.cshtml";
50-
var snippet = '@Html.Partial("Folder with spaces/Footer")';
50+
var snippet = '@await Html.PartialAsync("Folder with spaces/Footer")';
5151
expect(templateHelper.getInsertPartialSnippet(parentId, nodeName)).toBe(snippet);
5252
});
5353

0 commit comments

Comments
 (0)