Skip to content

Commit

Permalink
Merge branch 'release/4.4.0'
Browse files Browse the repository at this point in the history
While this update primarily focuses on some minor bug fixes in the Editor itself, it also includes a dependency on OnTopic 4.4.0, which introduces updates and bug fixes which are of specific relevance to the OnTopic Editor. Notably, it resolves a number of issues with Oroborus Configuration in which updates to `ContentTypeDescriptor` and `AttributeDescriptor` topics wouldn't take immediate effect in the Editor. This was caused by versioning conflicts between two competing caches: `CachedTopicRepositor._cache` and `TopicRepositoryBase._contentTypeDescriptors`. By introducing a number of updates to help ensure these are synchronized, these should now always be pointing to the same object references, thus avoiding version conflicts when updating them in the Editor.

Features
- Allow `SelectableTreeView`, which is used by the `RelationshipsViewComponent`, to auto-expand to ensure existing selections are visible (4fee666)
- Added run-time view compilation for development mode, making it easier to test changes to the views (57c6714)

Bug Fixes
- The `SelectableTreeView`, which is used by the `RelationshipsViewComponent`, once again correctly supports multiple instances on a page (9b21224)
- Fixed a bug in which the underlying `ITopicRepository.Move()` wasn't getting correct metadata due to the parent being prematurely reset in `EditorController.Move()` (eaf9b59)

Maintenance
- Updated npm and NuGet dependencies, including resolution of several security vulnerabilities, and the introduction of OnTopic 4.4.0 (b1c7f3c)
  • Loading branch information
