-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto add Admin prefix only for Admin nodes. #13944
Conversation
src/OrchardCore/OrchardCore.Navigation.Core/NavigationManager.cs
Outdated
Show resolved
Hide resolved
@hishamco NavigationManager is used elsewhere than just the admin UI. I use it to build frontend dynamic menus. |
We do that too with Lombiq Base Theme. |
Did I ask a question or write a comment about this? |
You just did ask a question 😄 |
I was OFF for a week, I was surprised when you mentioned me while I didn't ask a question or write a comment, maybe I asked somewhere else |
@@ -25,7 +25,7 @@ public class ListsAdminNodeNavigationBuilder : IAdminNodeNavigationBuilder | |||
private ListsAdminNode _node; | |||
private ContentTypeDefinition _contentType; | |||
|
|||
private const int MaxItemsInNode = 100; // security check | |||
private const int _maxItemsInNode = 100; // security check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine for constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree, but Visual Studio shows a warning, because of the new rule we have on private fields (leading underscore required) in the editor config, maybe there is a way to exclude private const
from this rule. Note: We also have warnings on private localizer fields as S
and H
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I reverted the renaming of this const
I suggested here #13953 to ignore the underscore rule for private const.
Fixes #13943
We recently updated the
NavigationManager
so that admin menu items are auto prefixed by theAdminUrlPrefix
option if not yet done, but as stated by @Piedone #12807 (comment), currently the auto admin prefixing should only be done for menu items built by theLinkAdminNodeNavigationBuilder
.This to not break people using the
NavigationManager
with other menu nodes but not for admin menus.