Commit Graph
37 Commits
Author SHA1 Message Date
Aaron Bohy dc2be03dba [IMP] web,*: lazy load jSignature lib and extension
The jSignature lib is only used by the NameAndSignature component,
which is not accessible on a many screens. This commit thus
removes the lib and its extension from the bundles, and makes the
NameAndSignature component load it on demand.

Part of task~3439226

closes odoo/odoo#138054

Related: odoo/enterprise#48633
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-11 08:18:46 +00:00
Aaron Bohy 9e46a8a58c [REF] web,*: remove owl.App.validateTarget override
The motivation of this commit was to remove the override of owl
that disables the validateTarget check, which we believed was
necessary for the renderToString function.

Fun fact: renderToString doesn't seem to need the override, as
validateTarget is only called when mounting an app and when
completing a fiber, which renderToString doesn't do. It was instead
probably necessary for the legacy compatibily layers that have now
been removed.

So this commit removes the validateTarget override.

This commit also simplifies the setup of the renderToString fn by
lazy creating the app itself, instead of requiring the application
setup to set the main app as renderToString app (e.g. main.js in
web).

Part of task~3508223

closes odoo/odoo#137807

Related: odoo/enterprise#48514
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-06 14:33:45 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Pierre Rousseau 82697d0b18 [REF] web, *: remove owl2 compatibility
*: mrp_subcontracting, point_of_sale, project, web_editor, website,
website_slides

Part of task-id 3439226

closes odoo/odoo#133551

Related: odoo/enterprise#46526
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-01 13:20:56 +00:00
Samuel Degueldre 6f95be6884 [REF] *: remove web.assets_common
*: auth_password_policy, bus, event, im_livechat, mail, mass_mailing,
mrp_subcontracting, point_of_sale, pos_self_order, project, stock,
survey, web, web_editor, web_tour, website, website_event,
website_forum, website_sale, website_slides, base

Historically, the web.assets_common bundle was used to contain assets
that were needed by both the frontend and the backend. In practice, this
caused a bunch of issues where people would add things in assets common
that were not needed by both, and it was also abused as a way to get
bootstrap working in unrelated places by only using that bundle's css.

Because of this, as a first step, the assets_common stop being used in
the frontend, but was left everywhere else.

This commit removes the bundle completely, and moves the files that used
to be in that bundle in the other bundles that need them, this will
allow those bundles to evolve independently going forward.

in im_livechat and mail, some of the unneeded legacy code was removed, this
allows us to avoind including all of the legacy code from web in the
livechat embed bundle and in the dicuss public bundle respectively.

closes odoo/odoo#132190

Related: odoo/enterprise#45884
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-24 15:11:05 +02:00
Pierre Paridans 586ed792fb [REF] web,*: group Bootstrap config/customization files
- Take them out of `legacy` codebase.
- Group them in a generic `static/src/scss` folder, as those files are
  used in webclient but also in public livechat, portal...

X-original-commit: ca2e4fea92b5a26078a412072275a969508358c7
Part-of: odoo/odoo#100759
2022-09-23 01:39:34 +02:00
qsm-odoo 1968599a45 [FIX] web: restore default website navbar (BS5 order classes)
Commit [1] broke the default website navbar by removing the generation
of order-XXX-0 classes.

[1]: https://github.com/odoo/odoo/commit/6ed6a512bfec8e2415da2d19304215fcd06273b2

closes odoo/odoo#98609

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-22 20:27:01 +02:00
Romeo Fragomeli 6ed6a512bf [FIX] web: restore order-* for some oe_stat_button
In BS4, the classes utilities order was set from `-1` (first) to
`13` (last). This commit restores the old behaviour.
In BS5, you only have a range from `-1` to `6`.

These classes are used in Odoo to order the `oe_stat_button`
particularly for UTM campaign. The order is set using CSS as there no
simple way to do it using `XPath` as there are many module (installed or
not) targeting the `oe_stat_button`.

closes odoo/odoo#98458

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-19 14:28:23 +02:00
stefanorigano (SRI) 6b41d20815 [ADD] web, *: transition-x utility classes
Define classes for some default bootstrap transitions + 'none'.
These values are generic enough to fit different circumstances.

