Commit Graph
26 Commits
Author SHA1 Message Date
Benoit Socias 871b2ecaea [FIX] web, website: further neutralize BS dropdown when editing submenu
Since [1] when the mega menu were first introduced, to make their
edition possible, the bootstrap dropdown behavior was neutralized by
removing the `data-[bs-]toggle` attribute.

In [2] when Bootstrap was upgraded to version 5.1.3, the
`dataApiKeydownHandler` event handler that is called when up, down or
escape are pressed raises an error if `data-bs-toggle` cannot be found
on a previous sibling of the dropdown. This makes the approach chosen
in [1] incomplete.

This commit avoids this issue by temporarily adding a class that
is excluded from the event handler selector.
The patch must unfortunately be applied within bootstrap itself because
the event handler is registered right after the method is defined and
we have no way to access the registered event handlers afterwards.
This makes it impossible to patch the called method from outside, nor
its associated selector.

We cannot simply update the selector that was already patched by [3]
because it is also used by other methods.

A test is included which should mitigate the risk of accidentally losing
this patch upon bootstrap upgrades.

Steps to reproduce:
- Create a mega menu.
- Edit the page.
- Open the mega menu.
- Click inside the mega menu content to have a cursor selection.
- Press the arrow up key, the arrow down key or the escape key.

=> An error dialog was displayed.

The same issue happened with a nested menu instead of a mega menu.

[1]: https://github.com/odoo/odoo/commit/1345702258adbfbee0d780dc22e552395e6d1df7
[2]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968
[3]: https://github.com/odoo/odoo/commit/daca8fe4e3da4a5ad5fabf3730496a3919af8abc

task-3614926
opw-3741670

closes odoo/odoo#155019

X-original-commit: 48f0c4203ceb5e770fed6193bd6382690b1b62fe
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2024-02-22 16:24:01 +00:00
Chrysanthe (chgo) 8120fca14f [FIX] account, kanban_dashboard: fix favorite alignment
Commit[1] introduced some changes in order to fix a layout issue in the
accounting dashboard but these changes were applied in a way that affects
a lot of modules and files that should not be modified.

In fact, by removing the padding inside the `kanban_dashboard.scss`
commit[1] is actually removing the padding in every place where
the boolean_favorite widget is used.

There is also a change applied in the Bootstrap library files, which
should remain untouched.

=== AFTER ===

We revert the changes applied by commit[1] and also fix the layout issue
in the accounting dashboard that it aimed to fix.

commit[1]: d4ba0c1

task-3453799
part of task-3326263

closes odoo/odoo#132134

X-original-commit: f78571cec0a5debf78c5dd1859c78b13d33df1ab
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-17 01:04:34 +02:00
Maximilien (malb) e3f4651c52 [FIX] * : Display improvement
This PR will introduce multiple display improvements. Here is the list:

- In the accounting settings, the fiscal localization section has a button that
was oddly placed. This PR solves that issue.

- On the dashboard, when clicking the three dots on a card, the options "remove
from favorites" and "configuration" were not aligned.

- In ir_attachment, the label and field of "datas" will be aligned, and a gap
will be added between the icons.

- In the settings, the button links were inconsistent in terms of padding. This
PR resolves that.

- In the payment providers, two button links had text wrapping issues. By adding
 Bootstrap classes, this has been resolved.

closes odoo/odoo#130522

Task-id: 3342969
X-original-commit: d4ba0c1f69212bfb0030036951c2888e935bbdf0
Related: odoo/enterprise#45060
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-08-02 17:29:27 +02:00
Bruno Boi ff619c4761 [FIX] web: repair keynav in dropdowns
- Before this commit
Keyboard navigation in dropdowns lead to a traceback

- Explanation
The traceback happens in the bootstrap library.
When upgrading to bootstrap v5.1.3 (see c48f57e), a fix done in the
previous bootstrap version was lost (see 78f85f2).
This previous fix also added a test but it was not enough to
detect the issue when the bootstrap lib was upgraded.

- After this commit
This commit reintroduce the same previous fix and adapts the test,
hoping it would be enough for future changes to not break further
the expected behavior.

closes odoo/odoo#108080

X-original-commit: daca8fe4e3da4a5ad5fabf3730496a3919af8abc
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-12-15 15:45:18 +01:00
Adrien Dieudonne d5bf4ca473 [FIX] web, hw_drivers: bootstrap: removes js bundled Bootstrap file
Some modules used Bootstrap minified bundle but this was replaced
in [1] to avoid using of minified files.

We now want to have the same way to import bootstrap by using non-minified
individually compiled Bootstrap files (bootstrap/js/dist/).

Note that in 'hw_drivers', the js and css part was imported at the
same time but the javascript seems never used...

REF:
[1] https://github.com/odoo/odoo/pull/95450

