Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular error when adding a custom action in the ContainerMenu #73

Closed
jemayn opened this issue Nov 3, 2023 · 2 comments
Closed

Angular error when adding a custom action in the ContainerMenu #73

jemayn opened this issue Nov 3, 2023 · 2 comments

Comments

@jemayn
Copy link

jemayn commented Nov 3, 2023

Describe the bug
I've added a custom action that I want to trigger from the containermenu. It gets added just fine, but when I click it and try to execute it throws an error:

angular.js:15697  Error: [$injector:unpr] http://errors.angularjs.org/1.8.3/$injector/unpr?p0=uibMenuActionServiceProvider%20%3C-%20uibMenuActionService
    at angular.js:99:1
    at angular.js:4991:19
    at Object.d [as get] (angular.js:5151:32)
    at angular.js:4996:28
    at Object.d [as get] (angular.js:5151:32)
    at Object.executeMenuAction (umbraco.services.min.js?d=638345992050000000:1:71214)
    at scope.executeMenuItem (umbraco.directives.min.js?d=638345992050000000:1:173214)
    at fn (eval at compile (angular.js:16548:15), <anonymous>:4:238)
    at e (angular.js:29123:13)
    at m.$eval (angular.js:19523:16)

Steps To Reproduce
Steps to reproduce the behavior:

  1. Add a custom action:
public class ImportAction : Umbraco.UIBuilder.Configuration.Actions.Action<ActionResult>
{
    public override string Alias => "importDealers";
    public override string Name => "Import dealers from old site";
    public override string Icon => "icon-page-down";
    
    public override ActionResult Execute(string collectionAlias, object[] entityIds)
    {
        return new ActionResult(true);
    }
}
  1. Set it to the ContainerMenu in the configurator:
.AddAction<ImportAction>(actionConfig => actionConfig
                            .SetVisibility(x => x.ActionType == ActionType.ContainerMenu))
  1. It shows up just fine in the backoffice, but when clicking it the error occurs.
    image

Expected behavior
I'd expect it to hit the action code

Environment (please complete the following information):

  • Server OS: Windows
  • Browser Edge
  • Umbraco Version 12.1.2
  • Product Version 12.0.1

This item has been added to our backlog AB#34766

@jemayn jemayn added the bug Something isn't working label Nov 3, 2023
@mastrup
Copy link

mastrup commented Nov 27, 2023

The same happens when setting ActionType.EntityMenu.

angular.js:15697 Error: [$injector:unpr] http://errors.angularjs.org/1.8.3/$injector/unpr?p0=uibMenuActionServiceProvider%20%3C-%20uibMenuActionService
    at angular.js:99:1
    at angular.js:4991:19
    at Object.d [as get] (angular.js:5151:32)
    at angular.js:4996:28
    at Object.d [as get] (angular.js:5151:32)
    at Object.executeMenuAction (umbraco.services.min.js?d=638367150300000000:1:71061)
    at scope.executeMenuItem (umbraco.directives.min.js?d=638367150300000000:1:171957)
    at fn (eval at compile (angular.js:16548:15), <anonymous>:4:238)
    at e (angular.js:29123:13)
    at m.$eval (angular.js:19523:16)

@acoumb
Copy link

acoumb commented Dec 1, 2023

Hi @jemayn, @mastrup,

I have released version 12.0.2 of Umbraco.UIBuilder with a fix to this issue.

Thank you,
Adrian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants