diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/data-type/tree/folder/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/data-type/tree/folder/manifests.ts index 65d6454e00..06426f03fe 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/data-type/tree/folder/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/data-type/tree/folder/manifests.ts @@ -13,24 +13,11 @@ const folderRepository: ManifestRepository = { }; const entityActions: Array = [ - { - type: 'entityAction', - alias: 'Umb.EntityAction.DataType.DeleteFolder', - name: 'Delete Data Type Folder Entity Action', - weight: 800, - api: UmbDeleteFolderEntityAction, - meta: { - icon: 'icon-trash', - label: 'Delete Folder...', - repositoryAlias: UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS, - entityTypes: [UMB_DATA_TYPE_FOLDER_ENTITY_TYPE], - }, - }, { type: 'entityAction', alias: 'Umb.EntityAction.DataType.RenameFolder', name: 'Rename Data Type Folder Entity Action', - weight: 700, + weight: 800, api: UmbFolderUpdateEntityAction, meta: { icon: 'icon-edit', @@ -39,6 +26,19 @@ const entityActions: Array = [ entityTypes: [UMB_DATA_TYPE_FOLDER_ENTITY_TYPE], }, }, + { + type: 'entityAction', + alias: 'Umb.EntityAction.DataType.DeleteFolder', + name: 'Delete Data Type Folder Entity Action', + weight: 700, + api: UmbDeleteFolderEntityAction, + meta: { + icon: 'icon-trash', + label: 'Delete Folder...', + repositoryAlias: UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS, + entityTypes: [UMB_DATA_TYPE_FOLDER_ENTITY_TYPE], + }, + }, ]; export const manifests = [folderRepository, ...entityActions]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/entity-actions/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/entity-actions/manifests.ts index 0173032ee9..c797c718e9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/entity-actions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/entity-actions/manifests.ts @@ -1,5 +1,5 @@ import { UMB_DICTIONARY_REPOSITORY_ALIAS } from '../repository/manifests.js'; -import { UMB_DICTIONARY_ENTITY_TYPE } from '../entities.js'; +import { UMB_DICTIONARY_ENTITY_TYPE, UMB_DICTIONARY_ROOT_ENTITY_TYPE } from '../entities.js'; import UmbReloadDictionaryEntityAction from './reload.action.js'; import UmbImportDictionaryEntityAction from './import/import.action.js'; import UmbExportDictionaryEntityAction from './export/export.action.js'; @@ -18,7 +18,7 @@ const entityActions: Array = [ icon: 'icon-add', label: 'Create', repositoryAlias: UMB_DICTIONARY_REPOSITORY_ALIAS, - entityTypes: [UMB_DICTIONARY_ENTITY_TYPE], + entityTypes: [UMB_DICTIONARY_ENTITY_TYPE, UMB_DICTIONARY_ROOT_ENTITY_TYPE], }, }, { @@ -57,7 +57,7 @@ const entityActions: Array = [ icon: 'icon-page-up', label: 'Import', repositoryAlias: UMB_DICTIONARY_REPOSITORY_ALIAS, - entityTypes: [UMB_DICTIONARY_ENTITY_TYPE], + entityTypes: [UMB_DICTIONARY_ENTITY_TYPE, UMB_DICTIONARY_ROOT_ENTITY_TYPE], }, }, { @@ -70,7 +70,7 @@ const entityActions: Array = [ icon: 'icon-refresh', label: 'Reload', repositoryAlias: UMB_DICTIONARY_REPOSITORY_ALIAS, - entityTypes: [UMB_DICTIONARY_ENTITY_TYPE], + entityTypes: [UMB_DICTIONARY_ENTITY_TYPE, UMB_DICTIONARY_ROOT_ENTITY_TYPE], }, }, { diff --git a/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/workspace/dictionary-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/workspace/dictionary-workspace.context.ts index 7510b31611..c6f23dea9f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/workspace/dictionary-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/dictionary/dictionary/workspace/dictionary-workspace.context.ts @@ -83,7 +83,10 @@ export class UmbDictionaryWorkspaceContext if (!this.#data.value.id) return; if (this.getIsNew()) { - await this.repository.create(this.#data.value); + const { error } = await this.repository.create(this.#data.value); + if (error) { + return; + } this.setIsNew(false); } else { await this.repository.save(this.#data.value.id, this.#data.value); diff --git a/src/Umbraco.Web.UI.Client/src/packages/dictionary/section.manifest.ts b/src/Umbraco.Web.UI.Client/src/packages/dictionary/section.manifest.ts index eefc5e1c62..9ea2fde786 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/dictionary/section.manifest.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/dictionary/section.manifest.ts @@ -1,3 +1,4 @@ +import { UMB_DICTIONARY_ROOT_ENTITY_TYPE } from './dictionary/entities.js'; import type { ManifestDashboard, ManifestSection, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; const sectionAlias = 'Umb.Section.Dictionary'; @@ -15,13 +16,14 @@ const section: ManifestSection = { const menuSectionSidebarApp: ManifestTypes = { type: 'sectionSidebarApp', - kind: 'menu', + kind: 'menuWithEntityActions', alias: 'Umb.SidebarMenu.Dictionary', name: 'Dictionary Sidebar Menu', weight: 100, meta: { label: 'Dictionary', menu: 'Umb.Menu.Dictionary', + entityType: UMB_DICTIONARY_ROOT_ENTITY_TYPE, }, conditions: [ { diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/tree/folder/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/tree/folder/manifests.ts index a7ced4e26a..410d2f5096 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/tree/folder/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/tree/folder/manifests.ts @@ -13,24 +13,11 @@ const folderRepository: ManifestRepository = { }; const entityActions: Array = [ - { - type: 'entityAction', - alias: 'Umb.EntityAction.DocumentType.DeleteFolder', - name: 'Delete Document Type Folder Entity Action', - weight: 800, - api: UmbDeleteFolderEntityAction, - meta: { - icon: 'icon-trash', - label: 'Delete Folder...', - repositoryAlias: UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS, - entityTypes: [UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE], - }, - }, { type: 'entityAction', alias: 'Umb.EntityAction.DocumentType.RenameFolder', name: 'Rename Document Type Folder Entity Action', - weight: 700, + weight: 800, api: UmbFolderUpdateEntityAction, meta: { icon: 'icon-edit', @@ -39,6 +26,19 @@ const entityActions: Array = [ entityTypes: [UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE], }, }, + { + type: 'entityAction', + alias: 'Umb.EntityAction.DocumentType.DeleteFolder', + name: 'Delete Document Type Folder Entity Action', + weight: 700, + api: UmbDeleteFolderEntityAction, + meta: { + icon: 'icon-trash', + label: 'Delete Folder...', + repositoryAlias: UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS, + entityTypes: [UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE], + }, + }, ]; export const manifests = [folderRepository, ...entityActions]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/manifests.ts index 1b443a788a..67d4bc409e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/manifests.ts @@ -13,24 +13,11 @@ const folderRepository: ManifestRepository = { }; const entityActions: Array = [ - { - type: 'entityAction', - alias: 'Umb.EntityAction.MediaType.DeleteFolder', - name: 'Delete Media Type Folder Entity Action', - weight: 800, - api: UmbDeleteFolderEntityAction, - meta: { - icon: 'icon-trash', - label: 'Delete Folder...', - repositoryAlias: UMB_MEDIA_TYPE_FOLDER_REPOSITORY_ALIAS, - entityTypes: [UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE], - }, - }, { type: 'entityAction', alias: 'Umb.EntityAction.MediaType.RenameFolder', name: 'Rename Media Type Folder Entity Action', - weight: 700, + weight: 800, api: UmbFolderUpdateEntityAction, meta: { icon: 'icon-edit', @@ -39,6 +26,19 @@ const entityActions: Array = [ entityTypes: [UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE], }, }, + { + type: 'entityAction', + alias: 'Umb.EntityAction.MediaType.DeleteFolder', + name: 'Delete Media Type Folder Entity Action', + weight: 700, + api: UmbDeleteFolderEntityAction, + meta: { + icon: 'icon-trash', + label: 'Delete Folder...', + repositoryAlias: UMB_MEDIA_TYPE_FOLDER_REPOSITORY_ALIAS, + entityTypes: [UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE], + }, + }, ]; export const manifests = [folderRepository, ...entityActions]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts index 828a84acdf..48553749df 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts @@ -9,6 +9,7 @@ import { UmbBooleanState, UmbObjectState } from '@umbraco-cms/backoffice/observa import type { TemplateItemResponseModel, TemplateResponseModel } from '@umbraco-cms/backoffice/backend-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import { UmbId } from '@umbraco-cms/backoffice/id'; export class UmbTemplateWorkspaceContext extends UmbEditableWorkspaceContextBase @@ -138,7 +139,10 @@ ${currentContent}`; const isNew = this.getIsNew(); if (isNew && template) { + const key = UmbId.new(); + this.#data.update({ id: key }); await this.repository.create({ + key: key, name: template.name, content: template.content, alias: template.alias,