propertyInfoByAlias
This commit is contained in:
@@ -172,6 +172,11 @@ export class UmbDocumentWorkspaceContext
|
||||
return this.#draft.getObservablePart((data) => data?.properties?.filter((x) => variantId.compare(x)));
|
||||
}
|
||||
|
||||
propertyInfoByAlias(propertyAlias: string, variantId = new UmbVariantId()) {
|
||||
return this.#draft.getObservablePart((data) =>
|
||||
data?.properties?.find((x) => x?.alias === propertyAlias && variantId.compare(x))
|
||||
);
|
||||
}
|
||||
propertyValueByAlias(propertyAlias: string, variantId = new UmbVariantId()) {
|
||||
return this.#draft.getObservablePart(
|
||||
(data) => data?.properties?.find((x) => x?.alias === propertyAlias && variantId.compare(x))?.value
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface UmbWorkspaceInvariantableEntityContextInterface<T = unknown>
|
||||
getName(): void;
|
||||
setName(name: string): void;
|
||||
|
||||
propertyInfoByAlias(alias: string): Observable<PropertyViewModelBaseModel | undefined>;
|
||||
propertyValueByAlias(alias: string): Observable<any | undefined>;
|
||||
getPropertyValue(alias: string): void;
|
||||
setPropertyValue(alias: string, value: unknown): void;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { Observable } from 'rxjs';
|
||||
import { PropertyViewModelBaseModel } from '@umbraco-cms/backend-api';
|
||||
|
||||
export interface UmbWorkspacePropertySetContextInterface {
|
||||
propertyValueByAlias(alias: string): void;
|
||||
propertyInfoByAlias(alias: string): Observable<PropertyViewModelBaseModel | undefined>;
|
||||
propertyValueByAlias(alias: string): Observable<any | undefined>;
|
||||
getPropertyValue(alias: string): void;
|
||||
setPropertyValue(alias: string, value: unknown): void;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@ export class UmbWorkspacePropertySetContext implements UmbWorkspacePropertySetCo
|
||||
new UmbContextProviderController(host, 'umbWorkspacePropertySetContext', this);
|
||||
}
|
||||
|
||||
propertyDataByAlias(alias: string) {
|
||||
return this.workspaceContext.propertyDataByAlias(alias);
|
||||
}
|
||||
propertyValueByAlias(alias: string) {
|
||||
return this.workspaceContext.propertyValueByAlias(alias);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,9 @@ export class UmbWorkspaceVariantPropertySetContext implements UmbWorkspaceProper
|
||||
this.variantId = variantId;
|
||||
}
|
||||
|
||||
propertyDataByAlias(alias: string) {
|
||||
return this.workspaceContext.propertyDataByAlias(alias, this.variantId);
|
||||
}
|
||||
propertyValueByAlias(alias: string) {
|
||||
return this.workspaceContext.propertyValueByAlias(alias, this.variantId);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface UmbWorkspaceVariantableEntityContextInterface<T = unknown>
|
||||
getName(variantId?: UmbVariantId): void;
|
||||
setName(name: string, variantId?: UmbVariantId): void;
|
||||
|
||||
propertyInfoByAlias(alias: string, variantId?: UmbVariantId): Observable<PropertyViewModelBaseModel | undefined>;
|
||||
propertyValueByAlias(alias: string, variantId?: UmbVariantId): Observable<any | undefined>;
|
||||
getPropertyValue(alias: string, variantId?: UmbVariantId): void;
|
||||
setPropertyValue(alias: string, value: unknown, variantId?: UmbVariantId): void;
|
||||
|
||||
Reference in New Issue
Block a user