Skip to content

Commit

Permalink
Merge branch 'release/5.0.0' into master
Browse files Browse the repository at this point in the history
OnTopic Editor 5.0.0 is a major release focused primarily on introducing full support for attribute type plugins, as well as new features exposed from OnTopic 5.0.0 such as topic references.

Features
- Updated attribute types to be truly dynamically imported at runtime; this allows new attribute types to be defined on a per-implementation basis (04a7470).
- The `DateTimeViewComponent` now uses the HTML5 `date`, `time`, or `datetime-local` types, instead of a custom jQuery UI plugin (c73a76c).
- The version history dropdown list now displays version times using the local time zone, instead of UTC (2f0a1c2).
- Exposed warning in the unlikely scenario that not all relationships or topic references could be fully loaded, in which case there are limitations to what modifications can be made (6e22974).
- Exposed warning if the topic has been disabled, to help provide visibility to this high-impact scenario (02d892c).
- Exposed warning if the topic is hidden from the navigation (bdfcb7e, b581915).
- Exposed warning if the topic is hidden from search engines (4e17a5e, b581915).
- Elevated severity of warnings for critical issues to a red "danger" alert (a1f0fca).
- Established `OnTopic.Editor.All` metapackage which includes a reference to all of the core packages and implementations (44e7f9e).
- Configured `SourceLink` with references to GitHub commits so that packages can be properly debugged by implementers (6e41c37).
- The NuGet packages now include the XML documentation, thus allowing implementers to benefit from IntelliSense annotations in Visual Studio (38ff680).
- Added icon to NuGet packages to make them easier to recognize, and consistently branded (2503bcc).
- Removed unnecessary resources such as duplicate JavaScript files (a562cd9) and npm configuration (ba09497) from the NuGet package, dramatically reducing its size.

Bug Fixes
- Links within the modal windows now relay the `IsModal` query string parameter to ensure that they link to pages that know they are within a modal window. Notably, this applies to links to base topics (47921ae).
- Fixed an irritating jog in the page-level navigation—i.e., the tabs at the top of each form—which occurred each time the page loaded (66ec7e1).

Breaking Changes
- Removed support for the legacy ASP.NET Web Forms style of configuring OnTopic Editor attributes via the `DefaultConfiguration` property, including removal of the (deprecated) helper functions on `AttributeDescriptorTopicViewModel`, such as `GetConfigurationValue()` (ff8f0de).
- Removed deprecated features, mostly related to backward compatibility of the legacy ASP.NET Web Forms implementation (606b9c0).
- Reorganized all .NET related attribute type files into a new `OnTopic.Editor.AspNetCore.Attributes` project/package (04a7470); at minimum, this requires replacing the `OnTopic.Editor.Models` package with the `OnTopic.Editor.AspNetCore.Attributes` package.
- Updated references to account for the rename from `Topic.DerivedTopic` to `Topic.BaseTopic`, including updating references to the legacy `TopicId` attribute key (360de6c, 776d543).
- Removed deprecated configuration attributes on the `AttributeDescriptorViewModel`s as well as from their associated `ViewComponent`s (606b9c0, 5c4fb28, 63b4ef1).
- The `EditorViewModelLookupService` no longer derives from the `TopicViewModelLookupService` and, thus, cannot be used to also lookup `OnTopic.ViewModels`, if they're being utilized (9945a94). This can be resolved by using the `CompositeTypeLookupService` to combine these into a single service.

Code Improvements
- Updated to OnTopic 5.0.0, which includes a number of breaking changes that needed to be accounted for, such as changes in namespaces (926da84, 5010de1).
- Updated to OnTopic Data Transfer 2.0.0, which includes support for resolving associations orphaned due to the import order (bdf6a6a), as well as support for the new topic references feature (c74e528, f79e168).
- Renamed the attribute descriptors from having an `Attribute` suffix to having an `AttributeDescriptor` suffix (04a7470) and the view models from having an `TopicViewModel` suffix to just the `ViewModel` suffix. E.g., `TopicListAttributeTopicViewModel` is now `TopicListAttributeDescriptorViewModel`. This requires updating the name of the corresponding content types in the OnTopic database. The OnTopic migration scripts includes this update.
- Migrated all view models (including the `EditorViewModel`, `AttributeViewModel`, `AttributeBindingModel`, and derivatives) from classes to read-only, immutable C# 9.0 `record` types (77f304f).
- Added a new `StyleSheets` and `Scripts` collection of `ClientResource<T>` objects to the `AttributeDescriptorViewModel` as a way of registering client-side stylesheets and JavaScript files from plugins, while having them de-duplicated and injected in the appropriate location in the header or footer (71c2ab9, ce3477a).
- Added a new `GetNamespacedUri()` method for prefixing the client resource paths with the plugin assembly's namespace, as required for Razor Class Libraries (4c7bf0f).
- Implemented the latest version of Microsoft's code analysis library (`NetAnalyzers`), and implemented the feedback it exposed (71b7783), including nullable reference annotations (185d4bf).
- Resolved issues preventing Razor Runtime Compilation from working correctly (51925b1). This affects development of the Editor itself.
  • Loading branch information
