summaryrefslogtreecommitdiff
path: root/addons/website_form
diff options
context:
space:
mode:
authorxO-Tx <mou@odoo.com>2021-01-13 16:08:21 +0000
committerxO-Tx <mou@odoo.com>2021-02-22 09:45:48 +0000
commitfc83af4b0b209ffc0ae3d117fd9865b68aa2f118 (patch)
tree85381a0f3e9bfb39dd7f8ad069119d8e24c6bbe3 /addons/website_form
parentd5d4eabed0695554c92b9abdb36d819ad8423d69 (diff)
[FIX] website_form, *: allow to update buttons using link dialog
*: web_editor, website_mass_mailing When we double click a link/button, a link dialog appears to update the target properties, and since the current link dialog can only handle anchor targets, using it on buttons leads to some inconsistencies : - visible href options for button & url required to save changes. - missing preview when button style changed. ... The goal of this commit is to add a fix (with minimum of code) on summernote linkdialog to handle button elements using the same logic as anchor nodes. Also, update website form test tour to test those new changes. Part of https://github.com/odoo/odoo/pull/62206 task-2381305
Diffstat (limited to 'addons/website_form')
-rw-r--r--addons/website_form/static/tests/tours/website_form_editor.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/addons/website_form/static/tests/tours/website_form_editor.js b/addons/website_form/static/tests/tours/website_form_editor.js
index a50afdf1e7b..97708dccc52 100644
--- a/addons/website_form/static/tests/tours/website_form_editor.js
+++ b/addons/website_form/static/tests/tours/website_form_editor.js
@@ -226,6 +226,39 @@ odoo.define('website_form_editor.tour', function (require) {
...addExistingField('attachment_ids', 'file', 'Invoice Scan'),
+ // Edit the submit button using linkDialog.
+ {
+ content: "Double click submit button to edit it",
+ trigger: '.s_website_form_send',
+ run: 'dblclick',
+ }, {
+ content: "Check that no URL field is suggested",
+ trigger: 'form:has(#o_link_dialog_label_input:hidden)',
+ run: () => null,
+ }, {
+ content: "Check that preview element has the same style",
+ trigger: '.o_link_dialog_preview:has(.s_website_form_send.btn.btn-lg.btn-primary)',
+ run: () => null,
+ }, {
+ content: "Change button's style",
+ trigger: 'label:has(input[name="link_style_color"][value="secondary"])',
+ run: () => {
+ $('input[name="link_style_color"][value="secondary"]').click();
+ $('select[name="link_style_shape"]').val('rounded-circle').change();
+ $('select[name="link_style_size"]').val('sm').change();
+ },
+ }, {
+ content: "Check that preview is updated too",
+ trigger: '.o_link_dialog_preview:has(.s_website_form_send.btn.btn-sm.btn-secondary.rounded-circle)',
+ run: () => null,
+ }, {
+ content: "Save changes from linkDialog",
+ trigger: '.modal-footer .btn-primary',
+ }, {
+ content: "Check the resulting button",
+ trigger: '.s_website_form_send.btn.btn-sm.btn-secondary.rounded-circle',
+ run: () => null,
+ },
// Save the page
{
trigger: 'body',