From 7d02b58d800424bd65c04f07700cd97a3f7ece32 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 13 Nov 2023 15:29:07 +0100 Subject: [PATCH] use file system item store as base for stylesheet item store --- .../repository/item/stylesheet-item.store.ts | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts index c80754a7a3..f621751a98 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts @@ -1,35 +1,23 @@ import type { StylesheetItemResponseModel } from '@umbraco-cms/backoffice/backend-api'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api'; -import { UmbItemStore, UmbStoreBase } from '@umbraco-cms/backoffice/store'; -import { UmbArrayState } from '@umbraco-cms/backoffice/observable-api'; +import { UmbFileSystemItemStore } from '@umbraco-cms/backoffice/store'; /** * @export * @class UmbStylesheetItemStore - * @extends {UmbStoreBase} + * @extends {UmbFileSystemItemStore} * @description - Data Store for Stylesheet items */ -export class UmbStylesheetItemStore - extends UmbStoreBase - implements UmbItemStore -{ +export class UmbStylesheetItemStore extends UmbFileSystemItemStore { /** * Creates an instance of UmbStylesheetItemStore. * @param {UmbControllerHostElement} host * @memberof UmbStylesheetItemStore */ constructor(host: UmbControllerHostElement) { - super( - host, - UMB_STYLESHEET_ITEM_STORE_CONTEXT_TOKEN.toString(), - new UmbArrayState([], (x) => x.path), - ); - } - - items(ids: Array) { - return this._data.asObservablePart((items) => items.filter((item) => ids.includes(item.path ?? ''))); + super(host, UMB_STYLESHEET_ITEM_STORE_CONTEXT_TOKEN.toString()); } }