JeremyCaney committed Mar 3, 2021
2 parents f28a6c9 + e4ea7bb commit 4d0e5a4
Show file tree
Hide file tree
Showing 183 changed files with 30,350 additions and 3,022 deletions.
36 changes: 36 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project>

<PropertyGroup>
<LangVersion>9.0</LangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<Nullable>enable</Nullable>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<NoWarn>NU5118</NoWarn>
</PropertyGroup>

<PropertyGroup>
<Product>OnTopic</Product>
<Authors>Ignia</Authors>
<Company>Ignia</Company>
<Copyright>©2021 Ignia, LLC</Copyright>
<PackageProjectUrl>https://github.com/Ignia/Topic-Editor-MVC/</PackageProjectUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<UseFullSemVerForNuGet>true</UseFullSemVerForNuGet>
<RepositoryType>git</RepositoryType>
<NeutralLanguage>en</NeutralLanguage>
<IncludeSymbols>true</IncludeSymbols>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIcon>Icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="../Icon.png" Pack="true" PackagePath=""/>
</ItemGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

</Project>
12 changes: 12 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>

<ItemGroup>
<Content Remove="wwwroot\shared\**\*.map" />
</ItemGroup>

<ItemGroup>
<Content Update="package.json" Pack="false" />
<Content Update="package-lock.json" Pack="false" />
</ItemGroup>

</Project>
Binary file added Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions OnTopic.Editor.AspNetCore.All/OnTopic.Editor.AspNetCore.All.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<AssemblyTitle>OnTopic Library Metapackage</AssemblyTitle>
<Description>Includes all core packages associated with the OnTopic Editor, including the default attribute type plugins. Reference this package as a shorthand for establishing a reference to each of the individual packages.</Description>
<OutputPath>bin\$(Configuration)\</OutputPath>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\OnTopic.Editor.AspNetCore.Attributes\OnTopic.Editor.AspNetCore.Attributes.csproj" />
<ProjectReference Include="..\OnTopic.Editor.AspNetCore\OnTopic.Editor.AspNetCore.csproj" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions OnTopic.Editor.AspNetCore.All/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*==============================================================================================================================
| Author Ignia, LLC
| Client Ignia, LLC
| Project Topics Library
\=============================================================================================================================*/
using System;
using System.Runtime.InteropServices;

/*==============================================================================================================================
| DEFINE ASSEMBLY ATTRIBUTES
>===============================================================================================================================
| Declare and define attributes used in the compiling of the finished assembly.
\-----------------------------------------------------------------------------------------------------------------------------*/
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
28 changes: 28 additions & 0 deletions OnTopic.Editor.AspNetCore.All/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# OnTopic Editor Metapackage
The `OnTopic.Editor.AspNetCore.All` metapackage includes a reference to both the core OnTopic Editor as well as all standard attribute type plugins. It is recommended that implementers reference this package instead of referencing each of the OnTopic Editor packages individually, unless they have a specific need to customize e.g. which attribute plugins are referenced.