Classes added:
- transition-base
- transition-fade
- transition-none

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

closes odoo/odoo#97051

Related: odoo/enterprise#30066
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-08-04 13:54:15 +02:00
stefanorigano (SRI) d8bbddb9a7 [ADD] web: font-sans-serif utility class
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:15 +02:00
stefanorigano (SRI) 6eeecd19b5 [REM] *: drop custom bg-[color]-light classes
Drop custom `bg-[color]-light` classes in favor of BS's background
color opacity system.
ref: https://getbootstrap.com/docs/5.1/utilities/background/#opacity

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:12 +02:00
stefanorigano (SRI) e377a08417 [IMP] web, *: size and position utility-classes
Improve BS default size and position stack adding classes to fine-tune 
the layout in several circumstances. Classes added:

- 'position-[device]-[position]'
- 'mw-[device]-[size]'
- 'mh-[device]-[size]'
- 'flex-basis-[device]-[size]'
- 'z-index-[0, 1]'
- 'overflow-[x, y]-[overflow type]'
- 'min-w-0'

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:12 +02:00
stefanorigano (SRI) bd2a1110a0 [REM] *: drop o_cursor_default & o_cursor_pointer classes
Drop custom cursor classes in favor of Bootstrap default ones.
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:12 +02:00
stefanorigano (SRI) fe5a3a89fb [IMP] web: opacity-x utility classes
This commits adds the '$o-opacity-disabled' value in the opacity
utility class generation list,  allowing to use the 'opacity-disabled'
class to style on the fly elements that don't support disabled states by
default (eg. generic divs)

The commit introduces also a new '.opacity-trigger-hover' class.
It can be applied on parent elements in order to trigger their children
opacity states. Eg:

   <div class="opacity-trigger-hover">
       <span>Always visible</span>

       <span class="opacity-0 opacity-100-hover">
           Visible when parent is :hover
       </span>
   </div>

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:11 +02:00
Jigar Patel d132421180 [FIX] web: restore .text-body class
During the BS5 migration, the .text-body class wasn't properly ported.

As it is a standard Bootstrap class and useful to override component's color with the one used by the body (ie. set a heading color the same as the content).

This commit restores it.

closes odoo/odoo#96173

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-07-26 18:44:52 +02:00
Romeo Fragomeli cf2d625a85 [FIX] mail,web: DiscussPublicView layout broken
Since BS5 migration [1], we added the possibility to customize the
BS utilities classes using Bootstrap API [2].

But in the mail module files was not added in the
`mail.assets_discuss_public` bundle so no utility class was generated.

Also, missing 'text-black' and 'text-white' are now added in the
compiled SCSS (for `mail.assets_discuss_public` bundle).

Refs:
[1] odoo/odoo#95450
[2] https://getbootstrap.com/docs/5.1/utilities/api/

closes odoo/odoo#95661

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-07-08 19:52:52 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli c741f6e48c [REF] web: add responsive width/height classes utilities
This allows media queries in width/height classes.
This behavior was supported in BS4 but has been deleted in BS5.

e.g. w-md-75 (in Leaderboard eLearning)

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli f68329346f [REF] web: BS5: merge rounded using Bootstrap utilities API
To avoid redundancy and mess rules with rounded classes we simplify
all rules in one location (before was in web and web_enterprise)

Also, we don't set the $rounded variables to 0, so we can use it in
the Bootstrap utilities API. Instead, we have set to 0 the specific
variables.

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:23 +02:00
Romeo Fragomeli fe4f1efb70 [REF] *: BS5: Restore BS4 behaviour
- new prefix `bs-` for the root CSS variables
As some website snippet relay on these values we need to restore the old
behaviour by setting this prefix to an empty string.

- restore negative margins disabled in BS5 by default

- restore BS4 behaviour for setting element content
  Fix some cases when we want to render more than one node on the root
  level.
  In BS4 the jQuery was using all node but in the jQuery compatibility
  layer in BS5 it takes only the first node if the jQuery Element is used
  in the function. This hack try to restore the old behaviour wrapping all
  element in a DIV element (to be single root node).
  PS: this can break some querySelector and some CSS selector if they are
  too fragile.
  e.g. of element that break before this hack:
  Popover content for PaymentPopOver XML in ShowPaymentLineWidget

