Skip to content

Commit

Permalink
Use constants in TreeControllers (#231)
Browse files Browse the repository at this point in the history
* Use contants in SiteAuditTreeController

* Use constants in ScriptManagerTreeController

* Use constants in RobotsTxtTreeController

* Use constants in RedirectsTreeController

* Sort
  • Loading branch information
erikjanwestendorp authored Sep 19, 2023
1 parent 2b597e5 commit 8ee64df
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,29 @@ public class TreeControllerConstants
{
public const string SeoToolkitTreeControllerAlias = "SiteAudit";
public const string SeoToolkitTreeGroupAlias = "SeoToolkit";

public static class Redirects
{
public const string Alias = "Redirects";
public const string Title = "Redirects";
}

public static class RobotsTxt
{
public const string Alias = "RobotsTxt";
public const string Title = "Robots.txt";
}

public static class ScriptManager
{
public const string Alias = "ScriptManager";
public const string Title = "Script Manager";
}

public static class SiteAudit
{
public const string Alias = "SiteAudit";
public const string Title = "Site Audits";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@

namespace SeoToolkit.Umbraco.Redirects.Core.Controllers
{
[Tree("SeoToolkit", "Redirects", TreeTitle = "Redirects", TreeGroup = TreeGroupAlias, SortOrder = 4)]
[Tree("SeoToolkit", Alias, TreeTitle = Title, TreeGroup = TreeGroupAlias, SortOrder = 4)]
[PluginController("SeoToolkit")]
public class RedirectsTreeController : TreeController
{
public const string Alias = TreeControllerConstants.Redirects.Alias;
public const string Title = TreeControllerConstants.Redirects.Title;
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
Expand Up @@ -10,10 +10,12 @@

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

public RobotsTxtTreeController(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@

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

private readonly IMenuItemCollectionFactory _menuItemCollectionFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@

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

private readonly IMenuItemCollectionFactory _menuItemCollectionFactory;
Expand Down

0 comments on commit 8ee64df

Please sign in to comment.