import { css, html, LitElement } from 'lit'; import { customElement, state } from 'lit/decorators.js'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api'; import { UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/router'; import { EXAMPLE_ROUTED_MODAL } from './../modal/example-modal-token'; @customElement('umb-dashboard-tab2') export class UmbDashboardTab2Element extends UmbElementMixin(LitElement) { #workspaceModal?: UmbModalRouteRegistrationController; @state() _editLinkPath?: string; constructor() { super(); // Using workspace modal context this.#workspaceModal?.destroy(); this.#workspaceModal = new UmbModalRouteRegistrationController(this, EXAMPLE_ROUTED_MODAL) .addAdditionalPath('view/:entityKey') .onSetup(() => { return { data: {}, value: {} }; }) .observeRouteBuilder((routeBuilder) => { this._editLinkPath = routeBuilder({entityKey : 'abc123'}); }); } override render() { return html`
This element hosts the UmbModalRouteRegistrationController
Open modal