From 2fdd998a9abc65b4eab994202eb721f95fc85709 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Fri, 25 Nov 2022 11:36:40 +0000 Subject: [PATCH] [IMP] website: improve we-urlpicker URL preview button wording Quick feedback from client, this is following [1] that added a button next to the URL input of `we-urlpicket` to be able to preview the link. The wording was not great, it gives the impression it's an option to chose to have that URL opened in new tab (eg when form is submitted). Also, giving it the style of a conventional we-button was also giving the same impression that it was actually an option that you could click on to enable something. Changing the wording and the style of those special we-button should reduce the confusion. Arguably, one might think about the usefulness of this button but it acts as the counterpart of the regular links which have a "Open in new tab" possibility when hovering the link in their preview tooltip. [1]: https://github.com/odoo/odoo/commit/acdf3cf7f5aebd803ffa1507e81ed8801727a03a opw-3060966 closes odoo/odoo#106538 Signed-off-by: Quentin Smetz (qsm) --- addons/website/static/src/js/editor/snippets.options.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 18baaf0fc01..36d40a6a05a 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -54,11 +54,11 @@ const UrlPickerUserValueWidget = InputUserValueWidget.extend({ await this._super(...arguments); const linkButton = document.createElement('we-button'); const icon = document.createElement('i'); - icon.classList.add('fa', 'fa-fw', 'fa-external-link') - linkButton.classList.add('o_we_redirect_to'); - linkButton.title = _t("Redirect to URL in a new tab"); + icon.classList.add('fa', 'fa-fw', 'fa-external-link'); + linkButton.classList.add('o_we_redirect_to', 'o_we_link', 'ms-1'); + linkButton.title = _t("Preview this URL in a new tab"); linkButton.appendChild(icon); - this.containerEl.appendChild(linkButton); + this.containerEl.after(linkButton); this.el.classList.add('o_we_large'); this.inputEl.classList.add('text-start'); const options = {