more corrections

This commit is contained in:
Niels Lyngsø
2023-09-06 10:28:33 +02:00
parent 304f3faf5a
commit 8c24739b35
4 changed files with 8 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ import {
UMB_WORKSPACE_SPLIT_VIEW_CONTEXT,
UMB_VARIANT_CONTEXT,
ActiveVariant,
IsNameablePropertySetContext,
isNameablePropertySetContext,
} from '@umbraco-cms/backoffice/workspace';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { DocumentVariantResponseModel, ContentStateModel } from '@umbraco-cms/backoffice/backend-api';
@@ -54,7 +54,7 @@ export class UmbVariantSelectorElement extends UmbLitElement {
});
this.consumeContext(UMB_VARIANT_CONTEXT, (instance) => {
this.#variantContext = instance;
this._observeDatasetContext();
this._observeVariantContext();
});
}
@@ -92,7 +92,7 @@ export class UmbVariantSelectorElement extends UmbLitElement {
}
}
private async _observeDatasetContext() {
private async _observeVariantContext() {
if (!this.#variantContext) return;
const variantId = this.#variantContext.getVariantId();
@@ -123,7 +123,7 @@ export class UmbVariantSelectorElement extends UmbLitElement {
if (event instanceof UUIInputEvent) {
const target = event.composedPath()[0] as UUIInputElement;
if (typeof target?.value === 'string' && this.#variantContext && IsNameablePropertySetContext(this.#variantContext)) {
if (typeof target?.value === 'string' && this.#variantContext && isNameablePropertySetContext(this.#variantContext)) {
this.#variantContext.setName(target.value);
}
}

View File

@@ -2,8 +2,8 @@ import { type UmbVariantContext } from "./variant-context.interface.js";
import { UmbNameableVariantContext } from "./nameable-variant-context.interface.js";
import { UmbContextToken } from "@umbraco-cms/backoffice/context-api";
export const IsNameablePropertySetContext = (context: UmbVariantContext): context is UmbNameableVariantContext => 'setName' in context;
export const isNameablePropertySetContext = (context: UmbVariantContext): context is UmbNameableVariantContext => 'setName' in context;
export const UMB_NAMEABLE_VARIANT_CONTEXT = new UmbContextToken<UmbVariantContext, UmbNameableVariantContext>(
"UmbVariantContext",
IsNameablePropertySetContext);
isNameablePropertySetContext);

View File

@@ -5,6 +5,6 @@ import type { ValueModelBaseModel } from '@umbraco-cms/backoffice/backend-api';
export interface UmbPropertyStructureWorkspaceContextInterface<EntityType = unknown>
extends UmbWorkspaceContextInterface<EntityType> {
propertyDataById(id: string): Promise<Observable<ValueModelBaseModel | undefined>>;
propertyStructureById(id: string): Promise<Observable<ValueModelBaseModel | undefined>>;
}

View File

@@ -135,7 +135,7 @@ export class UmbDocumentWorkspaceContext
this.#currentData.update({ variants });
}
async propertyDataById(propertyId: string) {
async propertyStructureById(propertyId: string) {
return this.structure.propertyStructureById(propertyId);
}