From 048860d06cc6bf2ffd724f22a56c6d5e93df6960 Mon Sep 17 00:00:00 2001 From: Ivan Lieckens Date: Tue, 10 Sep 2024 02:31:59 +0200 Subject: [PATCH] Implement using new ASP.NET Core SDK (#479) Co-authored-by: Ivan Lieckens --- Packages.props | 8 +++-- .../RenderingEngineOptionsExtensions.cs | 4 +-- .../MVP.Feature.BasicContent.Rendering.csproj | 6 ++-- .../rendering/Models/AnnouncementBar.cs | 9 ++--- .../rendering/Models/ContentList.cs | 34 +++++++++---------- .../rendering/Models/CtaContent.cs | 16 ++++----- .../rendering/Models/EmbedContent.cs | 4 +-- .../rendering/Models/HalfWidthBanner.cs | 11 ++---- .../BasicContent/rendering/Models/HeroBase.cs | 16 +++++---- .../BasicContent/rendering/Models/HeroBig.cs | 4 +-- .../rendering/Models/HeroMedium.cs | 4 +-- .../rendering/Models/HeroMediumWithLink.cs | 4 +-- .../rendering/Models/ImageTeaser.cs | 17 +++++----- .../rendering/Models/RichTextContent.cs | 7 ++-- .../rendering/Models/VideoTeaser.cs | 17 +++++----- .../SitecoreComponent/AnnouncementBar.cshtml | 2 +- .../SitecoreComponent/ContentList.cshtml | 34 ++++++------------- .../SitecoreComponent/EmbedContent.cshtml | 2 +- .../SitecoreComponent/HalfWidthBanner.cshtml | 6 ++-- .../SitecoreComponent/HeroBig.cshtml | 4 +-- .../SitecoreComponent/HeroMedium.cshtml | 6 ++-- .../HeroMediumWithLink.cshtml | 8 ++--- .../SitecoreComponent/ImageTeaser.cshtml | 2 +- .../SitecoreComponent/VideoTeaser.cshtml | 4 +-- .../SitecoreComponent/_clFeatureBlock.cshtml | 8 ++--- .../_clMvpYearBlockFourColumn.cshtml | 8 ++--- .../_clMvpYearBlockThreeColumn.cshtml | 8 ++--- .../rendering/Views/_ViewImports.cshtml | 9 +++-- .../RenderingEngineOptionsExtensions.cs | 4 +-- .../Navigation/rendering/Models/ChildItems.cs | 14 ++++---- .../Navigation/rendering/Models/Footer.cs | 12 +++---- .../Navigation/rendering/Models/MainNav.cs | 22 ++++++------ .../Navigation/rendering/Models/SocialLink.cs | 2 +- .../Navigation/rendering/Models/TopLinks.cs | 23 ++++++++----- .../Mvp.Feature.Navigation.Rendering.csproj | 5 +-- .../SitecoreComponent/Footer.cshtml | 9 ++--- .../SitecoreComponent/MainNav.cshtml | 11 +++--- .../SitecoreComponent/TopLinks.cshtml | 7 ++-- .../rendering/Views/_ViewImports.cshtml | 8 ++--- .../Extensions/HyperLinkFieldExtensions.cs | 2 +- .../RenderingEngineOptionsExtensions.cs | 4 +-- .../MvpProfileRenderingEnginePipeline.cs | 4 +-- .../Middleware/MvpProfileRoutingMiddleware.cs | 2 +- .../People/rendering/Models/BaseViewModel.cs | 2 +- .../Models/Directory/DirectoryViewModel.cs | 2 +- .../Models/Directory/FacetViewModel.cs | 2 +- .../Models/Profile/ProfileViewModel.cs | 2 +- .../Mvp.Feature.People.Rendering.csproj | 5 +-- .../ViewComponents/DirectoryViewComponent.cs | 12 +++---- .../ViewComponents/ProfileViewComponent.cs | 2 +- .../Shared/Components/Directory/_Facet.cshtml | 1 - .../Views/Shared/_ViewImports.cshtml | 2 +- .../DependencyInjectionExtensions.cs | 4 +-- .../Models/Admin/ApplicationCommentModel.cs | 2 +- .../Admin/ApplicationReviewSettingsModel.cs | 2 +- .../Models/Admin/ApplicationsOverviewModel.cs | 2 +- .../rendering/Models/Admin/AwardModel.cs | 2 +- .../Models/Admin/CountriesOverviewModel.cs | 2 +- .../Models/Admin/MvpTypesOverviewModel.cs | 2 +- .../Models/Admin/RegionsOverviewModel.cs | 2 +- .../Models/Admin/ScoreCardDetailModel.cs | 2 +- .../rendering/Models/Admin/ScoreCardsModel.cs | 2 +- .../Models/Admin/SelectionOverviewModel.cs | 2 +- .../Models/Admin/SystemRolesOverviewModel.cs | 2 +- .../rendering/Models/Admin/UserEditModel.cs | 2 +- .../Models/Admin/UsersOverviewModel.cs | 2 +- .../rendering/Models/Any/DashboardModel.cs | 2 +- .../rendering/Models/Any/MyDataEditModel.cs | 2 +- .../Models/Any/MyProfilesFormModel.cs | 2 +- .../Models/Apply/ApplicationFormModel.cs | 2 +- .../Models/Apply/ContributionOverviewModel.cs | 2 +- .../Selections/rendering/Models/BaseModel.cs | 2 +- .../Mvp.Feature.Selections.Rendering.csproj | 5 +-- .../Admin/ApplicationCommentViewComponent.cs | 2 +- .../Admin/ApplicationOverviewViewComponent.cs | 2 +- .../ApplicationReviewSettingsViewComponent.cs | 2 +- .../Admin/AwardViewComponent.cs | 2 +- .../Admin/CountriesOverviewViewComponent.cs | 2 +- .../Admin/MvpTypesOverviewViewComponent.cs | 2 +- .../Admin/RegionsOverviewViewComponent.cs | 2 +- .../Admin/ScoreCardDetailViewComponent.cs | 2 +- .../Admin/ScoreCardsViewComponent.cs | 2 +- .../Admin/SelectionOverviewViewComponent.cs | 2 +- .../Admin/SystemRolesOverviewViewComponent.cs | 2 +- .../Admin/UserEditViewComponent.cs | 2 +- .../Admin/UsersOverviewViewComponent.cs | 2 +- .../Any/DashboardViewComponent.cs | 10 ++---- .../Any/MyDataEditViewComponent.cs | 2 +- .../Any/MyProfilesFormViewComponent.cs | 2 +- .../Apply/ApplicationFormViewComponent.cs | 2 +- .../ContributionOverviewViewComponent.cs | 2 +- .../ViewComponents/BaseViewComponent.cs | 2 +- .../rendering/Views/_ViewImports.cshtml | 2 +- .../RenderingEngineOptionsExtensions.cs | 4 +-- src/Feature/Social/rendering/Models/Rss.cs | 4 +-- .../Mvp.Feature.Social.Rendering.csproj | 5 +-- .../rendering/Views/_ViewImports.cshtml | 9 +++-- .../RenderingEngineOptionsExtensions.cs | 4 +-- .../Mvp.Feature.User.Rendering.csproj | 5 +-- .../User/rendering/Views/_ViewImports.cshtml | 8 ++--- .../Controllers/DefaultController.cs | 15 ++++---- .../Controllers/MvpProfileController.cs | 9 ++--- .../MvpSiteRenderingEnginePipeline.cs | 4 +-- .../Middleware/NotFoundRoutingMiddleware.cs | 13 ++++--- .../rendering/Models/LayoutViewModel.cs | 4 +-- .../Mvp.Project.MvpSite.Rendering.csproj | 9 ++--- src/Project/MvpSite/rendering/Startup.cs | 12 +++---- .../Views/Shared/_ComponentNotFound.cshtml | 2 +- .../rendering/Views/_ViewImports.cshtml | 4 +-- src/XmCloudIntroduction.sln | 2 +- 110 files changed, 305 insertions(+), 324 deletions(-) diff --git a/Packages.props b/Packages.props index 3bf36c705..0f517f02d 100644 --- a/Packages.props +++ b/Packages.props @@ -9,6 +9,7 @@ 1.* 21.0.* 8.0.0 + 0.0.7 @@ -20,9 +21,10 @@ - - - + + + + diff --git a/src/Feature/BasicContent/rendering/Extensions/RenderingEngineOptionsExtensions.cs b/src/Feature/BasicContent/rendering/Extensions/RenderingEngineOptionsExtensions.cs index 1fa5397d9..03b8dddd9 100644 --- a/src/Feature/BasicContent/rendering/Extensions/RenderingEngineOptionsExtensions.cs +++ b/src/Feature/BasicContent/rendering/Extensions/RenderingEngineOptionsExtensions.cs @@ -1,6 +1,6 @@ using Mvp.Feature.BasicContent.Models; -using Sitecore.AspNet.RenderingEngine.Configuration; -using Sitecore.AspNet.RenderingEngine.Extensions; +using Sitecore.AspNetCore.SDK.RenderingEngine.Configuration; +using Sitecore.AspNetCore.SDK.RenderingEngine.Extensions; namespace Mvp.Feature.BasicContent.Extensions { diff --git a/src/Feature/BasicContent/rendering/MVP.Feature.BasicContent.Rendering.csproj b/src/Feature/BasicContent/rendering/MVP.Feature.BasicContent.Rendering.csproj index 3efff152c..a6a5298fc 100644 --- a/src/Feature/BasicContent/rendering/MVP.Feature.BasicContent.Rendering.csproj +++ b/src/Feature/BasicContent/rendering/MVP.Feature.BasicContent.Rendering.csproj @@ -5,11 +5,13 @@ Mvp.Feature.BasicContent Mvp.Feature.BasicContent true + enable - - + + + \ No newline at end of file diff --git a/src/Feature/BasicContent/rendering/Models/AnnouncementBar.cs b/src/Feature/BasicContent/rendering/Models/AnnouncementBar.cs index 03a9fa774..5971bf0b9 100644 --- a/src/Feature/BasicContent/rendering/Models/AnnouncementBar.cs +++ b/src/Feature/BasicContent/rendering/Models/AnnouncementBar.cs @@ -1,13 +1,10 @@ -using Sitecore.LayoutService.Client.Response.Model.Fields; -using System; -using System.Collections.Generic; -using System.Text; +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.BasicContent.Models { public class AnnouncementBar { - public RichTextField AnnouncementText { get; set; } - public HyperLinkField AnnouncementLink { get; set; } + public RichTextField? AnnouncementText { get; set; } + public HyperLinkField? AnnouncementLink { get; set; } } } diff --git a/src/Feature/BasicContent/rendering/Models/ContentList.cs b/src/Feature/BasicContent/rendering/Models/ContentList.cs index 23d4a203c..a4de16a2f 100644 --- a/src/Feature/BasicContent/rendering/Models/ContentList.cs +++ b/src/Feature/BasicContent/rendering/Models/ContentList.cs @@ -1,48 +1,46 @@ -using Sitecore.AspNet.RenderingEngine.Binding; -using Sitecore.AspNet.RenderingEngine.Binding.Attributes; -using Sitecore.LayoutService.Client.Response.Model.Fields; +using Sitecore.AspNetCore.SDK.RenderingEngine.Binding.Attributes; +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.BasicContent.Models { public class ContentList { [SitecoreComponentField(Name = "ContentListTitle")] - public TextField Title { get; set; } + public TextField? Title { get; set; } [SitecoreComponentField(Name = "Selected Items")] - public ContentListItem[] Items { get; set; } + public ContentListItem[]? Items { get; set; } - [SitecoreComponentProperty()] - public ItemLinkField ContentListType { get; set; } + [SitecoreComponentProperty] + public ItemLinkField? ContentListType { get; set; } [SitecoreComponentField] - public NumberField ContentListLimit { get; set; } + public NumberField? ContentListLimit { get; set; } } public class ContentListItem { - public string Url { get; set; } - public string Name { get; set; } - public string Id { get; set; } - public string DisplayName { get; set; } + public string? Url { get; set; } + public string? Name { get; set; } + public string? Id { get; set; } + public string? DisplayName { get; set; } [SitecoreComponentField] - - public ContentListItemFields Fields { get; set; } + public ContentListItemFields? Fields { get; set; } } public class ContentListItemFields { [SitecoreComponentField] - public TextField ItemTitle { get; set; } + public TextField? ItemTitle { get; set; } [SitecoreComponentField] - public TextField ItemSubtitle { get; set; } + public TextField? ItemSubtitle { get; set; } [SitecoreComponentField] - public TextField ItemText { get; set; } + public TextField? ItemText { get; set; } [SitecoreComponentField] - public HyperLinkField ItemLink { get; set; } + public HyperLinkField? ItemLink { get; set; } } } \ No newline at end of file diff --git a/src/Feature/BasicContent/rendering/Models/CtaContent.cs b/src/Feature/BasicContent/rendering/Models/CtaContent.cs index 13493656f..05d6886f2 100644 --- a/src/Feature/BasicContent/rendering/Models/CtaContent.cs +++ b/src/Feature/BasicContent/rendering/Models/CtaContent.cs @@ -1,15 +1,15 @@ -using Sitecore.LayoutService.Client.Response.Model.Fields; -using System; -using System.Collections.Generic; -using System.Text; +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.BasicContent.Models { public class CtaContent { - public TextField CtaTitle { get; set; } - public RichTextField CtaText { get; set; } - public HyperLinkField CtaLink { get; set; } - public ImageField CtaImage{ get; set; } + public TextField? CtaTitle { get; set; } + + public RichTextField? CtaText { get; set; } + + public HyperLinkField? CtaLink { get; set; } + + public ImageField? CtaImage{ get; set; } } } diff --git a/src/Feature/BasicContent/rendering/Models/EmbedContent.cs b/src/Feature/BasicContent/rendering/Models/EmbedContent.cs index 4a0867221..14c507556 100644 --- a/src/Feature/BasicContent/rendering/Models/EmbedContent.cs +++ b/src/Feature/BasicContent/rendering/Models/EmbedContent.cs @@ -1,9 +1,9 @@ -using Sitecore.LayoutService.Client.Response.Model.Fields; +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.BasicContent.Models { public class EmbedContent { - public TextField EmbedCode { get; set; } + public TextField? EmbedCode { get; set; } } } \ No newline at end of file diff --git a/src/Feature/BasicContent/rendering/Models/HalfWidthBanner.cs b/src/Feature/BasicContent/rendering/Models/HalfWidthBanner.cs index 3e946e17d..989ea4555 100644 --- a/src/Feature/BasicContent/rendering/Models/HalfWidthBanner.cs +++ b/src/Feature/BasicContent/rendering/Models/HalfWidthBanner.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Mvp.Feature.BasicContent.Models +namespace Mvp.Feature.BasicContent.Models { - public class HalfWidthBanner : CtaContent - { - - } + public class HalfWidthBanner : CtaContent; } diff --git a/src/Feature/BasicContent/rendering/Models/HeroBase.cs b/src/Feature/BasicContent/rendering/Models/HeroBase.cs index 34daada2f..0de4fcd17 100644 --- a/src/Feature/BasicContent/rendering/Models/HeroBase.cs +++ b/src/Feature/BasicContent/rendering/Models/HeroBase.cs @@ -1,13 +1,17 @@ -using Sitecore.LayoutService.Client.Response.Model.Fields; +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.BasicContent.Models { public class HeroBase { - public TextField HeroTitle { get; set; } - public TextField HeroSubtitle { get; set; } - public TextField HeroDescription { get; set; } - public HyperLinkField HeroLink { get; set; } - public ImageField HeroImage { get; set; } + public TextField? HeroTitle { get; set; } + + public TextField? HeroSubtitle { get; set; } + + public TextField? HeroDescription { get; set; } + + public HyperLinkField? HeroLink { get; set; } + + public ImageField? HeroImage { get; set; } } } diff --git a/src/Feature/BasicContent/rendering/Models/HeroBig.cs b/src/Feature/BasicContent/rendering/Models/HeroBig.cs index 63b617a5c..27a7aeedd 100644 --- a/src/Feature/BasicContent/rendering/Models/HeroBig.cs +++ b/src/Feature/BasicContent/rendering/Models/HeroBig.cs @@ -1,6 +1,4 @@ namespace Mvp.Feature.BasicContent.Models { - public class HeroBig : HeroBase - { - } + public class HeroBig : HeroBase; } diff --git a/src/Feature/BasicContent/rendering/Models/HeroMedium.cs b/src/Feature/BasicContent/rendering/Models/HeroMedium.cs index 18b648b58..87daa117f 100644 --- a/src/Feature/BasicContent/rendering/Models/HeroMedium.cs +++ b/src/Feature/BasicContent/rendering/Models/HeroMedium.cs @@ -1,6 +1,4 @@ namespace Mvp.Feature.BasicContent.Models { - public class HeroMedium : HeroBase - { - } + public class HeroMedium : HeroBase; } diff --git a/src/Feature/BasicContent/rendering/Models/HeroMediumWithLink.cs b/src/Feature/BasicContent/rendering/Models/HeroMediumWithLink.cs index 7e819e4f7..b5da10ed9 100644 --- a/src/Feature/BasicContent/rendering/Models/HeroMediumWithLink.cs +++ b/src/Feature/BasicContent/rendering/Models/HeroMediumWithLink.cs @@ -1,6 +1,4 @@ namespace Mvp.Feature.BasicContent.Models { - public class HeroMediumWithLink : HeroBase - { - } + public class HeroMediumWithLink : HeroBase; } diff --git a/src/Feature/BasicContent/rendering/Models/ImageTeaser.cs b/src/Feature/BasicContent/rendering/Models/ImageTeaser.cs index 3648a0018..9adaf8ef0 100644 --- a/src/Feature/BasicContent/rendering/Models/ImageTeaser.cs +++ b/src/Feature/BasicContent/rendering/Models/ImageTeaser.cs @@ -1,16 +1,15 @@ -using Sitecore.LayoutService.Client.Response.Model.Fields; -using System; -using System.Collections.Generic; -using System.Text; - +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.BasicContent.Models { public class ImageTeaser { - public TextField TeaserTitle { get; set; } - public RichTextField TeaserText { get; set; } - public HyperLinkField TeaserLink { get; set; } - public ImageField TeaserImage { get; set; } + public TextField? TeaserTitle { get; set; } + + public RichTextField? TeaserText { get; set; } + + public HyperLinkField? TeaserLink { get; set; } + + public ImageField? TeaserImage { get; set; } } } diff --git a/src/Feature/BasicContent/rendering/Models/RichTextContent.cs b/src/Feature/BasicContent/rendering/Models/RichTextContent.cs index c084e60d8..9f9424308 100644 --- a/src/Feature/BasicContent/rendering/Models/RichTextContent.cs +++ b/src/Feature/BasicContent/rendering/Models/RichTextContent.cs @@ -1,12 +1,9 @@ -using Sitecore.LayoutService.Client.Response.Model.Fields; -using System; -using System.Collections.Generic; -using System.Text; +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.BasicContent.Models { public class RichTextContent { - public RichTextField Content { get; set; } + public RichTextField? Content { get; set; } } } diff --git a/src/Feature/BasicContent/rendering/Models/VideoTeaser.cs b/src/Feature/BasicContent/rendering/Models/VideoTeaser.cs index 6c666d7f7..fb0a82ef6 100644 --- a/src/Feature/BasicContent/rendering/Models/VideoTeaser.cs +++ b/src/Feature/BasicContent/rendering/Models/VideoTeaser.cs @@ -1,16 +1,15 @@ -using Sitecore.LayoutService.Client.Response.Model.Fields; -using System; -using System.Collections.Generic; -using System.Text; - +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.BasicContent.Models { public class VideoTeaser { - public TextField TeaserTitle { get; set; } - public RichTextField TeaserText { get; set; } - public HyperLinkField TeaserLink { get; set; } - public TextField TeaserEmbed { get; set; } + public TextField? TeaserTitle { get; set; } + + public RichTextField? TeaserText { get; set; } + + public HyperLinkField? TeaserLink { get; set; } + + public TextField? TeaserEmbed { get; set; } } } diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/AnnouncementBar.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/AnnouncementBar.cshtml index 126fc3dbc..ddb66184d 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/AnnouncementBar.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/AnnouncementBar.cshtml @@ -9,7 +9,7 @@

- + Stay informed
diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/ContentList.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/ContentList.cshtml index 65ffde30a..427f9590d 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/ContentList.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/ContentList.cshtml @@ -1,7 +1,8 @@ -@model Mvp.Feature.BasicContent.Models.ContentList +@using Mvp.Feature.BasicContent.Models +@model Mvp.Feature.BasicContent.Models.ContentList -@if (!string.IsNullOrEmpty(Model.Title.Value)) +@if (!string.IsNullOrEmpty(Model.Title?.Value)) {

@@ -9,36 +10,23 @@ } @{ - var fileName = string.Empty; + string fileName = string.Empty; - switch (Model.ContentListType.Id) + switch (Model.ContentListType?.Id) { - case var id when(id == new Guid("E58A021E-74D2-471E-9EBA-B09616350605")): // White blocks + case var id when id == new Guid("E58A021E-74D2-471E-9EBA-B09616350605"): // White blocks fileName = "_clFeatureBlock.cshtml"; break; - case var id when(id == new Guid("92DD658A-76BE-437A-86E4-589DF627FBCC")): // MVP 3 columns + case var id when id == new Guid("92DD658A-76BE-437A-86E4-589DF627FBCC"): // MVP 3 columns fileName = "_clMvpYearBlockThreeColumn.cshtml"; break; - case var id when(id == new Guid("F0027CB2-8725-48EA-B85D-EB83E5216E5A")): // MVP 4 columns + case var id when id == new Guid("F0027CB2-8725-48EA-B85D-EB83E5216E5A"): // MVP 4 columns fileName = "_clMvpYearBlockFourColumn.cshtml"; break; - default: - break; } } -@*@if (Model.ContentListLimit.Value > 0) +@foreach (ContentListItem item in Model.Items ?? []) { - - @foreach (var item in Model.Items.Take(Model.ContentListLimit.Value.Value as int)) - { - @await Html.PartialAsync(fileName, item) - } -} -else -{*@ - @foreach (var item in Model.Items) - { - @await Html.PartialAsync(fileName, item) - } -@*}*@ \ No newline at end of file + @await Html.PartialAsync(fileName, item) +} \ No newline at end of file diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/EmbedContent.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/EmbedContent.cshtml index 1a605e427..e3f777aa0 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/EmbedContent.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/EmbedContent.cshtml @@ -1,5 +1,5 @@ @model Mvp.Feature.BasicContent.Models.EmbedContent
- @Html.Raw(Model.EmbedCode.Value) + @Html.Raw(Model.EmbedCode?.Value)
diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HalfWidthBanner.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HalfWidthBanner.cshtml index dc4a2fd5e..9711dab25 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HalfWidthBanner.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HalfWidthBanner.cshtml @@ -6,14 +6,14 @@

- @Html.Raw(@Model.CtaText.Value) + @Html.Raw(Model.CtaText?.Value) - + Learn more
- @Model.CtaImage.Value.Alt + @Model.CtaImage?.Value.Alt
diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroBig.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroBig.cshtml index 06c4d2976..e7d9fbaed 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroBig.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroBig.cshtml @@ -2,7 +2,7 @@
@if (!string.IsNullOrEmpty(Model.HeroImage?.Value.Src)) { -
+
}
@@ -11,7 +11,7 @@

- @if (!string.IsNullOrWhiteSpace(Model.HeroLink.Value.Href)) { + @if (!string.IsNullOrWhiteSpace(Model.HeroLink?.Value.Href)) { }
diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroMedium.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroMedium.cshtml index a75ddca38..8c229d866 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroMedium.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroMedium.cshtml @@ -14,9 +14,9 @@
- - - + + +
diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroMediumWithLink.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroMediumWithLink.cshtml index e762fa8ce..5531f70e2 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroMediumWithLink.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/HeroMediumWithLink.cshtml @@ -8,7 +8,7 @@

- @if (!string.IsNullOrWhiteSpace(Model.HeroLink.Value.Href)) + @if (!string.IsNullOrWhiteSpace(Model.HeroLink?.Value.Href)) { @Model.HeroLink.Value.Text @@ -20,9 +20,9 @@
- - - + + +
diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/ImageTeaser.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/ImageTeaser.cshtml index d26b5c7c9..5b593d118 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/ImageTeaser.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/ImageTeaser.cshtml @@ -8,7 +8,7 @@

- + Learn more diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/VideoTeaser.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/VideoTeaser.cshtml index d33164fa1..57a3faf9c 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/VideoTeaser.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/VideoTeaser.cshtml @@ -8,7 +8,7 @@

- @if (!string.IsNullOrEmpty(Model.TeaserLink.Value.Href)) + @if (!string.IsNullOrEmpty(Model.TeaserLink?.Value.Href)) { Learn more @@ -16,7 +16,7 @@ }
- @Html.Raw(Model.TeaserEmbed.Value) + @Html.Raw(Model.TeaserEmbed?.Value)
diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clFeatureBlock.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clFeatureBlock.cshtml index e4481a279..84ede478a 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clFeatureBlock.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clFeatureBlock.cshtml @@ -2,11 +2,11 @@
diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clMvpYearBlockFourColumn.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clMvpYearBlockFourColumn.cshtml index cafb02539..e05c235d0 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clMvpYearBlockFourColumn.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clMvpYearBlockFourColumn.cshtml @@ -2,10 +2,10 @@
-

-

-

+

+

+

- +
\ No newline at end of file diff --git a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clMvpYearBlockThreeColumn.cshtml b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clMvpYearBlockThreeColumn.cshtml index 4f2017315..2e175ad53 100644 --- a/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clMvpYearBlockThreeColumn.cshtml +++ b/src/Feature/BasicContent/rendering/Views/Shared/Components/SitecoreComponent/_clMvpYearBlockThreeColumn.cshtml @@ -2,10 +2,10 @@
-

-

-

+

+

+

- +
\ No newline at end of file diff --git a/src/Feature/BasicContent/rendering/Views/_ViewImports.cshtml b/src/Feature/BasicContent/rendering/Views/_ViewImports.cshtml index 608708dff..9cdab433d 100644 --- a/src/Feature/BasicContent/rendering/Views/_ViewImports.cshtml +++ b/src/Feature/BasicContent/rendering/Views/_ViewImports.cshtml @@ -1,7 +1,6 @@ -@using Sitecore.LayoutService.Client.Response.Model -@using Sitecore.LayoutService.Client.Response.Model.Fields -@using Sitecore.AspNet.RenderingEngine.Extensions +@using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model +@using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields +@using Sitecore.AspNetCore.SDK.RenderingEngine.Extensions @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Sitecore.AspNet.RenderingEngine - +@addTagHelper *, Sitecore.AspNetCore.SDK.RenderingEngine \ No newline at end of file diff --git a/src/Feature/Navigation/rendering/Extensions/RenderingEngineOptionsExtensions.cs b/src/Feature/Navigation/rendering/Extensions/RenderingEngineOptionsExtensions.cs index 05de458b1..faa208ce8 100644 --- a/src/Feature/Navigation/rendering/Extensions/RenderingEngineOptionsExtensions.cs +++ b/src/Feature/Navigation/rendering/Extensions/RenderingEngineOptionsExtensions.cs @@ -1,6 +1,6 @@ using Mvp.Feature.Navigation.Models; -using Sitecore.AspNet.RenderingEngine.Configuration; -using Sitecore.AspNet.RenderingEngine.Extensions; +using Sitecore.AspNetCore.SDK.RenderingEngine.Configuration; +using Sitecore.AspNetCore.SDK.RenderingEngine.Extensions; namespace Mvp.Feature.Navigation.Extensions { diff --git a/src/Feature/Navigation/rendering/Models/ChildItems.cs b/src/Feature/Navigation/rendering/Models/ChildItems.cs index 9395300ab..320fd4950 100644 --- a/src/Feature/Navigation/rendering/Models/ChildItems.cs +++ b/src/Feature/Navigation/rendering/Models/ChildItems.cs @@ -1,15 +1,15 @@ -using Sitecore.AspNet.RenderingEngine.Binding.Attributes; +using Sitecore.AspNetCore.SDK.RenderingEngine.Binding.Attributes; namespace Mvp.Feature.Navigation.Models { - public class ChildItems + public class ChildItems { - public string Url { get; set; } - public string Name { get; set; } - public string Id { get; set; } - public string DisplayName { get; set; } + public string? Url { get; set; } + public string? Name { get; set; } + public string? Id { get; set; } + public string? DisplayName { get; set; } [SitecoreComponentField] - public FieldType Fields { get; set; } + public TFieldType? Fields { get; set; } } } diff --git a/src/Feature/Navigation/rendering/Models/Footer.cs b/src/Feature/Navigation/rendering/Models/Footer.cs index 9b11539cc..740d63713 100644 --- a/src/Feature/Navigation/rendering/Models/Footer.cs +++ b/src/Feature/Navigation/rendering/Models/Footer.cs @@ -1,21 +1,21 @@ -using Sitecore.AspNet.RenderingEngine.Binding.Attributes; -using Sitecore.LayoutService.Client.Response.Model.Fields; +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; +using Sitecore.AspNetCore.SDK.RenderingEngine.Binding.Attributes; namespace Mvp.Feature.Navigation.Models { public class Footer { [SitecoreComponentField(Name = "Social Media Links")] - public ChildItems[] SocialLinks { get; set; } + public ChildItems[]? SocialLinks { get; set; } [SitecoreComponentField(Name = "Content")] - public Sitecore.LayoutService.Client.Response.Model.Fields.RichTextField CopyrightText { get; set; } + public RichTextField? CopyrightText { get; set; } } } public class FooterFields { [SitecoreComponentField] - public HyperLinkField Link { get; set; } - public TextField Icon { get; set; } + public HyperLinkField? Link { get; set; } + public TextField? Icon { get; set; } } \ No newline at end of file diff --git a/src/Feature/Navigation/rendering/Models/MainNav.cs b/src/Feature/Navigation/rendering/Models/MainNav.cs index 71df3aec0..71e18dcdc 100644 --- a/src/Feature/Navigation/rendering/Models/MainNav.cs +++ b/src/Feature/Navigation/rendering/Models/MainNav.cs @@ -1,33 +1,33 @@ -using Sitecore.AspNet.RenderingEngine.Binding.Attributes; -using Sitecore.LayoutService.Client.Response.Model.Fields; +using Sitecore.AspNetCore.SDK.RenderingEngine.Binding.Attributes; +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.Navigation.Models { public class MainNav { [SitecoreComponentField] - public MainNavItems[] Items { get; set; } + public MainNavItems[]? Items { get; set; } } public class MainNavItems { - public string Url { get; set; } - public string Name { get; set; } - public string Id { get; set; } - public string DisplayName { get; set; } + public string? Url { get; set; } + public string? Name { get; set; } + public string? Id { get; set; } + public string? DisplayName { get; set; } [SitecoreComponentField] - public MainNavItemFields Fields { get; set; } + public MainNavItemFields? Fields { get; set; } } public class MainNavItemFields { [SitecoreComponentField] - public CheckboxField IncludeInMenu { get; set; } + public CheckboxField? IncludeInMenu { get; set; } [SitecoreComponentField] - public CheckboxField RequiresAuthentication { get; set; } + public CheckboxField? RequiresAuthentication { get; set; } - public TextField MenuTitle { get; set; } + public TextField? MenuTitle { get; set; } } } \ No newline at end of file diff --git a/src/Feature/Navigation/rendering/Models/SocialLink.cs b/src/Feature/Navigation/rendering/Models/SocialLink.cs index 9e3e78b20..9f2bf85c0 100644 --- a/src/Feature/Navigation/rendering/Models/SocialLink.cs +++ b/src/Feature/Navigation/rendering/Models/SocialLink.cs @@ -2,6 +2,6 @@ { public class SocialLink //: Link { - public string Icon { get; set; } + public string? Icon { get; set; } } } \ No newline at end of file diff --git a/src/Feature/Navigation/rendering/Models/TopLinks.cs b/src/Feature/Navigation/rendering/Models/TopLinks.cs index 4eb087837..bdf2990fa 100644 --- a/src/Feature/Navigation/rendering/Models/TopLinks.cs +++ b/src/Feature/Navigation/rendering/Models/TopLinks.cs @@ -1,24 +1,29 @@ -using Sitecore.AspNet.RenderingEngine.Binding.Attributes; -using Sitecore.LayoutService.Client.Response.Model.Fields; +using Sitecore.AspNetCore.SDK.RenderingEngine.Binding.Attributes; +using Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields; namespace Mvp.Feature.Navigation.Models { public class TopLinks { [SitecoreComponentField] - public TopLink[] Items { get; set; } + public TopLink[]? Items { get; set; } } public class TopLink { - public string Url { get; set; } - public string Name { get; set; } - public string Id { get; set; } - public string DisplayName { get; set; } - public TopLinkFields Fields { get; set; } + public string? Url { get; set; } + + public string? Name { get; set; } + + public string? Id { get; set; } + + public string? DisplayName { get; set; } + + public TopLinkFields? Fields { get; set; } } + public class TopLinkFields { - public HyperLinkField Link { get; set; } + public HyperLinkField? Link { get; set; } } } \ No newline at end of file diff --git a/src/Feature/Navigation/rendering/Mvp.Feature.Navigation.Rendering.csproj b/src/Feature/Navigation/rendering/Mvp.Feature.Navigation.Rendering.csproj index 04e3f1aa1..7dbfb12fb 100644 --- a/src/Feature/Navigation/rendering/Mvp.Feature.Navigation.Rendering.csproj +++ b/src/Feature/Navigation/rendering/Mvp.Feature.Navigation.Rendering.csproj @@ -5,12 +5,13 @@ Mvp.Feature.Navigation Mvp.Feature.Navigation true + enable - - + + diff --git a/src/Feature/Navigation/rendering/Views/Shared/Components/SitecoreComponent/Footer.cshtml b/src/Feature/Navigation/rendering/Views/Shared/Components/SitecoreComponent/Footer.cshtml index 5988c616b..a9ed3f9d6 100644 --- a/src/Feature/Navigation/rendering/Views/Shared/Components/SitecoreComponent/Footer.cshtml +++ b/src/Feature/Navigation/rendering/Views/Shared/Components/SitecoreComponent/Footer.cshtml @@ -1,14 +1,15 @@ -@model Mvp.Feature.Navigation.Models.Footer +@using Mvp.Feature.Navigation.Models +@model Footer