JeremyCaney committed Aug 21, 2020
2 parents 585dc88 + b1c7f3c commit 3b11cbe
Show file tree
Hide file tree
Showing 15 changed files with 126 additions and 586 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OnTopic" Version="4.3.0" />
<PackageReference Include="OnTopic.ViewModels" Version="4.3.0" />
<PackageReference Include="OnTopic.AspNetCore.Mvc" Version="4.3.0" />
<PackageReference Include="OnTopic.Data.Caching" Version="4.3.0" />
<PackageReference Include="OnTopic.Data.Sql" Version="4.3.0" />
<PackageReference Include="OnTopic" Version="4.4.0" />
<PackageReference Include="OnTopic.ViewModels" Version="4.4.0" />
<PackageReference Include="OnTopic.AspNetCore.Mvc" Version="4.4.0" />
<PackageReference Include="OnTopic.Data.Caching" Version="4.4.0" />
<PackageReference Include="OnTopic.Data.Sql" Version="4.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.7" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 15 additions & 1 deletion OnTopic.Editor.AspNetCore.Host/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
| Client Ignia, LLC
| Project Sample OnTopic Site
\=============================================================================================================================*/
using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;
using Microsoft.AspNetCore.Mvc.ViewComponents;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using OnTopic.AspNetCore.Mvc;
using OnTopic.Editor.AspNetCore;
Expand Down Expand Up @@ -74,14 +77,25 @@ public void ConfigureServices(IServiceCollection services) {
/*------------------------------------------------------------------------------------------------------------------------
| Configure: MVC
\-----------------------------------------------------------------------------------------------------------------------*/
services.AddControllersWithViews()
var mvcBuilder = services.AddControllersWithViews()

//Add OnTopic support
.AddTopicSupport()

//Add OnTopic editor support
.AddTopicEditor();

/*------------------------------------------------------------------------------------------------------------------------
| Configure: Runtime View Compilation
\-----------------------------------------------------------------------------------------------------------------------*/
if (HostingEnvironment.IsDevelopment()) {
mvcBuilder.AddRazorRuntimeCompilation();
services.Configure<MvcRazorRuntimeCompilationOptions>(options => {
var libraryPath = Path.GetFullPath(Path.Combine(HostingEnvironment.ContentRootPath, "..", "OnTopic.Editor.AspNetCore"));
options.FileProviders.Add(new PhysicalFileProvider(libraryPath));
});
}

/*------------------------------------------------------------------------------------------------------------------------
| Configure: Watch Razor Class Library (RCLs) views
>-------------------------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script type="text/javascript">
Ext.onReady(function(){
var tree = new OnTopic.SelectableTreeView({
dataUrl : '/OnTopic/Json/@[email protected]&ShowAll=true&[email protected]&[email protected]&[email protected]&[email protected]',
dataUrl : '/OnTopic/Json/@[email protected]&ShowAll=true&[email protected]&[email protected]&[email protected]&[email protected]&[email protected]',
checkAscendants : @((descriptor.CheckAscendants is true).ToString().ToLower()),
backingField : '@Html.IdFor(m => m.Value)'
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
}

<vc:tokenized-topic-list
current-topic=@Model.CurrentTopic
html-field-prefix=@ViewData.TemplateInfo.HtmlFieldPrefix
attribute=@attributeDescriptor>
current-topic =@Model.CurrentTopic
html-field-prefix =@ViewData.TemplateInfo.HtmlFieldPrefix
attribute =@attributeDescriptor
>
</vc:tokenized-topic-list>
5 changes: 0 additions & 5 deletions OnTopic.Editor.AspNetCore/Controllers/EditorController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,6 @@ public IActionResult Move(int topicId, int targetTopicId = -1, int siblingId = -
var topic = TopicRepository.Load(topicId);
var target = (targetTopicId >= 0)? TopicRepository.Load(targetTopicId) : topic.Parent;

/*--------------------------------------------------------------------------------------------------------------------------
| Reset the source topic's Parent
\-------------------------------------------------------------------------------------------------------------------------*/
topic.Parent = target;

/*--------------------------------------------------------------------------------------------------------------------------
| Move the topic and/or reorder it with its siblings; lock the Topic repository prior to execution
\-------------------------------------------------------------------------------------------------------------------------*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ private void MapQueryResult(
topic.GetUniqueKey(),
topic.GetWebPath(),
options.EnableCheckboxes ? (options.MarkRelated ? related.Contains(topic) : true) : new bool?(),
topic.Attributes.GetValue("DisableDelete", "0").Equals("0")
topic.Attributes.GetValue("DisableDelete", "0").Equals("0"),
options.ExpandRelated && related.Any(r => r.GetUniqueKey().StartsWith(topic.GetUniqueKey(), StringComparison.Ordinal))
);

//Add topic to topic list
Expand Down
6 changes: 3 additions & 3 deletions OnTopic.Editor.AspNetCore/OnTopic.Editor.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="OnTopic" Version="4.3.0" />
<PackageReference Include="OnTopic" Version="4.4.0" />
<PackageReference Include="OnTopic.Data.Transfer" Version="1.2.0" />
<PackageReference Include="OnTopic.ViewModels" Version="4.3.0" />
<PackageReference Include="OnTopic.AspNetCore.Mvc" Version="4.3.0" />
<PackageReference Include="OnTopic.ViewModels" Version="4.4.0" />
<PackageReference Include="OnTopic.AspNetCore.Mvc" Version="4.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions OnTopic.Editor.AspNetCore/Shared/Scripts/DraggableTreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ OnTopic.DraggableTreeView = Ext.extend(Ext.tree.TreePanel, {
| Move on server
\-------------------------------------------------------------------------------------------------------------------------*/
$.ajax({
method: "POST",
url: "/OnTopic/Move",
method : "POST",
url : "/OnTopic/Move",
data: {
topicId : node.attributes.id,
targetTopicId : newParent.attributes.id,
Expand Down
18 changes: 10 additions & 8 deletions OnTopic.Editor.AspNetCore/Shared/Scripts/SelectableTreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ OnTopic.SelectableTreeView = Ext.extend(Ext.tree.TreePanel, {
\-------------------------------------------------------------------------------------------------------------------------*/
Ext.apply(this, options, OnTopic.SelectableTreeView.defaults);

/*--------------------------------------------------------------------------------------------------------------------------
| Initialize root
\-------------------------------------------------------------------------------------------------------------------------*/
this.root = new Ext.tree.AsyncTreeNode({
checked : true,
text : 'Web',
draggable : false,
leaf : false
});

/*--------------------------------------------------------------------------------------------------------------------------
| Initialize variables
\-------------------------------------------------------------------------------------------------------------------------*/
Expand Down Expand Up @@ -100,20 +110,12 @@ OnTopic.SelectableTreeView = Ext.extend(Ext.tree.TreePanel, {
| DEFAULTS
\-----------------------------------------------------------------------------------------------------------------------------*/
OnTopic.SelectableTreeView.defaults = {
id : 'relatedTree',
useArrows : true,
autoScroll : true,
animate : true,
enableDD : false,
containerScroll : true,
border : false,
baseCls : 'RelationshipsTreeView',
root : new Ext.tree.AsyncTreeNode({
checked : true,
text : 'Web',
draggable : false,
id : 'related',
leaf : false
}),
rootVisible : false
};
Loading

0 comments on commit 3b11cbe

Please sign in to comment.