From 0e7d8002659985b74b967461cd0f1d14008b31aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 23 Aug 2023 10:37:34 +0200 Subject: [PATCH 1/4] use conditions right --- src/Umbraco.Web.UI.Client/README.md | 18 ++++++++++++------ .../utils/json-schema/test-package.json | 15 ++++++++++----- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/README.md b/src/Umbraco.Web.UI.Client/README.md index e8e2e3b0b4..6308975ef4 100644 --- a/src/Umbraco.Web.UI.Client/README.md +++ b/src/Umbraco.Web.UI.Client/README.md @@ -29,9 +29,12 @@ Create an umbraco-package.json file in the root of your package. "label": "My Dashboard", "pathname": "my-dashboard" }, - "conditions": { - "sections": ["Umb.Section.Content"] - } + "conditions": [ + { + "alias": "Umb.Condition.SectionAlias", + "match": "Umb.Section.Content" + } + ] } ] } @@ -157,9 +160,12 @@ Finally add an umbraco-package.json file in the root of your package folder `my- "label": "My Dashboard", "pathname": "my-dashboard" }, - "conditions": { - "sections": ["Umb.Section.Content"] - } + "conditions": [ + { + "alias": "Umb.Condition.SectionAlias", + "match": "Umb.Section.Content" + } + ] } ] } diff --git a/src/Umbraco.Web.UI.Client/utils/json-schema/test-package.json b/src/Umbraco.Web.UI.Client/utils/json-schema/test-package.json index 34edf0f9e9..4ddbf8a51f 100644 --- a/src/Umbraco.Web.UI.Client/utils/json-schema/test-package.json +++ b/src/Umbraco.Web.UI.Client/utils/json-schema/test-package.json @@ -6,7 +6,7 @@ { "name": "My Dashboard", "alias": "myDashboard", - + "weight": -10, "elementName": "my-dashboard", "js": "js/my-dashboard.js", @@ -14,9 +14,14 @@ "type": "dashboard", "meta": { "label": "My Dashboard", - "pathname": "my-dashboard", - "sections": ["Umb.Section.Content"] - } + "pathname": "my-dashboard" + }, + "conditions": [ + { + "alias": "Umb.Condition.SectionAlias", + "match": "Umb.Section.Content" + } + ] } ] -} \ No newline at end of file +} From d558db19cc79168d6140f241f91b115ce2acb916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 23 Aug 2023 10:39:20 +0200 Subject: [PATCH 2/4] update spacing --- .../utils/json-schema/test-package.json | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/utils/json-schema/test-package.json b/src/Umbraco.Web.UI.Client/utils/json-schema/test-package.json index 4ddbf8a51f..59034cd817 100644 --- a/src/Umbraco.Web.UI.Client/utils/json-schema/test-package.json +++ b/src/Umbraco.Web.UI.Client/utils/json-schema/test-package.json @@ -1,27 +1,27 @@ { - "$schema": "../../types/umbraco-package-schema.json", - "name": "My Package", - "version": "1.0.0", - "extensions": [ - { - "name": "My Dashboard", - "alias": "myDashboard", + "$schema": "../../types/umbraco-package-schema.json", + "name": "My Package", + "version": "1.0.0", + "extensions": [ + { + "name": "My Dashboard", + "alias": "myDashboard", - "weight": -10, - "elementName": "my-dashboard", - "js": "js/my-dashboard.js", + "weight": -10, + "elementName": "my-dashboard", + "js": "js/my-dashboard.js", - "type": "dashboard", - "meta": { - "label": "My Dashboard", - "pathname": "my-dashboard" - }, - "conditions": [ - { - "alias": "Umb.Condition.SectionAlias", - "match": "Umb.Section.Content" - } - ] - } - ] + "type": "dashboard", + "meta": { + "label": "My Dashboard", + "pathname": "my-dashboard" + }, + "conditions": [ + { + "alias": "Umb.Condition.SectionAlias", + "match": "Umb.Section.Content" + } + ] + } + ] } From e0a22a59bbc2902e38194be79c4c65ed731b0ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 23 Aug 2023 10:39:53 +0200 Subject: [PATCH 3/4] update import order --- .../src/packages/core/localization/localize.element.test.ts | 2 +- .../components/insert-menu/templating-insert-menu.element.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/localization/localize.element.test.ts b/src/Umbraco.Web.UI.Client/src/packages/core/localization/localize.element.test.ts index 3e46e024bb..478dc8ba7f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/localization/localize.element.test.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/localization/localize.element.test.ts @@ -1,6 +1,6 @@ import { aTimeout, elementUpdated, expect, fixture, html } from '@open-wc/testing'; -import { umbTranslationRegistry } from '@umbraco-cms/backoffice/localization'; import { UmbLocalizeElement } from './localize.element.js'; +import { umbTranslationRegistry } from '@umbraco-cms/backoffice/localization'; import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; import { UmbLocalizeController } from '@umbraco-cms/backoffice/localization-api'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/components/insert-menu/templating-insert-menu.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/components/insert-menu/templating-insert-menu.element.ts index babb659488..19fe1076a7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/components/insert-menu/templating-insert-menu.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/components/insert-menu/templating-insert-menu.element.ts @@ -1,7 +1,7 @@ -import { UmbDictionaryRepository } from '@umbraco-cms/backoffice/dictionary'; import { UMB_MODAL_TEMPLATING_INSERT_CHOOSE_TYPE_SIDEBAR_ALIAS } from '../../modals/manifests.js'; import { getInsertDictionarySnippet, getInsertPartialSnippet } from '../../utils.js'; import { ChooseInsertTypeModalResult, CodeSnippetType } from '../../modals/insert-choose-type-sidebar.element.js'; +import { UmbDictionaryRepository } from '@umbraco-cms/backoffice/dictionary'; import { customElement, property, css, html } from '@umbraco-cms/backoffice/external/lit'; import { UUITextStyles } from '@umbraco-cms/backoffice/external/uui'; import { From 517dc7623691b528ecc7a4ea84349e7450ce928f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 23 Aug 2023 14:28:41 +0200 Subject: [PATCH 4/4] correct mdx docs --- .../storybook/stories/extending/registration/conditions.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/storybook/stories/extending/registration/conditions.mdx b/src/Umbraco.Web.UI.Client/storybook/stories/extending/registration/conditions.mdx index 9833605deb..24ae95827f 100644 --- a/src/Umbraco.Web.UI.Client/storybook/stories/extending/registration/conditions.mdx +++ b/src/Umbraco.Web.UI.Client/storybook/stories/extending/registration/conditions.mdx @@ -25,7 +25,7 @@ In this following example we define the manifest for a Workspace Action, this ac conditions: [ { alias: 'Umb.Condition.SectionAlias', - matches: 'My.Example.Workspace' + match: 'My.Example.Workspace' } ] } @@ -37,7 +37,7 @@ Each condition is an object with the following properties: - `alias`- The alias of the condition to utilize. - `...` - The rest of the properties of the object are specific to the condition. -In the above example the `Umb.Condition.SectionAlias` condition is used, this condition takes a property `matches` which must be set to the alias of the section to match. +In the above example the `Umb.Condition.SectionAlias` condition is used, this condition takes a property `match` which must be set to the alias of the section to match. ### Core conditions types