File tree Expand file tree Collapse file tree 8 files changed +40
-42
lines changed
extension-registry/conditions Expand file tree Collapse file tree 8 files changed +40
-42
lines changed Original file line number Diff line number Diff line change 1
1
import type { ManifestTypes } from '../models/index.js' ;
2
- import { manifest as sectionAliasConditionManifest } from './section-alias.condition.js' ;
2
+
3
3
import { manifest as switchConditionManifest } from './switch.condition.js' ;
4
4
5
- export const manifests : Array < ManifestTypes > = [ sectionAliasConditionManifest , switchConditionManifest ] ;
5
+ export const manifests : Array < ManifestTypes > = [ switchConditionManifest ] ;
Original file line number Diff line number Diff line change 1
1
import type { CollectionAliasConditionConfig } from '../../collection/collection-alias.manifest.js' ;
2
2
import type { CollectionBulkActionPermissionConditionConfig } from '../../collection/collection-bulk-action-permission.manifest.js' ;
3
- import type { SectionAliasConditionConfig } from './section-alias.condition.js' ;
4
3
import type { SwitchConditionConfig } from './switch.condition.js' ;
5
4
import type { UmbConditionConfigBase } from '@umbraco-cms/backoffice/extension-api' ;
6
5
7
6
export type ConditionTypes =
8
7
| CollectionAliasConditionConfig
9
8
| CollectionBulkActionPermissionConditionConfig
10
- | SectionAliasConditionConfig
11
9
| SwitchConditionConfig
12
10
| UmbConditionConfigBase ;
13
11
Original file line number Diff line number Diff line change 1
- export * from './section-user-permission.condition .js' ;
1
+ export type * from './types .js' ;
Original file line number Diff line number Diff line change
1
+ import { UmbSectionAliasCondition } from './section-alias.condition.js' ;
2
+ import { UmbSectionUserPermissionCondition } from './section-user-permission.condition.js' ;
3
+
4
+ export const manifests : Array < UmbExtensionManifest > = [
5
+ {
6
+ type : 'condition' ,
7
+ name : 'Section User Permission Condition' ,
8
+ alias : 'Umb.Condition.SectionUserPermission' ,
9
+ api : UmbSectionUserPermissionCondition ,
10
+ } ,
11
+ {
12
+ type : 'condition' ,
13
+ name : 'Section Alias Condition' ,
14
+ alias : 'Umb.Condition.SectionAlias' ,
15
+ api : UmbSectionAliasCondition ,
16
+ } ,
17
+ ] ;
Original file line number Diff line number Diff line change 1
- import { UmbConditionBase } from './condition-base.controller.js' ;
1
+ import { UmbConditionBase } from '../../extension-registry/conditions/condition-base.controller.js' ;
2
+ import type { SectionAliasConditionConfig } from './types.js' ;
2
3
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api' ;
3
- import type {
4
- ManifestCondition ,
5
- UmbConditionConfigBase ,
6
- UmbConditionControllerArguments ,
7
- UmbExtensionCondition ,
8
- } from '@umbraco-cms/backoffice/extension-api' ;
4
+ import type { UmbConditionControllerArguments , UmbExtensionCondition } from '@umbraco-cms/backoffice/extension-api' ;
9
5
import { UMB_SECTION_CONTEXT } from '@umbraco-cms/backoffice/section' ;
10
6
11
7
export class UmbSectionAliasCondition
@@ -35,24 +31,3 @@ export class UmbSectionAliasCondition
35
31
}
36
32
}
37
33
}
38
-
39
- export type SectionAliasConditionConfig = UmbConditionConfigBase < 'Umb.Condition.SectionAlias' > & {
40
- /**
41
- * Define the section that this extension should be available in
42
- * @example "Umb.Section.Content"
43
- */
44
- match : string ;
45
- /**
46
- * Define one or more workspaces that this extension should be available in
47
- * @example
48
- * ["Umb.Section.Content", "Umb.Section.Media"]
49
- */
50
- oneOf ?: Array < string > ;
51
- } ;
52
-
53
- export const manifest : ManifestCondition = {
54
- type : 'condition' ,
55
- name : 'Section Alias Condition' ,
56
- alias : 'Umb.Condition.SectionAlias' ,
57
- api : UmbSectionAliasCondition ,
58
- } ;
Original file line number Diff line number Diff line change @@ -27,10 +27,3 @@ export class UmbSectionUserPermissionCondition extends UmbControllerBase impleme
27
27
} ) ;
28
28
}
29
29
}
30
-
31
- export const manifest = {
32
- type : 'condition' ,
33
- name : 'Section User Permission Condition' ,
34
- alias : 'Umb.Condition.SectionUserPermission' ,
35
- api : UmbSectionUserPermissionCondition ,
36
- } ;
Original file line number Diff line number Diff line change @@ -10,8 +10,23 @@ export type UmbSectionUserPermissionConditionConfig = UmbConditionConfigBase<'Um
10
10
match : string ;
11
11
} ;
12
12
13
+ export type SectionAliasConditionConfig = UmbConditionConfigBase < 'Umb.Condition.SectionAlias' > & {
14
+ /**
15
+ * Define the section that this extension should be available in
16
+ * @example "Umb.Section.Content"
17
+ */
18
+ match : string ;
19
+ /**
20
+ * Define one or more workspaces that this extension should be available in
21
+ * @example
22
+ * ["Umb.Section.Content", "Umb.Section.Media"]
23
+ */
24
+ oneOf ?: Array < string > ;
25
+ } ;
26
+
13
27
declare global {
14
28
interface UmbExtensionConditionMap {
15
29
UmbSectionUserPermissionConditionConfig : UmbSectionUserPermissionConditionConfig ;
30
+ UmbSectionAliasConditionConfig : SectionAliasConditionConfig ;
16
31
}
17
32
}
Original file line number Diff line number Diff line change 1
- import { manifest as sectionUserPermissionConditionManifest } from './conditions/section-user-permission.condition .js' ;
1
+ import { manifests as sectionUserPermissionConditionManifests } from './conditions/manifests .js' ;
2
2
import { manifests as repositoryManifests } from './repository/manifests.js' ;
3
3
4
4
export const manifests : Array < UmbExtensionManifest > = [
@@ -8,6 +8,6 @@ export const manifests: Array<UmbExtensionManifest> = [
8
8
name : 'Section Picker Modal' ,
9
9
element : ( ) => import ( './section-picker-modal/section-picker-modal.element.js' ) ,
10
10
} ,
11
- sectionUserPermissionConditionManifest ,
11
+ ... sectionUserPermissionConditionManifests ,
12
12
...repositoryManifests ,
13
13
] ;
You can’t perform that action at this time.
0 commit comments