Skip to content

Commit 3b11cbe

Browse files
committed
Merge branch 'release/4.4.0'
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)
2 parents 585dc88 + b1c7f3c commit 3b11cbe

15 files changed

Lines changed: 126 additions & 586 deletions

File tree

OnTopic.Editor.AspNetCore.Host/OnTopic.Editor.AspNetCore.Host.csproj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="OnTopic" Version="4.3.0" />
11-
<PackageReference Include="OnTopic.ViewModels" Version="4.3.0" />
12-
<PackageReference Include="OnTopic.AspNetCore.Mvc" Version="4.3.0" />
13-
<PackageReference Include="OnTopic.Data.Caching" Version="4.3.0" />
14-
<PackageReference Include="OnTopic.Data.Sql" Version="4.3.0" />
10+
<PackageReference Include="OnTopic" Version="4.4.0" />
11+
<PackageReference Include="OnTopic.ViewModels" Version="4.4.0" />
12+
<PackageReference Include="OnTopic.AspNetCore.Mvc" Version="4.4.0" />
13+
<PackageReference Include="OnTopic.Data.Caching" Version="4.4.0" />
14+
<PackageReference Include="OnTopic.Data.Sql" Version="4.4.0" />
15+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.7" />
1516
</ItemGroup>
1617

1718
<ItemGroup>

