Description
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