From 890cd45677f2ae14dbe6eced093eaf38834d4ab5 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 22 Feb 2021 10:09:20 +0100 Subject: [PATCH] Fix namespace --- src/Umbraco.Core/IO/ViewHelper.cs | 2 +- .../Services/Implement/FileService.cs | 2 +- src/Umbraco.TestData/LoadTestController.cs | 12 +- .../cypress/integration/Content/content.ts | 5 +- .../integration/Settings/partialsViews.ts | 6 +- .../cypress/integration/Settings/templates.ts | 6 +- .../Repositories/TemplateRepositoryTest.cs | 6 +- .../Importing/StandardMvc-Package.xml | 166 +++++++++--------- .../Umbraco.Core/Templates/ViewHelperTests.cs | 14 +- .../Views/UmbracoViewPageTests.cs | 2 +- .../Macros/PartialViewMacroPage.cs | 2 +- .../Views/UmbracoViewPage.cs | 2 +- .../Views/Partials/blocklist/default.cshtml | 2 +- .../Partials/grid/bootstrap3-fluid.cshtml | 2 +- .../Views/Partials/grid/bootstrap3.cshtml | 2 +- .../Views/Partials/grid/editors/embed.cshtml | 3 +- .../Views/Partials/grid/editors/macro.cshtml | 2 +- 17 files changed, 117 insertions(+), 119 deletions(-) diff --git a/src/Umbraco.Core/IO/ViewHelper.cs b/src/Umbraco.Core/IO/ViewHelper.cs index 9a7016b6be..258c4a7f64 100644 --- a/src/Umbraco.Core/IO/ViewHelper.cs +++ b/src/Umbraco.Core/IO/ViewHelper.cs @@ -71,7 +71,7 @@ namespace Umbraco.Cms.Core.IO // @inherits Umbraco.Web.Mvc.UmbracoViewPage // @inherits Umbraco.Web.Mvc.UmbracoViewPage content.AppendLine("@using Umbraco.Cms.Web.Common.PublishedModels;"); - content.Append("@inherits Umbraco.Cms.Web.Common.AspNetCore.UmbracoViewPage"); + content.Append("@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage"); if (modelClassName.IsNullOrWhiteSpace() == false) { content.Append("<"); diff --git a/src/Umbraco.Infrastructure/Services/Implement/FileService.cs b/src/Umbraco.Infrastructure/Services/Implement/FileService.cs index acab6caae4..ff42a35a25 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/FileService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/FileService.cs @@ -33,7 +33,7 @@ namespace Umbraco.Core.Services.Implement private readonly GlobalSettings _globalSettings; private readonly IHostingEnvironment _hostingEnvironment; - private const string PartialViewHeader = "@inherits Umbraco.Web.Common.Views.UmbracoViewPage"; + private const string PartialViewHeader = "@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage"; private const string PartialViewMacroHeader = "@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage"; public FileService(IScopeProvider uowProvider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, diff --git a/src/Umbraco.TestData/LoadTestController.cs b/src/Umbraco.TestData/LoadTestController.cs index 6cbe31d70e..817b7a1d76 100644 --- a/src/Umbraco.TestData/LoadTestController.cs +++ b/src/Umbraco.TestData/LoadTestController.cs @@ -1,14 +1,12 @@ using System; -using System.Threading; +using System.Configuration; +using System.Diagnostics; using System.Linq; -using System.Web.Mvc; -using Umbraco.Core.Services; -using Umbraco.Core.Models; +using System.Threading; using System.Web; using System.Web.Hosting; +using System.Web.Mvc; using System.Web.Routing; -using System.Diagnostics; -using System.Configuration; using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.DependencyInjection; @@ -63,7 +61,7 @@ namespace Umbraco.TestData "; private static readonly string _containerTemplateText = @" -@inherits Umbraco.Web.Mvc.UmbracoViewPage +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage @{ Layout = null; var container = Umbraco.ContentAtRoot().OfTypes(""" + _containerAlias + @""").FirstOrDefault(); diff --git a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts index 22f1f883d0..c862708bbe 100644 --- a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts +++ b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts @@ -1,5 +1,6 @@ /// -import { DocumentTypeBuilder, ContentBuilder, AliasHelper } from 'umbraco-cypress-testhelpers'; +import {AliasHelper, ContentBuilder, DocumentTypeBuilder} from 'umbraco-cypress-testhelpers'; + context('Content', () => { beforeEach(() => { @@ -558,7 +559,7 @@ context('Content', () => { cy.saveDocumentType(pickerDocType); // Edit it the template to allow us to verify the rendered view. - cy.editTemplate(pickerDocTypeName, `@inherits Umbraco.Web.Mvc.UmbracoViewPage + cy.editTemplate(pickerDocTypeName, `@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage @using ContentModels = Umbraco.Web.PublishedModels; @{ Layout = null; diff --git a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/partialsViews.ts b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/partialsViews.ts index 068338f8fa..f664123d3b 100644 --- a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/partialsViews.ts +++ b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/partialsViews.ts @@ -1,5 +1,5 @@ /// -import { PartialViewBuilder } from "umbraco-cypress-testhelpers"; +import {PartialViewBuilder} from "umbraco-cypress-testhelpers"; context('Partial Views', () => { @@ -95,7 +95,7 @@ context('Partial Views', () => { // Build and save partial view const partialView = new PartialViewBuilder() .withName(name) - .withContent("@inherits Umbraco.Web.Mvc.UmbracoViewPage") + .withContent("@inherits UUmbraco.Cms.Web.Common.Views.UmbracoViewPage") .build(); cy.savePartialView(partialView); @@ -123,7 +123,7 @@ context('Partial Views', () => { const partialView = new PartialViewBuilder() .withName(name) - .withContent("@inherits Umbraco.Web.Mvc.UmbracoViewPage\n") + .withContent("@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage\n") .build(); cy.savePartialView(partialView); diff --git a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/templates.ts b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/templates.ts index c586384af7..3122c3ebf7 100644 --- a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/templates.ts +++ b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Settings/templates.ts @@ -1,5 +1,5 @@ /// -import { TemplateBuilder } from 'umbraco-cypress-testhelpers'; +import {TemplateBuilder} from 'umbraco-cypress-testhelpers'; context('Templates', () => { @@ -54,7 +54,7 @@ context('Templates', () => { const template = new TemplateBuilder() .withName(name) - .withContent('@inherits Umbraco.Web.Mvc.UmbracoViewPage\n') + .withContent('@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage\n') .build(); cy.saveTemplate(template); @@ -87,7 +87,7 @@ context('Templates', () => { const template = new TemplateBuilder() .withName(name) - .withContent('@inherits Umbraco.Web.Mvc.UmbracoViewPage\n') + .withContent('@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage\n') .build(); cy.saveTemplate(template); diff --git a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs index e704b82bdd..b323abf472 100644 --- a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs +++ b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Text; using Microsoft.Extensions.Logging; using NUnit.Framework; +using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Hosting; @@ -24,7 +25,6 @@ using Umbraco.Core.Persistence.Repositories.Implement; using Umbraco.Core.Scoping; using Umbraco.Core.Serialization; using Umbraco.Extensions; -using Constants = Umbraco.Cms.Core.Constants; namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repositories { @@ -95,7 +95,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos Assert.That(repository.Get("test"), Is.Not.Null); Assert.That(FileSystems.MvcViewsFileSystem.FileExists("test.cshtml"), Is.True); Assert.AreEqual( - @"@usingUmbraco.Cms.Web.Common.PublishedModels;@inheritsUmbraco.Cms.Web.Common.AspNetCore.UmbracoViewPage@{Layout=null;}".StripWhitespace(), + @"@usingUmbraco.Cms.Web.Common.PublishedModels;@inheritsUmbraco.Cms.Web.Common.Views.UmbracoViewPage@{Layout=null;}".StripWhitespace(), template.Content.StripWhitespace()); } } @@ -123,7 +123,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos Assert.That(repository.Get("test2"), Is.Not.Null); Assert.That(FileSystems.MvcViewsFileSystem.FileExists("test2.cshtml"), Is.True); Assert.AreEqual( - "@usingUmbraco.Cms.Web.Common.PublishedModels;@inherits Umbraco.Cms.Web.Common.AspNetCore.UmbracoViewPage @{ Layout = \"test.cshtml\";}".StripWhitespace(), + "@usingUmbraco.Cms.Web.Common.PublishedModels;@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage @{ Layout = \"test.cshtml\";}".StripWhitespace(), template2.Content.StripWhitespace()); } } diff --git a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/Importing/StandardMvc-Package.xml b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/Importing/StandardMvc-Package.xml index ee6f7cea4a..a4787dd570 100644 --- a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/Importing/StandardMvc-Package.xml +++ b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/Importing/StandardMvc-Package.xml @@ -189,17 +189,17 @@ http://www.creativefounds.co.uk - @@ -1099,7 +1099,7 @@ Google Maps - A map macro that you can use within Rich Text Areas Articles SW_Master -
- + @Html.Raw(Model.Content.GetPropertyValue("bodyText")) - +
    @foreach (var item in nodes.Skip((page - 1) * pageSize).Take(pageSize)) { @@ -1172,9 +1172,9 @@ Google Maps - A map macro that you can use within Rich Text Areas

    @item.GetPropertyValue("articleSummary") - +

    - + }