OnTopic.Editor.AspNetCore.Host/Startup.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
| Client Ignia, LLC
44
| Project Sample OnTopic Site
55
\=============================================================================================================================*/
6+
using System.IO;
67
using Microsoft.AspNetCore.Builder;
78
using Microsoft.AspNetCore.Hosting;
89
using Microsoft.AspNetCore.Http;
910
using Microsoft.AspNetCore.Mvc.Controllers;
11+
using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;
1012
using Microsoft.AspNetCore.Mvc.ViewComponents;
1113
using Microsoft.Extensions.Configuration;
1214
using Microsoft.Extensions.DependencyInjection;
15+
using Microsoft.Extensions.FileProviders;
1316
using Microsoft.Extensions.Hosting;
1417
using OnTopic.AspNetCore.Mvc;
1518
using OnTopic.Editor.AspNetCore;
@@ -74,14 +77,25 @@ public void ConfigureServices(IServiceCollection services) {
7477
/*------------------------------------------------------------------------------------------------------------------------
7578
| Configure: MVC
7679
\-----------------------------------------------------------------------------------------------------------------------*/
77-
services.AddControllersWithViews()
80+
var mvcBuilder = services.AddControllersWithViews()
7881

7982
//Add OnTopic support
8083
.AddTopicSupport()
8184

8285
//Add OnTopic editor support
8386
.AddTopicEditor();
8487

88+
/*------------------------------------------------------------------------------------------------------------------------
89+
| Configure: Runtime View Compilation
90+
\-----------------------------------------------------------------------------------------------------------------------*/
91+
if (HostingEnvironment.IsDevelopment()) {
92+
mvcBuilder.AddRazorRuntimeCompilation();
93+
services.Configure<MvcRazorRuntimeCompilationOptions>(options => {
94+
var libraryPath = Path.GetFullPath(Path.Combine(HostingEnvironment.ContentRootPath, "..", "OnTopic.Editor.AspNetCore"));
95+
options.FileProviders.Add(new PhysicalFileProvider(libraryPath));
96+
});
97+
}
98+
8599
/*------------------------------------------------------------------------------------------------------------------------
86100
| Configure: Watch Razor Class Library (RCLs) views
87101
>-------------------------------------------------------------------------------------------------------------------------

OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/Relationship/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<script type="text/javascript">
1717
Ext.onReady(function(){
1818
var tree = new OnTopic.SelectableTreeView({
19-
dataUrl : '/OnTopic/Json/@rootTopicKey?ShowRoot=@descriptor.ShowRoot&ShowAll=true&RelatedNamespace=@descriptor.Key&RelatedTopicID=@Model.CurrentTopic.Id&AttributeName=@descriptor.AttributeKey&AttributeValue=@descriptor.AttributeValue',
19+
dataUrl : '/OnTopic/Json/@rootTopicKey?ShowRoot=@descriptor.ShowRoot&ShowAll=true&RelatedNamespace=@descriptor.Key&RelatedTopicID=@Model.CurrentTopic.Id&AttributeName=@descriptor.AttributeKey&AttributeValue=@descriptor.AttributeValue&ExpandRelated=@descriptor.ExpandRelated',
2020
checkAscendants : @((descriptor.CheckAscendants is true).ToString().ToLower()),
2121
backingField : '@Html.IdFor(m => m.Value)'
2222
});

OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/TopicReference/Default.cshtml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
}
1818

1919
<vc:tokenized-topic-list
20-
current-topic=@Model.CurrentTopic
21-
html-field-prefix=@ViewData.TemplateInfo.HtmlFieldPrefix
22-
attribute=@attributeDescriptor>
20+
current-topic =@Model.CurrentTopic
21+
html-field-prefix =@ViewData.TemplateInfo.HtmlFieldPrefix
22+
attribute =@attributeDescriptor
23+
>
2324
</vc:tokenized-topic-list>

OnTopic.Editor.AspNetCore/Controllers/EditorController.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,6 @@ public IActionResult Move(int topicId, int targetTopicId = -1, int siblingId = -
491491
var topic = TopicRepository.Load(topicId);
492492
var target = (targetTopicId >= 0)? TopicRepository.Load(targetTopicId) : topic.Parent;
493493

494-
/*--------------------------------------------------------------------------------------------------------------------------
495-
| Reset the source topic's Parent
496-
\-------------------------------------------------------------------------------------------------------------------------*/
497-
topic.Parent = target;
498-
499494
/*--------------------------------------------------------------------------------------------------------------------------
500495
| Move the topic and/or reorder it with its siblings; lock the Topic repository prior to execution
501496
\-------------------------------------------------------------------------------------------------------------------------*/

OnTopic.Editor.AspNetCore/Infrastructure/TopicQueryService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ private void MapQueryResult(
100100
topic.GetUniqueKey(),
101101
topic.GetWebPath(),
102102
options.EnableCheckboxes ? (options.MarkRelated ? related.Contains(topic) : true) : new bool?(),
103-
topic.Attributes.GetValue("DisableDelete", "0").Equals("0")
103+
topic.Attributes.GetValue("DisableDelete", "0").Equals("0"),
104+
options.ExpandRelated && related.Any(r => r.GetUniqueKey().StartsWith(topic.GetUniqueKey(), StringComparison.Ordinal))
104105
);
105106

106107
//Add topic to topic list

OnTopic.Editor.AspNetCore/OnTopic.Editor.AspNetCore.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>
33-
<PackageReference Include="OnTopic" Version="4.3.0" />
33+
<PackageReference Include="OnTopic" Version="4.4.0" />
3434
<PackageReference Include="OnTopic.Data.Transfer" Version="1.2.0" />
35-
<PackageReference Include="OnTopic.ViewModels" Version="4.3.0" />
36-
<PackageReference Include="OnTopic.AspNetCore.Mvc" Version="4.3.0" />
35+
<PackageReference Include="OnTopic.ViewModels" Version="4.4.0" />
36+
<PackageReference Include="OnTopic.AspNetCore.Mvc" Version="4.4.0" />
3737
</ItemGroup>
3838

3939
<ItemGroup>

OnTopic.Editor.AspNetCore/Shared/Scripts/DraggableTreeView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ OnTopic.DraggableTreeView = Ext.extend(Ext.tree.TreePanel, {
5050
| Move on server
5151
\-------------------------------------------------------------------------------------------------------------------------*/
5252
$.ajax({
53-
method: "POST",
54-
url: "/OnTopic/Move",
53+
method : "POST",
54+
url : "/OnTopic/Move",
5555
data: {
5656
topicId : node.attributes.id,
5757
targetTopicId : newParent.attributes.id,

OnTopic.Editor.AspNetCore/Shared/Scripts/SelectableTreeView.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ OnTopic.SelectableTreeView = Ext.extend(Ext.tree.TreePanel, {
6161
\-------------------------------------------------------------------------------------------------------------------------*/
6262
Ext.apply(this, options, OnTopic.SelectableTreeView.defaults);
6363

64+
/*--------------------------------------------------------------------------------------------------------------------------
65+
| Initialize root
66+
\-------------------------------------------------------------------------------------------------------------------------*/
67+
this.root = new Ext.tree.AsyncTreeNode({
68+
checked : true,
69+
text : 'Web',
70+
draggable : false,
71+
leaf : false
72+
});
73+
6474
/*--------------------------------------------------------------------------------------------------------------------------
6575
| Initialize variables
6676
\-------------------------------------------------------------------------------------------------------------------------*/
@@ -100,20 +110,12 @@ OnTopic.SelectableTreeView = Ext.extend(Ext.tree.TreePanel, {
100110
| DEFAULTS
101111
\-----------------------------------------------------------------------------------------------------------------------------*/
102112
OnTopic.SelectableTreeView.defaults = {
103-
id : 'relatedTree',
104113
useArrows : true,
105114
autoScroll : true,
106115
animate : true,
107116
enableDD : false,
108117
containerScroll : true,
109118
border : false,
110119
baseCls : 'RelationshipsTreeView',
111-
root : new Ext.tree.AsyncTreeNode({
112-
checked : true,
113-
text : 'Web',
114-
draggable : false,
115-
id : 'related',
116-
leaf : false
117-
}),
118120
rootVisible : false
119121
};

0 commit comments

Comments
 (0)