Skip to content

Commit f5430f1

Browse files
committed
fix(navigation): Allow apps to hide registered navigation entries
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent a0bf541 commit f5430f1

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

lib/public/INavigationManager.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* icon?: string,
2828
* color?: string,
2929
* classes?: string,
30-
* type?: 'link'|'action'|'settings',
30+
* type?: 'link'|'action'|'settings'|'hidden',
3131
* }
3232
* @psalm-type NavigationEntryOutput = array{
3333
* id: string,
@@ -77,6 +77,19 @@ interface INavigationManager {
7777
*/
7878
public const string TYPE_GUEST = 'guest';
7979

80+
/**
81+
* Navigation entries that are hidden
82+
*
83+
* Usually an entry like this should not be registered at all, but sometimes
84+
* it can be costly to check if an entry should be shown because group
85+
* memberships and other things have to be considered. As an easy way apps
86+
* can register the closure straight away and then set the type to hidden
87+
* when the closure is resolved.
88+
*
89+
* @since 35.0.0
90+
*/
91+
public const string TYPE_HIDDEN = 'hidden';
92+
8093
/**
8194
* Creates a new navigation entry
8295
*

0 commit comments

Comments
 (0)