[![OnTopic.Editor.AspNetCore package in Internal feed in Azure Artifacts](https://igniasoftware.feeds.visualstudio.com/_apis/public/Packaging/Feeds/46d5f49c-5e1e-47bb-8b14-43be6c719ba8/Packages/682244bf-1062-48de-949e-16f9cb11a6cf/Badge)](https://igniasoftware.visualstudio.com/OnTopic/_packaging?_a=package&feed=46d5f49c-5e1e-47bb-8b14-43be6c719ba8&package=682244bf-1062-48de-949e-16f9cb11a6cf&preferRelease=true)
[![Build Status](https://igniasoftware.visualstudio.com/OnTopic/_apis/build/status/OnTopic-Editor-CI-V1?branchName=master)](https://igniasoftware.visualstudio.com/OnTopic/_build/latest?definitionId=8&branchName=master)
![NuGet Deployment Status](https://rmsprodscussu1.vsrm.visualstudio.com/A09668467-721c-4517-8d2e-aedbe2a7d67f/_apis/public/Release/badge/bd7f03e0-6fcf-4ec6-939d-4e995668d40f/2/2)

### Contents
- [Scope](#scope)
- [Installation](#installation)

## Scope
The `OnTopic.Editor.AspNetCore.All` metapackage maintains a reference to the following packages:
- [`OnTopic.Editor.AspNetCore`](../OnTopic.Editor.AspNetCore/README.md): The core OnTopic Editor interface.
- [`OnTopic.Editor.AspNetCore.Attributes`](../OnTopic.Editor.AspNetCore.Attributes/README.md): The standard attribute types for supporting typing implementations of the OnTopic Editor.

## Installation
Installation can be performed by providing a `<PackageReference /`> to the `OnTopic.Editor.AspNetCore.All` **NuGet** package.
```xml
<Project Sdk="Microsoft.NET.Sdk.Web">
<ItemGroup>
<PackageReference Include="OnTopic.Editor.AspNetCore.All" Version="5.0.0" />
</ItemGroup>
</Project>
```

> *Note:* This package is currently only available on Ignia's private **NuGet** repository. For access, please contact [Ignia](http://www.ignia.com/).
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
| Client Ignia, LLC
| Project Topics Library
\=============================================================================================================================*/
using OnTopic.Editor.AspNetCore.Models;

namespace OnTopic.Editor.Models.Components.BindingModels {
namespace OnTopic.Editor.AspNetCore.Attributes.BooleanAttribute {

/*============================================================================================================================
| CLASS: BOOLEAN ATTRIBUTE (BINDING MODEL)
Expand All @@ -14,7 +15,7 @@ namespace OnTopic.Editor.Models.Components.BindingModels {
/// </summary>
/// <remarks>
/// </remarks>
public class BooleanAttributeBindingModel : AttributeBindingModel {
public record BooleanAttributeBindingModel : AttributeBindingModel {

/*==========================================================================================================================
| PRIVATE VARIABLES
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*==============================================================================================================================
| Author Ignia, LLC
| Client Ignia, LLC
| Project Topics Library
\=============================================================================================================================*/
using OnTopic.Metadata;

namespace OnTopic.Editor.AspNetCore.Attributes.BooleanAttribute {

/*============================================================================================================================
| CLASS: BOOLEAN ATTRIBUTE (DESCRIPTOR)
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Represents metadata for describing an boolean attribute type, including information on how it will be presented and
/// validated in the editor.
/// </summary>
/// <remarks>
/// This class is primarily used by the Topic Editor interface to determine how attributes are displayed as part of the
/// CMS; except in very specific scenarios, it is not typically used elsewhere in the Topic Library itself.
/// </remarks>
public class BooleanAttributeDescriptor : AttributeDescriptor {

/*==========================================================================================================================
| CONSTRUCTOR
\-------------------------------------------------------------------------------------------------------------------------*/
/// <inheritdoc />
public BooleanAttributeDescriptor(
string key,
string contentType,
Topic parent,
int id = -1
) : base(
key,
contentType,
parent,
id
) {
}

} //Class
} //Namespace
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@
| Client Ignia, LLC
| Project Topics Library
\=============================================================================================================================*/
using OnTopic.Editor.AspNetCore.Models.Metadata;

#nullable enable

namespace OnTopic.Editor.Models.Metadata {
namespace OnTopic.Editor.AspNetCore.Attributes.BooleanAttribute {

/*============================================================================================================================
| CLASS: BOOLEAN ATTRIBUTE (TOPIC VIEW MODEL)
| CLASS: BOOLEAN ATTRIBUTE DESCRIPTOR (VIEW MODEL)
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Provides access to attributes associated with the <see cref="BooleanViewComponent"/>.
/// </summary>
public class BooleanAttributeTopicViewModel: AttributeDescriptorTopicViewModel {
public record BooleanAttributeDescriptorViewModel: AttributeDescriptorViewModel {


} //Class
} //Namespace

#nullable restore
} //Namespace
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
| Project Topics Library
\=============================================================================================================================*/
using System;
using OnTopic.Editor.Models.Metadata;
using OnTopic.Editor.AspNetCore.Models;
using OnTopic.Editor.AspNetCore.Models.Metadata;

namespace OnTopic.Editor.Models.Components.ViewModels {
namespace OnTopic.Editor.AspNetCore.Attributes.BooleanAttribute {

/*============================================================================================================================
| CLASS: BOOLEAN ATTRIBUTE (VIEW MODEL)
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Represents the data model for the <see cref="BooleanViewComponent"/>. Additionally provides access to the underlying
/// <see cref="AttributeDescriptorTopicViewModel"/> as well as the instance values for that attribute from the currently
/// <see cref="AttributeDescriptorViewModel"/> as well as the instance values for that attribute from the currently
/// selected <see cref="Topic"/>.
/// </summary>
public class BooleanAttributeViewModel: AttributeViewModel<BooleanAttributeTopicViewModel> {
public record BooleanAttributeViewModel: AttributeViewModel<BooleanAttributeDescriptorViewModel> {

/*==========================================================================================================================
| CONSTRUCTOR
Expand All @@ -26,9 +27,9 @@ public class BooleanAttributeViewModel: AttributeViewModel<BooleanAttributeTopic
/// </summary>
public BooleanAttributeViewModel(
EditingTopicViewModel currentTopic,
BooleanAttributeTopicViewModel attributeDescriptor,
string value = null,
string inheritedValue = null
BooleanAttributeDescriptorViewModel attributeDescriptor,
string? value = null,
string? inheritedValue = null
): base(
currentTopic,
attributeDescriptor,
Expand All @@ -45,7 +46,7 @@ public BooleanAttributeViewModel(
public bool? IsTrue() {
if (
(Value?.Equals("1", StringComparison.OrdinalIgnoreCase)?? false) ||
(Value?.Equals("true", StringComparison.InvariantCultureIgnoreCase)?? false)
(Value?.Equals("true", StringComparison.OrdinalIgnoreCase)?? false)
) {
return true;
}
Expand All @@ -61,7 +62,7 @@ public BooleanAttributeViewModel(
public bool? IsFalse() {
if (
(Value?.Equals("0", StringComparison.OrdinalIgnoreCase) ?? false) ||
(Value?.Equals("false", StringComparison.InvariantCultureIgnoreCase) ?? false)
(Value?.Equals("false", StringComparison.OrdinalIgnoreCase) ?? false)
) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
| Project Topics Library
\=============================================================================================================================*/
using Microsoft.AspNetCore.Mvc;
using OnTopic.Editor.Models;
using OnTopic.Editor.Models.Components.ViewModels;
using OnTopic.Editor.Models.Metadata;
using OnTopic.AspNetCore.Mvc.Components;
using OnTopic.Editor.AspNetCore.Models;

namespace OnTopic.Editor.AspNetCore.Components {
namespace OnTopic.Editor.AspNetCore.Attributes.BooleanAttribute {

/*============================================================================================================================
| CLASS: BOOLEAN (VIEW COMPONENT)
Expand All @@ -35,7 +34,7 @@ public BooleanViewComponent() : base() { }
/// </summary>
public IViewComponentResult Invoke(
EditingTopicViewModel currentTopic,
BooleanAttributeTopicViewModel attribute,
BooleanAttributeDescriptorViewModel attribute,
string htmlFieldPrefix
) {
ViewData.TemplateInfo.HtmlFieldPrefix = htmlFieldPrefix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
| Client Ignia, LLC
| Project Topics Library
\=============================================================================================================================*/
using OnTopic.Editor.AspNetCore.Models;

namespace OnTopic.Editor.Models.Components.BindingModels {
namespace OnTopic.Editor.AspNetCore.Attributes.DateTimeAttribute {

/*============================================================================================================================
| CLASS: DATE TIME ATTRIBUTE (BINDING MODEL)
Expand All @@ -14,7 +15,7 @@ namespace OnTopic.Editor.Models.Components.BindingModels {
/// </summary>
/// <remarks>
/// </remarks>
public class DateTimeAttributeBindingModel : AttributeBindingModel {
public record DateTimeAttributeBindingModel : AttributeBindingModel {

/*==========================================================================================================================
| PRIVATE VARIABLES
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*==============================================================================================================================
| Author Ignia, LLC
| Client Ignia, LLC
| Project Topics Library
\=============================================================================================================================*/
using OnTopic.Metadata;

namespace OnTopic.Editor.AspNetCore.Attributes.DateTimeAttribute {

/*============================================================================================================================
| CLASS: DATE/TIME ATTRIBUTE (DESCRIPTOR)
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Represents metadata for describing a Date/Time attribute type, including information on how it will be presented and
/// validated in the editor.
/// </summary>
/// <remarks>
/// This class is primarily used by the Topic Editor interface to determine how attributes are displayed as part of the
/// CMS; except in very specific scenarios, it is not typically used elsewhere in the Topic Library itself.
/// </remarks>
public class DateTimeAttributeDescriptor : AttributeDescriptor {

/*==========================================================================================================================
| CONSTRUCTOR
\-------------------------------------------------------------------------------------------------------------------------*/
/// <inheritdoc />
public DateTimeAttributeDescriptor(
string key,
string contentType,
Topic parent,
int id = -1
) : base(
key,
contentType,
parent,
id
) {
}

} //Class
} //Namespace
Loading

0 comments on commit 4d0e5a4

Please sign in to comment.