Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/packages/core/data-type/tree/folder/manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ const folderRepository: ManifestRepository = {
const entityActions: Array<ManifestEntityAction> = [
{
type: 'entityAction',
alias: 'Umb.EntityAction.DataType.DeleteFolder',
name: 'Delete Data Type Folder Entity Action',
alias: 'Umb.EntityAction.DataType.RenameFolder',
name: 'Rename Data Type Folder Entity Action',
weight: 800,
api: UmbDeleteFolderEntityAction,
api: UmbFolderUpdateEntityAction,
meta: {
icon: 'icon-trash',
label: 'Delete Folder...',
icon: 'icon-edit',
label: 'Rename 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',
alias: 'Umb.EntityAction.DataType.DeleteFolder',
name: 'Delete Data Type Folder Entity Action',
weight: 700,
api: UmbFolderUpdateEntityAction,
api: UmbDeleteFolderEntityAction,
meta: {
icon: 'icon-edit',
label: 'Rename Folder...',
icon: 'icon-trash',
label: 'Delete Folder...',
repositoryAlias: UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS,
entityTypes: [UMB_DATA_TYPE_FOLDER_ENTITY_TYPE],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -18,7 +18,7 @@ const entityActions: Array<ManifestEntityAction> = [
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],
},
},
{
Expand Down Expand Up @@ -57,7 +57,7 @@ const entityActions: Array<ManifestEntityAction> = [
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],
},
},
{
Expand All @@ -70,7 +70,7 @@ const entityActions: Array<ManifestEntityAction> = [
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],
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/packages/dictionary/section.manifest.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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: [
{
Expand Down
20 changes: 10 additions & 10 deletions src/packages/documents/document-types/tree/folder/manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ const folderRepository: ManifestRepository = {
const entityActions: Array<ManifestEntityAction> = [
{
type: 'entityAction',
alias: 'Umb.EntityAction.DocumentType.DeleteFolder',
name: 'Delete Document Type Folder Entity Action',
alias: 'Umb.EntityAction.DocumentType.RenameFolder',
name: 'Rename Document Type Folder Entity Action',
weight: 800,
api: UmbDeleteFolderEntityAction,
api: UmbFolderUpdateEntityAction,
meta: {
icon: 'icon-trash',
label: 'Delete Folder...',
icon: 'icon-edit',
label: 'Rename 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',
alias: 'Umb.EntityAction.DocumentType.DeleteFolder',
name: 'Delete Document Type Folder Entity Action',
weight: 700,
api: UmbFolderUpdateEntityAction,
api: UmbDeleteFolderEntityAction,
meta: {
icon: 'icon-edit',
label: 'Rename Folder...',
icon: 'icon-trash',
label: 'Delete Folder...',
repositoryAlias: UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE],
},
Expand Down
20 changes: 10 additions & 10 deletions src/packages/media/media-types/tree/folder/manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ const folderRepository: ManifestRepository = {
const entityActions: Array<ManifestEntityAction> = [
{
type: 'entityAction',
alias: 'Umb.EntityAction.MediaType.DeleteFolder',
name: 'Delete Media Type Folder Entity Action',
alias: 'Umb.EntityAction.MediaType.RenameFolder',
name: 'Rename Media Type Folder Entity Action',
weight: 800,
api: UmbDeleteFolderEntityAction,
api: UmbFolderUpdateEntityAction,
meta: {
icon: 'icon-trash',
label: 'Delete Folder...',
icon: 'icon-edit',
label: 'Rename 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',
alias: 'Umb.EntityAction.MediaType.DeleteFolder',
name: 'Delete Media Type Folder Entity Action',
weight: 700,
api: UmbFolderUpdateEntityAction,
api: UmbDeleteFolderEntityAction,
meta: {
icon: 'icon-edit',
label: 'Rename Folder...',
icon: 'icon-trash',
label: 'Delete Folder...',
repositoryAlias: UMB_MEDIA_TYPE_FOLDER_REPOSITORY_ALIAS,
entityTypes: [UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TemplateResponseModel>
Expand Down Expand Up @@ -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,
Expand Down