Part-of: odoo/odoo#95628
2022-07-08 17:10:47 +02:00
Adrien Dieudonne 9d0bf51458 [IMP] web: bootstrap: remove source files
Sources files (boostrap/js/src/) are not used in Odoo.
We actually use:
- All at once compiled code (bootstrap/dist/)
  -> only for /hw_drivers (POS) and /web (database_manager)
- Individually compiled Bootstrap (bootstrap/js/dist/)

REF:
https://github.com/odoo/odoo/pull/95450
https://getbootstrap.com/docs/5.1/getting-started/contents/
https://getbootstrap.com/docs/5.1/getting-started/javascript/

Part-of: odoo/odoo#95628
2022-07-08 17:10:47 +02:00
Adrien Dieudonne 2bc60ad9bd [FIX] web: bootstrap: unwanted triggerTransitionEnd
There is a timeout that force the call to the transitionEnd
to prevent some issue [1]. '_cleanTipClass' callback was then
executed who call getTipElement.
It seems that the tip doesn't exists but the JS is still alive.
After that a crash occurs in [2]: _config is null.

Maybe jQuery was more permissive/defensive before BS5 and this error
was avoided.

So, we had this non-deterministic error:
> UncaughtTypeError: Cannot read properties of null (reading 'template')
Especially in 'test_17_website_edit_menus' with tooltip/popover.

Now we avoid the error in complete by checking if there is an element or
_config not null.

Ref:
[1] https://github.com/twbs/bootstrap/pull/33845/files
[2] https://github.com/twbs/bootstrap/blob/v5.1.3/js/dist/tooltip.js#L630
https://stackoverflow.com/questions/69766375/typeerror-cannot-read-properties-of-null-reading-template-on-bootstrap-tool
https://github.com/twbs/bootstrap/issues/25519

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli c48f57ea25 [IMP] web,*: upgrade to Bootstrap 5.1.3
* = base,http_routing,hw_drivers

- Update Bootstrap from 4.3.1 to 5.1.3

- Update PopperJS to version 2 for Bootstrap 5 (JS part)
  Some code was for PopperJS V1, but it's not compatible anymore.

- Remove some BS5 classes utilities backport

- Fix path for BS5

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:15 +02:00
Bruno Boi 78f85f2725 [FIX] web: repair some keynav in dropdowns
ENCOUNTERED ISSUE:
Unable to close a dropdown with ESC when the focus has been given
to a select element inside the dropdown.

TO REPRODUCE:
i.e. in the searchpanel, go to "FilterMenu > Add Custom Filter" and
open the field select element.
Press ESC once: the field select element closes just fine.
Press ESC a 2nd time: we expect the dropdown to close but nothing occur.

REASON EXPLANATION:
Since 84715436d our Dropdown component uses the 'dropdown-menu'
bootstrap class.
But under some conditions bootstrap stops the keydown events propagation
when the event.target matches the query selector '.dropdown-menu'.

IMPLEMENTED FIX:
This commit refines this selector directly inside the bootstrap library.
This is admittedly a bad practice but:
- this modification is trivial and sensible
- the modified selector is only used locally
  in the bootstrap's 'dropdown.js' file
- the added test should prevent the lost of
  this customization in the future

task-2764821

Part-of: odoo/odoo#84969
2022-02-21 20:11:54 +00:00
qsm-odoo 9a7858efe1 [FIX] web: remove bootstrap sourceMappingURL
Same as https://github.com/odoo/odoo/commit/8e17223c260add842d83b2549d7bdaa4c3cc4d6c

Part of https://github.com/odoo/odoo/pull/31401
task-1944790
2019-02-27 10:28:30 +00:00
qsm-odoo 4697d74480 [IMP] web: update bootstrap 4.2.1 -> 4.3.1
See https://blog.getbootstrap.com/2019/02/11/bootstrap-4-3-0/
and https://blog.getbootstrap.com/2019/02/13/bootstrap-4-3-1-and-3-4-1/

Again, some fixes were added in this version and not in a 4.2.x version
so there is no clean way to backport them in 12.0 / saas-12.2.
If needed, the file bootstrap_review.scss is there for that.

Among the new features, two notable ones:
- The '.modal-dialog-scrollable' class which does what odoo already
  implemented for all its modals. So we could remove our custom code in
  a next update.
- Responsive font sizes ! Plan was to develop something similar for the
  website, so this comes at the right time. The behavior is opt-in, we
  will enable it in a next update.

