Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handle not unique issue on page layout copy #1230

Merged
merged 2 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions client/web/compose/src/views/Admin/Pages/Builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -772,16 +772,16 @@ export default {
this.processing = true

const layout = {
...this.layout,
...this.layout.clone(),
handle: '',
weight: this.layouts.length + 1,
}

layout.meta.title = `${layout.meta.title}`
layout.meta.title = `${this.$t('copyOf')}${layout.meta.title}`

this.createPageLayout(this.layout).then(({ layoutID }) => {
this.createPageLayout(layout).then(({ pageLayoutID }) => {
return this.fetchPageLayouts().then(() => {
this.switchLayout(layoutID)
this.switchLayout(pageLayoutID)
this.toastSuccess(this.$t('notification:page.page-layout.clone.success'))
})
}).finally(() => {
Expand Down
2 changes: 1 addition & 1 deletion locale/en/corteza-webapp-compose/notification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ page:
success: Layout saved
failed: Failed to save layout
clone:
success: Layout created
success: Layout cloned and selected
failed: Failed to clone layout
delete:
success: Layout deleted
Expand Down