Skip to content

Commit 710cf32

Browse files
committed
update create path
1 parent f755943 commit 710cf32

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

src/packages/dictionary/entity-action/create/create.action.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action';
22
import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action';
33
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
4+
import { UMB_CREATE_DICTIONARY_WORKSPACE_PATH_PATTERN } from '../../workspace/paths';
45

56
export class UmbCreateDictionaryEntityAction extends UmbEntityActionBase<never> {
6-
constructor(host: UmbControllerHost, args: UmbEntityActionArgs<never>) {
7-
super(host, args);
8-
}
9-
107
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);
1614
}
1715
}
1816

src/packages/translation/menu/manifests.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { UMB_TRANSLATION_SECTION_ALIAS } from '../section/index.js';
12
import { UMB_TRANSLATION_MENU_ALIAS } from './constants.js';
23

34
export const manifests: Array<UmbExtensionManifest> = [
@@ -6,4 +7,22 @@ export const manifests: Array<UmbExtensionManifest> = [
67
alias: UMB_TRANSLATION_MENU_ALIAS,
78
name: 'Translation Menu',
89
},
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+
},
928
];

0 commit comments

Comments
 (0)