Part of https://github.com/odoo/odoo/pull/31401
task-1944790
2019-02-27 10:28:30 +00:00
qsm-odoo f4503d09dc [FIX] web: remove bootstrap sourceMappingURL
Same as https://github.com/odoo/odoo/commit/8e17223c260add842d83b2549d7bdaa4c3cc4d6c
2019-01-09 14:03:47 +00:00
qsm-odoo 63e52e6acf [IMP] web: update bootstrap from 4.1.3 to 4.2.1
This commit only updates the existing bootstrap files and add the new
ones the update brings.
2019-01-09 14:03:47 +00:00
Xavier Morel 8e17223c26 [FIX] web: remove bootstrap sourceMappingURL
We're not shipping the sourcemap files, and while the assets minifier
strips out the mappings they're getting hit in debug=assets which is
bot useless and problematic when running odoo-bin without a proxy for
static folders: if sourcemaps are enabled (which is apparently the
default in all browsers if devtools are opened at this point) the
browser tries to fetch the sourcemap, which does through the
SharedDataMiddleware which doesn't find them and passes the query on
to the regular Application which goes through the entire dispatch &
NotFound process.

If website is installed, that process ends up rendering website.404,
which can be pretty costly until everything is properly cached:

    # initial request
    "GET /web/static/lib/bootstrap/js/index.js.map HTTP/1.1" 404 - 319 0.198 0.954
    # a few requests later
    "GET /web/static/lib/bootstrap/js/index.js.map HTTP/1.1" 404 - 27 0.022 0.060

And the way sourcemaps are fetched (might be headers, might be the
stampede as browsers will try to fetch a dozen sourcemaps as fast as
possible) seems to make this problem much, much worse: instead of 300+
the requests take 800+ queries each, multiple seconds, and requests
get worse as time goes on (didn't investigate the exact reason for
that) *and* they apparently don't ever get cached (at least they don't
after half a dozen reloads of the client).
2018-09-17 10:44:58 +02:00
qsm-odoo 9d90c7ea7b [IMP] base, web: update bootstrap 3.3.7 to 4.1.3
Simply updating the lib, the assets bundle content and the assets bundle
compiler.
2018-07-27 12:36:54 +02:00
qsm-odoo 6096f24501 [REF] web: change bootstrap source from less to scss
Note: bootstrap 3.3.7 in SCSS produces slightly different CSS
of bootstrap 3.3.7 in LESS... the DOM result should be the same
though.
2018-04-18 15:59:09 +02:00
qsm-odoo 126850e9bd [IMP] web: update bootstrap to 3.3.7
Before this commit the bootstrap version we used was inconsistent.
Indeed, the javascript files were the 3.3.4 ones and the less files
were the 3.3.5 ones. This was due to a failed merged resolution in 9.0.
This should however not cause any issue as the difference between
3.3.x versions are very minor.

Basically, this commit is more of a fix than an improvement and may
even be backported if we find reasons to do so. This commit is mainly
made to prepare the transition to version 4.0.0, which requires to
switch our LESS files to SCSS first (and it will be easier to go by
bootstrap 3.3.7 with SCSS files first).
2018-02-01 11:03:05 +01:00
fwi-odoo 9a3ad41cfa [FIX] web: change selection color in the correct file
Fix commit 537b919ec2
Don't change the lib file directly.
2016-11-21 10:53:02 +01:00
fwi-odoo 537b919ec2 [IMP] web: darker highlight selection 2016-11-21 09:45:14 +01:00
Aaron Bohy 977db823c7 [REF] web: stop duplicating web
Avoid duplicating web addon in enterprise by extracting a common basis.
Enterprise features stay in enterprise, but use that common basis.

Mainly:
 - JS refactoring and linting
 - Conversion of .sass into .less split into multiple files
 - Templates cleaning and DOM simplification
 - Re-generation of web.pot, and update of .po files
2016-04-21 15:21:39 +02:00
Christophe Simonis 2cf91d16a5 [MERGE] forward port of branch saas-6 up to 63e92cb 2015-07-22 16:17:54 +02:00
Jeremy Kersten 1516b11596 [IMP] web: update bootstrap from 3.2.0 to 3.3.5 2015-07-02 15:44:02 +02:00
Simon Lejeune 5cb10d4fc9 [IMP] web: update bootstrap to 3.4, and use less files
important note: the bootstrap.css file is left in the tree because
it is used for reports.  (reports fails if they use the less files)
2015-06-15 16:29:38 +02:00
Christophe Matthieu 67e15d8d86 [FIX] web: update bootstrap to version 3.2.0; add bootstrap less files 2014-07-10 16:59:31 +02:00
Christophe Matthieu e2898a1d59 [IMP] web: update lib bootstrap 3.1.0
bzr revid: chm@openerp.com-20140211111118-ur6xntyf6o9lwsac
2014-02-11 12:11:18 +01:00
Antony Lesuisse d6c6f31231 [MERGE] boostrap3 manually merged
bzr revid: al@openerp.com-20131202131943-b01fb56u0qsgcs53
2013-12-02 14:19:43 +01:00