Skip to content
Snippets Groups Projects
  1. May 15, 2023
    • xO-Tx's avatar
      [FIX] website: correctly mark translatable attributes · 8b522e5c
      xO-Tx authored
      
      Steps to reproduce:
      
      - Go to a website page > Add a 'Form' block > Set an input "Placeholder"
      value.
      - Go to the page (in 'edit_translations' mode) > The translation of the
      input "Placeholder" attribute doesn't mark the input as translated and
      even after saving the translation, the input is still marked as
      "to_translate".
      
      The goal of this commit is to fix this issue by extending the same
      behaviour on the translated `<select/>` options (using `.oe_translated`
      class) and setting the right translation state on the input from the
      linked attribute translation `<span/>`.
      
      task-3323245
      
      closes odoo/odoo#121128
      
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      8b522e5c
    • Benjamin Vray's avatar
      [FIX] website: fix overflowing navbar links on mobile · 0a575bea
      Benjamin Vray authored
      
      This commit fixes a bug with the navbar links in the header of a website
      on mobile. When the text of a link is long enough to be wider than the
      screen, the text does not wrap to the next line as intended, but instead
      overflows to the right outside of the screen, causing part of the text
      to be hidden.
      
      Steps to reproduce the bug:
      
      - Edit the text of one of the menu links on a website to make it longer
      than the width of the mobile screen.
      - Bug: In mobile view, part of the link text is hidden.
      
      This bug occurs with both the "default" hamburger type and the
      "off-canvas" hamburger type.
      
      opw-3233684
      
      closes odoo/odoo#119998
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      0a575bea
  2. Apr 28, 2023
  3. Apr 27, 2023
    • xO-Tx's avatar
      [FIX] website, tools: make select options translatable · 57d7e75b
      xO-Tx authored
      
      Steps to reproduce:
      
      - Go to a website page > Add a 'Form' block > Add a new 'Selection'
      field.
      - Go to the page (in 'edit_translations' mode) > The selection field
      options are not translatable.
      
      The goal of this commit is to make the select options translatable
      by adding an intermediate `.o_translation_select` element.
      
      This element will handle option's text translations from the linked
      `<select/>`. The final values are copied to the original element
      right before save.
      
      opw-3233360
      
      closes odoo/odoo#117519
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      57d7e75b
  4. Apr 25, 2023
    • Benjamin Vray's avatar
      [FIX] website, website_form: fix anchor link redirects · fb087dbe
      Benjamin Vray authored
      Before this commit, links scrolling to an anchor with a special
      character did not work and displayed a traceback. The issue was that to
      check that the anchor is valid, we don't need to check that the anchor
      is a valid url as we have been doing since these commits [1], [2]. But
      we only need to check if the jQuery selector is valid to correctly
      target the element to which the page must scroll.
      
      Indeed, the anchor widget returns stuff like 'ok%C3%A9%25' when typing
      'oké%' wich is not valid jQuery selector. It has to be encoded to
      '#ok\\%C3\\%A9\\%25' to be valid and that's what this commit does.
      
      We also changed the way to display a new anchor to the user in this
      commit. Before, we showed the anchor unencoded in a notification and now
      we show it encoded. That way, if the user copies the anchor from the
      notification, it's the real anchor.
      
      Also, this commit detect if the success URL of the redirect of a from is
      the current page to perform a scroll to the anchor instead of a
      redirect. To make this comparison, we needed to add the url code of the
      language of the current page to the session info.
      
      Also, before this commit, the page froze when we clicked on the "submit"
      button of a form that redirected to an anchor that did not exist.
      
      [1]: https://github.com/odoo/odoo/commit/0abfaeda96c2eaa868cc7fc5fa1926dfa90fc420
      [2]: https://github.com/odoo/odoo/commit/b492bde6a121be1c15ed90ce0827fcfd72a12f5c
      
      
      
      task-2172312
      
      closes odoo/odoo#82059
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      fb087dbe
  5. Apr 24, 2023
    • divy-odoo's avatar
      [FIX] website: keep language selector flag size ratio · 32aca111
      divy-odoo authored
      
      There was an issue before this commit where some flags (basically all
      the ones which are not tribands) would appear "broken".
      This is the case for the China one where the symbol on the flag would be
      squashed.
      Using `object-fit` css property will keep the original flag ratio.
      
      task-2929438
      
      closes odoo/odoo#118903
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      32aca111
  6. Apr 19, 2023
  7. Apr 17, 2023
    • Guillaume (gdi)'s avatar
      [FIX] website: add a robust utility to enter in edit mode · e02c3a18
      Guillaume (gdi) authored
      
      This commit creates a new util which clicks on edit and waits for the
      edit mode to be started. This way, we make sure that the edit mode is
      enabled before testing the next step of the test. This avoids race
      conditions during tests.
      
      Note that we leave the old clickOnEdit util as it could be used in
      custom codes and we don't want to break them.
      
      task-3203820
      
      closes odoo/odoo#116490
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      e02c3a18
    • Benoit Socias's avatar
      [FIX] website: disable mega menu hover mode while editing · 4a1de8b6
      Benoit Socias authored
      When a mega menu "Sub Menus" are configured as "On Hover", it becomes
      very difficult to edit its content.
      
      This commit changes the behavior of the "On Hover" while the page is
      being edited:
      - it disables the hide on exit (`mouseleave`)
      - it prevents the show on hover if another dropdown is already opened
      - it hides the menu when the page is clicked outside of the opened menu
      
      This commit also disables the preview of the "Show Sign In" option
      which is not previewed anyway, so that it does not deselect the mega
      menu when hovering the options.
      
      task-2825376
      
      Part-of: odoo/odoo#110258
      4a1de8b6
  8. Apr 05, 2023
    • Kamen Zhekov's avatar
      [FIX] web_editor, website: fix website editor as restricted editor · bbf4e333
      Kamen Zhekov authored
      
      When assigned the role of restricted editor, there are many ways to
      break the web_editor when trying to do actions that should be
      unavailable. There is a traceback for the following scenarios under
      some circumstances (mainly because of pages without editable areas or
      features without the proper access rights):
      
      - Drag and dropping snippet when Restricted Editor.
      - Clicking on product when Restricted Editor in /shop.
      - Clicking on product image on specific product page.
      - Clicking on user name (e.g. Marc Demo).
      - Clicking on menu items or logo.
      - Clicking on a blog's image in /blog.
      - Clicking on a blog's image on specific blog page.
      - Clicking on calendar's image in /calendar.
      
      There is now no longer a traceback which makes the editor crash or
      freeze. This mimics the behavior in other cases where the editor does
      not show a traceback, but there is no message indicating that the action
      is unauthorized.
      
      When accessing a menu that cannot be edited, the "Edit the menu" button
      is not shown to the restricted editor.
      
      task-2747895
      opw-3164176
      
      closes odoo/odoo#76900
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      Co-authored-by: default avatarBenjamin Vray <bvr@odoo.com>
      Co-authored-by: default avatarqsm-odoo <qsm@odoo.com>
      bbf4e333
  9. Apr 03, 2023
  10. Mar 27, 2023
  11. Mar 22, 2023
    • Benjamin Vray's avatar
      [FIX] website: fix navbar position and alignment options · 3eaab4e8
      Benjamin Vray authored
      This commit fixes several bugs with the navbar and the header templates:
      
      - The "right" alignment options didn't work with most headers. This was
      due to a missing CSS rule.
      
      - The "right/left" alignment option was reversed with the "vertical"
      header template.
      
      - The navbar collapse style was broken with the "Hamburger Full" header
      template.
      
      - This commit hides the alignment options in cases where they have no
      effect ("Hamburger Full" or "Magazine" header template + not
      "off-canvas"). It also changes the options label to "Mobile Alignment"
      when the alignment only impacts the mobile view (since this commit =>
      [1], the "alignment" option no longer only impacts the mobile view,
      depending on the templates, it can also impact the "desktop" view).
      
      - The text section of the "Magazine" header template had no background
      color (It was transparent after scrolling the page).
      
      - The "off-canvas" navbar was not positioned correctly with several
      header templates (e.g. "Boxed" header template).
      
      [1]: https://github.com/odoo/odoo/commit/2a1aa808e939eeaa3caec6a1a82e19f023f1d010
      
      
      
      opw-2951315
      
      closes odoo/odoo#106764
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      3eaab4e8
    • Guillaume (gdi)'s avatar
      [FIX] website: correctly position the hoverable sub-menus · 03c82f6b
      Guillaume (gdi) authored
      
      Before this commit, the sub-menus that appear when the mouse hovers them
      were not displayed correctly. The public widget which is in charge of
      positioning the sub-menu (`menuDirection`) could not work because the
      dropdowns were opened manually (which is not recommended) and so, the
      `show.bs.dropdown` event was never triggered which prevented the public
      widget from aligning the sub-menu items correctly.
      
      Steps to reproduce the bug:
      - Have a long sub-menu in the last position of the navbar.
      - In edit mode align the navbar elements to the right.
      - Enable the option to have the sub-menus displayed at hover.
      - Save the page.
      
      => When hovering the sub-menu, it opens on the right and overflows the
      page while there is enough space on the left.
      
      task-2904507
      
      closes odoo/odoo#115153
      
      Signed-off-by: default avatarBojabza Soukéina (sobo) <sobo@odoo.com>
      03c82f6b
    • Guillaume (gdi)'s avatar
      [FIX] website: support RTL for the opening direction of the sub-menus · e4171a6e
      Guillaume (gdi) authored
      Since [this commit], some JS code tries to open the sub-menus in the
      right direction so that the page overflow is limited. Unfortunately,
      languages that read from right to left (RTL) were not supported by this
      code, which left some sub-menus of the navbar overflowing when there was
      room to open them without overflowing (on the other side).
      Steps to reproduce the bug:
      - Have a sub-menu in the last but one position of the navbar with long
      strings of characters.
      - Align navbar items to the right.
      - Have an RTL language installed on your website.
      
      => When you open the sub-menu in RTL, it opens on the wrong side and
      causes an overflow of the page.
      
      [this commit]: https://github.com/odoo/odoo/commit/392c91cda3133b921e9aca9a7b1c511231027438
      
      task-2904507
      
      Part-of: odoo/odoo#115153
      e4171a6e
  12. Mar 21, 2023
  13. Mar 16, 2023
    • xO-Tx's avatar
      [FIX] website: fix the scrollspy on table of content · c5305de9
      xO-Tx authored
      Steps to reproduce:
      
      - Add a "Table Of Content" snippet from the website editor.
      - Save > The effect on the active page item (in top menu) is removed.
      
      Starting from [1], a `.scrollspy('dispose')` call was added to destroy
      the existing ScrollSpy, and to be able to make a new call that works
      correctly when the header height changed.
      
      Since this call has no specific target as option, it will trigger the
      `scrollspy._clear()` process on all `'.nav-link'` elements including
      navbar items which removes the `'active'` class from current page link.
      
      The goal of this commit is to fix this behaviour by calling the
      'dispose' only when an instance of `Scrollspy` exists.
      
      [1]: https://github.com/odoo/odoo/commit/476995ba5a1d33aa0590214609346557d1d471c0
      
      
      
      task-3223277
      
      closes odoo/odoo#114937
      
      Signed-off-by: default avatarVray Benjamin (bvr) <bvr@odoo.com>
      c5305de9
  14. Mar 13, 2023
    • Benoit Socias's avatar
      [FIX] website, *: define specific dynamic snippet name · d34925e3
      Benoit Socias authored
      *: web_editor, website_sale
      
      Since [1] when the Dynamic Snippet was first introduced, it also
      introduced a concept of "inherited" snippets. Specific snippets would
      all `t-call` the same template for their rendering.
      A mechanism was introduced to deduce the `data-snippet` from the caller
      template, but it stored the obtained value in the `t-called` template
      itself. Because of this if several "specific snippets" that used that
      template had to be rendered, they would all have the `data-snippet`
      value of the first one that got compiled.
      
      We could compile the snippet template into something having a
      dynamically obtained `data-snippet` value, but then that would be
      equivalent to just using a `t-attf-data-snippet`.
      All specific snippets already do set a `snippet_name` in the context
      because it needs to be added in the classes.
      
      This commit therefore adds a `t-att-data-snippet` attribute on the
      base template, and populates with that same value in `onBuilt` for
      stable versions.
      
      During forward ports across stable versions, each new caller must be
      patched as well - and all patches must be removed in master.
      
      [1]: https://github.com/odoo/odoo/pull/53175
      
      
      
      task-2922635
      
      closes odoo/odoo#98924
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      d34925e3
  15. Mar 06, 2023
    • Soukéina Bojabza's avatar
      [FIX] website: increase the breakpoint of the 'Show on mobile' option · 791670db
      Soukéina Bojabza authored
      
      When using the 'Show on mobile' option, we can see that there is a
      mismatch between the screen breakpoint at which the elements are
      displayed like in mobile view (=> under 992px or `lg`) and the one that
      is impacted by the 'Hide/Show' option (=> under 768px or `md`). This is
      a problem because between these two breakpoints, the display is like in
      mobile view but is not considered as such and so, hiding an element in
      the mobile view (for example, if it does not look good in it) has no
      effect until the screen reaches 768px.
      
      This commit increases the screen breakpoint at which the 'Show on
      mobile' option is applied, that is, up to 992px instead of 768px, in
      order to be consistent with the display.
      
      task-3110770
      
      closes odoo/odoo#109053
      
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      791670db
  16. Mar 03, 2023
    • Benjamin Vray's avatar
      [FIX] website: fix scroll table of content · eb356dfd
      Benjamin Vray authored
      
      This commit fixes two bugs with the table of content snippet:
      
      - Before this commit, the scrollspy position for the table of content
      navbar was incorrect in fullscreen or edit mode due to the calculation
      being based on the presence of the main navbar, which is not present in
      those modes.
      
      - Before this commit, when the table of content navbar contained enough
      elements to exceed the height of the page, the bottom elements were not
      accessible without first scrolling through the entire table of content.
      This commit addresses this issue by adding a scrollbar to the navbar,
      allowing for easier access to these links.
      
      opw-3115597
      
      closes odoo/odoo#109927
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      eb356dfd
    • Louis (loco)'s avatar
      [FIX] web, website: restore the use of the scroll to top button · 4ca793a3
      Louis (loco) authored
      
      Steps to reproduce the bug:
      - Go to the website and edit a page.
      - Make sure there is enough content to be able to scroll the page.
      - Go to the "Theme" tab and disable the "Show Header" option.
      - Click on the footer and enable the "Scroll Top Button".
      - Click on "Save".
      => Clicking on the "Scroll To Top" button does nothing.
      
      The "Scroll To Top" button is an anchor with its `href` set to `#top`.
      By disabling the "Show Header" option, the header is removed from the
      DOM and there is no existing element with `id=top` anymore. To fix
      this, the `scrollTo` function has been patched in order to be able to
      receive selectors as arguments. In the '#top' and '#bottom' case, those
      positions are known and always the same (either at the top of the
      document or the bottom of it) so there is no need to have the header or
      the footer present in the DOM in order to be able to scroll up to those
      positions.
      
      Now that the `scrollTo` function is able to scroll to the top or the
      bottom of the page even without header or footer, those two positions
      can always be suggested as internal link anchors during link edition.
      
      opw-3133464
      
      closes odoo/odoo#113117
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      4ca793a3
    • Arthur Detroux (ard)'s avatar
      [FIX] website: give correct height to image gallery on smaller screens · c36607dc
      Arthur Detroux (ard) authored
      
      Prior to this commit, the height of the Image Gallery snippet was set to
      auto on screens smaller than 400px.
      
      This ensures that the snippet looks the best on phones.
      
      However, when using Bootstrap, what defines a smaller screen is not
      any screen below 400px, but any screen below 768px.
      This meant that the Image Gallery snippet did not look the same on an
      iPhone 11 Pro max as it would on an iPhone 11 for example.
      
      This commit fixes that by using the built-in mixin that relies on
      Bootstrap's breakpoints (in this case SM).
      
      Steps to reproduce:
      - Go in edit mode and drop an "Image Gallery" snippet
      - Open the dev tools and choose "iPhone 11" or 375x812
      - The image gallery does not have white bands
      - Change the resolution to "iPhone 11 Pro Max" or 414x896
      - The image gallery has white bands / has a different layout
      
      opw-2995100
      task-2997119
      
      closes odoo/odoo#109761
      
      Signed-off-by: default avatarVray Benjamin (bvr) <bvr@odoo.com>
      c36607dc
  17. Mar 01, 2023
    • Guillaume (gdi)'s avatar
      [FIX] website,web_editor: prevent horizontal scroll on we-matrix · 356e0a1f
      Guillaume (gdi) authored
      
      Before this commit, we-matrix could create a horizontal scroll bar in
      the editor. This was because the inputs had a minimum width size.
      
      Steps to reproduce the bug:
      - Drop a chart block on a page
      - Add some series
      
      => The matrix overflows from the editor.
      
      There is no perfect solution to this problem... We have the choice
      between:
      1) Leave the existing overflow on the editor.
      2) Put a horizontal scroll on the we-matrix.
      3) Distribute the available space between the columns.
      
      As we don't want a horizontal scrollbar, the best solution is to
      distribute the available space between the columns. This solution has a
      drawback which is that the cells can become really small if there are a
      lot of columns but this solution seems to be the least bad from a UX
      point of view.
      
      task-3094162
      
      closes odoo/odoo#107400
      
      Signed-off-by: default avatarBojabza Soukéina (sobo) <sobo@odoo.com>
      356e0a1f
  18. Feb 17, 2023
  19. Feb 07, 2023
    • qsm-odoo's avatar
      [FIX] website: fix some components in case of contrasted boxed layout · 03f238aa
      qsm-odoo authored
      In some cases, components had dark text over dark background (or light
      text over light background) by mistake.
      
      Example:
      - Enter edit mode.
      - In the theme tab, choose "boxed" as page layout.
      - A color picker appears below to control the color behind the box.
      - Set it to a dark color (if your box main color is light)
      - Go to a course page (install website_slides)
      - Check the mobile version
      => The bootstrap tab and its section uses the dark color you set up as
         body color instead of the expected boxed layout color (this can also
         be seen with standard "tabs" snippets, although their body is not
         buggy in that case).
      
      This is because of bootstrap which uses `$body-bg` as default value for
      other variables, such as `$nav-tabs-link-active-bg` in the case
      described above. It also uses the variable in the creation of CSS rules
      not controlled by explicit variables.
      
      In 16.0, bootstrap was updated to 5.1.3 with [1] and this actually
      increased the problem: input backgrounds now default to `$body-bg`,
      amongst other things. Since [2], `$body-bg` is also used as the default
      color for range thumbs. Those are for example visible on the shop main
      page with the price filter enabled. With a white boxed layout and dark
      background, those were broken as well.
      
      This commit focused on fixing the only critical component: nav-tabs, for
      which the fix in straightforward. CSS rules that depends on `$body-bg`
      in bootstrap are less easy to fix (without duplicating their rule), are
      mainly less important ones and would actually not really be possible to
      fix in a fully stable way. Those will be fixed only starting from 16.0
      with an entirely different fix.
      
      [1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968
      [2]: https://github.com/odoo/odoo/commit/46e53879749be7ba3d30338d0f25c0a68a88eb3c
      
      
      
      opw-3151962
      
      closes odoo/odoo#111780
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      03f238aa
  20. Jan 25, 2023
    • Benjamin Vray's avatar
      [FIX] website, website_mass_mailing: fix parallax in modals · e97f6134
      Benjamin Vray authored
      
      Before this commit "parallax" animation was not working in modals.
      
      This commit adds a parameter to the animation effects to enable
      animations (triggered by the scroll) in the modals.
      
      Note that for the "Newsletter" popup we have hidden the "parallax"
      options. To make them work, it would be necessary to review the
      structure of the "Newsletter" popup so that the vertical scrollbar is in
      the same location as the "s_popup" snippet (on the ".modal" element).
      
      task-2971402
      
      closes odoo/odoo#99894
      
      Signed-off-by: default avatarOutagant Mehdi (mou) <mou@odoo.com>
      e97f6134
  21. Dec 29, 2022
    • Benjamin Vray's avatar
      [FIX] website: fix auto scroll when moving inner content · c0b3302b
      Benjamin Vray authored
      
      Steps to reproduce:
      
          - Drop enough snippets to have a scrollbar.
          - Drop a snippet with inner content having up/down arrows (e.g.
            showcase,timeline).
          - Move inner content with the arrows.
          - => The element is correctly placed but the screen scrolled along
            with it.
      
      This commit fixes it by preventing the page from scrolling if the
      element being moved is still visible after the move. The page therefore
      scrolls only if the moved element is not visible after the move.
      
      This commit also improves page scrolling when the element is hidden at
      the bottom. Before, the page scrolled to bring the moved element to the
      top of the page but now, it stops scrolling as soon as the element is
      fully visible.
      
      task-2952200
      
      closes odoo/odoo#103083
      
      Signed-off-by: default avatarBojabza Soukéina (sobo) <sobo@odoo.com>
      c0b3302b
  22. Dec 27, 2022
    • qsm-odoo's avatar
      [FIX] website: hide the "no column" option for snippets with columns · ad561c15
      qsm-odoo authored
      Commit [1] which occurred in 13.X for the upcoming release of the 14.0
      version introduced a "No column" option for snippets whose only column
      was removed but that we wanted having the possibility to switch to a
      multi-columns layout. At the time: Title, Text and Cover snippets.
      
      That "None" option was meant to be hidden (as it was at the time) for
      other snippets already in a multi-columns layout. Indeed the "No column"
      and "1 column" options are very similar: "No column" is just an
      optimization for experienced users.
      
      The problem here was that [2] broke the behavior. Indeed [1] marked the
      code in charge to hide that "No column" option as "To improve" as the
      system was limited to do that at the time... [2] actually improved the
      system to allow hiding sub-widgets, but did not adapt [1], making the
      "No column" option always visible.
      
      While working and not harmful, that "No column" option may be confusing
      as at best you don't see the difference with the "One column" option and
      at worst, removing the column removes nice style that you cannot restore
      by choosing a multi-column layout again afterwards.
      
      While not entirely stable (in the end we never released a major version
      where [1] was working as intended), this commit restores the idea behind
      [1] anyway to avoid further confusion and tickets. Choosing "One column"
      instead of "None" most of the time leads to a better UX anyway.
      
      [1]: https://github.com/odoo/odoo/commit/b293ccc7c3c5ca9a55092afd2e4a7b88c7b93fc8
      [2]: https://github.com/odoo/odoo/commit/ecefd51b63ed8c933243b4a2d26381d05ac288d2
      
      
      
      Related to task-3106301
      
      closes odoo/odoo#108739
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      ad561c15
  23. Dec 21, 2022
  24. Dec 19, 2022
    • Benjamin Vray's avatar
      [FIX] web_editor, website: fix style tab selected after closing a popup · 987f189e
      Benjamin Vray authored
      
      Steps to reproduce the bug:
      
          - In edit mode, drag and drop a popup in a page.
          - Click on the "Win $20" text in the popup to activate the overlay
          of the column.
          - Close the popup by clicking on the "s_popup_close" button.
          - Bug => the "style" tab is still activated (instead of the "blocks"
          tab).
      
      This is actually a more general bug: when selecting text anywhere in the
      page, there is no check to know if the range is editable or not.
      (e.g. Selecting a link in the navbar of the "table of content" snippet
      makes the toolbar appear and it is possible to change the color/size of
      the selected text while these links are in a non-editable element.)
      
      This commit adds the missing check to know if a selected range is
      editable or not to show/hide the text toolbar.
      
      This commit also removes the duplicate
      "snippet_option_visibility_update" trigger_up when closing a popup with
      the "close" button. It is not necessary because it is called anyway in
      the "hide" event triggered by "onTargetHide".
      
      task-3072669
      
      closes odoo/odoo#105957
      
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      987f189e
  25. Dec 15, 2022
    • Benjamin Vray's avatar
      [FIX] web_editor, website: mitigate line between shapes issues · f7fd40d6
      Benjamin Vray authored
      This commit mitigates an issue with shape elements sometimes having tiny
      spacing on their top or bottom edge.
      
      This issue is mainly on Chrome when the user has changed the page zoom.
      When the page is zoomed the elements can have a width value with a
      decimal part. Because of it, the size of the SVG background images are
      not correctly rounded compared to their container and therefore leaves a
      visible space.
      
      Steps to reproduce the bug:
      
      - On Chrome, add several shapes on a website page.
      - Change the zoom of the page and change the window width.
      - At some points, the gap will appear.
      
      The least bad solution we found to fix this is to ensure that the width
      of the shape elements is always as close to an integer as possible.
      
      Reminder: several commits had attempted to fix this before ([1], [2],
      [3], [4]). But that wasn't enough to stop it happening. Some shapes
      still need to be fixed although that will likely be done in future
      versions.
      
      [1]: https://github.com/odoo/odoo/commit/c0f62593a4da37e8404dddc0a5762879a5ebbf7f
      [2]: https://github.com/odoo/odoo/commit/ac82407b259eab929486bf0a333a48bc507efa60
      [3]: https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566
      [4]: https://github.com/odoo/odoo/commit/e386f318f5cff50901dba3db8a2587911ba02a6e
      
      task-2824607
      opw-3069213
      opw-3057533
      
      Part-of: odoo/odoo#107492
      f7fd40d6
    • Benjamin Vray's avatar
      [FIX] website: fix table of content scrollSpy offset · 476995ba
      Benjamin Vray authored
      
      Steps to reproduce the bugs:
      - In edit mode, choose the "contact" header template.
      - Drag and drop a table of content snippet on the page.
      - Save the page.
      - Click on the table of content links.
      - Bug => the links are not activated correctly.
      
      The reason of the bug was that the scrollspy offset (calculated against
      the header height) was not updating when the header height changed.
      
      We did make a new call to scrollspy at the right time but that had no
      effect because we first had to destroy the existing scrollSpy to be able
      to make a new call that works.
      
      opw-2951315
      
      closes odoo/odoo#104092
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      476995ba
    • Benjamin Vray's avatar
      [FIX] website: fix resizing columns out of parent · 2d825e02
      Benjamin Vray authored
      
      Before this commit, it was possible to resize a column so that it
      overflows the right border of the row.
      
      Steps to reproduce the bug:
        1. In website edit mode, drop a `media list` snippet in the page.
        2. Select a column.
        3. Resize the column by dragging its left side to the right to make it
        smaller.
        4. Drag its right side to make it bigger and go until the edge of the
        editor => The column overflows and ends outside of the content zone.
      
      This commit prevents the column from overflowing when it has an offset.
      
      task-2837361
      
      closes odoo/odoo#96993
      
      Signed-off-by: default avatarBojabza Soukéina (sobo) <sobo@odoo.com>
      2d825e02
  26. Dec 14, 2022
  27. Dec 09, 2022
    • Romain Derie's avatar
      [FIX] website: authorize again the trailing slash in SEO name field · 427ce767
      Romain Derie authored
      Commit [1] improved the "sanitation" of this field for special
      character. For instance, when copy pasting the following terms:
      
      |      Input      |      Before      |       After     |
      |-----------------|------------------|-----------------|
      | fée d'été à 40€ |    f-e-d-t-40-   |  fee-dete-a-40  |
      | Nội dung có Dấu |  n-i-dung-c-d-u  | noi-dung-co-dau |
      
      But it actually came with a bad behavior which was not noticed: it
      prevents to type `-` at the end of the input, which sounds good but is
      not.
      Indeed, when typing `a-word`, you will type `a` then try to type `-`
      which won't work as considering a (forbidden) trailing slash, even if
      you actually want to type something after.
      
      This commit allows trailing slashes again, it's not a big deal and one
      can remove it if he wants to.
      
      [1]: https://github.com/odoo/odoo/commit/bb43d4dbb5745be84f0f9462e768989e50607bea
      
      
      
      opw-3075419
      
      closes odoo/odoo#107610
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      427ce767
  28. Dec 08, 2022
    • Romain Derie's avatar
      [FIX] website: make sidebar menu visible on safari on mac · ffa34d84
      Romain Derie authored
      
      For some reason, safari on mac is not showing the sidebar menu content
      at all. It remains a white div without content.
      
      Seems like a bad implementation of that browser for this case, or at
      least an implementation which is not shared by all other browsers.
      
      Note that removing `z-index`, `position:absolute` or `overflow` css
      property from the `wrapwrap` will make the menu appear.
      !!! Also note that having a non scrollable page (not enough content),
      like an empty homepage, will make the menu appear too. !!!
      
      As this issue is quite critical:
      - All mac/safari users are not seeing your website menu..
      - And the admin don't event know it most of the time (as not on mac)
      And since:
      - It's been going for months without someone finding a proper fix
      - It's hard to investigate as devs generally don't have mac to
        investigate and have to use browserstack which is really bad for such
        work
      This commit is a fix attempt using `calc` which is probably not ideal.
      
      Step to reproduce:
      - Select the sidebar header template
      - Visit the website on safari
      -> The menu will be invisible, like if the navbar was empty
      
      opw-2984536
      opw-2896939
      
      closes odoo/odoo#107010
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      ffa34d84
  29. Dec 01, 2022
    • Guillaume (gdi)'s avatar
      [FIX] website: prevent deadlock on editor restart · 6ae53175
      Guillaume (gdi) authored
      
      Before this commit, a deadlock caused the editor not to restart
      correctly when there is an invisible element on a page. The error is
      visible by following these steps:
      
      - Edit a website page
      - Click on the footer
      - Toggle off the page visibility option
      - Click on the navbar
      - Change the template
      - The editor has to restart so click on "OK"
      
      => The Odoo top bar stays in edit mode and the user is not able to
      modify the page.
      
      Technical information:
      When entering edit mode via the URL (enable_editor) the `WebsiteNavbar`
      is not yet `ReadyForActions` because it is waiting for its sub-component
      `EditPageMenu` to start edit mode. Then invisible snippets options start
      (so the `VisibilityPageOptionUpdate` too). But for `isShown()` to work,
      the navbar must be `ReadyForActions`. This is the reason why we can't
      await for `isShown()` in the start of the option, otherwise we would
      have a deadlock. On one hand the `WebsiteNavbar` waiting for the
      invisible snippets options to be started to be `ReadyForActions` and on
      the other hand the `VisibilityPageOptionUpdate` option which needs the
      `WebsiteNavbar` to be `ReadyForActions` to be started.
      
      Related to opw-2971181
      
      closes odoo/odoo#103783
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      6ae53175
    • Guillaume (gdi)'s avatar
      [FIX] website: allow to have all pages popups with a slide hover footer · bae2c6e9
      Guillaume (gdi) authored
      
      Before this commit, the popup snippet was not displayed correctly if it
      had to be displayed on all pages and the footer was a slide hover
      footer. This commit just permits disabling the footer effect while the
      popup is displayed.
      
      Steps to reproduce the bug:
      - Drop some block on a page
      - Set the the footer Slideout Effect to "slide hover"
      - Add a popup and set it to be displayed on all pages
      - Save
      
      => The page is blocked when the popup appears.
      
      opw-2971181
      
      Part-of: odoo/odoo#103783
      Co-authored-by: default avatarRomain Derie <rde@odoo.com>
      Co-authored-by: default avatarqsm-odoo <qsm@odoo.com>
      bae2c6e9
  30. Nov 29, 2022
Loading