Commit a4a80c5 1 parent 402d531 commit a4a80c5 Copy full SHA for a4a80c5
File tree 1 file changed +25
-0
lines changed
src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { UMB_HAS_CHILDREN_ENTITY_CONTEXT } from '../context/has-children.context-token.js' ;
2
+ import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api' ;
3
+ import type {
4
+ UmbConditionConfigBase ,
5
+ UmbConditionControllerArguments ,
6
+ UmbExtensionCondition ,
7
+ } from '@umbraco-cms/backoffice/extension-api' ;
8
+ import { UmbConditionBase } from '@umbraco-cms/backoffice/extension-registry' ;
9
+
10
+ export class UmbEntityHasChildrenCondition
11
+ extends UmbConditionBase < UmbConditionConfigBase >
12
+ implements UmbExtensionCondition
13
+ {
14
+ constructor ( host : UmbControllerHost , args : UmbConditionControllerArguments < UmbConditionConfigBase > ) {
15
+ super ( host , args ) ;
16
+
17
+ this . consumeContext ( UMB_HAS_CHILDREN_ENTITY_CONTEXT , ( context ) => {
18
+ this . observe ( context . hasChildren , ( hasChildren ) => {
19
+ this . permitted = hasChildren === true ;
20
+ } ) ;
21
+ } ) ;
22
+ }
23
+ }
24
+
25
+ export { UmbEntityHasChildrenCondition as api } ;
You can’t perform that action at this time.
0 commit comments