From d662aa0fcd2ff7fb047b9bab88187a94ef1c54ef Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:02:17 +0200 Subject: [PATCH] chore: optimise the path length of the property-editor-ui-image-crops-configuration element --- .../image-crops-configuration/index.ts | 1 - ...editor-ui-image-crops-configuration.stories.ts | 15 --------------- .../media/property-editors/image-crops/index.ts | 1 + .../manifests.ts | 4 ++-- .../property-editor-ui-image-crops.element.ts} | 13 +++++-------- .../property-editor-ui-image-crops.stories.ts | 15 +++++++++++++++ .../property-editor-ui-image-crops.test.ts} | 12 +++++------- .../media/media/property-editors/index.ts | 2 +- .../media/media/property-editors/manifests.ts | 2 +- 9 files changed, 30 insertions(+), 35 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/index.ts delete mode 100644 src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.stories.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/index.ts rename src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/{image-crops-configuration => image-crops}/manifests.ts (69%) rename src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/{image-crops-configuration/property-editor-ui-image-crops-configuration.element.ts => image-crops/property-editor-ui-image-crops.element.ts} (93%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.stories.ts rename src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/{image-crops-configuration/property-editor-ui-image-crops-configuration.test.ts => image-crops/property-editor-ui-image-crops.test.ts} (61%) diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/index.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/index.ts deleted file mode 100644 index c68c521c08..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './property-editor-ui-image-crops-configuration.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.stories.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.stories.ts deleted file mode 100644 index 2cd2ffdb18..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.stories.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { UmbPropertyEditorUIImageCropsConfigurationElement } from './property-editor-ui-image-crops-configuration.element.js'; -import type { Meta, Story } from '@storybook/web-components'; -import { html } from '@umbraco-cms/backoffice/external/lit'; - -import './property-editor-ui-image-crops-configuration.element.js'; - -export default { - title: 'Property Editor UIs/Image Crops Configuration', - component: 'umb-property-editor-ui-image-crops-configuration', - id: 'umb-property-editor-ui-image-crops-configuration', -} as Meta; - -export const AAAOverview: Story = () => - html``; -AAAOverview.storyName = 'Overview'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/index.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/index.ts new file mode 100644 index 0000000000..e0bd6d0c5e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/index.ts @@ -0,0 +1 @@ +export * from './property-editor-ui-image-crops.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/manifests.ts similarity index 69% rename from src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/manifests.ts index d3bda8f6ee..03ee6346ac 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/manifests.ts @@ -3,8 +3,8 @@ import type { ManifestPropertyEditorUi } from '@umbraco-cms/backoffice/extension export const manifest: ManifestPropertyEditorUi = { type: 'propertyEditorUi', alias: 'Umb.PropertyEditorUi.ImageCropsConfiguration', - name: 'Image Crops Configuration Property Editor UI', - element: () => import('./property-editor-ui-image-crops-configuration.element.js'), + name: 'Image Crops Property Editor UI', + element: () => import('./property-editor-ui-image-crops.element.js'), meta: { label: 'Image Crops Configuration', icon: 'icon-autofill', diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.element.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.element.ts similarity index 93% rename from src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.element.ts index 4661cb9fb8..52f8db37de 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.element.ts @@ -13,13 +13,10 @@ export type UmbCrop = { }; /** - * @element umb-property-editor-ui-image-crops-configuration + * @element umb-property-editor-ui-image-crops */ -@customElement('umb-property-editor-ui-image-crops-configuration') -export class UmbPropertyEditorUIImageCropsConfigurationElement - extends UmbLitElement - implements UmbPropertyEditorUiElement -{ +@customElement('umb-property-editor-ui-image-crops') +export class UmbPropertyEditorUIImageCropsElement extends UmbLitElement implements UmbPropertyEditorUiElement { @query('#label') private _labelInput!: HTMLInputElement; @@ -244,10 +241,10 @@ export class UmbPropertyEditorUIImageCropsConfigurationElement ]; } -export default UmbPropertyEditorUIImageCropsConfigurationElement; +export default UmbPropertyEditorUIImageCropsElement; declare global { interface HTMLElementTagNameMap { - 'umb-property-editor-ui-image-crops-configuration': UmbPropertyEditorUIImageCropsConfigurationElement; + 'umb-property-editor-ui-image-crops': UmbPropertyEditorUIImageCropsElement; } } diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.stories.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.stories.ts new file mode 100644 index 0000000000..9e4fcc22ab --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.stories.ts @@ -0,0 +1,15 @@ +import type { UmbPropertyEditorUIImageCropsElement } from './property-editor-ui-image-crops.element.js'; +import type { Meta, StoryObj } from '@storybook/web-components'; + +import './property-editor-ui-image-crops.element.js'; + +const meta: Meta = { + title: 'Property Editor UIs/Image Crops', + id: 'umb-property-editor-ui-image-crops', + component: 'umb-property-editor-ui-image-crops', +}; + +export default meta; +type Story = StoryObj; + +export const Overview: Story = {}; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.test.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.test.ts similarity index 61% rename from src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.test.ts rename to src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.test.ts index 06c714d10c..e36bc07b0e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.test.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops/property-editor-ui-image-crops.test.ts @@ -1,19 +1,17 @@ -import { UmbPropertyEditorUIImageCropsConfigurationElement } from './property-editor-ui-image-crops-configuration.element.js'; +import { UmbPropertyEditorUIImageCropsElement } from './property-editor-ui-image-crops.element.js'; import { expect, fixture, html } from '@open-wc/testing'; import type { UmbTestRunnerWindow } from '@umbraco-cms/internal/test-utils'; //import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils'; -describe('UmbPropertyEditorUIImageCropsConfigurationElement', () => { - let element: UmbPropertyEditorUIImageCropsConfigurationElement; +describe('UmbPropertyEditorUIImageCropsElement', () => { + let element: UmbPropertyEditorUIImageCropsElement; beforeEach(async () => { - element = await fixture(html` - - `); + element = await fixture(html` `); }); it('is defined with its own instance', () => { - expect(element).to.be.instanceOf(UmbPropertyEditorUIImageCropsConfigurationElement); + expect(element).to.be.instanceOf(UmbPropertyEditorUIImageCropsElement); }); /* diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/index.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/index.ts index 91ac2c4199..0dc3ef8cf2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/index.ts @@ -1,5 +1,5 @@ export * from './image-cropper/index.js'; -export * from './image-crops-configuration/index.js'; +export * from './image-crops/index.js'; export * from './media-entity-picker/index.js'; export * from './media-picker/index.js'; export * from './upload-field/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/manifests.ts index 0cd00a29b7..c824ef42b2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/manifests.ts @@ -1,4 +1,4 @@ -import { manifest as imageCropsConfiguration } from './image-crops-configuration/manifests.js'; +import { manifest as imageCropsConfiguration } from './image-crops/manifests.js'; import { manifest as mediaEntityPicker } from './media-entity-picker/manifests.js'; import { manifests as imageCropperManifests } from './image-cropper/manifests.js'; import { manifests as mediaPickerManifests } from './media-picker/manifests.js';