Revert "move file system tree item into templating folder"

This reverts commit 48f238f5a0.
This commit is contained in:
Mads Rasmussen
2023-03-27 09:43:44 +02:00
parent 48f238f5a0
commit 55893a054f
8 changed files with 9 additions and 11 deletions

View File

@@ -37,6 +37,7 @@ import './table/table.element';
import './tree/tree.element';
import './tree/entity-tree-item/entity-tree-item.element';
import './tree/file-system-tree-item/file-system-tree-item.element';
import './tree/tree-menu-item/tree-menu-item.element';
import './variantable-property/variantable-property.element';

View File

@@ -1,7 +1,7 @@
import { UmbTreeItemContextBase } from '../../../shared/components/tree/tree-item-base/tree-item-base.context';
import { urlFriendlyPathFromServerFilePath } from '../../utils';
import { UmbTreeItemContextBase } from '../tree-item-base/tree-item-base.context';
import { UmbControllerHostInterface } from '@umbraco-cms/backoffice/controller';
import { FileSystemTreeItemPresentationModel } from '@umbraco-cms/backoffice/backend-api';
import { urlFriendlyPathFromServerPath } from 'src/backoffice/templating/utils';
// TODO get unique method from an entity repository static method
export class UmbFileSystemTreeItemContext extends UmbTreeItemContextBase<FileSystemTreeItemPresentationModel> {
@@ -10,6 +10,6 @@ export class UmbFileSystemTreeItemContext extends UmbTreeItemContextBase<FileSys
}
constructPath(pathname: string, entityType: string, path: string) {
return `section/${pathname}/workspace/${entityType}/edit/${urlFriendlyPathFromServerFilePath(path)}`;
return `section/${pathname}/workspace/${entityType}/edit/${urlFriendlyPathFromServerPath(path)}`;
}
}

View File

@@ -14,7 +14,7 @@ import {
} from '@umbraco-cms/backoffice/context-api';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-api';
import type { TreeItemPresentationModel } from '@umbraco-cms/backoffice/backend-api';
import { urlFriendlyPathFromServerFilePath } from 'src/backoffice/templating/utils';
import { urlFriendlyPathFromServerPath } from 'src/backoffice/templating/utils';
// add type for unique function
export type UmbTreeItemUniqueFunction<T extends TreeItemPresentationModel> = (x: T) => string | null | undefined;

View File

@@ -1 +0,0 @@
import './file-system-tree-item/file-system-tree-item.element';

View File

@@ -4,8 +4,6 @@ import { manifests as stylesheetManifests } from './stylesheets/manifests';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-api';
import { ManifestTypes } from '@umbraco-cms/backoffice/extensions-registry';
import './components';
export const manifests = [...menuManifests, ...templateManifests, ...stylesheetManifests];
const registerExtensions = (manifests: Array<ManifestTypes>) => {

View File

@@ -2,10 +2,10 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { css, html } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { IRoutingInfo } from 'router-slot';
import { serverFilePathFromUrlFriendlyPath } from '../../utils';
import { UmbStylesheetWorkspaceEditElement } from './stylesheet-workspace-edit.element';
import { UmbStylesheetWorkspaceContext } from './stylesheet-workspace.context';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { serverPathFromUrlFriendlyPath } from '../../utils';
@customElement('umb-stylesheet-workspace')
export class UmbStylesheetWorkspaceElement extends UmbLitElement {
@@ -30,7 +30,7 @@ export class UmbStylesheetWorkspaceElement extends UmbLitElement {
component: () => this.#element,
setup: (component: HTMLElement, info: IRoutingInfo) => {
const path = info.match.params.path;
const serverPath = serverFilePathFromUrlFriendlyPath(path);
const serverPath = serverPathFromUrlFriendlyPath(path);
this.#workspaceContext.load(serverPath);
},
},

View File

@@ -1,5 +1,5 @@
// TODO: we can try and make pretty urls if we want to
export const urlFriendlyPathFromServerFilePath = (path: string) => encodeURIComponent(path).replace('.', '-');
export const urlFriendlyPathFromServerPath = (path: string) => encodeURIComponent(path).replace('.', '-');
// TODO: we can try and make pretty urls if we want to
export const serverFilePathFromUrlFriendlyPath = (unique: string) => decodeURIComponent(unique.replace('-', '.'));
export const serverPathFromUrlFriendlyPath = (unique: string) => decodeURIComponent(unique.replace('-', '.'));