Skip to content

Commit

Permalink
Add tree group to constants (#226)
Browse files Browse the repository at this point in the history
* Add SeoToolkitTreeGroupAlias to constants class

* Use the TreeGroup alias constant
  • Loading branch information
erikjanwestendorp authored Sep 13, 2023
1 parent 1bd3129 commit 2b597e5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
public class TreeControllerConstants
{
public const string SeoToolkitTreeControllerAlias = "SiteAudit";
public const string SeoToolkitTreeGroupAlias = "SeoToolkit";
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SeoToolkit.Umbraco.Common.Core.Constants;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Services;
Expand All @@ -9,9 +10,11 @@
namespace SeoToolkit.Umbraco.Common.Core.Controllers
{
//This controller is only here to prevent single node trees if you only download one package
[Tree("SeoToolkit", "info", TreeTitle = "Info", TreeGroup = "SeoToolkit", SortOrder = 99)]
[Tree("SeoToolkit", "info", TreeTitle = "Info", TreeGroup = TreeGroupAlias, SortOrder = 99)]
public class InfoTreeController : TreeController
{
public const string TreeGroupAlias = TreeControllerConstants.SeoToolkitTreeGroupAlias;

public InfoTreeController(ILocalizedTextService localizedTextService, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, IEventAggregator eventAggregator) : base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator)
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SeoToolkit.Umbraco.Common.Core.Constants;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Services;
Expand All @@ -9,10 +10,12 @@

namespace SeoToolkit.Umbraco.Redirects.Core.Controllers
{
[Tree("SeoToolkit", "Redirects", TreeTitle = "Redirects", TreeGroup = "SeoToolkit", SortOrder = 4)]
[Tree("SeoToolkit", "Redirects", TreeTitle = "Redirects", TreeGroup = TreeGroupAlias, SortOrder = 4)]
[PluginController("SeoToolkit")]
public class RedirectsTreeController : TreeController
{
public const string TreeGroupAlias = TreeControllerConstants.SeoToolkitTreeGroupAlias;

public RedirectsTreeController(ILocalizedTextService localizedTextService, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, IEventAggregator eventAggregator) : base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator)
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SeoToolkit.Umbraco.Common.Core.Constants;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Services;
Expand All @@ -9,10 +10,12 @@

namespace SeoToolkit.Umbraco.RobotsTxt.Core.Controllers
{
[Tree("SeoToolkit", "RobotsTxt", TreeTitle = "Robots.txt", TreeGroup = "SeoToolkit", SortOrder = 3)]
[Tree("SeoToolkit", "RobotsTxt", TreeTitle = "Robots.txt", TreeGroup = TreeGroupAlias, SortOrder = 3)]
[PluginController("SeoToolkit")]
public class RobotsTxtTreeController : TreeController
{
public const string TreeGroupAlias = TreeControllerConstants.SeoToolkitTreeGroupAlias;

public RobotsTxtTreeController(
ILocalizedTextService localizedTextService,
UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NUglify.JavaScript.Syntax;
using SeoToolkit.Umbraco.Common.Core.Constants;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Actions;
using Umbraco.Cms.Core.Events;
Expand All @@ -12,10 +13,12 @@

namespace SeoToolkit.Umbraco.ScriptManager.Core.Controllers
{
[Tree("SeoToolkit", "ScriptManager", TreeTitle = "Script Manager", TreeGroup = "SeoToolkit", SortOrder = 2)]
[Tree("SeoToolkit", "ScriptManager", TreeTitle = "Script Manager", TreeGroup = TreeGroupAlias, SortOrder = 2)]
[PluginController("SeoToolkit")]
public class ScriptManagerTreeController : TreeController
{
public const string TreeGroupAlias = TreeControllerConstants.SeoToolkitTreeGroupAlias;

private readonly IMenuItemCollectionFactory _menuItemCollectionFactory;

public ScriptManagerTreeController(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SeoToolkit.Umbraco.Common.Core.Constants;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Actions;
using Umbraco.Cms.Core.Events;
Expand All @@ -12,10 +13,12 @@

namespace SeoToolkit.Umbraco.SiteAudit.Core.Controllers
{
[Tree("SeoToolkit", "SiteAudit", TreeTitle = "Site Audits", TreeGroup = "SeoToolkit", SortOrder = 1)]
[Tree("SeoToolkit", "SiteAudit", TreeTitle = "Site Audits", TreeGroup = TreeGroupAlias, SortOrder = 1)]
[PluginController("SeoToolkit")]
public class SeoToolkitTreeController : TreeController
{
public const string TreeGroupAlias = TreeControllerConstants.SeoToolkitTreeGroupAlias;

private readonly IMenuItemCollectionFactory _menuItemCollectionFactory;

public SeoToolkitTreeController(ILocalizedTextService localizedTextService,
Expand Down

0 comments on commit 2b597e5

Please sign in to comment.