diff --git a/client/web/compose/src/components/Admin/Module/RelatedPages.vue b/client/web/compose/src/components/Admin/Module/RelatedPages.vue index 457c52f3a..04a8a6fa2 100644 --- a/client/web/compose/src/components/Admin/Module/RelatedPages.vue +++ b/client/web/compose/src/components/Admin/Module/RelatedPages.vue @@ -112,6 +112,7 @@ export default { ...mapActions({ createPage: 'page/create', updatePage: 'page/update', + createPageLayout: 'pageLayout/create', }), handleRecordPageCreation () { @@ -121,19 +122,21 @@ export default { const { namespaceID } = this.namespace // A simple record block w/o preselected fields - const blocks = [new compose.PageBlockRecord({ xywh: [0, 0, 12, 16] })] + const blocks = [new compose.PageBlockRecord({ xywh: [0, 0, 48, 82] })] const selfID = (this.recordListPage || {}).pageID || NoID - const page = { + const page = new compose.Page({ namespaceID, moduleID, selfID, title: `${this.$t('forModule.recordPage')} "${name || moduleID}"`, blocks, - } + }) - this.createPage(page) - .catch(this.toastErrorHandler(this.$t('notification:module.recordPage.createFailed'))) + this.createPage(page).then(({ pageID, blocks }) => { + const pageLayout = new compose.PageLayout({ namespaceID, pageID, blocks, meta: { title: 'Primary' } }) + return this.createPageLayout(pageLayout) + }).catch(this.toastErrorHandler(this.$t('notification:module.recordPage.createFailed'))) .finally(() => { this.processing = false }) @@ -146,7 +149,7 @@ export default { const { name, moduleID } = this.module const blocks = [new compose.PageBlockRecordList({ - xywh: [0, 0, 12, 17], + xywh: [0, 0, 48, 82], options: { moduleID, fields: [], @@ -156,15 +159,19 @@ export default { }, })] - const page = { + const page = new compose.Page({ title: `${this.$t('forModule.recordList')} "${name || moduleID}"`, namespaceID, blocks, - } + }) this.createPage(page) - .then(({ pageID: selfID = NoID }) => { - return this.updatePage({ ...this.recordPage, selfID }) + .then(({ pageID = NoID, blocks }) => { + const pageLayout = new compose.PageLayout({ namespaceID, pageID, blocks, meta: { title: 'Primary' } }) + return Promise.all([ + this.updatePage({ ...this.recordPage, selfID: pageID }), + this.createPageLayout(pageLayout), + ]) }) .catch(this.toastErrorHandler(this.$t('notification:module.recordPage.createFailed'))) .finally(() => { diff --git a/client/web/compose/src/components/Admin/Page/Builder/Selector.vue b/client/web/compose/src/components/Admin/Page/Builder/Selector.vue index 698f6d520..04b487d08 100644 --- a/client/web/compose/src/components/Admin/Page/Builder/Selector.vue +++ b/client/web/compose/src/components/Admin/Page/Builder/Selector.vue @@ -2,55 +2,101 @@ - - - {{ type.label }} - - + + {{ type.label }} + - - - - -
- {{ $t('selectBlockFootnote') }} +
+ +
+ + + + + + + + + + + + + + +
+ + + diff --git a/client/web/compose/src/components/Common/Grid.vue b/client/web/compose/src/components/Common/Grid.vue index 05ce40a28..77f10f675 100644 --- a/client/web/compose/src/components/Common/Grid.vue +++ b/client/web/compose/src/components/Common/Grid.vue @@ -1,37 +1,42 @@