Skip to content

16.1.0-rc - Reload entity action does not close entity action menu #19761

@warrenbuckley

Description

@warrenbuckley

Which Umbraco version are you using?

16.1.0-rc

Bug summary

Clicking the reload entity action menu item, does not close the menu after executing the action

Specifics

It seems that this is/was an issue before and perhaps is a regression?

Original issue reported by @nhudinh0309
#19295

Original PR fixing issue
#19305

Video - vanilla install of 16.1.0-rc

20250721-0922-57.2810170.mp4

Video - Content Lock entity actions not closing menu

20250721-0935-36.2119549.mp4

Entity Action Code

import { UmbControllerHost } from "@umbraco-cms/backoffice/controller-api";
import { UmbEntityActionArgs, UmbEntityActionBase } from "@umbraco-cms/backoffice/entity-action";
import { UMB_NOTIFICATION_CONTEXT, UmbNotificationContext } from "@umbraco-cms/backoffice/notification";
import { ContentLockService } from "../api";
import { ProblemDetailResponse } from "../interfaces/ProblemDetailResponse";
import { UmbLocalizationController } from "@umbraco-cms/backoffice/localization-api";

export class LockDocumentEntityAction extends UmbEntityActionBase<never> {
    
    #notificationCtx?: UmbNotificationContext;

    // Create a new instance of the controller and attach it to the element
    #localize = new UmbLocalizationController(this);

    constructor(host: UmbControllerHost, args: UmbEntityActionArgs<never>) {
        super(host, args);

        this.getContext(UMB_NOTIFICATION_CONTEXT).then((notificationCtx) => {
            this.#notificationCtx = notificationCtx;
        });
    }

    async execute() {
        if (!this.args.unique) {
            throw new Error('The document unique identifier is missing');
        }

        // Make API call
        const { error } = await ContentLockService.lockContent({
            path: {
                key: this.args.unique
            }
        });

        if(error) {
            const errorResponse = error as ProblemDetailResponse;
            this.#notificationCtx?.peek('danger', {
                data: {
                    headline: errorResponse.title,
                    message: errorResponse.detail
                }
            });

            return;
        }

        // Success notification
        this.#notificationCtx?.peek('positive', {
            data: {
                headline: this.#localize.term('contentLockNotification_lockedHeader'),
                message: this.#localize.term('contentLockNotification_lockedMessage')
            }
        });
    }
}

Steps to reproduce

  • Login to backoffice
  • Navigate to content tree
  • Open entity actions menu from three dots
  • Choose Reload
  • Menu does not close after action clicked/completed

Expected result / actual result

When clicking any entity action that it will close the entity action menu


This item has been added to our backlog AB#54974

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions