rename collection workspace interface

This commit is contained in:
Niels Lyngsø
2024-03-22 08:41:12 +01:00
parent 6c352947e2
commit e6d0c60ed0
4 changed files with 17 additions and 9 deletions

View File

@@ -2,9 +2,17 @@ import type { UmbWorkspaceContextInterface } from './workspace-context.interface
import type { Observable } from '@umbraco-cms/backoffice/external/rxjs';
import type { UmbContentTypeModel, UmbContentTypeStructureManager } from '@umbraco-cms/backoffice/content-type';
export interface UmbWorkspaceCollectionContextInterface<T extends UmbContentTypeModel>
export interface UmbCollectionWorkspaceContextInterface<T extends UmbContentTypeModel>
extends UmbWorkspaceContextInterface {
contentTypeHasCollection: Observable<boolean>;
getCollectionAlias(): string;
structure: UmbContentTypeStructureManager<T>;
}
/**
* @deprecated Use UmbCollectionWorkspaceContextInterface instead — Will be removed before RC.
* TODO: Delete before RC.
*/
export interface UmbWorkspaceCollectionContextInterface<T extends UmbContentTypeModel>
extends UmbCollectionWorkspaceContextInterface<T>

View File

@@ -2,15 +2,15 @@ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
import type { UmbContentTypeModel } from '@umbraco-cms/backoffice/content-type';
import type {
UmbWorkspaceContextInterface,
UmbWorkspaceCollectionContextInterface,
UmbCollectionWorkspaceContextInterface,
} from '@umbraco-cms/backoffice/workspace';
export const UMB_WORKSPACE_COLLECTION_CONTEXT = new UmbContextToken<
UmbWorkspaceContextInterface,
UmbWorkspaceCollectionContextInterface<UmbContentTypeModel>
UmbCollectionWorkspaceContextInterface<UmbContentTypeModel>
>(
'UmbWorkspaceContext',
undefined,
(context): context is UmbWorkspaceCollectionContextInterface<UmbContentTypeModel> =>
(context as UmbWorkspaceCollectionContextInterface<UmbContentTypeModel>).contentTypeHasCollection !== undefined,
(context): context is UmbCollectionWorkspaceContextInterface<UmbContentTypeModel> =>
(context as UmbCollectionWorkspaceContextInterface<UmbContentTypeModel>).contentTypeHasCollection !== undefined,
);

View File

@@ -28,7 +28,7 @@ import {
UmbWorkspaceSplitViewManager,
} from '@umbraco-cms/backoffice/workspace';
import type {
UmbWorkspaceCollectionContextInterface,
UmbCollectionWorkspaceContextInterface,
UmbVariantDatasetWorkspaceContextInterface,
UmbPublishableWorkspaceContextInterface,
UmbRoutableWorkspaceContext,
@@ -56,7 +56,7 @@ export class UmbDocumentWorkspaceContext
UmbRoutableWorkspaceContext,
UmbVariantDatasetWorkspaceContextInterface<UmbDocumentVariantModel>,
UmbPublishableWorkspaceContextInterface,
UmbWorkspaceCollectionContextInterface<UmbDocumentTypeDetailModel>
UmbCollectionWorkspaceContextInterface<UmbDocumentTypeDetailModel>
{
public readonly repository = new UmbDocumentDetailRepository(this);
public readonly publishingRepository = new UmbDocumentPublishingRepository(this);

View File

@@ -6,7 +6,7 @@ import type { UmbMediaDetailModel, UmbMediaVariantModel, UmbMediaVariantOptionMo
import { UMB_INVARIANT_CULTURE, UmbVariantId } from '@umbraco-cms/backoffice/variant';
import { UmbContentTypeStructureManager } from '@umbraco-cms/backoffice/content-type';
import type {
UmbWorkspaceCollectionContextInterface,
UmbCollectionWorkspaceContextInterface,
UmbVariantDatasetWorkspaceContextInterface,
} from '@umbraco-cms/backoffice/workspace';
import {
@@ -36,7 +36,7 @@ export class UmbMediaWorkspaceContext
extends UmbSaveableWorkspaceContextBase<EntityType>
implements
UmbVariantDatasetWorkspaceContextInterface,
UmbWorkspaceCollectionContextInterface<UmbMediaTypeDetailModel>
UmbCollectionWorkspaceContextInterface<UmbMediaTypeDetailModel>
{
//
public readonly repository = new UmbMediaDetailRepository(this);