@@ -1185,7 +1185,7 @@ Google Maps - A map macro that you can use within Rich Text Areas @for (int p = 1; p < totalPages + 1; p++) { //string selected = (p == page) ? "selected" : String.Empty; - //
  • @p
  • + //
  • @p
  • @p if (p < totalPages) { @@ -1197,7 +1197,7 @@ Google Maps - A map macro that you can use within Rich Text Areas
    - + @Html.Partial("ContentPanels",@Model.Content) ]]>
    @@ -1207,13 +1207,13 @@ Google Maps - A map macro that you can use within Rich Text Areas ClientAreas SW_Master - x.IsVisible() && x.TemplateId > 0 && Umbraco.MemberHasAccess(x.Id, x.Path)); }
    - + - - + +
    ]]>
    @@ -1243,7 +1243,7 @@ Google Maps - A map macro that you can use within Rich Text Areas Layout = "SW_Master.cshtml"; }
    - + ]]> @@ -1266,9 +1266,9 @@ Google Maps - A map macro that you can use within Rich Text Areas @{ Layout = "SW_Master.cshtml"; } - +
    -
      +
        @{ var nodeIds = Model.Content.GetPropertyValue("slideshow").ToString().Split(','); List slides = new List(); @@ -1313,7 +1313,7 @@ Google Maps - A map macro that you can use within Rich Text Areas
    - +
    @Html.Raw(Model.Content.GetPropertyValue("panelContent1").ToString()) @@ -1345,7 +1345,7 @@ Google Maps - A map macro that you can use within Rich Text Areas } }
    - + ]]> @@ -1420,13 +1420,13 @@ Google Maps - A map macro that you can use within Rich Text Areas page = 1; } } - + }
    @@ -1470,14 +1470,14 @@ Google Maps - A map macro that you can use within Rich Text Areas

    @Html.Raw(searchHiglight)

    - + } } @@ -1489,7 +1489,7 @@ Google Maps - A map macro that you can use within Rich Text Areas @for (int p = 1; p < totalPages + 1; p++) { //string selected = (p == page) ? "selected" : String.Empty; - //
  • @p
  • + //
  • @p
  • @p if (p < totalPages) { @@ -1514,7 +1514,7 @@ Google Maps - A map macro that you can use within Rich Text Areas Layout = "SW_Master.cshtml"; }
    - + @helper traverse(IPublishedContent node) { - var cc = node.Children.Where(x=>x.IsVisible() && x.TemplateId > 0); + var cc = node.Children.Where(x=>x.IsVisible() && x.TemplateId > 0); if (cc.Count()>0) {
      @@ -1560,7 +1560,7 @@ Google Maps - A map macro that you can use within Rich Text Areas Layout = "SW_Master.cshtml"; }
      - + ]]> @@ -1590,27 +1590,27 @@ Google Maps - A map macro that you can use within Rich Text Areas @Model.Content.GetPropertyValue("title") - - + + - + - +