migrate UmbMediaTypeStore to UmbContextAlias
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
UmbDocumentTypeStore,
|
||||
UMB_DOCUMENT_TYPE_STORE_CONTEXT_ALIAS,
|
||||
} from './documents/document-types/document-type.store';
|
||||
import { UmbMediaTypeStore } from './media/media-types/media-type.store';
|
||||
import { UmbMediaTypeStore, UMB_MEDIA_TYPE_STORE_CONTEXT_ALIAS } from './media/media-types/media-type.store';
|
||||
import { UmbMemberTypeStore } from './members/member-types/member-type.store';
|
||||
import { UmbDocumentStore, UMB_DOCUMENT_STORE_CONTEXT_ALIAS } from './documents/documents/document.store';
|
||||
import { UmbMediaStore, UMB_MEDIA_STORE_CONTEXT_ALIAS } from './media/media/media.store';
|
||||
@@ -65,7 +65,7 @@ export class UmbBackofficeElement extends UmbLitElement {
|
||||
this.provideContext(UMB_MEDIA_STORE_CONTEXT_ALIAS, new UmbMediaStore(this));
|
||||
this.provideContext(UMB_DATA_TYPE_STORE_CONTEXT_ALIAS, new UmbDataTypeStore(this));
|
||||
this.provideContext(UMB_DOCUMENT_TYPE_STORE_CONTEXT_ALIAS, new UmbDocumentTypeStore(this));
|
||||
this.provideContext('umbMediaTypeStore', new UmbMediaTypeStore(this));
|
||||
this.provideContext(UMB_MEDIA_TYPE_STORE_CONTEXT_ALIAS, new UmbMediaTypeStore(this));
|
||||
this.provideContext('umbMemberTypeStore', new UmbMemberTypeStore(this));
|
||||
this.provideContext('umbUserStore', new UmbUserStore(this));
|
||||
this.provideContext('umbUserGroupStore', new UmbUserGroupStore(this));
|
||||
|
||||
@@ -3,8 +3,12 @@ import { UmbNodeStoreBase } from '../../../core/stores/store';
|
||||
import { MediaTypeResource, FolderTreeItem } from '@umbraco-cms/backend-api';
|
||||
import type { MediaTypeDetails } from '@umbraco-cms/models';
|
||||
import { tryExecuteAndNotify } from '@umbraco-cms/resources';
|
||||
import { UmbContextAlias } from '@umbraco-cms/context-api';
|
||||
|
||||
export type UmbMediaTypeStoreItemType = MediaTypeDetails | FolderTreeItem;
|
||||
|
||||
export const STORE_ALIAS = 'umbMediaTypeStore';
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @class UmbMediaTypeStore
|
||||
@@ -12,7 +16,7 @@ export type UmbMediaTypeStoreItemType = MediaTypeDetails | FolderTreeItem;
|
||||
* @description - Data Store for Media Types
|
||||
*/
|
||||
export class UmbMediaTypeStore extends UmbNodeStoreBase<UmbMediaTypeStoreItemType> {
|
||||
public readonly storeAlias = 'umbMediaTypeStore';
|
||||
public readonly storeAlias = STORE_ALIAS;
|
||||
|
||||
/**
|
||||
* @description - Request a Data Type by key. The Data Type is added to the store and is returned as an Observable.
|
||||
@@ -85,3 +89,5 @@ export class UmbMediaTypeStore extends UmbNodeStoreBase<UmbMediaTypeStoreItemTyp
|
||||
return this.items.pipe(map((items) => items.filter((item) => item.parentKey === key)));
|
||||
}
|
||||
}
|
||||
|
||||
export const UMB_MEDIA_TYPE_STORE_CONTEXT_ALIAS = new UmbContextAlias<UmbMediaTypeStore>(STORE_ALIAS);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { STORE_ALIAS } from '../media-type.store';
|
||||
import type { ManifestTree, ManifestTreeItemAction } from '@umbraco-cms/models';
|
||||
|
||||
const tree: ManifestTree = {
|
||||
@@ -5,7 +6,7 @@ const tree: ManifestTree = {
|
||||
alias: 'Umb.Tree.MediaTypes',
|
||||
name: 'Media Types Tree',
|
||||
meta: {
|
||||
storeAlias: 'umbMediaTypeStore',
|
||||
storeAlias: STORE_ALIAS,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user