- restore old value from BS4 and adapt to new value
  $table-cell-padding -> $table-cell-padding-x
  $table-cell-padding -> $table-cell-padding-y
  $table-cell-padding-sm -> $table-cell-padding-x-sm
  $table-cell-padding-sm -> $table-cell-padding-y-sm

- restore BS4 smooth-scroll behaviour

- restore `text-X` from BS4 that use text-emphasis-variant
  In BS5, to generate the text utilities `test-X` its use BS5 utilities
  (See $utilities SCSS variables). To restore the old behaviour we replace
  with the custom `text-emphasis-variant` mixin.
  See odoo/odoo@e111cfd35e

- restore border and background of table
  In `_reboot.scss`, BS5 add `border-style` to all element of a table.
  In some case we customize the table with CSS rules (e.g. `listview`),
  these rules set a size of border. The mix of all rules made that the
  border of the `td` in `tfoot` are visible and make a black line.

- reset block quote Y margin to 0
 BS5 add a spacer and we reset that by puttin margin-y 0

- In BS5, border color is linked to the text color in it. We doesn't
want that and we restore the same behavior as un BS4 by putting
border-color in grey.

- restore HR style like in BS4
  Since in BS5, the height matter we remove the padding and added into the
  margin.
  Also, we restore the color of BS4 for the HR tag

> <hr> elements now use height instead of border to better support the
> size attribute. This also enables use of padding utilities to create
> thicker dividers (e.g., <hr class="py-1">).

https://getbootstrap.com/docs/5.1/migration/#content-reboot-etc

- restore old value for grid gutter to avoid calc error
  In BS5 `$grid-gutter-width` is set in rem and in BS4 it was in px.
  So SCSS compiler generates error when it tries to calc rem and px.

- restore badge, navbar paddings like in BS4

- restore link decoration in frontend (Portal) whiteout website

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:21 +02:00
Romeo Fragomeli 19a0ee516f [REF] event, web: BS5: $emphasized-link-hover-darken-percentage -> $link-shade-percentage
In BS5 `$emphasized-link-hover-darken-percentage` was removed, so we use
the new variable but we restore some BS4 values:

- 15% as in BS4
- remove the underline on links as in BS4

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:17 +02:00
Romeo Fragomeli 42d546a902 [REF] web: BS5: adapt opacity-X-hover classes to class utilities
This can be done by using BS5 API.

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:16 +02:00
Romeo Fragomeli 3c4ffd1c89 [REF] *: BS5: remove hover mixins usage (due to BS5 removal)
* = mail, survey, web, web_editor, website, website_event, website_mail

removed mixins:
* hover
* plain-hover-focus
* hover-focus

These mixins are now replaced by their CSS equivalent.

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:16 +02:00
Romeo Fragomeli fb3b9f96de [REF] *: BS5: handle color overrides
This commit is a hack for Bootstrap 5
In Bootstrap 4 these variables was used with map-merge()
In Bootstrap 5 these variables has set only if they don't exist before

PS: Another fix will be to reorder all bundle to follow Bootstrap
documentation and do another logic that wasn't use before.

Ref:
https://getbootstrap.com/docs/5.1/customize/sass/#colors

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:16 +02:00
Romeo Fragomeli 8d8afbddf5 [REF] web: backport .text-bg-#{$color} from BS 5.2
Add the new helper `.text-bg-#{$color}` to restore the old behaviour like in
BS4 for the `.bg-#{$color}`

In short, in BS5 `.bg-#{$color}` don't change anymore the text color but
only the background. `.text-bg-#{$color}` change both color text and
background.

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:16 +02:00
Romeo Fragomeli 03f95c0f6d [REF] web: forwardport mixins/variable from BS4 -> BS5
mixins:
* make-container-max-widths
* text-emphasis-variant

variable:
* $modal-footer-margin-between

