Skip to content

Commit 6277039

Browse files
authored
Merge pull request #1862 from umbraco/bugfix/document-blueprint-entity-actions
Bugfix/document blueprint entity actions
2 parents 5963240 + d2a03dc commit 6277039

File tree

6 files changed

+25
-11
lines changed

6 files changed

+25
-11
lines changed

src/packages/documents/document-blueprints/entity-actions/create/create.action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class UmbCreateEntityAction extends UmbEntityActionBase<never> {
2626
const documentTypeUnique = modalContext.getValue().documentTypeUnique;
2727
if (!documentTypeUnique) return;
2828

29-
const url = `section/settings/workspace/${UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE}/create/parent/${UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE}/${this.args.unique ?? 'null'}/${documentTypeUnique}`;
29+
const url = `section/settings/workspace/${UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE}/create/parent/${this.args.entityType}/${this.args.unique ?? 'null'}/${documentTypeUnique}`;
3030
history.pushState(null, '', url);
3131
}
3232
}

src/packages/documents/document-blueprints/entity-actions/create/manifests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE } from '../../entity.js';
1+
import { UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE } from '../../entity.js';
22
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
33

44
const entityActions: Array<ManifestTypes> = [
@@ -9,7 +9,7 @@ const entityActions: Array<ManifestTypes> = [
99
name: 'Document Blueprint Options Create Entity Action',
1010
weight: 1200,
1111
api: () => import('./create.action.js'),
12-
forEntityTypes: [UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE],
12+
forEntityTypes: [UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE],
1313
meta: {
1414
icon: 'icon-add',
1515
label: '#actions_createblueprint',

src/packages/documents/document-blueprints/tree/document-blueprint-tree.repository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE } from '../entity.js';
1+
import { UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE } from '../entity.js';
22
import { UmbDocumentBlueprintTreeServerDataSource } from './document-blueprint-tree.server.data-source.js';
33
import { UMB_DOCUMENT_BLUEPRINT_TREE_STORE_CONTEXT } from './document-blueprint-tree.store.js';
44
import type { UmbDocumentBlueprintTreeItemModel, UmbDocumentBlueprintTreeRootModel } from './types.js';
@@ -20,7 +20,7 @@ export class UmbDocumentBlueprintTreeRepository
2020

2121
const data: UmbDocumentBlueprintTreeRootModel = {
2222
unique: null,
23-
entityType: UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE,
23+
entityType: UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE,
2424
name: 'Document Blueprints',
2525
hasChildren,
2626
isFolder: true,

src/packages/documents/document-blueprints/tree/manifests.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE } from '../entity.js';
1+
import {
2+
UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE,
3+
UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE,
4+
UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE,
5+
} from '../entity.js';
26
import {
37
UMB_DOCUMENT_BLUEPRINT_TREE_ALIAS,
48
UMB_DOCUMENT_BLUEPRINT_TREE_REPOSITORY_ALIAS,
@@ -45,7 +49,11 @@ const treeItem: ManifestTreeItem = {
4549
kind: 'default',
4650
alias: 'Umb.TreeItem.DocumentBlueprint',
4751
name: 'Document Blueprint Tree Item',
48-
forEntityTypes: [UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE],
52+
forEntityTypes: [
53+
UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE,
54+
UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE,
55+
UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE,
56+
],
4957
};
5058

5159
export const manifests: Array<ManifestTypes> = [
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE } from '../../entity.js';
1+
import { UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE } from '../../entity.js';
22
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
33

44
export const manifests: Array<ManifestTypes> = [
@@ -7,7 +7,7 @@ export const manifests: Array<ManifestTypes> = [
77
kind: 'reloadTreeItemChildren',
88
alias: 'Umb.EntityAction.DocumentBlueprint.Tree.ReloadChildrenOf',
99
name: 'Reload Document Blueprint Tree Item Children Entity Action',
10-
forEntityTypes: [UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE],
10+
forEntityTypes: [UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE, UMB_DOCUMENT_BLUEPRINT_FOLDER_ENTITY_TYPE],
1111
meta: {},
1212
},
1313
];

src/packages/documents/document-blueprints/tree/types.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
import type { UmbDocumentBlueprintEntityType, UmbDocumentBlueprintFolderEntityType } from '../entity.js';
1+
import type {
2+
UmbDocumentBlueprintEntityType,
3+
UmbDocumentBlueprintFolderEntityType,
4+
UmbDocumentBlueprintRootEntityType,
5+
} from '../entity.js';
26
import type { UmbTreeItemModel, UmbTreeRootModel } from '@umbraco-cms/backoffice/tree';
37

4-
export interface UmbDocumentBlueprintTreeRootModel extends UmbTreeRootModel {}
8+
export interface UmbDocumentBlueprintTreeRootModel extends UmbTreeRootModel {
9+
entityType: UmbDocumentBlueprintRootEntityType;
10+
}
511

612
export interface UmbDocumentBlueprintTreeItemModel extends UmbTreeItemModel {
713
entityType: UmbDocumentBlueprintEntityType | UmbDocumentBlueprintFolderEntityType;

0 commit comments

Comments
 (0)