diff --git a/src/Umbraco.Web.UI.Client/libs/store/store.ts b/src/Umbraco.Web.UI.Client/libs/store/store.ts index 083cc9fc2f..d4af9c2275 100644 --- a/src/Umbraco.Web.UI.Client/libs/store/store.ts +++ b/src/Umbraco.Web.UI.Client/libs/store/store.ts @@ -9,33 +9,7 @@ export interface UmbDataStore { readonly storeAlias: string; } -export interface UmbTreeStore extends UmbDataStore { - - getTreeRoot(): Observable>; - - getTreeItemChildren(key: string): Observable>; - - // Notice: this might not be right to put here as only some content items has ability to be trashed. - /** - * @description - Trash data. - * @param {string[]} keys - * @return {*} {(Promise)} - * @memberof UmbTreeStore - */ - trash(keys: string[]): Promise; - - // Notice: this might not be right to put here as only some content items has ability to be moved. - /** - * @description - Move data. - * @param {string[]} keys - * @return {*} {(Promise)} - * @memberof UmbTreeStore - */ - move(keys: string[], destination: string): Promise; -} - export interface UmbEntityDetailStore extends UmbDataStore { - /** * @description - Request scaffold data by entityType and . The data is added to the store and is returned as an Observable. * @param {string} key @@ -61,10 +35,7 @@ export interface UmbEntityDetailStore extends UmbDataStore { save(data: T[]): Promise; } - export interface UmbContentStore extends UmbEntityDetailStore { - // TODO: make something that is specific for UmbContentStore, or then we should get rid of it. But for now i kept it as we might want this for rollback or other things specific to Content types. save(data: T[]): Promise; - } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/collection.context.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/collection.context.ts index 4347266039..d698ed1f71 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/collection.context.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/collection.context.ts @@ -1,6 +1,5 @@ import { Observable } from 'rxjs'; import type { EntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api'; -import type { UmbTreeStore } from '@umbraco-cms/backoffice/store'; import type { UmbControllerHostInterface } from '@umbraco-cms/backoffice/controller'; import { UmbContextToken, UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api'; import { ArrayState, UmbObserverController } from '@umbraco-cms/backoffice/observable-api'; @@ -9,17 +8,14 @@ import { createExtensionClass } from 'libs/extensions-api/create-extension-class import { UmbTreeRepository } from '@umbraco-cms/backoffice/repository'; // TODO: Clean up the need for store as Media has switched to use Repositories(repository). -export class UmbCollectionContext< - DataType extends EntityTreeItemResponseModel = EntityTreeItemResponseModel, - StoreType extends UmbTreeStore = UmbTreeStore -> { +export class UmbCollectionContext { private _host: UmbControllerHostInterface; private _entityType: string | null; private _entityKey: string | null; #repository?: UmbTreeRepository; - private _store?: StoreType; + private _store?: any; protected _dataObserver?: UmbObserverController; #data = new ArrayState(>[]); @@ -46,7 +42,7 @@ export class UmbCollectionContext< this._entityKey = entityKey; if (storeAlias) { - new UmbContextConsumerController(this._host, storeAlias, (_instance: StoreType) => { + new UmbContextConsumerController(this._host, storeAlias, (_instance) => { this._store = _instance; if (!this._store) { // TODO: if we keep the type assumption of _store existing, then we should here make sure to break the application in a good way. @@ -175,4 +171,4 @@ export class UmbCollectionContext< } } -export const UMB_COLLECTION_CONTEXT_TOKEN = new UmbContextToken>('UmbCollectionContext'); +export const UMB_COLLECTION_CONTEXT_TOKEN = new UmbContextToken>('UmbCollectionContext'); diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/dashboards/dashboard-collection.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/dashboards/dashboard-collection.element.ts index 5c21bbee38..2c96968191 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/dashboards/dashboard-collection.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/dashboards/dashboard-collection.element.ts @@ -25,7 +25,7 @@ export class UmbDashboardCollectionElement extends UmbLitElement { ]; // TODO: Use the right type here: - private _collectionContext?: UmbCollectionContext; + private _collectionContext?: UmbCollectionContext; public manifest!: ManifestDashboardCollection; diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/views/collection/workspace-view-collection.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/views/collection/workspace-view-collection.element.ts index a5a5be1fec..b6c42e1de1 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/views/collection/workspace-view-collection.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/views/collection/workspace-view-collection.element.ts @@ -30,7 +30,7 @@ export class UmbWorkspaceViewCollectionElement extends UmbLitElement { private _workspaceContext?: UmbEntityWorkspaceContextInterface; // TODO: add type for the collection context. - private _collectionContext?: UmbCollectionContext; + private _collectionContext?: UmbCollectionContext; constructor() { super();