Changes namespace of UmbracoViewPage

This commit is contained in:
Shannon
2021-02-12 17:23:14 +11:00
parent af42af7425
commit 996c2b4277
12 changed files with 24 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using System.Text;
@@ -70,7 +70,7 @@ namespace Umbraco.Core.IO
// @inherits Umbraco.Web.Mvc.UmbracoViewPage
// @inherits Umbraco.Web.Mvc.UmbracoViewPage<ModelClass>
content.AppendLine("@using Umbraco.Web.PublishedModels;");
content.Append("@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage");
content.Append("@inherits Umbraco.Web.Common.Views.UmbracoViewPage");
if (modelClassName.IsNullOrWhiteSpace() == false)
{
content.Append("<");

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -34,7 +34,7 @@ namespace Umbraco.Core.Services.Implement
private readonly GlobalSettings _globalSettings;
private readonly IHostingEnvironment _hostingEnvironment;
private const string PartialViewHeader = "@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage";
private const string PartialViewHeader = "@inherits Umbraco.Web.Common.Views.UmbracoViewPage";
private const string PartialViewMacroHeader = "@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage";
public FileService(IScopeProvider uowProvider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory,

View File

@@ -122,7 +122,7 @@ namespace Umbraco.Tests.Integration.Umbraco.Infrastructure.Persistence.Repositor
Assert.That(repository.Get("test2"), Is.Not.Null);
Assert.That(FileSystems.MvcViewsFileSystem.FileExists("test2.cshtml"), Is.True);
Assert.AreEqual(
"@usingUmbraco.Web.PublishedModels;@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage @{ Layout = \"test.cshtml\";}".StripWhitespace(),
"@usingUmbraco.Web.PublishedModels;@inherits Umbraco.Web.Common.Views.UmbracoViewPage @{ Layout = \"test.cshtml\";}".StripWhitespace(),
template2.Content.StripWhitespace());
}
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) Umbraco.
// Copyright (c) Umbraco.
// See LICENSE for more details.
using NUnit.Framework;
@@ -15,7 +15,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Templates
var view = ViewHelper.GetDefaultFileContent();
Assert.AreEqual(
FixView(@"@using Umbraco.Web.PublishedModels;
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage
@inherits Umbraco.Web.Common.Views.UmbracoViewPage
@{
Layout = null;
}"), FixView(view));
@@ -27,7 +27,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Templates
var view = ViewHelper.GetDefaultFileContent(layoutPageAlias: "Dharznoik");
Assert.AreEqual(
FixView(@"@using Umbraco.Web.PublishedModels;
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage
@inherits Umbraco.Web.Common.Views.UmbracoViewPage
@{
Layout = ""Dharznoik.cshtml"";
}"), FixView(view));
@@ -39,7 +39,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Templates
var view = ViewHelper.GetDefaultFileContent(modelClassName: "ClassName");
Assert.AreEqual(
FixView(@"@using Umbraco.Web.PublishedModels;
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage<ClassName>
@inherits Umbraco.Web.Common.Views.UmbracoViewPage<ClassName>
@{
Layout = null;
}"), FixView(view));
@@ -51,7 +51,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Templates
var view = ViewHelper.GetDefaultFileContent(modelNamespace: "Models");
Assert.AreEqual(
FixView(@"@using Umbraco.Web.PublishedModels;
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage
@inherits Umbraco.Web.Common.Views.UmbracoViewPage
@{
Layout = null;
}"), FixView(view));
@@ -63,7 +63,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Templates
var view = ViewHelper.GetDefaultFileContent(modelClassName: "ClassName", modelNamespace: "My.Models");
Assert.AreEqual(
FixView(@"@using Umbraco.Web.PublishedModels;
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage<ContentModels.ClassName>
@inherits Umbraco.Web.Common.Views.UmbracoViewPage<ContentModels.ClassName>
@using ContentModels = My.Models;
@{
Layout = null;
@@ -76,7 +76,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Templates
var view = ViewHelper.GetDefaultFileContent(modelClassName: "ClassName", modelNamespace: "My.Models", modelNamespaceAlias: "MyModels");
Assert.AreEqual(
FixView(@"@using Umbraco.Web.PublishedModels;
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage<MyModels.ClassName>
@inherits Umbraco.Web.Common.Views.UmbracoViewPage<MyModels.ClassName>
@using MyModels = My.Models;
@{
Layout = null;
@@ -89,7 +89,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Templates
var view = ViewHelper.GetDefaultFileContent(layoutPageAlias: "Dharznoik", modelClassName: "ClassName", modelNamespace: "My.Models", modelNamespaceAlias: "MyModels");
Assert.AreEqual(
FixView(@"@using Umbraco.Web.PublishedModels;
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage<MyModels.ClassName>
@inherits Umbraco.Web.Common.Views.UmbracoViewPage<MyModels.ClassName>
@using MyModels = My.Models;
@{
Layout = ""Dharznoik.cshtml"";

View File

@@ -10,8 +10,8 @@ using Moq;
using NUnit.Framework;
using Umbraco.Core.Events;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web.Common.AspNetCore;
using Umbraco.Web.Common.ModelBinders;
using Umbraco.Web.Common.Views;
using Umbraco.Web.Models;
namespace Umbraco.Tests.UnitTests.Umbraco.Web.Common.Views

View File

@@ -1,4 +1,4 @@
using Umbraco.Web.Common.AspNetCore;
using Umbraco.Web.Common.Views;
using Umbraco.Web.Models;
namespace Umbraco.Web.Common.Macros

View File

@@ -19,10 +19,8 @@ using Umbraco.Web.Common.ModelBinders;
using Umbraco.Web.Models;
using Umbraco.Web.Website;
namespace Umbraco.Web.Common.AspNetCore
namespace Umbraco.Web.Common.Views
{
// TODO: Should be in Views namespace?
public abstract class UmbracoViewPage : UmbracoViewPage<IPublishedContent>
{

View File

@@ -1,4 +1,4 @@
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage<Umbraco.Core.Models.Blocks.BlockListModel>
@inherits Umbraco.Web.Common.Views.UmbracoViewPage<Umbraco.Core.Models.Blocks.BlockListModel>
@{
if (!Model.Any()) { return; }
}

View File

@@ -1,7 +1,7 @@
@using System.Web
@using System.Web
@using Microsoft.AspNetCore.Html
@using Newtonsoft.Json.Linq
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage<dynamic>
@inherits Umbraco.Web.Common.Views.UmbracoViewPage<dynamic>
@*
Razor helpers located at the bottom of this file

View File

@@ -1,7 +1,7 @@
@using System.Web
@using System.Web
@using Microsoft.AspNetCore.Html
@using Newtonsoft.Json.Linq
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage<dynamic>
@inherits Umbraco.Web.Common.Views.UmbracoViewPage<dynamic>
@if (Model != null && Model.sections != null)
{

View File

@@ -1,5 +1,5 @@
@using Umbraco.Core
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage<dynamic>
@ using Umbraco.Core
@inherits UmbracoViewPage<dynamic>
@{
string embedValue = Convert.ToString(Model.value);

View File

@@ -1,4 +1,4 @@
@inherits Umbraco.Web.Common.AspNetCore.UmbracoViewPage<dynamic>
@inherits UmbracoViewPage<dynamic>
@if (Model.value != null)
{