Skip to content

Unable to do any client-side logic with UI Builder Actions #157

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

Open
jho-md opened this issue Apr 22, 2025 · 0 comments
Open

Unable to do any client-side logic with UI Builder Actions #157

jho-md opened this issue Apr 22, 2025 · 0 comments
Labels
bug Something isn't working state/sprint-candidate

Comments

@jho-md
Copy link

jho-md commented Apr 22, 2025

Describe the bug
We are developing a portal where a backoffice member can impersonate another member, hiding/revealing content based on that impersonated member's access privileges.

We have implemented a custom action for impersonation, using this documentation for Entity Actions. A requirement is that upon clicking the action, the user's browser opens a new page with the root node. Since the entity action is in TypeScript, we can open a new window as follows:

override async execute() {
        const TOKEN = await this.#authContext?.getLatestToken();

        fetch(`/api/v1/impersonation-start?memberId=${this.#memberGuid}`, {
            method: 'GET',
            headers: { Authorization: `Bearer ${TOKEN}` }
        }).then(response => {
            if (response.status != 200) {
                throw new Error();
            }
            return response.json();
        }).then(() => {
            window.open("/", "_blank");

Now, we would like to do the same thing for a UI builder entity called employee, where each employee is linked to a member. However, looking at the documentation, we're struggling to find the best way to achieve this client-side logic of opening a new window, as these actions are built differently. We have the impersonation logic working, just missing the requirement of opening that new window on click.

Is there something we're missing to allow this to be done easily?

Environment (please complete the following information):

  • Server OS: Windows
  • Browser: Chrome
  • Umbraco Version 15.3.0
  • Product Version 15.1.2

This item has been added to our backlog AB#52305

@jho-md jho-md added the bug Something isn't working label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working state/sprint-candidate
Projects
None yet
Development

No branches or pull requests

2 participants