remove file system tree

This commit is contained in:
Julia Gru
2023-07-18 09:46:53 +02:00
parent f422033083
commit 6954647784
3 changed files with 4 additions and 62 deletions

View File

@@ -6,4 +6,8 @@ export class UmbFileSystemTreeItemContext extends UmbTreeItemContextBase<FileSys
constructor(host: UmbControllerHostElement) {
super(host, (x: FileSystemTreeItemPresentationModel) => x.path);
}
constructPath(pathname: string, entityType: string, path: string) {
return `section/${pathname}/workspace/${entityType}/edit/${encodeURIComponent(path).replace('.', '-')}`;
}
}

View File

@@ -1,14 +0,0 @@
import { urlFriendlyPathFromServerFilePath } from '../../utils.js';
import { UmbTreeItemContextBase } from '@umbraco-cms/backoffice/tree';
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
import { FileSystemTreeItemPresentationModel } from '@umbraco-cms/backoffice/backend-api';
export class UmbFileSystemTreeItemContext extends UmbTreeItemContextBase<FileSystemTreeItemPresentationModel> {
constructor(host: UmbControllerHostElement) {
super(host, (x: FileSystemTreeItemPresentationModel) => x.path);
}
constructPath(pathname: string, entityType: string, path: string) {
return `section/${pathname}/workspace/${entityType}/edit/${urlFriendlyPathFromServerFilePath(path)}`;
}
}

View File

@@ -1,48 +0,0 @@
import { UmbFileSystemTreeItemContext } from './file-system-tree-item.context.js';
import { css, html, nothing, customElement, property } from '@umbraco-cms/backoffice/external/lit';
import { UUITextStyles } from '@umbraco-cms/backoffice/external/uui';
import { UmbTreeItemElement } from '@umbraco-cms/backoffice/tree';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { UmbBackofficeManifestKind, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import { FileSystemTreeItemPresentationModel } from '@umbraco-cms/backoffice/backend-api';
// TODO: Move to separate file:
const manifest: UmbBackofficeManifestKind = {
type: 'kind',
alias: 'Umb.Kind.FileSystemTreeItem',
matchKind: 'fileSystem',
matchType: 'treeItem',
manifest: {
type: 'treeItem',
elementName: 'umb-file-system-tree-item',
},
};
umbExtensionsRegistry.register(manifest);
@customElement('umb-file-system-tree-item')
export class UmbFileSystemTreeItemElement extends UmbLitElement implements UmbTreeItemElement {
private _item?: FileSystemTreeItemPresentationModel;
@property({ type: Object, attribute: false })
public get item() {
return this._item;
}
public set item(value: FileSystemTreeItemPresentationModel | undefined) {
this._item = value;
this.#context.setTreeItem(value);
}
#context = new UmbFileSystemTreeItemContext(this);
render() {
if (!this.item) return nothing;
return html`<umb-tree-item-base></umb-tree-item-base>`;
}
static styles = [UUITextStyles, css``];
}
declare global {
interface HTMLElementTagNameMap {
'umb-file-system-tree-item': UmbFileSystemTreeItemElement;
}
}