make typescript happy
This commit is contained in:
@@ -3,13 +3,14 @@ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbArrayState, UmbStringState } from '@umbraco-cms/backoffice/observable-api';
|
||||
import { UmbDocumentTypeDetailModel, UmbDocumentTypeDetailRepository } from '@umbraco-cms/backoffice/document-type';
|
||||
import { UmbDocumentTypeDetailRepository } from '@umbraco-cms/backoffice/document-type';
|
||||
import { getKeyFromUdi } from '@umbraco-cms/backoffice/utils';
|
||||
import { UmbBlockTypeBase } from '@umbraco-cms/backoffice/block';
|
||||
import { UMB_WORKSPACE_MODAL, UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/modal';
|
||||
import { UmbContentTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
|
||||
// TODO: We are using backend model here, I think we should get our own model:
|
||||
type ElementTypeModel = UmbDocumentTypeDetailModel;
|
||||
type ElementTypeModel = UmbContentTypeModel;
|
||||
|
||||
export class UmbBlockManagerContext<
|
||||
BlockType extends UmbBlockTypeBase = UmbBlockTypeBase,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { UmbBlockDataType } from '../types.js';
|
||||
import { UmbBlockElementPropertyDatasetContext } from './block-element-property-dataset.context.js';
|
||||
import { UmbContentTypePropertyStructureManager } from '@umbraco-cms/backoffice/content-type';
|
||||
import { UmbContentTypeModel, UmbContentTypePropertyStructureManager } from '@umbraco-cms/backoffice/content-type';
|
||||
import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbBaseController } from '@umbraco-cms/backoffice/class-api';
|
||||
@@ -17,7 +17,10 @@ export class UmbBlockElementManager extends UmbBaseController {
|
||||
readonly unique = this.#data.asObservablePart((data) => data?.udi);
|
||||
readonly contentTypeId = this.#data.asObservablePart((data) => data?.contentTypeKey);
|
||||
|
||||
readonly structure = new UmbContentTypePropertyStructureManager(this, new UmbDocumentTypeDetailRepository(this));
|
||||
readonly structure = new UmbContentTypePropertyStructureManager<UmbContentTypeModel>(
|
||||
this,
|
||||
new UmbDocumentTypeDetailRepository(this),
|
||||
);
|
||||
|
||||
constructor(host: UmbControllerHost) {
|
||||
// TODO: Get Workspace Alias via Manifest.
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { UMB_BLOCK_WORKSPACE_CONTEXT } from '../../block-workspace.context.js';
|
||||
import { css, html, customElement, property, state, repeat } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
|
||||
import { UmbContentTypePropertyStructureHelper, PropertyContainerTypes } from '@umbraco-cms/backoffice/content-type';
|
||||
import {
|
||||
UmbContentTypePropertyStructureHelper,
|
||||
PropertyContainerTypes,
|
||||
UmbContentTypeModel,
|
||||
} from '@umbraco-cms/backoffice/content-type';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import { PropertyTypeModelBaseModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
|
||||
@@ -23,7 +27,7 @@ export class UmbBlockWorkspaceViewEditPropertiesElement extends UmbLitElement {
|
||||
this._propertyStructureHelper.setContainerType(value);
|
||||
}
|
||||
|
||||
_propertyStructureHelper = new UmbContentTypePropertyStructureHelper(this);
|
||||
_propertyStructureHelper = new UmbContentTypePropertyStructureHelper<UmbContentTypeModel>(this);
|
||||
|
||||
@state()
|
||||
_propertyStructure: Array<PropertyTypeModelBaseModel> = [];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { UMB_BLOCK_WORKSPACE_CONTEXT } from '../../block-workspace.context.js';
|
||||
import { css, html, customElement, property, state, repeat } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
|
||||
import { UmbContentTypeContainerStructureHelper } from '@umbraco-cms/backoffice/content-type';
|
||||
import { UmbContentTypeContainerStructureHelper, UmbContentTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import { PropertyTypeContainerModelBaseModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
|
||||
@@ -42,7 +42,7 @@ export class UmbBlockWorkspaceViewEditTabElement extends UmbLitElement {
|
||||
this._groupStructureHelper.setOwnerId(value);
|
||||
}
|
||||
|
||||
_groupStructureHelper = new UmbContentTypeContainerStructureHelper(this);
|
||||
_groupStructureHelper = new UmbContentTypeContainerStructureHelper<UmbContentTypeModel>(this);
|
||||
|
||||
@state()
|
||||
_groups: Array<PropertyTypeContainerModelBaseModel> = [];
|
||||
|
||||
@@ -2,7 +2,7 @@ import { UMB_BLOCK_WORKSPACE_CONTEXT } from '../../block-workspace.context.js';
|
||||
import type { UmbBlockWorkspaceViewEditTabElement } from './block-workspace-view-edit-tab.element.js';
|
||||
import { css, html, customElement, state, repeat } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
|
||||
import { UmbContentTypeContainerStructureHelper } from '@umbraco-cms/backoffice/content-type';
|
||||
import { UmbContentTypeContainerStructureHelper, UmbContentTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import {
|
||||
encodeFolderName,
|
||||
UmbRoute,
|
||||
@@ -32,7 +32,7 @@ export class UmbBlockWorkspaceViewEditElement extends UmbLitElement implements U
|
||||
|
||||
private _workspaceContext?: typeof UMB_BLOCK_WORKSPACE_CONTEXT.TYPE;
|
||||
|
||||
private _tabsStructureHelper = new UmbContentTypeContainerStructureHelper(this);
|
||||
private _tabsStructureHelper = new UmbContentTypeContainerStructureHelper<UmbContentTypeModel>(this);
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
@@ -37,14 +37,13 @@ export class UmbDocumentTypeWorkspaceContext
|
||||
readonly defaultTemplateId;
|
||||
readonly cleanup;
|
||||
|
||||
readonly structure = new UmbContentTypePropertyStructureManager(this, this.repository);
|
||||
readonly structure = new UmbContentTypePropertyStructureManager<EntityType>(this, this.repository);
|
||||
|
||||
#isSorting = new UmbBooleanState(undefined);
|
||||
isSorting = this.#isSorting.asObservable();
|
||||
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
super(host, 'Umb.Workspace.DocumentType');
|
||||
this.structure = new UmbContentTypePropertyStructureManager<UmbDocumentTypeDetailModel>(this.host, this.repository);
|
||||
|
||||
// General for content types:
|
||||
this.data = this.structure.ownerContentType;
|
||||
|
||||
@@ -30,7 +30,7 @@ export class UmbMediaTypeWorkspaceContext
|
||||
readonly allowedContentTypes;
|
||||
readonly compositions;
|
||||
|
||||
readonly structure;
|
||||
readonly structure = new UmbContentTypePropertyStructureManager<EntityType>(this, this.repository);
|
||||
|
||||
#isSorting = new UmbBooleanState(undefined);
|
||||
isSorting = this.#isSorting.asObservable();
|
||||
@@ -38,8 +38,6 @@ export class UmbMediaTypeWorkspaceContext
|
||||
constructor(host: UmbControllerHost) {
|
||||
super(host, 'Umb.Workspace.MediaType');
|
||||
|
||||
this.structure = new UmbContentTypePropertyStructureManager<UmbMediaTypeDetailModel>(host, this.repository);
|
||||
|
||||
// General for content types:
|
||||
this.data = this.structure.ownerContentType;
|
||||
this.name = this.structure.ownerContentTypeObservablePart((data) => data?.name);
|
||||
|
||||
Reference in New Issue
Block a user