Skip to content

Commit 58ea8bd

Browse files
dabo-odoorobinlej
authored andcommitted
[FIX] html_builder: page creation does not re-ask url
1 parent 0973924 commit 58ea8bd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

addons/website/static/src/client_actions/website_preview/edit_website_systray_item.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<DropdownItem onSelected.bind="() => this.translatable ? this.editFromTranslate() : this.onClickEditPage()" class="'o_edit_website_dropdown_item'">
2525
Edit 404 page<t t-if="translatable" t-translation="off"> - <span class="text-muted" t-out="this.currentWebsiteInfo.defaultLangName"/></t>
2626
</DropdownItem>
27-
<DropdownItem onSelected.bind="() => this.props.onNewPage()" class="'o_edit_website_dropdown_item'">
27+
<DropdownItem onSelected.bind="() => this.props.onNewPage(true)" class="'o_edit_website_dropdown_item'">
2828
<t t-set="url" t-value="this.websiteService.currentLocation"/>
2929
Create <span class="text-muted" t-out="url"/> page
3030
</DropdownItem>

addons/website/static/src/client_actions/website_preview/website_builder_action.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,17 @@ export class WebsiteBuilder extends Component {
190190
}
191191
}
192192

193-
onNewPage() {
194-
this.dialog.add(AddPageDialog, {
193+
onNewPage(keepUrl = false) {
194+
const params = {
195195
onAddPage: () => {
196196
this.websiteService.context.showNewContentModal = false;
197197
},
198198
websiteId: this.websiteService.currentWebsite.id,
199-
});
199+
};
200+
if (keepUrl) {
201+
params.forcedURL = this.websiteService.currentLocation;
202+
}
203+
this.dialog.add(AddPageDialog, params);
200204
}
201205

202206
async onEditPage() {

0 commit comments

Comments
 (0)