Temporary fix for the child name button
to navigate through to the target document.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { UmbDocumentCollectionItemModel } from '../../../types.js';
|
||||
import { css, customElement, html, property, state } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
import { UMB_WORKSPACE_MODAL, UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/modal';
|
||||
//import { UMB_WORKSPACE_MODAL, UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/modal';
|
||||
import type { UmbTableColumn, UmbTableColumnLayoutElement, UmbTableItem } from '@umbraco-cms/backoffice/components';
|
||||
|
||||
@customElement('umb-document-table-column-name')
|
||||
@@ -21,30 +21,33 @@ export class UmbDocumentTableColumnNameElement extends UmbLitElement implements
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
new UmbModalRouteRegistrationController(this, UMB_WORKSPACE_MODAL)
|
||||
.addAdditionalPath('document')
|
||||
.onSetup(() => {
|
||||
return { data: { entityType: 'document', preset: {} } };
|
||||
})
|
||||
.observeRouteBuilder((routeBuilder) => {
|
||||
this._editDocumentPath = routeBuilder({});
|
||||
});
|
||||
// new UmbModalRouteRegistrationController(this, UMB_WORKSPACE_MODAL)
|
||||
// .addAdditionalPath('document')
|
||||
// .onSetup(() => {
|
||||
// return { data: { entityType: 'document', preset: {} } };
|
||||
// })
|
||||
// .observeRouteBuilder((routeBuilder) => {
|
||||
// this._editDocumentPath = routeBuilder({});
|
||||
// });
|
||||
|
||||
this._editDocumentPath = '/section/content/workspace/document/';
|
||||
}
|
||||
|
||||
#onClick(event: Event) {
|
||||
// TODO: [LK] Review the `stopPropagation` usage, as it causes a page reload.
|
||||
// But we still need a say to prevent the `umb-table` from triggering a selection event.
|
||||
event.stopPropagation();
|
||||
}
|
||||
// #onClick(event: Event) {
|
||||
// // TODO: [LK] Review the `stopPropagation` usage, as it causes a page reload.
|
||||
// // But we still need a say to prevent the `umb-table` from triggering a selection event.
|
||||
// event.stopPropagation();
|
||||
// }
|
||||
|
||||
render() {
|
||||
return html`<uui-button
|
||||
look="default"
|
||||
color="default"
|
||||
compact
|
||||
href="${this._editDocumentPath}edit/${this.value.unique}"
|
||||
label="${this.value.name}"
|
||||
@click=${this.#onClick}></uui-button>`;
|
||||
return html`
|
||||
<uui-button
|
||||
compact
|
||||
color="default"
|
||||
look="default"
|
||||
href="${this._editDocumentPath}edit/${this.value.unique}"
|
||||
label=${this.value.name}></uui-button>
|
||||
`;
|
||||
}
|
||||
|
||||
static styles = [
|
||||
|
||||
Reference in New Issue
Block a user