fixes
This commit is contained in:
@@ -7,6 +7,8 @@ import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
|
||||
export class UmbPublishDocumentEntityAction extends UmbEntityActionBase<unknown> {
|
||||
async execute() {
|
||||
if (!this.unique) throw new Error('The document unique identifier is missing');
|
||||
|
||||
const languageRepository = new UmbLanguageCollectionRepository(this._host);
|
||||
const { data: languageData } = await languageRepository.requestCollection({});
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
|
||||
export class UmbUnpublishDocumentEntityAction extends UmbEntityActionBase<unknown> {
|
||||
async execute() {
|
||||
if (!this.unique) throw new Error('The document unique identifier is missing');
|
||||
|
||||
const languageRepository = new UmbLanguageCollectionRepository(this._host);
|
||||
const { data: languageData } = await languageRepository.requestCollection({});
|
||||
|
||||
|
||||
@@ -21,35 +21,13 @@ export class UmbMediaTreeStore extends UmbUniqueTreeStore {
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
super(host, UMB_MEDIA_TREE_STORE_CONTEXT.toString());
|
||||
|
||||
new UmbStoreConnector<UmbMediaTreeItemModel, UmbMediaDetailModel>(
|
||||
host,
|
||||
this,
|
||||
UMB_MEDIA_DETAIL_STORE_CONTEXT,
|
||||
(item) => this.#createTreeItemMapper(item),
|
||||
(item) => this.#updateTreeItemMapper(item),
|
||||
);
|
||||
new UmbStoreConnector<UmbMediaTreeItemModel, UmbMediaDetailModel>(host, {
|
||||
store: this,
|
||||
connectToStoreAlias: UMB_MEDIA_DETAIL_STORE_CONTEXT,
|
||||
updateStoreItemMapper: (item) => this.#updateTreeItemMapper(item),
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: revisit this when we have decided on detail model sizes
|
||||
// TODO: Fix tree model
|
||||
#createTreeItemMapper = (item: UmbMediaDetailModel) => {
|
||||
const treeItem: UmbMediaTreeItemModel = {
|
||||
unique: item.unique,
|
||||
parentUnique: item.parentUnique,
|
||||
name: item.variants[0].name,
|
||||
entityType: item.entityType,
|
||||
isFolder: false,
|
||||
hasChildren: false,
|
||||
variants: item.variants,
|
||||
isTrashed: item.isTrashed,
|
||||
mediaType: { unique: item.mediaType.unique, icon: '', collection: null },
|
||||
noAccess: false,
|
||||
};
|
||||
|
||||
return treeItem;
|
||||
};
|
||||
|
||||
// TODO: revisit this when we have decided on detail model sizes
|
||||
#updateTreeItemMapper = (item: UmbMediaDetailModel) => {
|
||||
return {
|
||||
name: item.variants[0].name,
|
||||
|
||||
@@ -16,8 +16,6 @@ export class UmbMemberWorkspaceContext
|
||||
{
|
||||
public readonly repository = new UmbMemberDetailRepository(this);
|
||||
|
||||
#parentUnique: string | null = null;
|
||||
|
||||
#persistedData = new UmbObjectState<EntityType | undefined>(undefined);
|
||||
#currentData = new UmbObjectState<EntityType | undefined>(undefined);
|
||||
|
||||
@@ -45,9 +43,8 @@ export class UmbMemberWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
async create(parentUnique: string | null, memberTypeUnique: string) {
|
||||
async create(memberTypeUnique: string) {
|
||||
this.resetState();
|
||||
this.#parentUnique = parentUnique;
|
||||
const { data } = await this.repository.createScaffold({
|
||||
memberType: { unique: memberTypeUnique },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user