File tree Expand file tree Collapse file tree 2 files changed +26
-9
lines changed
dictionary/entity-action/create Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Original file line number Diff line number Diff line change 1
1
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action' ;
2
2
import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action' ;
3
3
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api' ;
4
+ import { UMB_CREATE_DICTIONARY_WORKSPACE_PATH_PATTERN } from '../../workspace/paths' ;
4
5
5
6
export class UmbCreateDictionaryEntityAction extends UmbEntityActionBase < never > {
6
- constructor ( host : UmbControllerHost , args : UmbEntityActionArgs < never > ) {
7
- super ( host , args ) ;
8
- }
9
-
10
7
override async execute ( ) {
11
- history . pushState (
12
- { } ,
13
- '' ,
14
- `/section/dictionary/workspace/dictionary/create/parent/${ this . args . entityType } /${ this . args . unique ?? 'null' } ` ,
15
- ) ;
8
+ const createPath = UMB_CREATE_DICTIONARY_WORKSPACE_PATH_PATTERN . generateAbsolute ( {
9
+ parentEntityType : this . args . entityType ,
10
+ parentUnique : this . args . unique ?? 'null' ,
11
+ } ) ;
12
+
13
+ history . pushState ( { } , '' , createPath ) ;
16
14
}
17
15
}
18
16
Original file line number Diff line number Diff line change
1
+ import { UMB_TRANSLATION_SECTION_ALIAS } from '../section/index.js' ;
1
2
import { UMB_TRANSLATION_MENU_ALIAS } from './constants.js' ;
2
3
3
4
export const manifests : Array < UmbExtensionManifest > = [
@@ -6,4 +7,22 @@ export const manifests: Array<UmbExtensionManifest> = [
6
7
alias : UMB_TRANSLATION_MENU_ALIAS ,
7
8
name : 'Translation Menu' ,
8
9
} ,
10
+ {
11
+ type : 'sectionSidebarApp' ,
12
+ kind : 'menuWithEntityActions' ,
13
+ alias : 'Umb.SidebarMenu.Translation' ,
14
+ name : 'Translation Sidebar Menu' ,
15
+ weight : 100 ,
16
+ meta : {
17
+ label : '#sections_translation' ,
18
+ menu : UMB_TRANSLATION_MENU_ALIAS ,
19
+ entityType : 'dictionary-root' , // hard-coded on purpose to avoid circular dependency. We need another way to add actions to a menu kind.
20
+ } ,
21
+ conditions : [
22
+ {
23
+ alias : 'Umb.Condition.SectionAlias' ,
24
+ match : UMB_TRANSLATION_SECTION_ALIAS ,
25
+ } ,
26
+ ] ,
27
+ } ,
9
28
] ;
You can’t perform that action at this time.
0 commit comments