@@ -9,7 +9,7 @@ export class UmbCreateEntityAction<T extends { copy(): Promise<void> }> extends
|
||||
// TODO: can we make this a generic create action
|
||||
async execute() {
|
||||
// TODO: get entity type from repository?
|
||||
const url = `section/settings/workspace/template/create/${this.unique || 'null'}`;
|
||||
const url = `section/settings/workspace/template/create/${this.unique || 'root'}`;
|
||||
// TODO: how do we handle this with a href?
|
||||
history.pushState(null, '', url);
|
||||
}
|
||||
|
||||
@@ -148,6 +148,7 @@ ${currentContent}`;
|
||||
alias: template.alias,
|
||||
});
|
||||
this.repository.requestTreeItemsOf(this.#masterTemplate.value?.id ?? '');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +157,7 @@ ${currentContent}`;
|
||||
if (!data) return;
|
||||
this.setIsNew(true);
|
||||
this.#data.next({ ...data, id: '', name: '', alias: '', $type: 'TemplateResponseModel' });
|
||||
if (!parentId) return;
|
||||
if (!parentId || parentId === 'root') return;
|
||||
await this.setMasterTemplate(parentId);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ export class UmbTemplateWorkspaceElement extends UmbLitElement {
|
||||
@state()
|
||||
_routes: UmbRoute[] = [
|
||||
{
|
||||
path: 'create/:parentId',
|
||||
path: 'create/:parentKey',
|
||||
component: () => this.#element,
|
||||
setup: (component: PageComponent, info: IRoutingInfo) => {
|
||||
const parentId = info.match.params.parentId === 'null' ? null : info.match.params.parentId;
|
||||
this.#templateWorkspaceContext.create(parentId);
|
||||
const parentKey = info.match.params.parentKey;
|
||||
this.#templateWorkspaceContext.create(parentKey);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user