diff --git a/OnTopic.Editor.AspNetCore.Host/OnTopic.Editor.AspNetCore.Host.csproj b/OnTopic.Editor.AspNetCore.Host/OnTopic.Editor.AspNetCore.Host.csproj index 4255a40a..d37ffd19 100644 --- a/OnTopic.Editor.AspNetCore.Host/OnTopic.Editor.AspNetCore.Host.csproj +++ b/OnTopic.Editor.AspNetCore.Host/OnTopic.Editor.AspNetCore.Host.csproj @@ -2,16 +2,21 @@ netcoreapp3.1 + 9.0 InProcess aff0d52c-eab2-4c07-88b2-5af34649f874 - - - - - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + diff --git a/OnTopic.Editor.AspNetCore.Host/SampleActivator.cs b/OnTopic.Editor.AspNetCore.Host/SampleActivator.cs index 963d2ccb..4b92c919 100644 --- a/OnTopic.Editor.AspNetCore.Host/SampleActivator.cs +++ b/OnTopic.Editor.AspNetCore.Host/SampleActivator.cs @@ -88,6 +88,11 @@ public SampleActivator(string connectionString, IWebHostEnvironment webHostEnvir /// A concrete instance of an . public object Create(ControllerContext context) { + /*------------------------------------------------------------------------------------------------------------------------ + | Validate parameters + \-----------------------------------------------------------------------------------------------------------------------*/ + Contract.Requires(context, nameof(context)); + /*------------------------------------------------------------------------------------------------------------------------ | Determine controller type \-----------------------------------------------------------------------------------------------------------------------*/ @@ -111,6 +116,11 @@ public object Create(ControllerContext context) { /// A concrete instance of an . public object Create(ViewComponentContext context) { + /*------------------------------------------------------------------------------------------------------------------------ + | Validate parameters + \-----------------------------------------------------------------------------------------------------------------------*/ + Contract.Requires(context, nameof(context)); + /*------------------------------------------------------------------------------------------------------------------------ | Determine view component type \-----------------------------------------------------------------------------------------------------------------------*/ diff --git a/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/ContentTypeList/Default.cshtml b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/ContentTypeList/Default.cshtml index 4b8eeb59..e25f7752 100644 --- a/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/ContentTypeList/Default.cshtml +++ b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/ContentTypeList/Default.cshtml @@ -1,6 +1,6 @@ @model ContentTypeListViewModel -@if (Model.TopicList.Count == 1) { +@if (Model.TopicList.Count is 1) { } @@ -20,7 +20,9 @@ else if (Model.TopicList.Count > 2) { var option = $('option:selected', this); @if (Model.EnableModal?? false) { - initEditorModal('@Model.AttributeKey', option.text(), option.val(), @Model.OnModalClose); return false; + initEditorModal('@Model.AttributeKey', option.text(), option.val(), @Model.OnModalClose); + $(this).prop('selectedIndex', 0); + return false; } else { @@ -37,7 +39,7 @@ else if (Model.TopicList.Count > 2) { else {
- @if (Model.EnableModal == true) { + @if (Model.EnableModal is true) { @Model.TopicList.LastOrDefault().Text diff --git a/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Edit.cshtml b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Edit.cshtml index 542829f2..79a2a4b0 100644 --- a/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Edit.cshtml +++ b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Edit.cshtml @@ -20,7 +20,7 @@
- @if (Model.ContentTypeDescriptor.DisableDelete) { + @if (Model.ContentTypeDescriptor.DisableDelete && !Model.IsNew) { } - @if (Model.Topic.DerivedTopic != null) { + @if (Model.Topic.DerivedTopic is not null) { @@ -46,7 +46,7 @@ var displayGroupId = displayGroupName.Replace(" ", String.Empty); -
+
@foreach (var attribute in Model.ContentTypeDescriptor.GetAttributeDescriptors(displayGroupName)) { @@ -105,7 +105,7 @@ } }); - @if (Model.Topic.DerivedTopic != null) { + @if (Model.Topic.DerivedTopic is not null) { /** * Disable required fields if derived topic, as missing values will be inherited diff --git a/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Shared/_Toolbar.cshtml b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Shared/_Toolbar.cshtml index d0944732..7f7adce5 100644 --- a/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Shared/_Toolbar.cshtml +++ b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Shared/_Toolbar.cshtml @@ -11,13 +11,13 @@ @if (Model.Topic.VersionHistory.Count > 1) { -