diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/backoffice.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/backoffice.element.ts index 8f260397cb..9c33e5ea91 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/backoffice.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/backoffice.element.ts @@ -15,8 +15,6 @@ import { UmbBackofficeContext, UMB_BACKOFFICE_CONTEXT_TOKEN, } from './shared/components/backoffice-frame/backoffice.context'; -import { UmbDictionaryDetailStore } from './translation/dictionary/repository/dictionary.detail.store'; -import { UmbDictionaryTreeStore } from './translation/dictionary/repository/dictionary.tree.store'; import { UmbDocumentBlueprintDetailStore } from './documents/document-blueprints/document-blueprint.detail.store'; import { UmbDocumentBlueprintTreeStore } from './documents/document-blueprints/document-blueprint.tree.store'; import { UmbTemplateTreeStore } from './templating/templates/tree/data/template.tree.store'; @@ -74,8 +72,6 @@ export class UmbBackofficeElement extends UmbLitElement { new UmbUserStore(this); new UmbUserGroupStore(this); - new UmbDictionaryDetailStore(this); - new UmbDictionaryTreeStore(this); new UmbDocumentBlueprintDetailStore(this); new UmbDocumentBlueprintTreeStore(this); new UmbTemplateTreeStore(this); diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.repository.ts b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.repository.ts index 745e1ad8b4..2618c22ffd 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.repository.ts @@ -1,7 +1,7 @@ import { DictionaryTreeServerDataSource } from './sources/dictionary.tree.server.data'; import { UmbDictionaryTreeStore, UMB_DICTIONARY_TREE_STORE_CONTEXT_TOKEN } from './dictionary.tree.store'; import { UmbDictionaryDetailServerDataSource } from './sources/dictionary.detail.server.data'; -import { UmbDictionaryDetailStore, UMB_DICTIONARY_DETAIL_STORE_CONTEXT_TOKEN } from './dictionary.detail.store'; +import { UmbDictionaryStore, UMB_DICTIONARY_STORE_CONTEXT_TOKEN } from './dictionary.store'; import { UmbControllerHostInterface } from '@umbraco-cms/controller'; import { UmbContextConsumerController } from '@umbraco-cms/context-api'; import { RepositoryTreeDataSource, UmbDetailRepository, UmbTreeRepository } from '@umbraco-cms/repository'; @@ -18,7 +18,7 @@ export class UmbDictionaryRepository implements UmbTreeRepository, UmbDetailRepo #treeStore?: UmbDictionaryTreeStore; #detailSource: UmbDictionaryDetailServerDataSource; - #detailStore?: UmbDictionaryDetailStore; + #detailStore?: UmbDictionaryStore; #notificationContext?: UmbNotificationContext; @@ -30,7 +30,7 @@ export class UmbDictionaryRepository implements UmbTreeRepository, UmbDetailRepo this.#detailSource = new UmbDictionaryDetailServerDataSource(this.#host); this.#init = Promise.all([ - new UmbContextConsumerController(this.#host, UMB_DICTIONARY_DETAIL_STORE_CONTEXT_TOKEN, (instance) => { + new UmbContextConsumerController(this.#host, UMB_DICTIONARY_STORE_CONTEXT_TOKEN, (instance) => { this.#detailStore = instance; }), diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.detail.store.ts b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.store.ts similarity index 64% rename from src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.detail.store.ts rename to src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.store.ts index 9139f184b4..710115eae8 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.detail.store.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.store.ts @@ -6,17 +6,15 @@ import type { DictionaryDetails } from '@umbraco-cms/models'; /** * @export - * @class UmbDictionaryDetailStore + * @class UmbDictionaryStore * @extends {UmbStoreBase} - * @description - Details Data Store for Dictionary + * @description - Data Store for Dictionary */ -export class UmbDictionaryDetailStore - extends UmbStoreBase -{ +export class UmbDictionaryStore extends UmbStoreBase { #data = new ArrayState([], (x) => x.key); constructor(host: UmbControllerHostInterface) { - super(host, UmbDictionaryDetailStore.name); + super(host, UmbDictionaryStore.name); } append(dictionary: DictionaryDetails) { @@ -25,9 +23,7 @@ export class UmbDictionaryDetailStore remove(uniques: string[]) { this.#data.remove(uniques); - } + } } -export const UMB_DICTIONARY_DETAIL_STORE_CONTEXT_TOKEN = new UmbContextToken( - UmbDictionaryDetailStore.name -); \ No newline at end of file +export const UMB_DICTIONARY_STORE_CONTEXT_TOKEN = new UmbContextToken(UmbDictionaryStore.name); diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.tree.store.ts b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.tree.store.ts index d71ec0afcf..fdc7d40bff 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.tree.store.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/dictionary.tree.store.ts @@ -9,7 +9,6 @@ import { UmbControllerHostInterface } from '@umbraco-cms/controller'; * @description - Tree Data Store for Dictionary */ export class UmbDictionaryTreeStore extends UmbTreeStoreBase { - /** * Creates an instance of UmbDictionaryTreeStore. * @param {UmbControllerHostInterface} host @@ -22,4 +21,4 @@ export class UmbDictionaryTreeStore extends UmbTreeStoreBase { export const UMB_DICTIONARY_TREE_STORE_CONTEXT_TOKEN = new UmbContextToken( UmbDictionaryTreeStore.name -); \ No newline at end of file +); diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/manifests.ts b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/manifests.ts index 3e900b29a5..0309458660 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/manifests.ts @@ -1,5 +1,8 @@ import { UmbDictionaryRepository } from '../repository/dictionary.repository'; +import { UmbDictionaryTreeStore } from './dictionary.tree.store'; +import { UmbDictionaryStore } from './dictionary.store'; import { ManifestRepository } from 'libs/extensions-registry/repository.models'; +import { ManifestStore, ManifestTreeStore } from '@umbraco-cms/extensions-registry'; export const DICTIONARY_REPOSITORY_ALIAS = 'Umb.Repository.Dictionary'; @@ -10,4 +13,21 @@ const repository: ManifestRepository = { class: UmbDictionaryRepository, }; -export const manifests = [repository]; +export const DICTIONARY_STORE_ALIAS = 'Umb.Store.Dictionary'; +export const DICTIONARY_TREE_STORE_ALIAS = 'Umb.Store.DictionaryTree'; + +const store: ManifestStore = { + type: 'store', + alias: DICTIONARY_STORE_ALIAS, + name: 'Dictionary Store', + class: UmbDictionaryStore, +}; + +const treeStore: ManifestTreeStore = { + type: 'treeStore', + alias: DICTIONARY_TREE_STORE_ALIAS, + name: 'Dictionary Tree Store', + class: UmbDictionaryTreeStore, +}; + +export const manifests = [repository, store, treeStore];