we had to forward-port the BS4 variable `$modal-footer-margin-between`
to avoid error between px and rem calc :

e.g. of error:
Error: Incompatible units: 'rem' and 'px'.
padding: $modal-inner-padding - $modal-footer-margin-between * .5;

This is because BS5 now uses 'rem' but Odoo still continue to use 'px'.
Therefore, the calculation can't be processed.

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:15 +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
Brieuc-brd eaefb789e0 [IMP] web: bs5 utility-classes, add font-size
Define "Bootstrap v5 ready" utility-classes to handle font-size.
These classes definitions can be safely removed after migrating to v5.

task-2838625

Part-of: odoo/odoo#90476
2022-05-25 18:00:57 +02:00
xlu-odoo 9b98352f5f [IMP] web: bs5 utility-classes, add border-width
Define "Bootstrap v5 ready" utility-classes to handle border-width.
These classes definitions can be safely removed after migrating to v5.

task-2842691

Part-of: odoo/odoo#91298
2022-05-25 14:37:49 +02:00
Brieuc-brd 4877cc5a11 [IMP] web: bs5 utility-class, add font-style
Define "Bootstrap v5 ready" utility-class to handle font-style.
This class definition can be safely removed after migrating to v5.

This class is needed for https://github.com/odoo/odoo/pull/87639

task-2811202

closes odoo/odoo#87637

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-03-31 13:33:10 +02:00
Brieuc-brd 26a02711e6 [ADD] web: overflow-visible utility class
Define "Bootstrap v5 ready" utility-class to handle the property
overflow: visible.
This class definition can be safely removed after migrating to v5.

task-2742831

Part-of: odoo/odoo#83403
2022-03-14 14:29:41 +00:00
stefanorigano (SRI) 6f4f3699bf [ADD] web: bs5 utility-classes, add positions
closes odoo/odoo#85804

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-03-04 17:30:25 +00:00
Brieuc-brd 5097bbd595 [ADD] web: bs5 utility-classes, add gaps
Define "Bootstrap v5 ready" utility-class to handle gaps.
This class definition can be safely removed after migrating to v5.

task-2733437

Part-of: odoo/odoo#82866
2022-03-04 15:00:47 +00:00
stefanorigano (SRI) 28f910f5be [REF] *: odoo_ui_icons
Following new policies in terms of product design-language, this commit
will partially revert 546477d reducing the number of `oi` icons.

It will also improve rendering when icons are rendered at our default
font-size (13px), avoiding blur effects when icons use thin lines.

Since fontAwesome will coexists with `oi` longer than expected, the
commit will also review size utility-classes in order to get consistent
result when used in conjunction with fa's ones (notably `fa-lg`).

Part-of: odoo/odoo#85651
2022-03-03 14:19:44 +00:00
Adrien Dieudonne 4e1e762c53 [IMP] web: move BS5 utility classes in a dedicated file
Waiting the complete migration, some classes needs to be available to already
migrates xml files.

This file will be deleted once we're done.

closes odoo/odoo#85586

Task-id: 2704984
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-03-01 13:46:50 +00:00
stefanorigano (SRI) 04f74c0d7f [REF] web: optimize font-awesome
This commit reduces fontAwesome footprint by removing legacy font-files
(~750kb). It keeps WOFF(s) formats for browsers and TTF format for PDF
and ICON to PNG generations.

TTF format has been removed from the CSS [@]fontface rule, but it's
still called directly in python when needed[1].

This commit reviews the CSS too, removing obsolete vendor-prefix rules
and discontinued fontAwesome classes.

Part of v16 overall restyle (task-2704984).

task-2745275

[1] https://github.com/odoo/odoo/blob/15.0/addons/web_editor/controllers/main.py#L45

Part-of: odoo/odoo#83501
2022-02-08 12:05:54 +00:00
stefanorigano (SRI) 0f64e506f2 [MOV] web, * : move font-awesome library in an editable location
This commit "forks" fontAwesome into `src/libs` in order to allow
further customization.
Part of v16 overall restyle (task-2704984).

task-2745275

Part-of: odoo/odoo#83501
2022-02-08 12:05:54 +00:00