From 85883cee8587c1a13d25c8f414fc8556085b37d1 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 4 Mar 2025 15:22:22 +0100 Subject: [PATCH] Feature: Has Children Condition (#18161) * add children to reload translation * add has children condition + context * export * register manifests * set hasChildren value for tree items * add condition to document tree item * add has children condition to sort children of document * add conditions for media * add entity trashed event * dispatch event when entity is trashed * remove double event listeners * export action class * Update default-tree.context.ts * wip reload tree when entity is trashed * move into data folder * clean up listeners * move manifest * wip reload root * clean up * add recycle bin tree item * use for media * pass entity types through manifest + add recycle bin tree item kind * remove custom implementation for document recycle bin * use kind * rename to supportedEntityTypes * Update recycle-bin-tree-item.context.ts * clean up * remove condition * only show empty recycle bin if it has children * remove of sort children --- .../src/assets/lang/en-us.ts | 2 +- .../src/assets/lang/en.ts | 2 +- .../packages/core/entity-action/constants.ts | 1 + .../has-children/condition/constants.ts | 1 + .../entity-has-children.condition-config.ts | 12 +++++++ .../entity-has-children.condition.manifest.ts | 9 ++++++ .../entity-has-children.condition.ts | 25 +++++++++++++++ .../entity-action/has-children/constants.ts | 2 ++ .../has-children/context/constants.ts | 1 + .../context/has-children.context-token.ts | 6 ++++ .../context/has-children.entity-context.ts | 31 +++++++++++++++++++ .../has-children/context/index.ts | 1 + .../core/entity-action/has-children/index.ts | 1 + .../entity-action/has-children/manifests.ts | 4 +++ .../src/packages/core/entity-action/index.ts | 2 ++ .../packages/core/entity-action/manifests.ts | 2 ++ .../recycle-bin-tree-item.context.ts | 2 +- .../tree-item-base/tree-item-context-base.ts | 13 ++++++-- .../recycle-bin/entity-action/manifests.ts | 4 +++ .../recycle-bin/entity-action/manifests.ts | 6 ++++ .../package-lock.json | 8 ++--- .../Umbraco.Tests.AcceptanceTest/package.json | 2 +- .../Content/ChildrenContent.spec.ts | 2 +- .../ContentWithAllowedChildNodes.spec.ts | 2 +- .../ContentWithCollections.spec.ts | 4 +-- 25 files changed, 131 insertions(+), 14 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition-config.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition.manifest.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/has-children.context-token.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/has-children.entity-context.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/manifests.ts diff --git a/src/Umbraco.Web.UI.Client/src/assets/lang/en-us.ts b/src/Umbraco.Web.UI.Client/src/assets/lang/en-us.ts index 9a188a97bb..43b4c99226 100644 --- a/src/Umbraco.Web.UI.Client/src/assets/lang/en-us.ts +++ b/src/Umbraco.Web.UI.Client/src/assets/lang/en-us.ts @@ -48,7 +48,7 @@ export default { notify: 'Notifications', protect: 'Public Access', publish: 'Publish', - refreshNode: 'Reload', + refreshNode: 'Reload children', remove: 'Remove', rename: 'Rename', republish: 'Republish entire site', diff --git a/src/Umbraco.Web.UI.Client/src/assets/lang/en.ts b/src/Umbraco.Web.UI.Client/src/assets/lang/en.ts index c5079d0d76..93d8a67909 100644 --- a/src/Umbraco.Web.UI.Client/src/assets/lang/en.ts +++ b/src/Umbraco.Web.UI.Client/src/assets/lang/en.ts @@ -49,7 +49,7 @@ export default { protect: 'Public Access', publish: 'Publish', readOnly: 'Read-only', - refreshNode: 'Reload', + refreshNode: 'Reload children', remove: 'Remove', rename: 'Rename', republish: 'Republish entire site', diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/constants.ts index d60c068006..c6a840d160 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/constants.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/constants.ts @@ -1 +1,2 @@ export * from './common/constants.js'; +export * from './has-children/constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/constants.ts new file mode 100644 index 0000000000..cdfbe5b0b3 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/constants.ts @@ -0,0 +1 @@ +export const UMB_ENTITY_HAS_CHILDREN_CONDITION_ALIAS = 'Umb.Condition.EntityHasChildren'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition-config.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition-config.ts new file mode 100644 index 0000000000..2c08118a07 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition-config.ts @@ -0,0 +1,12 @@ +import type { UMB_ENTITY_HAS_CHILDREN_CONDITION_ALIAS } from './constants.js'; +import type { UmbConditionConfigBase } from '@umbraco-cms/backoffice/extension-api'; + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface UmbEntityHasChildrenConditionConfig + extends UmbConditionConfigBase {} + +declare global { + interface UmbExtensionConditionConfigMap { + UmbEntityHasChildrenConditionConfig: UmbEntityHasChildrenConditionConfig; + } +} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition.manifest.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition.manifest.ts new file mode 100644 index 0000000000..ddfde4f2a9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition.manifest.ts @@ -0,0 +1,9 @@ +import { UMB_ENTITY_HAS_CHILDREN_CONDITION_ALIAS } from './constants.js'; +import type { ManifestCondition } from '@umbraco-cms/backoffice/extension-api'; + +export const manifest: ManifestCondition = { + type: 'condition', + name: 'Entity Has Children Condition', + alias: UMB_ENTITY_HAS_CHILDREN_CONDITION_ALIAS, + api: () => import('./entity-has-children.condition.js'), +}; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition.ts new file mode 100644 index 0000000000..cc930c4cf8 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/condition/entity-has-children.condition.ts @@ -0,0 +1,25 @@ +import { UMB_HAS_CHILDREN_ENTITY_CONTEXT } from '../context/has-children.context-token.js'; +import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import type { + UmbConditionConfigBase, + UmbConditionControllerArguments, + UmbExtensionCondition, +} from '@umbraco-cms/backoffice/extension-api'; +import { UmbConditionBase } from '@umbraco-cms/backoffice/extension-registry'; + +export class UmbEntityHasChildrenCondition + extends UmbConditionBase + implements UmbExtensionCondition +{ + constructor(host: UmbControllerHost, args: UmbConditionControllerArguments) { + super(host, args); + + this.consumeContext(UMB_HAS_CHILDREN_ENTITY_CONTEXT, (context) => { + this.observe(context.hasChildren, (hasChildren) => { + this.permitted = hasChildren === true; + }); + }); + } +} + +export { UmbEntityHasChildrenCondition as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/constants.ts new file mode 100644 index 0000000000..853290d6b2 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/constants.ts @@ -0,0 +1,2 @@ +export * from './condition/constants.js'; +export * from './context/constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/constants.ts new file mode 100644 index 0000000000..137e79f843 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/constants.ts @@ -0,0 +1 @@ +export * from './has-children.context-token.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/has-children.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/has-children.context-token.ts new file mode 100644 index 0000000000..a2bb77d5e2 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/has-children.context-token.ts @@ -0,0 +1,6 @@ +import type { UmbHasChildrenEntityContext } from './has-children.entity-context.js'; +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; + +export const UMB_HAS_CHILDREN_ENTITY_CONTEXT = new UmbContextToken( + 'UmbHasChildrenEntityContext', +); diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/has-children.entity-context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/has-children.entity-context.ts new file mode 100644 index 0000000000..ed8d1c0de9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/has-children.entity-context.ts @@ -0,0 +1,31 @@ +import { UMB_HAS_CHILDREN_ENTITY_CONTEXT } from './has-children.context-token.js'; +import { UmbContextBase } from '@umbraco-cms/backoffice/class-api'; +import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import { UmbBooleanState } from '@umbraco-cms/backoffice/observable-api'; + +export class UmbHasChildrenEntityContext extends UmbContextBase { + #hasChildren = new UmbBooleanState(undefined); + public readonly hasChildren = this.#hasChildren.asObservable(); + + constructor(host: UmbControllerHost) { + super(host, UMB_HAS_CHILDREN_ENTITY_CONTEXT); + } + + /** + * Gets the hasChildren state + * @returns {boolean} - The hasChildren state + * @memberof UmbHasChildrenEntityContext + */ + public getHasChildren(): boolean | undefined { + return this.#hasChildren.getValue(); + } + + /** + * Sets the hasChildren state + * @param {boolean} hasChildren - The hasChildren state + * @memberof UmbHasChildrenEntityContext + */ + public setHasChildren(hasChildren: boolean) { + this.#hasChildren.setValue(hasChildren); + } +} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/index.ts new file mode 100644 index 0000000000..0b119e565c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/context/index.ts @@ -0,0 +1 @@ +export * from './has-children.entity-context.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/index.ts new file mode 100644 index 0000000000..00c55032bc --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/index.ts @@ -0,0 +1 @@ +export * from './context/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/manifests.ts new file mode 100644 index 0000000000..e3b60432b4 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/has-children/manifests.ts @@ -0,0 +1,4 @@ +import { manifest as conditionManifest } from './condition/entity-has-children.condition.manifest.js'; +import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [conditionManifest]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/index.ts index 886f167a42..2104b5fe36 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/index.ts @@ -5,8 +5,10 @@ export * from './constants.js'; export * from './entity-action-base.js'; export * from './entity-action-list.element.js'; export * from './entity-action.event.js'; +export * from './has-children/index.js'; export * from './entity-updated.event.js'; export * from './entity-deleted.event.js'; + export type * from './types.js'; export { UmbRequestReloadStructureForEntityEvent } from './request-reload-structure-for-entity.event.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/manifests.ts index 7d6813e49a..66347b90e6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/manifests.ts @@ -2,6 +2,7 @@ import { manifests as createEntityActionManifests } from './common/create/manife import { manifests as defaultEntityActionManifests } from './default/manifests.js'; import { manifests as deleteEntityActionManifests } from './common/delete/manifests.js'; import { manifests as duplicateEntityActionManifests } from './common/duplicate/manifests.js'; +import { manifests as hasChildrenManifests } from './has-children/manifests.js'; import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry'; @@ -10,4 +11,5 @@ export const manifests: Array = ...defaultEntityActionManifests, ...deleteEntityActionManifests, ...duplicateEntityActionManifests, + ...hasChildrenManifests, ]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/recycle-bin/tree/tree-item/recycle-bin-tree-item.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/recycle-bin/tree/tree-item/recycle-bin-tree-item.context.ts index ff1156ed0b..c0091158e8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/recycle-bin/tree/tree-item/recycle-bin-tree-item.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/recycle-bin/tree/tree-item/recycle-bin-tree-item.context.ts @@ -35,7 +35,7 @@ export class UmbRecycleBinTreeItemContext< const supportedEntityTypes = this.getManifest()?.meta.supportedEntityTypes; if (!supportedEntityTypes) { - throw new Error('Supported entity types are missing from the manifest. (manifest.meta.supportedEntityTypes)'); + throw new Error('Entity types are missing from the manifest (manifest.meta.supportedEntityTypes).'); } if (supportedEntityTypes.includes(entityType)) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-base/tree-item-context-base.ts b/src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-base/tree-item-context-base.ts index cd3e085fa2..93844ec277 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-base/tree-item-context-base.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-item/tree-item-base/tree-item-context-base.ts @@ -12,6 +12,7 @@ import { UMB_SECTION_CONTEXT, UMB_SECTION_SIDEBAR_CONTEXT } from '@umbraco-cms/b import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; import { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action'; import { + UmbHasChildrenEntityContext, UmbRequestReloadChildrenOfEntityEvent, UmbRequestReloadStructureForEntityEvent, } from '@umbraco-cms/backoffice/entity-action'; @@ -75,6 +76,8 @@ export abstract class UmbTreeItemContextBase< #sectionSidebarContext?: typeof UMB_SECTION_SIDEBAR_CONTEXT.TYPE; #actionEventContext?: typeof UMB_ACTION_EVENT_CONTEXT.TYPE; + #hasChildrenContext = new UmbHasChildrenEntityContext(this); + // TODO: get this from the tree context #paging = { skip: 0, @@ -128,7 +131,10 @@ export abstract class UmbTreeItemContextBase< if (!treeItem.entityType) throw new Error('Could not create tree item context, tree item type is missing'); this.entityType = treeItem.entityType; - this.#hasChildren.setValue(treeItem.hasChildren || false); + const hasChildren = treeItem.hasChildren || false; + this.#hasChildren.setValue(hasChildren); + this.#hasChildrenContext.setHasChildren(hasChildren); + this._treeItem.setValue(treeItem); // Update observers: @@ -184,7 +190,10 @@ export abstract class UmbTreeItemContextBase< this.#childItems.setValue(data.items); } - this.#hasChildren.setValue(data.total > 0); + const hasChildren = data.total > 0; + this.#hasChildren.setValue(hasChildren); + this.#hasChildrenContext.setHasChildren(hasChildren); + this.pagination.setTotalItems(data.total); } diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/recycle-bin/entity-action/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/recycle-bin/entity-action/manifests.ts index 6c4cf7b4b2..cc11edeb22 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/recycle-bin/entity-action/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/recycle-bin/entity-action/manifests.ts @@ -12,6 +12,7 @@ import { UMB_ENTITY_IS_NOT_TRASHED_CONDITION_ALIAS, UMB_ENTITY_IS_TRASHED_CONDITION_ALIAS, } from '@umbraco-cms/backoffice/recycle-bin'; +import { UMB_ENTITY_HAS_CHILDREN_CONDITION_ALIAS } from '@umbraco-cms/backoffice/entity-action'; export const manifests: Array = [ { @@ -70,6 +71,9 @@ export const manifests: Array = [ alias: 'Umb.Condition.UserPermission.Document', allOf: [UMB_USER_PERMISSION_DOCUMENT_DELETE], }, + { + alias: UMB_ENTITY_HAS_CHILDREN_CONDITION_ALIAS, + }, ], }, ...bulkTrashManifests, diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/recycle-bin/entity-action/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/recycle-bin/entity-action/manifests.ts index 65b3693975..144684b99c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/recycle-bin/entity-action/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/recycle-bin/entity-action/manifests.ts @@ -6,6 +6,7 @@ import { import { UMB_MEDIA_RECYCLE_BIN_ROOT_ENTITY_TYPE, UMB_MEDIA_RECYCLE_BIN_REPOSITORY_ALIAS } from '../constants.js'; import { UMB_MEDIA_REFERENCE_REPOSITORY_ALIAS } from '../../reference/constants.js'; import { manifests as bulkTrashManifests } from './bulk-trash/manifests.js'; +import { UMB_ENTITY_HAS_CHILDREN_CONDITION_ALIAS } from '@umbraco-cms/backoffice/entity-action'; import { UMB_ENTITY_IS_NOT_TRASHED_CONDITION_ALIAS, UMB_ENTITY_IS_TRASHED_CONDITION_ALIAS, @@ -55,6 +56,11 @@ export const manifests: Array = [ meta: { recycleBinRepositoryAlias: UMB_MEDIA_RECYCLE_BIN_REPOSITORY_ALIAS, }, + conditions: [ + { + alias: UMB_ENTITY_HAS_CHILDREN_CONDITION_ALIAS, + }, + ], }, ...bulkTrashManifests, ]; diff --git a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json index 43ad766350..46b9e661d8 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json @@ -8,7 +8,7 @@ "hasInstallScript": true, "dependencies": { "@umbraco/json-models-builders": "^2.0.29", - "@umbraco/playwright-testhelpers": "^15.0.27", + "@umbraco/playwright-testhelpers": "^15.0.29", "camelize": "^1.0.0", "dotenv": "^16.3.1", "node-fetch": "^2.6.7" @@ -67,9 +67,9 @@ } }, "node_modules/@umbraco/playwright-testhelpers": { - "version": "15.0.27", - "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-15.0.27.tgz", - "integrity": "sha512-PH1KDAN3Eo0eqKh5mmcZdNWPPuEWUr8RY/ZcGApZyTt5Sys2ES8aGFEReJV1fRyHsTT7Y2Q1qQfCES8p43v0dQ==", + "version": "15.0.29", + "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-15.0.29.tgz", + "integrity": "sha512-AHXmHkpB2fEYzjX5zyUjPArKhJyLi5CjzHuU/l5Bs9kwmn6QAIAdCpMt4LGoEizvBkDc+EiuH1JeMAHaV2Hhuw==", "license": "MIT", "dependencies": { "@umbraco/json-models-builders": "2.0.30", diff --git a/tests/Umbraco.Tests.AcceptanceTest/package.json b/tests/Umbraco.Tests.AcceptanceTest/package.json index 3d39c24048..42b975e74b 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package.json @@ -21,7 +21,7 @@ }, "dependencies": { "@umbraco/json-models-builders": "^2.0.29", - "@umbraco/playwright-testhelpers": "^15.0.27", + "@umbraco/playwright-testhelpers": "^15.0.29", "camelize": "^1.0.0", "dotenv": "^16.3.1", "node-fetch": "^2.6.7" diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts index f36fb09883..78cc3db04d 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ChildrenContent.spec.ts @@ -43,7 +43,7 @@ test('can create child node', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) = expect(childData[0].variants[0].name).toBe(childContentName); // verify that the child content displays in the tree after reloading children await umbracoUi.content.clickActionsMenuForContent(contentName); - await umbracoUi.content.clickReloadButton(); + await umbracoUi.content.clickReloadChildrenButton(); await umbracoUi.content.clickCaretButtonForContentName(contentName); await umbracoUi.content.doesContentTreeHaveName(childContentName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts index 766b26cdf1..d567a0984f 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithAllowedChildNodes.spec.ts @@ -83,7 +83,7 @@ test('can create multiple child nodes with different document types', async ({um expect(childData[1].variants[0].name).toBe(secondChildContentName); // verify that the child content displays in the tree after reloading children await umbracoUi.content.clickActionsMenuForContent(contentName); - await umbracoUi.content.clickReloadButton(); + await umbracoUi.content.clickReloadChildrenButton(); await umbracoUi.content.clickCaretButtonForContentName(contentName); await umbracoUi.content.doesContentTreeHaveName(firstChildContentName); await umbracoUi.content.doesContentTreeHaveName(secondChildContentName); diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithCollections.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithCollections.spec.ts index 17f17d6dab..98868fc1c1 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithCollections.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentWithDocumentTypeProperties/ContentWithCollections.spec.ts @@ -62,7 +62,7 @@ test('can create child content in a collection', async ({umbracoApi, umbracoUi}) expect(childData[0].variants[0].name).toBe(firstChildContentName); // verify that the child content displays in collection list after reloading tree await umbracoUi.content.clickActionsMenuForContent(contentName); - await umbracoUi.content.clickReloadButton(); + await umbracoUi.content.clickReloadChildrenButton(); await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.doesDocumentTableColumnNameValuesMatch(expectedNames); @@ -95,7 +95,7 @@ test('can create multiple child nodes in a collection', async ({umbracoApi, umbr expect(childData[1].variants[0].name).toBe(secondChildContentName); // verify that the child content displays in collection list after reloading tree await umbracoUi.content.clickActionsMenuForContent(contentName); - await umbracoUi.content.clickReloadButton(); + await umbracoUi.content.clickReloadChildrenButton(); await umbracoUi.content.goToContentWithName(contentName); await umbracoUi.content.doesDocumentTableColumnNameValuesMatch(expectedNames);