Merge pull request #1869 from umbraco/feature/content-property-dataset-context
refactor code to use content-property-dataset
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export * from './workspace/index.js';
|
||||
|
||||
export { UmbContentPropertyContext } from './content-property.context.js';
|
||||
export { UMB_CONTENT_PROPERTY_CONTEXT } from './content-property.context-token.js';
|
||||
export { UmbContentPropertyContext } from './content-property.context.js';
|
||||
export * from './property-dataset-context/content-property-dataset.context.js';
|
||||
export * from './workspace/index.js';
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
import type { UmbContentWorkspaceContext } from '../workspace/index.js';
|
||||
import type { UmbNameablePropertyDatasetContext, UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import { UMB_PROPERTY_DATASET_CONTEXT } from '@umbraco-cms/backoffice/property';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import { type Observable, map } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
|
||||
import type { UmbVariantModel } from '@umbraco-cms/backoffice/variant';
|
||||
import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
import type { UmbContentTypeModel, UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbWorkspaceUniqueType } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
export class UmbContentPropertyDatasetContext<
|
||||
ContentTypeModel extends UmbContentTypeModel = UmbContentTypeModel,
|
||||
VariantModelType extends UmbVariantModel = UmbVariantModel,
|
||||
>
|
||||
extends UmbContextBase<UmbPropertyDatasetContext>
|
||||
implements UmbPropertyDatasetContext, UmbNameablePropertyDatasetContext
|
||||
{
|
||||
#workspace: UmbContentWorkspaceContext<ContentTypeModel, VariantModelType>;
|
||||
#variantId: UmbVariantId;
|
||||
public getVariantId() {
|
||||
return this.#variantId;
|
||||
}
|
||||
|
||||
#currentVariant = new UmbObjectState<UmbVariantModel | undefined>(undefined);
|
||||
currentVariant = this.#currentVariant.asObservable();
|
||||
|
||||
name = this.#currentVariant.asObservablePart((x) => x?.name);
|
||||
culture = this.#currentVariant.asObservablePart((x) => x?.culture);
|
||||
segment = this.#currentVariant.asObservablePart((x) => x?.segment);
|
||||
|
||||
getEntityType(): string {
|
||||
return this.#workspace.getEntityType();
|
||||
}
|
||||
getUnique(): UmbWorkspaceUniqueType | undefined {
|
||||
return this.#workspace.getUnique();
|
||||
}
|
||||
getName(): string | undefined {
|
||||
return this.#workspace.getName(this.#variantId);
|
||||
}
|
||||
setName(name: string) {
|
||||
this.#workspace.setName(name, this.#variantId);
|
||||
}
|
||||
getVariantInfo() {
|
||||
return this.#workspace.getVariant(this.#variantId);
|
||||
}
|
||||
|
||||
constructor(
|
||||
host: UmbControllerHost,
|
||||
workspace: UmbContentWorkspaceContext<ContentTypeModel, VariantModelType>,
|
||||
variantId?: UmbVariantId,
|
||||
) {
|
||||
// The controller alias, is a very generic name cause we want only one of these for this controller host.
|
||||
super(host, UMB_PROPERTY_DATASET_CONTEXT);
|
||||
this.#workspace = workspace;
|
||||
this.#variantId = variantId ?? UmbVariantId.CreateInvariant();
|
||||
|
||||
this.observe(
|
||||
this.#workspace.variantById(this.#variantId),
|
||||
async (variantInfo) => {
|
||||
if (!variantInfo) return;
|
||||
this.#currentVariant.setValue(variantInfo);
|
||||
},
|
||||
'_observeActiveVariant',
|
||||
);
|
||||
}
|
||||
|
||||
#createPropertyVariantId(property: UmbPropertyTypeModel) {
|
||||
return UmbVariantId.Create({
|
||||
culture: property.variesByCulture ? this.#variantId.culture : null,
|
||||
segment: property.variesBySegment ? this.#variantId.segment : null,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @method propertyVariantId
|
||||
* @param {string} propertyAlias
|
||||
* @returns {Promise<Observable<UmbVariantId | undefined> | undefined>}
|
||||
* @description Get an Observable for the variant id of this property.
|
||||
*/
|
||||
async propertyVariantId(propertyAlias: string) {
|
||||
return (await this.#workspace.structure.propertyStructureByAlias(propertyAlias)).pipe(
|
||||
map((property) => (property ? this.#createPropertyVariantId(property) : undefined)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @method propertyValueByAlias
|
||||
* @param {string} propertyAlias
|
||||
* @returns {Promise<Observable<ReturnType | undefined> | undefined>}
|
||||
* @description Get an Observable for the value of this property.
|
||||
*/
|
||||
async propertyValueByAlias<ReturnType = unknown>(
|
||||
propertyAlias: string,
|
||||
): Promise<Observable<ReturnType | undefined> | undefined> {
|
||||
await this.#workspace.isLoaded();
|
||||
const structure = await this.#workspace.structure.getPropertyStructureByAlias(propertyAlias);
|
||||
if (structure) {
|
||||
return this.#workspace.propertyValueByAlias<ReturnType>(propertyAlias, this.#createPropertyVariantId(structure));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Refactor: Not used currently, but should investigate if we can implement this, to spare some energy.
|
||||
async propertyValueByAliasAndVariantId<ReturnType = unknown>(
|
||||
propertyAlias: string,
|
||||
propertyVariantId: UmbVariantId,
|
||||
): Promise<Observable<ReturnType | undefined> | undefined> {
|
||||
return this.#workspace.propertyValueByAlias<ReturnType>(propertyAlias, propertyVariantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @method setPropertyValueByVariant
|
||||
* @param {string} propertyAlias
|
||||
* @param {PromiseLike<unknown>} value - value can be a promise resolving into the actual value or the raw value it self.
|
||||
* @param {UmbVariantId} propertyVariantId - The variant id for the value to be set for.
|
||||
* @returns {Promise<unknown>}
|
||||
* @description Get the value of this property.
|
||||
*/
|
||||
setPropertyValueByVariant(
|
||||
propertyAlias: string,
|
||||
value: PromiseLike<unknown>,
|
||||
propertyVariantId: UmbVariantId,
|
||||
): Promise<void> {
|
||||
return this.#workspace.setPropertyValue(propertyAlias, value, propertyVariantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @method setPropertyValue
|
||||
* @param {string} propertyAlias
|
||||
* @param {PromiseLike<unknown>} value - value can be a promise resolving into the actual value or the raw value it self.
|
||||
* @returns {Promise<void>}
|
||||
* @description Set the value of this property.
|
||||
*/
|
||||
async setPropertyValue(propertyAlias: string, value: PromiseLike<unknown>) {
|
||||
this.#workspace.initiatePropertyValueChange();
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
const property = await this.#workspace.structure.getPropertyStructureByAlias(propertyAlias);
|
||||
if (property) {
|
||||
const variantId = this.#createPropertyVariantId(property);
|
||||
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
this.#workspace.setPropertyValue(propertyAlias, await value, variantId);
|
||||
}
|
||||
this.#workspace.finishPropertyValueChange();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { UmbContentTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbVariantModel } from '@umbraco-cms/backoffice/variant';
|
||||
import type { Observable } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
import type { UmbVariantId, UmbVariantModel } from '@umbraco-cms/backoffice/variant';
|
||||
import type {
|
||||
UmbPropertyStructureWorkspaceContext,
|
||||
UmbRoutableWorkspaceContext,
|
||||
@@ -13,4 +14,10 @@ export interface UmbContentWorkspaceContext<
|
||||
UmbVariantDatasetWorkspaceContext<VariantModelType>,
|
||||
UmbPropertyStructureWorkspaceContext<ContentTypeModel> {
|
||||
readonly IS_CONTENT_WORKSPACE_CONTEXT: true;
|
||||
|
||||
isLoaded(): Promise<unknown> | undefined;
|
||||
variantById(variantId: UmbVariantId): Observable<VariantModelType | undefined>;
|
||||
|
||||
initiatePropertyValueChange(): void;
|
||||
finishPropertyValueChange(): void;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE } from '../entity.js';
|
||||
import type { UmbDocumentBlueprintPropertyDataContext } from './document-blueprint-property-dataset-context.js';
|
||||
import type { UmbDocumentBlueprintPropertyDatasetContext } from './document-blueprint-property-dataset-context.js';
|
||||
import type { UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
export const IsDocumentBlueprintPropertyDatasetContext = (
|
||||
context: UmbPropertyDatasetContext,
|
||||
): context is UmbDocumentBlueprintPropertyDataContext => context.getEntityType() === UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE;
|
||||
): context is UmbDocumentBlueprintPropertyDatasetContext =>
|
||||
context.getEntityType() === UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE;
|
||||
|
||||
export const UMB_DOCUMENT_BLUEPRINT_PROPERTY_DATASET_CONTEXT = new UmbContextToken<
|
||||
UmbPropertyDatasetContext,
|
||||
UmbDocumentBlueprintPropertyDataContext
|
||||
UmbDocumentBlueprintPropertyDatasetContext
|
||||
>('UmbVariantContext', undefined, IsDocumentBlueprintPropertyDatasetContext);
|
||||
|
||||
@@ -1,122 +1,8 @@
|
||||
import type { UmbDocumentBlueprintWorkspaceContext } from '../workspace/index.js';
|
||||
import type { UmbNameablePropertyDatasetContext, UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import { UMB_PROPERTY_DATASET_CONTEXT } from '@umbraco-cms/backoffice/property';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import { type Observable, map } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
|
||||
import type { UmbVariantModel } from '@umbraco-cms/backoffice/variant';
|
||||
import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
import type { UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbDocumentBlueprintVariantModel } from '../types.js';
|
||||
import { UmbContentPropertyDatasetContext } from '@umbraco-cms/backoffice/content';
|
||||
import type { UmbDocumentTypeDetailModel } from '@umbraco-cms/backoffice/document-type';
|
||||
|
||||
// TODO: This code can be split into a UmbContentTypePropertyDatasetContext, leaving just the publishing state and methods to this class.
|
||||
export class UmbDocumentBlueprintPropertyDataContext
|
||||
extends UmbContextBase<UmbPropertyDatasetContext>
|
||||
implements UmbPropertyDatasetContext, UmbNameablePropertyDatasetContext
|
||||
{
|
||||
#workspace: UmbDocumentBlueprintWorkspaceContext;
|
||||
#variantId: UmbVariantId;
|
||||
public getVariantId() {
|
||||
return this.#variantId;
|
||||
}
|
||||
|
||||
#currentVariant = new UmbObjectState<UmbVariantModel | undefined>(undefined);
|
||||
currentVariant = this.#currentVariant.asObservable();
|
||||
|
||||
name = this.#currentVariant.asObservablePart((x) => x?.name);
|
||||
culture = this.#currentVariant.asObservablePart((x) => x?.culture);
|
||||
segment = this.#currentVariant.asObservablePart((x) => x?.segment);
|
||||
|
||||
// TODO: Refactor: Make a properties observable. (with such I think i mean a property value object array.. array with object with properties, alias, value, culture and segment)
|
||||
// TO make such happen I think we need to maintain all properties and their value of this object.
|
||||
// This will actually make it simpler if multiple are watching the same property.
|
||||
// But it will also mean that we wil watch all properties and their structure, for variantID, all the time for all of the properties.
|
||||
|
||||
getEntityType(): string {
|
||||
return this.#workspace.getEntityType();
|
||||
}
|
||||
getUnique(): string | undefined {
|
||||
return this.#workspace.getUnique();
|
||||
}
|
||||
getName(): string | undefined {
|
||||
return this.#workspace.getName(this.#variantId);
|
||||
}
|
||||
setName(name: string) {
|
||||
this.#workspace.setName(name, this.#variantId);
|
||||
}
|
||||
getVariantInfo() {
|
||||
return this.#workspace.getVariant(this.#variantId);
|
||||
}
|
||||
|
||||
constructor(host: UmbControllerHost, workspace: UmbDocumentBlueprintWorkspaceContext, variantId?: UmbVariantId) {
|
||||
// The controller alias, is a very generic name cause we want only one of these for this controller host.
|
||||
|
||||
super(host, UMB_PROPERTY_DATASET_CONTEXT);
|
||||
this.#workspace = workspace;
|
||||
this.#variantId = variantId ?? UmbVariantId.CreateInvariant();
|
||||
|
||||
this.observe(
|
||||
this.#workspace.variantById(this.#variantId),
|
||||
async (variantInfo) => {
|
||||
if (!variantInfo) return;
|
||||
this.#currentVariant.setValue(variantInfo);
|
||||
},
|
||||
'_observeActiveVariant',
|
||||
);
|
||||
}
|
||||
|
||||
#createPropertyVariantId(property: UmbPropertyTypeModel) {
|
||||
return UmbVariantId.Create({
|
||||
culture: property.variesByCulture ? this.#variantId.culture : null,
|
||||
segment: property.variesBySegment ? this.#variantId.segment : null,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write proper JSDocs here.
|
||||
* Ideally do not use these methods, its better to communicate directly with the workspace, but if you do not know the property variant id, then this will figure it out for you. So good for externals to set or get values of a property.
|
||||
*/
|
||||
async propertyVariantId(propertyAlias: string) {
|
||||
return (await this.#workspace.structure.propertyStructureByAlias(propertyAlias)).pipe(
|
||||
map((property) => (property ? this.#createPropertyVariantId(property) : undefined)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write proper JSDocs here.
|
||||
* Ideally do not use this method, its better to communicate directly with the workspace, but if you do not know the property variant id, then this will figure it out for you. So good for externals to set or get values of a property.
|
||||
*/
|
||||
async propertyValueByAlias<ReturnType = unknown>(
|
||||
propertyAlias: string,
|
||||
): Promise<Observable<ReturnType | undefined> | undefined> {
|
||||
await this.#workspace.isLoaded();
|
||||
const structure = await this.#workspace.structure.getPropertyStructureByAlias(propertyAlias);
|
||||
if (structure) {
|
||||
return this.#workspace.propertyValueByAlias<ReturnType>(propertyAlias, this.#createPropertyVariantId(structure));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Refactor: Not used currently, but should investigate if we can implement this, to spare some energy.
|
||||
async propertyValueByAliasAndVariantId<ReturnType = unknown>(
|
||||
propertyAlias: string,
|
||||
propertyVariantId: UmbVariantId,
|
||||
): Promise<Observable<ReturnType | undefined> | undefined> {
|
||||
return this.#workspace.propertyValueByAlias<ReturnType>(propertyAlias, propertyVariantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write proper JSDocs here.
|
||||
* Ideally do not use these methods, its better to communicate directly with the workspace, but if you do not know the property variant id, then this will figure it out for you. So good for externals to set or get values of a property.
|
||||
*/
|
||||
async setPropertyValue(propertyAlias: string, value: unknown) {
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
const property = await this.#workspace.structure.getPropertyStructureByAlias(propertyAlias);
|
||||
if (property) {
|
||||
const variantId = this.#createPropertyVariantId(property);
|
||||
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
this.#workspace.setPropertyValue(propertyAlias, value, variantId);
|
||||
}
|
||||
}
|
||||
}
|
||||
export class UmbDocumentBlueprintPropertyDatasetContext extends UmbContentPropertyDatasetContext<
|
||||
UmbDocumentTypeDetailModel,
|
||||
UmbDocumentBlueprintVariantModel
|
||||
> {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { UmbDocumentBlueprintPropertyDataContext } from '../property-dataset-context/document-blueprint-property-dataset-context.js';
|
||||
import { UmbDocumentBlueprintPropertyDatasetContext } from '../property-dataset-context/document-blueprint-property-dataset-context.js';
|
||||
import { UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE } from '../entity.js';
|
||||
import { UmbDocumentBlueprintDetailRepository } from '../repository/index.js';
|
||||
import type {
|
||||
@@ -441,8 +441,11 @@ export class UmbDocumentBlueprintWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
public createPropertyDatasetContext(host: UmbControllerHost, variantId: UmbVariantId) {
|
||||
return new UmbDocumentBlueprintPropertyDataContext(host, this, variantId);
|
||||
public createPropertyDatasetContext(
|
||||
host: UmbControllerHost,
|
||||
variantId: UmbVariantId,
|
||||
): UmbDocumentBlueprintPropertyDatasetContext {
|
||||
return new UmbDocumentBlueprintPropertyDatasetContext(host, this, variantId);
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { UMB_DOCUMENT_ENTITY_TYPE } from '../entity.js';
|
||||
import type { UmbDocumentPropertyDataContext } from './document-property-dataset-context.js';
|
||||
import type { UmbDocumentPropertyDatasetContext } from './document-property-dataset-context.js';
|
||||
import type { UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
export const IsDocumentPropertyDatasetContext = (
|
||||
context: UmbPropertyDatasetContext,
|
||||
): context is UmbDocumentPropertyDataContext => context.getEntityType() === UMB_DOCUMENT_ENTITY_TYPE;
|
||||
): context is UmbDocumentPropertyDatasetContext => context.getEntityType() === UMB_DOCUMENT_ENTITY_TYPE;
|
||||
|
||||
export const UMB_DOCUMENT_PROPERTY_DATASET_CONTEXT = new UmbContextToken<
|
||||
UmbPropertyDatasetContext,
|
||||
UmbDocumentPropertyDataContext
|
||||
UmbDocumentPropertyDatasetContext
|
||||
>('UmbPropertyDatasetContext', undefined, IsDocumentPropertyDatasetContext);
|
||||
|
||||
@@ -1,141 +1,8 @@
|
||||
import type { UmbDocumentWorkspaceContext } from '../workspace/index.js';
|
||||
import type { UmbNameablePropertyDatasetContext, UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import { UMB_PROPERTY_DATASET_CONTEXT } from '@umbraco-cms/backoffice/property';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import { type Observable, map } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
|
||||
import type { UmbVariantModel } from '@umbraco-cms/backoffice/variant';
|
||||
import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
import type { UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbDocumentVariantModel } from '../types.js';
|
||||
import { UmbContentPropertyDatasetContext } from '@umbraco-cms/backoffice/content';
|
||||
import type { UmbDocumentTypeDetailModel } from '@umbraco-cms/backoffice/document-type';
|
||||
|
||||
// TODO: This code can be split into a UmbContentTypePropertyDatasetContext, leaving just the publishing state and methods to this class. [NL]
|
||||
export class UmbDocumentPropertyDataContext
|
||||
extends UmbContextBase<UmbPropertyDatasetContext>
|
||||
implements UmbPropertyDatasetContext, UmbNameablePropertyDatasetContext
|
||||
{
|
||||
#workspace: UmbDocumentWorkspaceContext;
|
||||
#variantId: UmbVariantId;
|
||||
public getVariantId() {
|
||||
return this.#variantId;
|
||||
}
|
||||
|
||||
#currentVariant = new UmbObjectState<UmbVariantModel | undefined>(undefined);
|
||||
currentVariant = this.#currentVariant.asObservable();
|
||||
|
||||
name = this.#currentVariant.asObservablePart((x) => x?.name);
|
||||
culture = this.#currentVariant.asObservablePart((x) => x?.culture);
|
||||
segment = this.#currentVariant.asObservablePart((x) => x?.segment);
|
||||
|
||||
getEntityType(): string {
|
||||
return this.#workspace.getEntityType();
|
||||
}
|
||||
getUnique(): string | undefined {
|
||||
return this.#workspace.getUnique();
|
||||
}
|
||||
getName(): string | undefined {
|
||||
return this.#workspace.getName(this.#variantId);
|
||||
}
|
||||
setName(name: string) {
|
||||
this.#workspace.setName(name, this.#variantId);
|
||||
}
|
||||
getVariantInfo() {
|
||||
return this.#workspace.getVariant(this.#variantId);
|
||||
}
|
||||
|
||||
constructor(host: UmbControllerHost, workspace: UmbDocumentWorkspaceContext, variantId?: UmbVariantId) {
|
||||
// The controller alias, is a very generic name cause we want only one of these for this controller host.
|
||||
super(host, UMB_PROPERTY_DATASET_CONTEXT);
|
||||
this.#workspace = workspace;
|
||||
this.#variantId = variantId ?? UmbVariantId.CreateInvariant();
|
||||
|
||||
this.observe(
|
||||
this.#workspace.variantById(this.#variantId),
|
||||
async (variantInfo) => {
|
||||
if (!variantInfo) return;
|
||||
this.#currentVariant.setValue(variantInfo);
|
||||
},
|
||||
'_observeActiveVariant',
|
||||
);
|
||||
}
|
||||
|
||||
#createPropertyVariantId(property: UmbPropertyTypeModel) {
|
||||
return UmbVariantId.Create({
|
||||
culture: property.variesByCulture ? this.#variantId.culture : null,
|
||||
segment: property.variesBySegment ? this.#variantId.segment : null,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @method propertyVariantId
|
||||
* @param {string} propertyAlias
|
||||
* @returns {Promise<Observable<UmbVariantId | undefined> | undefined>}
|
||||
* @description Get an Observable for the variant id of this property.
|
||||
*/
|
||||
async propertyVariantId(propertyAlias: string) {
|
||||
return (await this.#workspace.structure.propertyStructureByAlias(propertyAlias)).pipe(
|
||||
map((property) => (property ? this.#createPropertyVariantId(property) : undefined)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @method propertyValueByAlias
|
||||
* @param {string} propertyAlias
|
||||
* @returns {Promise<Observable<ReturnType | undefined> | undefined>}
|
||||
* @description Get an Observable for the value of this property.
|
||||
*/
|
||||
async propertyValueByAlias<ReturnType = unknown>(
|
||||
propertyAlias: string,
|
||||
): Promise<Observable<ReturnType | undefined> | undefined> {
|
||||
await this.#workspace.isLoaded();
|
||||
const structure = await this.#workspace.structure.getPropertyStructureByAlias(propertyAlias);
|
||||
if (structure) {
|
||||
return this.#workspace.propertyValueByAlias<ReturnType>(propertyAlias, this.#createPropertyVariantId(structure));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Refactor: Not used currently, but should investigate if we can implement this, to spare some energy.
|
||||
async propertyValueByAliasAndVariantId<ReturnType = unknown>(
|
||||
propertyAlias: string,
|
||||
propertyVariantId: UmbVariantId,
|
||||
): Promise<Observable<ReturnType | undefined> | undefined> {
|
||||
return this.#workspace.propertyValueByAlias<ReturnType>(propertyAlias, propertyVariantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @method setPropertyValueByVariant
|
||||
* @param {string} propertyAlias
|
||||
* @param {PromiseLike<unknown>} value - value can be a promise resolving into the actual value or the raw value it self.
|
||||
* @param {UmbVariantId} propertyVariantId - The variant id for the value to be set for.
|
||||
* @returns {Promise<unknown>}
|
||||
* @description Get the value of this property.
|
||||
*/
|
||||
setPropertyValueByVariant(
|
||||
propertyAlias: string,
|
||||
value: PromiseLike<unknown>,
|
||||
propertyVariantId: UmbVariantId,
|
||||
): Promise<void> {
|
||||
return this.#workspace.setPropertyValue(propertyAlias, value, propertyVariantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @method setPropertyValue
|
||||
* @param {string} propertyAlias
|
||||
* @param {PromiseLike<unknown>} value - value can be a promise resolving into the actual value or the raw value it self.
|
||||
* @returns {Promise<void>}
|
||||
* @description Set the value of this property.
|
||||
*/
|
||||
async setPropertyValue(propertyAlias: string, value: PromiseLike<unknown>) {
|
||||
this.#workspace.initiatePropertyValueChange();
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
const property = await this.#workspace.structure.getPropertyStructureByAlias(propertyAlias);
|
||||
if (property) {
|
||||
const variantId = this.#createPropertyVariantId(property);
|
||||
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
this.#workspace.setPropertyValue(propertyAlias, await value, variantId);
|
||||
}
|
||||
this.#workspace.finishPropertyValueChange();
|
||||
}
|
||||
}
|
||||
export class UmbDocumentPropertyDatasetContext extends UmbContentPropertyDatasetContext<
|
||||
UmbDocumentTypeDetailModel,
|
||||
UmbDocumentVariantModel
|
||||
> {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { UmbDocumentTypeDetailRepository } from '../../document-types/repository/detail/document-type-detail.repository.js';
|
||||
import { UmbDocumentPropertyDataContext } from '../property-dataset-context/document-property-dataset-context.js';
|
||||
import { UmbDocumentPropertyDatasetContext } from '../property-dataset-context/document-property-dataset-context.js';
|
||||
import { UMB_DOCUMENT_ENTITY_TYPE } from '../entity.js';
|
||||
import { UmbDocumentDetailRepository } from '../repository/index.js';
|
||||
import type {
|
||||
@@ -853,16 +853,11 @@ export class UmbDocumentWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
concept notes:
|
||||
|
||||
public saveAndPreview() {
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
public createPropertyDatasetContext(host: UmbControllerHost, variantId: UmbVariantId) {
|
||||
return new UmbDocumentPropertyDataContext(host, this, variantId);
|
||||
public createPropertyDatasetContext(
|
||||
host: UmbControllerHost,
|
||||
variantId: UmbVariantId,
|
||||
): UmbDocumentPropertyDatasetContext {
|
||||
return new UmbDocumentPropertyDatasetContext(host, this, variantId);
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { UMB_MEDIA_ENTITY_TYPE } from '../entity.js';
|
||||
import type { UmbMediaPropertyDataContext } from './media-property-dataset-context.js';
|
||||
import type { UmbMediaPropertyDatasetContext } from './media-property-dataset-context.js';
|
||||
import type { UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
export const IsMediaVariantContext = (context: UmbPropertyDatasetContext): context is UmbMediaPropertyDataContext =>
|
||||
export const IsMediaVariantContext = (context: UmbPropertyDatasetContext): context is UmbMediaPropertyDatasetContext =>
|
||||
context.getEntityType() === UMB_MEDIA_ENTITY_TYPE;
|
||||
|
||||
export const UMB_MEDIA_VARIANT_CONTEXT = new UmbContextToken<UmbPropertyDatasetContext, UmbMediaPropertyDataContext>(
|
||||
export const UMB_MEDIA_VARIANT_CONTEXT = new UmbContextToken<UmbPropertyDatasetContext, UmbMediaPropertyDatasetContext>(
|
||||
'UmbVariantContext',
|
||||
undefined,
|
||||
IsMediaVariantContext,
|
||||
|
||||
@@ -1,118 +1,8 @@
|
||||
import type { UmbMediaWorkspaceContext } from '../workspace/index.js';
|
||||
import type { UmbNameablePropertyDatasetContext, UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import { UMB_PROPERTY_DATASET_CONTEXT } from '@umbraco-cms/backoffice/property';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import { map } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
|
||||
import type { UmbVariantModel } from '@umbraco-cms/backoffice/variant';
|
||||
import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
import type { UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbMediaVariantModel } from '../types.js';
|
||||
import { UmbContentPropertyDatasetContext } from '@umbraco-cms/backoffice/content';
|
||||
import type { UmbMediaTypeDetailModel } from '@umbraco-cms/backoffice/media-type';
|
||||
|
||||
// TODO: This code can be split into a UmbContentTypePropertyDatasetContext, leaving just the publishing state and methods to this class.
|
||||
export class UmbMediaPropertyDataContext
|
||||
extends UmbContextBase<UmbPropertyDatasetContext>
|
||||
implements UmbPropertyDatasetContext, UmbNameablePropertyDatasetContext
|
||||
{
|
||||
#workspace: UmbMediaWorkspaceContext;
|
||||
#variantId: UmbVariantId;
|
||||
public getVariantId() {
|
||||
return this.#variantId;
|
||||
}
|
||||
|
||||
#currentVariant = new UmbObjectState<UmbVariantModel | undefined>(undefined);
|
||||
currentVariant = this.#currentVariant.asObservable();
|
||||
|
||||
name = this.#currentVariant.asObservablePart((x) => x?.name);
|
||||
culture = this.#currentVariant.asObservablePart((x) => x?.culture);
|
||||
segment = this.#currentVariant.asObservablePart((x) => x?.segment);
|
||||
|
||||
// TODO: Refactor: Make a properties observable. (with such I think i mean a property value object array.. array with object with properties, alias, value, culture and segment)
|
||||
// TO make such happen I think we need to maintain all properties and their value of this object.
|
||||
// This will actually make it simpler if multiple are watching the same property.
|
||||
// But it will also mean that we wil watch all properties and their structure, for variantID, all the time for all of the properties.
|
||||
|
||||
getEntityType(): string {
|
||||
return this.#workspace.getEntityType();
|
||||
}
|
||||
getUnique(): string | undefined {
|
||||
return this.#workspace.getUnique();
|
||||
}
|
||||
getName(): string | undefined {
|
||||
return this.#workspace.getName(this.#variantId);
|
||||
}
|
||||
setName(name: string) {
|
||||
this.#workspace.setName(name, this.#variantId);
|
||||
}
|
||||
getVariantInfo() {
|
||||
return this.#workspace.getVariant(this.#variantId);
|
||||
}
|
||||
|
||||
constructor(host: UmbControllerHost, workspace: UmbMediaWorkspaceContext, variantId?: UmbVariantId) {
|
||||
// The controller alias, is a very generic name cause we want only one of these for this controller host.
|
||||
super(host, UMB_PROPERTY_DATASET_CONTEXT);
|
||||
this.#workspace = workspace;
|
||||
this.#variantId = variantId ?? UmbVariantId.CreateInvariant();
|
||||
|
||||
this.observe(
|
||||
this.#workspace.variantById(this.#variantId),
|
||||
async (variantInfo) => {
|
||||
if (!variantInfo) return;
|
||||
this.#currentVariant.setValue(variantInfo);
|
||||
},
|
||||
'_observeActiveVariant',
|
||||
);
|
||||
}
|
||||
|
||||
#createPropertyVariantId(property: UmbPropertyTypeModel) {
|
||||
return UmbVariantId.Create({
|
||||
culture: property.variesByCulture ? this.#variantId.culture : null,
|
||||
segment: property.variesBySegment ? this.#variantId.segment : null,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write proper JSDocs here.
|
||||
* Ideally do not use these methods, its better to communicate directly with the workspace, but if you do not know the property variant id, then this will figure it out for you. So good for externals to set or get values of a property.
|
||||
*/
|
||||
async propertyVariantId(propertyAlias: string) {
|
||||
return (await this.#workspace.structure.propertyStructureByAlias(propertyAlias)).pipe(
|
||||
map((property) => (property ? this.#createPropertyVariantId(property) : undefined)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write proper JSDocs here.
|
||||
* Ideally do not use these methods, its better to communicate directly with the workspace, but if you do not know the property variant id, then this will figure it out for you. So good for externals to set or get values of a property.
|
||||
*/
|
||||
async propertyValueByAlias<ReturnType = unknown>(propertyAlias: string) {
|
||||
await this.#workspace.isLoaded();
|
||||
return (await this.#workspace.structure.propertyStructureByAlias(propertyAlias)).pipe(
|
||||
map((property) =>
|
||||
property?.alias
|
||||
? this.#workspace.getPropertyValue<ReturnType>(property.alias, this.#createPropertyVariantId(property))
|
||||
: undefined,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: Refactor: Not used currently, but should investigate if we can implement this, to spare some energy.
|
||||
async propertyValueByAliasAndVariantId<ReturnType = unknown>(propertyAlias: string, propertyVariantId: UmbVariantId) {
|
||||
return this.#workspace.propertyValueByAlias<ReturnType>(propertyAlias, propertyVariantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write proper JSDocs here.
|
||||
* Ideally do not use these methods, its better to communicate directly with the workspace, but if you do not know the property variant id, then this will figure it out for you. So good for externals to set or get values of a property.
|
||||
*/
|
||||
async setPropertyValue(propertyAlias: string, value: unknown) {
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
const property = await this.#workspace.structure.getPropertyStructureByAlias(propertyAlias);
|
||||
if (property) {
|
||||
const variantId = this.#createPropertyVariantId(property);
|
||||
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
this.#workspace.setPropertyValue(propertyAlias, value, variantId);
|
||||
}
|
||||
}
|
||||
}
|
||||
export class UmbMediaPropertyDatasetContext extends UmbContentPropertyDatasetContext<
|
||||
UmbMediaTypeDetailModel,
|
||||
UmbMediaVariantModel
|
||||
> {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { UmbMediaTypeDetailRepository } from '../../media-types/repository/detail/media-type-detail.repository.js';
|
||||
import { UmbMediaPropertyDataContext } from '../property-dataset-context/media-property-dataset-context.js';
|
||||
import { UmbMediaPropertyDatasetContext } from '../property-dataset-context/media-property-dataset-context.js';
|
||||
import { UMB_MEDIA_ENTITY_TYPE } from '../entity.js';
|
||||
import { UmbMediaDetailRepository } from '../repository/index.js';
|
||||
import type { UmbMediaDetailModel, UmbMediaVariantModel, UmbMediaVariantOptionModel } from '../types.js';
|
||||
@@ -453,8 +453,11 @@ export class UmbMediaWorkspaceContext
|
||||
}
|
||||
*/
|
||||
|
||||
public createPropertyDatasetContext(host: UmbControllerHost, variantId: UmbVariantId) {
|
||||
return new UmbMediaPropertyDataContext(host, this, variantId);
|
||||
public createPropertyDatasetContext(
|
||||
host: UmbControllerHost,
|
||||
variantId: UmbVariantId,
|
||||
): UmbMediaPropertyDatasetContext {
|
||||
return new UmbMediaPropertyDatasetContext(host, this, variantId);
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { UMB_MEMBER_ENTITY_TYPE } from '../entity.js';
|
||||
import type { UmbMemberPropertyDataContext } from './member-property-dataset-context.js';
|
||||
import type { UmbMemberPropertyDatasetContext } from './member-property-dataset-context.js';
|
||||
import type { UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
export const IsMemberVariantContext = (context: UmbPropertyDatasetContext): context is UmbMemberPropertyDataContext =>
|
||||
context.getEntityType() === UMB_MEMBER_ENTITY_TYPE;
|
||||
export const IsMemberVariantContext = (
|
||||
context: UmbPropertyDatasetContext,
|
||||
): context is UmbMemberPropertyDatasetContext => context.getEntityType() === UMB_MEMBER_ENTITY_TYPE;
|
||||
|
||||
export const UMB_MEMBER_VARIANT_CONTEXT = new UmbContextToken<UmbPropertyDatasetContext, UmbMemberPropertyDataContext>(
|
||||
'UmbVariantContext',
|
||||
undefined,
|
||||
IsMemberVariantContext,
|
||||
);
|
||||
export const UMB_MEMBER_VARIANT_CONTEXT = new UmbContextToken<
|
||||
UmbPropertyDatasetContext,
|
||||
UmbMemberPropertyDatasetContext
|
||||
>('UmbVariantContext', undefined, IsMemberVariantContext);
|
||||
|
||||
@@ -1,118 +1,8 @@
|
||||
import type { UmbMemberWorkspaceContext } from '../workspace/member-workspace.context.js';
|
||||
import type { UmbNameablePropertyDatasetContext, UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import { UMB_PROPERTY_DATASET_CONTEXT } from '@umbraco-cms/backoffice/property';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import { map } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
|
||||
import type { UmbVariantModel } from '@umbraco-cms/backoffice/variant';
|
||||
import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
import type { UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbMemberVariantModel } from '../types.js';
|
||||
import { UmbContentPropertyDatasetContext } from '@umbraco-cms/backoffice/content';
|
||||
import type { UmbMemberTypeDetailModel } from '@umbraco-cms/backoffice/member-type';
|
||||
|
||||
// TODO: This code can be split into a UmbContentTypePropertyDatasetContext, leaving just the publishing state and methods to this class.
|
||||
export class UmbMemberPropertyDataContext
|
||||
extends UmbContextBase<UmbPropertyDatasetContext>
|
||||
implements UmbPropertyDatasetContext, UmbNameablePropertyDatasetContext
|
||||
{
|
||||
#workspace: UmbMemberWorkspaceContext;
|
||||
#variantId: UmbVariantId;
|
||||
public getVariantId() {
|
||||
return this.#variantId;
|
||||
}
|
||||
|
||||
#currentVariant = new UmbObjectState<UmbVariantModel | undefined>(undefined);
|
||||
currentVariant = this.#currentVariant.asObservable();
|
||||
|
||||
name = this.#currentVariant.asObservablePart((x) => x?.name);
|
||||
culture = this.#currentVariant.asObservablePart((x) => x?.culture);
|
||||
segment = this.#currentVariant.asObservablePart((x) => x?.segment);
|
||||
|
||||
// TODO: Refactor: Make a properties observable. (with such I think i mean a property value object array.. array with object with properties, alias, value, culture and segment)
|
||||
// TO make such happen I think we need to maintain all properties and their value of this object.
|
||||
// This will actually make it simpler if multiple are watching the same property.
|
||||
// But it will also mean that we wil watch all properties and their structure, for variantID, all the time for all of the properties.
|
||||
|
||||
getEntityType(): string {
|
||||
return this.#workspace.getEntityType();
|
||||
}
|
||||
getUnique(): string | undefined {
|
||||
return this.#workspace.getUnique();
|
||||
}
|
||||
getName(): string | undefined {
|
||||
return this.#workspace.getName(this.#variantId);
|
||||
}
|
||||
setName(name: string) {
|
||||
this.#workspace.setName(name, this.#variantId);
|
||||
}
|
||||
getVariantInfo() {
|
||||
return this.#workspace.getVariant(this.#variantId);
|
||||
}
|
||||
|
||||
constructor(host: UmbControllerHost, workspace: UmbMemberWorkspaceContext, variantId?: UmbVariantId) {
|
||||
// The controller alias, is a very generic name cause we want only one of these for this controller host.
|
||||
super(host, UMB_PROPERTY_DATASET_CONTEXT);
|
||||
this.#workspace = workspace;
|
||||
this.#variantId = variantId ?? UmbVariantId.CreateInvariant();
|
||||
|
||||
this.observe(
|
||||
this.#workspace.variantById(this.#variantId),
|
||||
async (variantInfo) => {
|
||||
if (!variantInfo) return;
|
||||
this.#currentVariant.setValue(variantInfo);
|
||||
},
|
||||
'_observeActiveVariant',
|
||||
);
|
||||
}
|
||||
|
||||
#createPropertyVariantId(property: UmbPropertyTypeModel) {
|
||||
return UmbVariantId.Create({
|
||||
culture: property.variesByCulture ? this.#variantId.culture : null,
|
||||
segment: property.variesBySegment ? this.#variantId.segment : null,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write proper JSDocs here.
|
||||
* Ideally do not use these methods, its better to communicate directly with the workspace, but if you do not know the property variant id, then this will figure it out for you. So good for externals to set or get values of a property.
|
||||
*/
|
||||
async propertyVariantId(propertyAlias: string) {
|
||||
return (await this.#workspace.structure.propertyStructureByAlias(propertyAlias)).pipe(
|
||||
map((property) => (property ? this.#createPropertyVariantId(property) : undefined)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write proper JSDocs here.
|
||||
* Ideally do not use these methods, its better to communicate directly with the workspace, but if you do not know the property variant id, then this will figure it out for you. So good for externals to set or get values of a property.
|
||||
*/
|
||||
async propertyValueByAlias<ReturnType = unknown>(propertyAlias: string) {
|
||||
await this.#workspace.isLoaded();
|
||||
return (await this.#workspace.structure.propertyStructureByAlias(propertyAlias)).pipe(
|
||||
map((property) =>
|
||||
property?.alias
|
||||
? this.#workspace.getPropertyValue<ReturnType>(property.alias, this.#createPropertyVariantId(property))
|
||||
: undefined,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: Refactor: Not used currently, but should investigate if we can implement this, to spare some energy.
|
||||
async propertyValueByAliasAndVariantId<ReturnType = unknown>(propertyAlias: string, propertyVariantId: UmbVariantId) {
|
||||
return this.#workspace.propertyValueByAlias<ReturnType>(propertyAlias, propertyVariantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write proper JSDocs here.
|
||||
* Ideally do not use these methods, its better to communicate directly with the workspace, but if you do not know the property variant id, then this will figure it out for you. So good for externals to set or get values of a property.
|
||||
*/
|
||||
async setPropertyValue(propertyAlias: string, value: unknown) {
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
const property = await this.#workspace.structure.getPropertyStructureByAlias(propertyAlias);
|
||||
if (property) {
|
||||
const variantId = this.#createPropertyVariantId(property);
|
||||
|
||||
// This is not reacting to if the property variant settings changes while running.
|
||||
this.#workspace.setPropertyValue(propertyAlias, value, variantId);
|
||||
}
|
||||
}
|
||||
}
|
||||
export class UmbMemberPropertyDatasetContext extends UmbContentPropertyDatasetContext<
|
||||
UmbMemberTypeDetailModel,
|
||||
UmbMemberVariantModel
|
||||
> {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { UmbMemberDetailRepository } from '../repository/index.js';
|
||||
import type { UmbMemberDetailModel, UmbMemberVariantModel, UmbMemberVariantOptionModel } from '../types.js';
|
||||
import { UmbMemberPropertyDataContext } from '../property-dataset-context/member-property-dataset-context.js';
|
||||
import { UmbMemberPropertyDatasetContext } from '../property-dataset-context/member-property-dataset-context.js';
|
||||
import { UMB_MEMBER_WORKSPACE_ALIAS } from './manifests.js';
|
||||
import { UmbMemberWorkspaceEditorElement } from './member-workspace-editor.element.js';
|
||||
import { type UmbMemberTypeDetailModel, UmbMemberTypeDetailRepository } from '@umbraco-cms/backoffice/member-type';
|
||||
@@ -371,8 +371,11 @@ export class UmbMemberWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
public createPropertyDatasetContext(host: UmbControllerHost, variantId: UmbVariantId) {
|
||||
return new UmbMemberPropertyDataContext(host, this, variantId);
|
||||
public createPropertyDatasetContext(
|
||||
host: UmbControllerHost,
|
||||
variantId: UmbVariantId,
|
||||
): UmbMemberPropertyDatasetContext {
|
||||
return new UmbMemberPropertyDatasetContext(host, this, variantId);
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
|
||||
Reference in New Issue
Block a user