This commit is contained in:
Mads Rasmussen
2024-01-26 08:56:22 +01:00
parent 695c735dad
commit f208fecc11
21 changed files with 46 additions and 58 deletions

View File

@@ -295,7 +295,7 @@ export class UmbDocumentTypeWorkspacePropertyElement extends UmbLitElement {
renderPropertyTags() {
return this.property
? html`<div class="types">
${this.property.dataTypeId ? html`<uui-tag look="default">${this._dataTypeName}</uui-tag>` : nothing}
${this.property.dataType.id ? html`<uui-tag look="default">${this._dataTypeName}</uui-tag>` : nothing}
${this.property.variesByCulture
? html`<uui-tag look="default">
<uui-icon name="icon-shuffle"></uui-icon> ${this.localize.term('contentTypeEditor_cultureVariantLabel')}

View File

@@ -6,7 +6,7 @@ import { UmbContentTypeContainerStructureHelper } from '@umbraco-cms/backoffice/
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import type { PropertyTypeContainerModelBaseModel } from '@umbraco-cms/backoffice/backend-api';
import { UMB_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
import type { UmbSorterConfig} from '@umbraco-cms/backoffice/sorter';
import type { UmbSorterConfig } from '@umbraco-cms/backoffice/sorter';
import { UmbSorterController } from '@umbraco-cms/backoffice/sorter';
import './document-type-workspace-view-edit-properties.element.js';
@@ -172,7 +172,11 @@ export class UmbDocumentTypeWorkspaceViewEditTabElement extends UmbLitElement {
value=${group.name ?? ''}
@change=${(e: InputEvent) => {
const newName = (e.target as HTMLInputElement).value;
this._groupStructureHelper.updateContainerName(group.id!, group.parentId ?? null, newName);
this._groupStructureHelper.updateContainerName(
group.id!,
group.parent?.id ?? null,
newName,
);
}}>
</uui-input>
</div>

View File

@@ -1,4 +1,4 @@
import { UMB_DOCUMENT_REPOSITORY_ALIAS } from '../repository/manifests.js';
import { UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS } from '../repository/index.js';
import { UMB_DOCUMENT_ENTITY_TYPE, UMB_DOCUMENT_ROOT_ENTITY_TYPE } from '../entity.js';
import { UmbPublishDocumentEntityAction } from './publish.action.js';
import { UmbDocumentCultureAndHostnamesEntityAction } from './culture-and-hostnames.action.js';
@@ -27,7 +27,7 @@ const entityActions: Array<ManifestTypes> = [
meta: {
icon: 'icon-blueprint',
label: 'Create Document Blueprint (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
},
@@ -40,7 +40,7 @@ const entityActions: Array<ManifestTypes> = [
meta: {
icon: 'icon-enter',
label: 'Move (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
},
@@ -53,7 +53,7 @@ const entityActions: Array<ManifestTypes> = [
meta: {
icon: 'icon-documents',
label: 'Copy (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
},
@@ -66,7 +66,7 @@ const entityActions: Array<ManifestTypes> = [
meta: {
icon: 'icon-navigation-vertical',
label: 'Sort (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ROOT_ENTITY_TYPE, UMB_DOCUMENT_ENTITY_TYPE],
},
},
@@ -79,7 +79,7 @@ const entityActions: Array<ManifestTypes> = [
meta: {
icon: 'icon-home',
label: 'Culture And Hostnames (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
},
@@ -91,7 +91,7 @@ const entityActions: Array<ManifestTypes> = [
meta: {
icon: 'icon-lock',
label: 'Public Access (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
},
@@ -103,7 +103,7 @@ const entityActions: Array<ManifestTypes> = [
meta: {
icon: 'icon-globe',
label: 'Publish (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
},
@@ -115,7 +115,7 @@ const entityActions: Array<ManifestTypes> = [
meta: {
icon: 'icon-globe',
label: 'Unpublish (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
},
@@ -127,7 +127,7 @@ const entityActions: Array<ManifestTypes> = [
meta: {
icon: 'icon-undo',
label: 'Rollback (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
},

View File

@@ -1,4 +1,4 @@
import { UMB_DOCUMENT_REPOSITORY_ALIAS } from '../../repository/manifests.js';
import { UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS } from '../../repository/manifests.js';
import { UMB_DOCUMENT_ENTITY_TYPE } from '../../entity.js';
import { UmbDocumentPermissionsEntityAction } from './permissions.action.js';
import type { ManifestEntityAction, ManifestModal } from '@umbraco-cms/backoffice/extension-registry';
@@ -12,7 +12,7 @@ const entityActions: Array<ManifestEntityAction> = [
meta: {
icon: 'icon-vcard',
label: 'Permissions (TBD)',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
},

View File

@@ -9,6 +9,6 @@ export class UmbDocumentCopyEntityBulkAction extends UmbEntityBulkActionBase<Umb
async execute() {
console.log(`execute copy for: ${this.selection}`);
await this.repository?.copy();
//await this.repository?.copy();
}
}

View File

@@ -9,6 +9,6 @@ export class UmbDocumentMoveEntityBulkAction extends UmbEntityBulkActionBase<Umb
async execute() {
console.log(`execute move for: ${this.selection}`);
await this.repository?.move();
//await this.repository?.move();
}
}

View File

@@ -1,5 +1,5 @@
import { UMB_DOCUMENT_ENTITY_TYPE } from '../../entity.js';
import { UMB_DOCUMENT_REPOSITORY_ALIAS } from '../../repository/index.js';
import { UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS } from '../../repository/index.js';
import { UmbTrashEntityAction } from '@umbraco-cms/backoffice/entity-action';
export const manifests = [
@@ -12,7 +12,7 @@ export const manifests = [
meta: {
icon: 'icon-trash',
label: 'Trash',
repositoryAlias: UMB_DOCUMENT_REPOSITORY_ALIAS,
repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},
conditions: [

View File

@@ -1,5 +1,5 @@
import type { UmbDocumentRecycleBinTreeItemModel } from './types.js';
import type { RecycleBinItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
import type { DocumentRecycleBinItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
import { DocumentResource } from '@umbraco-cms/backoffice/backend-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { UmbTreeServerDataSourceBase } from '@umbraco-cms/backoffice/tree';
@@ -42,14 +42,12 @@ const getChildrenOf = (parentUnique: string | null) => {
}
};
const mapper = (item: RecycleBinItemResponseModel): UmbDocumentRecycleBinTreeItemModel => {
const mapper = (item: DocumentRecycleBinItemResponseModel): UmbDocumentRecycleBinTreeItemModel => {
return {
id: item.id,
parentId: item.parentId || null,
name: item.name,
parentId: item.parent ? item.parent.id : null,
entityType: 'document-recycle-bin',
hasChildren: item.hasChildren,
isContainer: item.isContainer,
isFolder: false,
};
};

View File

@@ -1,5 +1,5 @@
import type { UmbEntityTreeItemModel, UmbEntityTreeRootModel } from '@umbraco-cms/backoffice/tree';
export interface UmbDocumentRecycleBinTreeItemModel extends UmbEntityTreeItemModel {}
// TODO: TREE STORE TYPE PROBLEM:
export interface UmbDocumentRecycleBinTreeRootModel extends UmbEntityTreeRootModel {}

View File

@@ -1,6 +1,6 @@
import { UmbDocumentDetailRepository } from './document-detail.repository.js';
import { UmbDocumentDetailStore } from './document-detail.store.js';
import { ManifestRepository, ManifestStore } from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestRepository, ManifestStore } from '@umbraco-cms/backoffice/extension-registry';
export const UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS = 'Umb.Repository.Document.Detail';

View File

@@ -21,7 +21,6 @@ export class UmbMediaTypeTreeRepository
name: 'Media Types',
icon: 'icon-folder',
hasChildren: true,
isContainer: false,
isFolder: true,
};

View File

@@ -46,11 +46,10 @@ const getChildrenOf = (parentUnique: string | null) => {
const mapper = (item: MediaTypeTreeItemResponseModel): UmbMediaTypeTreeItemModel => {
return {
unique: item.id,
parentUnique: item.parentId || null,
parentUnique: item.parent ? item.parent.id : null,
name: item.name,
entityType: item.isFolder ? UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE : UMB_MEDIA_TYPE_ENTITY_TYPE,
hasChildren: item.hasChildren,
isContainer: item.isContainer,
isFolder: item.isFolder,
};
};

View File

@@ -38,7 +38,6 @@ export class UmbMediaTypeTreeStore extends UmbUniqueTreeStore {
name: item.name,
entityType: item.entityType,
isFolder: false,
isContainer: false,
hasChildren: false,
};

View File

@@ -44,11 +44,9 @@ const getChildrenOf = (parentUnique: string | null) => {
const mapper = (item: MediaTreeItemResponseModel): UmbMediaTreeItemModel => {
return {
id: item.id,
parentId: item.parentId || null,
name: item.name,
parentId: item.parent ? item.parent.id : null,
entityType: 'media',
hasChildren: item.hasChildren,
isContainer: item.isContainer,
noAccess: item.noAccess,
isTrashed: item.isTrashed,
isFolder: false,

View File

@@ -1,6 +1,6 @@
import type { UmbEntityTreeItemModel, UmbEntityTreeRootModel } from '@umbraco-cms/backoffice/tree';
export interface UmbMediaTreeItemModel extends UmbEntityTreeItemModel {
export interface UmbMediaTreeItemModel extends Omit<UmbEntityTreeItemModel, 'name'> {
noAccess: boolean;
isTrashed: boolean;
}

View File

@@ -1,6 +1,6 @@
import type { UmbMemberGroupTreeItemModel } from './types.js';
import { UmbTreeServerDataSourceBase } from '@umbraco-cms/backoffice/tree';
import type { EntityTreeItemResponseModel} from '@umbraco-cms/backoffice/backend-api';
import type { NamedEntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
import { MemberGroupResource } from '@umbraco-cms/backoffice/backend-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
@@ -11,7 +11,7 @@ import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
* @implements {UmbTreeDataSource}
*/
export class UmbMemberGroupTreeServerDataSource extends UmbTreeServerDataSourceBase<
EntityTreeItemResponseModel,
NamedEntityTreeItemResponseModel,
UmbMemberGroupTreeItemModel
> {
/**
@@ -39,13 +39,12 @@ const getChildrenOf = (parentUnique: string | null) => {
}
};
const mapper = (item: EntityTreeItemResponseModel): UmbMemberGroupTreeItemModel => {
const mapper = (item: NamedEntityTreeItemResponseModel): UmbMemberGroupTreeItemModel => {
return {
id: item.id,
parentId: item.parentId || null,
parentId: item.parent ? item.parent.id : null,
name: item.name,
entityType: 'member-group',
isContainer: item.isContainer,
hasChildren: item.hasChildren,
isFolder: false,
};

View File

@@ -1,6 +1,6 @@
import type { UmbMemberTypeTreeItemModel } from './types.js';
import { UmbTreeServerDataSourceBase } from '@umbraco-cms/backoffice/tree';
import type { EntityTreeItemResponseModel} from '@umbraco-cms/backoffice/backend-api';
import type { NamedEntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
import { MemberTypeResource } from '@umbraco-cms/backoffice/backend-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
@@ -11,7 +11,7 @@ import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
* @implements {UmbTreeDataSource}
*/
export class UmbMemberTypeTreeServerDataSource extends UmbTreeServerDataSourceBase<
EntityTreeItemResponseModel,
NamedEntityTreeItemResponseModel,
UmbMemberTypeTreeItemModel
> {
/**
@@ -39,14 +39,13 @@ const getChildrenOf = (parentUnique: string | null) => {
}
};
const mapper = (item: EntityTreeItemResponseModel): UmbMemberTypeTreeItemModel => {
const mapper = (item: NamedEntityTreeItemResponseModel): UmbMemberTypeTreeItemModel => {
return {
id: item.id,
parentId: item.parentId || null,
parentId: item.parent ? item.parent.id : null,
name: item.name,
entityType: 'member-type',
hasChildren: item.hasChildren,
isContainer: item.isContainer,
isFolder: false,
};
};

View File

@@ -1,5 +1,5 @@
import type { UmbMemberTreeItemModel } from './types.js';
import type { EntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
import type { NamedEntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { UmbTreeServerDataSourceBase } from '@umbraco-cms/backoffice/tree';
@@ -10,7 +10,7 @@ import { UmbTreeServerDataSourceBase } from '@umbraco-cms/backoffice/tree';
* @extends {UmbTreeServerDataSourceBase}
*/
export class UmbMemberTreeServerDataSource extends UmbTreeServerDataSourceBase<
EntityTreeItemResponseModel,
NamedEntityTreeItemResponseModel,
UmbMemberTreeItemModel
> {
/**
@@ -33,14 +33,13 @@ const getChildrenOf = (parentUnique: string | null): any => {
alert('not implemented');
};
const mapper = (item: EntityTreeItemResponseModel): UmbMemberTreeItemModel => {
const mapper = (item: NamedEntityTreeItemResponseModel): UmbMemberTreeItemModel => {
return {
id: item.id,
parentId: item.parentId || null,
parentId: item.parent ? item.parent.id : null,
name: item.name,
entityType: 'member',
hasChildren: item.hasChildren,
isContainer: item.isContainer,
isFolder: false,
};
};

View File

@@ -1,8 +1,5 @@
import type { UmbRelationTypeTreeItemModel } from './types.js';
import type {
EntityTreeItemResponseModel,
NamedEntityTreeItemResponseModel,
} from '@umbraco-cms/backoffice/backend-api';
import type { NamedEntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
import { RelationTypeResource } from '@umbraco-cms/backoffice/backend-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { UmbTreeServerDataSourceBase } from '@umbraco-cms/backoffice/tree';
@@ -14,7 +11,7 @@ import { UmbTreeServerDataSourceBase } from '@umbraco-cms/backoffice/tree';
* @implements {UmbTreeDataSource}
*/
export class UmbRelationTypeTreeServerDataSource extends UmbTreeServerDataSourceBase<
EntityTreeItemResponseModel,
NamedEntityTreeItemResponseModel,
UmbRelationTypeTreeItemModel
> {
/**

View File

@@ -6,7 +6,6 @@ import { UmbTreeRepositoryBase } from '@umbraco-cms/backoffice/tree';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import type { UmbApi } from '@umbraco-cms/backoffice/extension-api';
// TODO: TREE STORE TYPE PROBLEM:
export class UmbPartialViewTreeRepository
extends UmbTreeRepositoryBase<UmbPartialViewTreeItemModel, UmbPartialViewTreeRootModel>
implements UmbApi
@@ -22,7 +21,6 @@ export class UmbPartialViewTreeRepository
name: 'Partial Views',
icon: 'icon-folder',
hasChildren: true,
isContainer: false,
isFolder: true,
};

View File

@@ -2,7 +2,7 @@ import { UMB_STYLESHEET_FOLDER_ENTITY_TYPE } from '../../entity.js';
import type { UmbStylesheetTreeItemModel } from '../types.js';
import { UMB_STYLESHEET_TREE_STORE_CONTEXT } from '../stylesheet-tree.store.js';
import { UmbStylesheetFolderServerDataSource } from './stylesheet-folder.server.data-source.js';
import type { UmbFolderModel} from '@umbraco-cms/backoffice/tree';
import type { UmbFolderModel } from '@umbraco-cms/backoffice/tree';
import { UmbFolderRepositoryBase } from '@umbraco-cms/backoffice/tree';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
@@ -24,7 +24,6 @@ const folderToStylesheetTreeItemFolder = (folder: UmbFolderModel): UmbStylesheet
name: folder.name,
entityType: UMB_STYLESHEET_FOLDER_ENTITY_TYPE,
isFolder: true,
isContainer: false,
hasChildren: false,
};
};