ensure scaffolding is done before initializing the redirect controller

This commit is contained in:
Mads Rasmussen
2024-11-06 13:03:45 +01:00
parent 8448123c29
commit 43dc866e83
19 changed files with 31 additions and 27 deletions

View File

@@ -46,7 +46,7 @@ export class UmbBlockTypeWorkspaceContext<BlockTypeData extends UmbBlockTypeWith
const elementTypeKey = info.match.params.elementTypeKey;
const groupKey = info.match.params.groupKey === 'null' ? null : info.match.params.groupKey;
this.create(elementTypeKey, groupKey);
await this.create(elementTypeKey, groupKey);
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -176,7 +176,7 @@ export class UmbBlockWorkspaceContext<LayoutDataType extends UmbBlockLayoutBaseM
(component as UmbBlockWorkspaceEditorElement).workspaceAlias = manifest.alias;
const elementTypeKey = info.match.params.elementTypeKey;
this.create(elementTypeKey);
await this.create(elementTypeKey);
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -63,7 +63,7 @@ export class UmbPropertyTypeWorkspaceContext<PropertyTypeData extends UmbPropert
const containerUnique =
info.match.params.containerUnique === 'null' ? null : info.match.params.containerUnique;
this.create(containerUnique);
await this.create(containerUnique);
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -86,10 +86,10 @@ export class UmbDataTypeWorkspaceContext
{
path: 'create/parent/:entityType/:parentUnique',
component: UmbDataTypeWorkspaceEditorElement,
setup: (_component, info) => {
setup: async (_component, info) => {
const parentEntityType = info.match.params.entityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
await this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -32,7 +32,7 @@ export class UmbDictionaryWorkspaceContext
setup: async (_component, info) => {
const parentEntityType = info.match.params.entityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
await this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -189,7 +189,7 @@ export class UmbDocumentBlueprintWorkspaceContext
const parentEntityType = info.match.params.parentEntityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
const documentTypeUnique = info.match.params.documentTypeUnique;
this.create({ entityType: parentEntityType, unique: parentUnique }, documentTypeUnique);
await this.create({ entityType: parentEntityType, unique: parentUnique }, documentTypeUnique);
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -110,7 +110,7 @@ export class UmbDocumentTypeWorkspaceContext
{
path: UMB_CREATE_DOCUMENT_TYPE_WORKSPACE_PATH_PATTERN.toString(),
component: UmbDocumentTypeWorkspaceEditorElement,
setup: (_component, info) => {
setup: async (_component, info) => {
const params = info.match.params as unknown as UmbPathPatternTypeAsEncodedParamsType<
typeof UMB_CREATE_DOCUMENT_TYPE_WORKSPACE_PATH_PATTERN.PARAMS
>;
@@ -120,7 +120,7 @@ export class UmbDocumentTypeWorkspaceContext
if (parentUnique === undefined) {
throw new Error('ParentUnique url parameter is required to create a document type');
}
this.create({ entityType: parentEntityType, unique: parentUnique }, presetAlias);
await this.create({ entityType: parentEntityType, unique: parentUnique }, presetAlias);
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -249,7 +249,11 @@ export class UmbDocumentWorkspaceContext
const documentTypeUnique = info.match.params.documentTypeUnique;
const blueprintUnique = info.match.params.blueprintUnique;
this.create({ entityType: parentEntityType, unique: parentUnique }, documentTypeUnique, blueprintUnique);
await this.create(
{ entityType: parentEntityType, unique: parentUnique },
documentTypeUnique,
blueprintUnique,
);
new UmbWorkspaceIsNewRedirectController(
this,
this,
@@ -264,7 +268,7 @@ export class UmbDocumentWorkspaceContext
const parentEntityType = info.match.params.parentEntityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
const documentTypeUnique = info.match.params.documentTypeUnique;
this.create({ entityType: parentEntityType, unique: parentUnique }, documentTypeUnique);
await this.create({ entityType: parentEntityType, unique: parentUnique }, documentTypeUnique);
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -32,7 +32,7 @@ export class UmbLanguageWorkspaceContext
path: 'create',
component: UmbLanguageWorkspaceEditorElement,
setup: async () => {
this.createScaffold({ parent: { entityType: UMB_LANGUAGE_ROOT_ENTITY_TYPE, unique: null } });
await this.createScaffold({ parent: { entityType: UMB_LANGUAGE_ROOT_ENTITY_TYPE, unique: null } });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -81,10 +81,10 @@ export class UmbMediaTypeWorkspaceContext
{
path: 'create/parent/:entityType/:parentUnique',
component: UmbMediaTypeWorkspaceEditorElement,
setup: (_component, info) => {
setup: async (_component, info) => {
const parentEntityType = info.match.params.entityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
this.create({ entityType: parentEntityType, unique: parentUnique });
await this.create({ entityType: parentEntityType, unique: parentUnique });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -191,7 +191,7 @@ export class UmbMediaWorkspaceContext
const parentEntityType = info.match.params.entityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
const mediaTypeUnique = info.match.params.mediaTypeUnique;
this.create({ entityType: parentEntityType, unique: parentUnique }, mediaTypeUnique);
await this.create({ entityType: parentEntityType, unique: parentUnique }, mediaTypeUnique);
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -29,8 +29,8 @@ export class UmbMemberGroupWorkspaceContext
{
path: 'create',
component: UmbMemberGroupWorkspaceEditorElement,
setup: () => {
this.createScaffold({ parent: { entityType: UMB_USER_GROUP_ROOT_ENTITY_TYPE, unique: null } });
setup: async () => {
await this.createScaffold({ parent: { entityType: UMB_USER_GROUP_ROOT_ENTITY_TYPE, unique: null } });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -77,10 +77,10 @@ export class UmbMemberTypeWorkspaceContext
{
path: 'create/parent/:entityType/:parentUnique',
component: UmbMemberTypeWorkspaceEditorElement,
setup: (_component, info) => {
setup: async (_component, info) => {
const parentEntityType = info.match.params.entityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
this.create({ entityType: parentEntityType, unique: parentUnique });
await this.create({ entityType: parentEntityType, unique: parentUnique });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -183,7 +183,7 @@ export class UmbMemberWorkspaceContext
component: () => new UmbMemberWorkspaceEditorElement(),
setup: async (_component, info) => {
const memberTypeUnique = info.match.params.memberTypeUnique;
this.create(memberTypeUnique);
await this.create(memberTypeUnique);
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -33,7 +33,7 @@ export class UmbScriptWorkspaceContext
setup: async (component: PageComponent, info: IRoutingInfo) => {
const parentEntityType = info.match.params.entityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
await this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -45,7 +45,7 @@ export class UmbStylesheetWorkspaceContext
setup: async (component: PageComponent, info: IRoutingInfo) => {
const parentEntityType = info.match.params.entityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
this.create({ entityType: parentEntityType, unique: parentUnique });
await this.create({ entityType: parentEntityType, unique: parentUnique });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -41,10 +41,10 @@ export class UmbTemplateWorkspaceContext
{
path: 'create/parent/:entityType/:parentUnique',
component: UmbTemplateWorkspaceEditorElement,
setup: (component: PageComponent, info: IRoutingInfo) => {
setup: async (component: PageComponent, info: IRoutingInfo) => {
const parentEntityType = info.match.params.entityType;
const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
this.create({ entityType: parentEntityType, unique: parentUnique });
await this.create({ entityType: parentEntityType, unique: parentUnique });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -42,8 +42,8 @@ export class UmbUserGroupWorkspaceContext
{
path: 'create',
component: UmbUserGroupWorkspaceEditorElement,
setup: () => {
this.createScaffold({ parent: { entityType: UMB_USER_GROUP_ROOT_ENTITY_TYPE, unique: null } });
setup: async () => {
await this.createScaffold({ parent: { entityType: UMB_USER_GROUP_ROOT_ENTITY_TYPE, unique: null } });
new UmbWorkspaceIsNewRedirectController(
this,

View File

@@ -28,7 +28,7 @@ export class UmbWebhookWorkspaceContext
path: 'create',
component: UmbWebhookWorkspaceEditorElement,
setup: async () => {
this.createScaffold({ parent: { entityType: UMB_WEBHOOK_ROOT_ENTITY_TYPE, unique: null } });
await this.createScaffold({ parent: { entityType: UMB_WEBHOOK_ROOT_ENTITY_TYPE, unique: null } });
new UmbWorkspaceIsNewRedirectController(
this,