From 9ea13513342b14e6b8d4e10e162b618a6ab2cce0 Mon Sep 17 00:00:00 2001 From: Romeo Fragomeli Date: Wed, 6 Jul 2022 08:10:07 +0000 Subject: [PATCH] [REF] *: BS5: Migrate forms and inputs - BS5 uses native inputs instead of pseudo-element for some input like checkbox, radio, ... in BS5 input checkbox don't have "virtual visual" checkbox anymore (::before), so we remove the relative's rules - removed `.custom-control` class - `form-switch` use a new layout system in BS5 we adapt the code to match the Bootstrap approach (inline SVG). - In tests, we don't check the exact value of the background as it change in community/enterprise, and it's difficult to check the value of an SVG. - Overflow in progressbar is now hidden. -> we had to restore it. - In BS5 margins in forms/inputs has been changed -> we had to restore it (e.g. 'mb-3') - .form-group, .form-row, .form-inline > Dropped form-specific layout classes for our grid system. > Use our grid and utilities instead of .form-group, .form-row, > or .form-inline. - .input-group-append and .input-group-prepend > Dropped .input-group-append and .input-group-prepend. > You can now just add buttons and .input-group-text as direct > children of the input groups. Ref: [1] https://getbootstrap.com/docs/5.1/migration/#forms Task ID: 2766483 Part-of: odoo/odoo#95450 --- .../channel_invitation_form.xml | 8 +-- addons/mail_group/views/portal_templates.xml | 8 +-- addons/portal/views/portal_templates.xml | 26 ++++----- .../static/src/xml/pricelist_report.xml | 8 +-- .../views/sale_portal_templates.xml | 24 ++++---- .../views/templates.xml | 16 ++--- .../src/js/fields_form_page_description.js | 12 ++-- .../src/scss/survey_templates_form.scss | 2 +- addons/survey/views/survey_templates.xml | 14 ++--- .../survey_templates_user_input_session.xml | 2 +- .../static/src/core/checkbox/checkbox.scss | 9 --- .../src/core/commands/command_palette.xml | 8 +-- .../core/debug/profiling/profiling_item.xml | 4 +- .../src/legacy/js/_deprecated/basic_fields.js | 2 +- addons/web/static/src/legacy/js/core/dom.js | 6 +- .../src/legacy/js/fields/basic_fields.js | 9 +-- .../src/legacy/js/fields/basic_fields_owl.js | 2 +- .../src/legacy/scss/bootstrap_overridden.scss | 18 ++++++ .../src/legacy/scss/bootstrap_review.scss | 12 ---- addons/web/static/src/legacy/xml/base.xml | 2 +- addons/web/static/src/legacy/xml/kanban.xml | 4 +- .../web/static/src/legacy/xml/week_days.xml | 2 +- .../database_manager.create_form.qweb.html | 4 +- .../database_manager.master_input.qweb.html | 4 +- .../src/public/database_manager.qweb.html | 4 +- .../web/static/src/webclient/webclient.scss | 47 +-------------- .../tests/legacy/fields/basic_fields_tests.js | 25 +++++--- .../tests/legacy/widgets/week_days_tests.js | 4 +- addons/web/views/webclient_templates.xml | 4 +- .../static/src/scss/web_editor.common.scss | 12 ---- .../website/static/src/xml/website.editor.xml | 4 +- .../static/src/xml/website_form_editor.xml | 8 +-- addons/website/views/website_templates.xml | 22 +++---- addons/website/views/website_views.xml | 8 +-- .../website_crm_partner_assign_templates.xml | 24 +++----- .../views/event_leaderboard_templates.xml | 16 ++--- .../static/src/js/website_forum.js | 6 +- addons/website_forum/views/website_forum.xml | 50 ++++++++-------- addons/website_mail/static/src/js/follow.js | 2 +- .../views/website_mail_templates.xml | 4 +- .../views/snippets/s_group.xml | 4 +- .../views/snippets_templates.xml | 6 +- .../website_profile/views/website_profile.xml | 16 ++--- .../static/src/js/website_sale.js | 9 +-- .../static/src/scss/website_sale.scss | 12 ++-- addons/website_sale/views/templates.xml | 58 ++++++++----------- .../views/website_sale_templates.xml | 4 +- .../static/src/xml/slide_quiz_create.xml | 18 +++--- .../static/src/xml/website_slides_share.xml | 25 ++++---- .../src/xml/website_slides_unsubscribe.xml | 8 +-- .../static/src/xml/website_slides_upload.xml | 4 +- .../views/website_slides_templates_course.xml | 10 ++-- .../website_slides_templates_homepage.xml | 6 +- .../views/website_slides_templates_lesson.xml | 20 +++---- .../website_slides_templates_lesson_embed.xml | 4 +- .../views/website_slides_templates_utils.xml | 8 +-- 56 files changed, 251 insertions(+), 407 deletions(-) diff --git a/addons/mail/static/src/components/channel_invitation_form/channel_invitation_form.xml b/addons/mail/static/src/components/channel_invitation_form/channel_invitation_form.xml index c4f6c4c2860..fdcfd488f6c 100644 --- a/addons/mail/static/src/components/channel_invitation_form/channel_invitation_form.xml +++ b/addons/mail/static/src/components/channel_invitation_form/channel_invitation_form.xml @@ -43,11 +43,9 @@
-
- -
+
diff --git a/addons/mail_group/views/portal_templates.xml b/addons/mail_group/views/portal_templates.xml index 3c3f38cd9f9..99eeb04983e 100644 --- a/addons/mail_group/views/portal_templates.xml +++ b/addons/mail_group/views/portal_templates.xml @@ -47,12 +47,8 @@
-
- -
-
- -
+ +
diff --git a/addons/portal/views/portal_templates.xml b/addons/portal/views/portal_templates.xml index 96cdbaa56cc..ece75a73f5e 100644 --- a/addons/portal/views/portal_templates.xml +++ b/addons/portal/views/portal_templates.xml @@ -321,23 +321,19 @@
-
- - +
diff --git a/addons/product/static/src/xml/pricelist_report.xml b/addons/product/static/src/xml/pricelist_report.xml index 256dc9ce045..624cb4033d1 100644 --- a/addons/product/static/src/xml/pricelist_report.xml +++ b/addons/product/static/src/xml/pricelist_report.xml @@ -5,11 +5,9 @@
-
- -
+
diff --git a/addons/sale_management/views/sale_portal_templates.xml b/addons/sale_management/views/sale_portal_templates.xml index 257127eb64b..66597c32404 100644 --- a/addons/sale_management/views/sale_portal_templates.xml +++ b/addons/sale_management/views/sale_portal_templates.xml @@ -75,22 +75,18 @@
-
- - - - - -
+ + + + + -
- - - - - -
+ + + + +
diff --git a/addons/sale_product_configurator/views/templates.xml b/addons/sale_product_configurator/views/templates.xml index 919cd41e221..0bad040ccd1 100644 --- a/addons/sale_product_configurator/views/templates.xml +++ b/addons/sale_product_configurator/views/templates.xml @@ -8,17 +8,13 @@ diff --git a/addons/survey/static/src/js/fields_form_page_description.js b/addons/survey/static/src/js/fields_form_page_description.js index ebbe42d015a..d8ccd146bcd 100644 --- a/addons/survey/static/src/js/fields_form_page_description.js +++ b/addons/survey/static/src/js/fields_form_page_description.js @@ -19,13 +19,11 @@ var FormDescriptionPage = FieldChar.extend({ this.$el.addClass('col'); var $inputGroup = $('
'); this.$el = $inputGroup.append(this.$el); - var $button = $( - '
\ - \ -
' - ); + var $button = $(` + + `); this.$el = this.$el.append($button); $button.on('click', this._onClickEdit.bind(this)); diff --git a/addons/survey/static/src/scss/survey_templates_form.scss b/addons/survey/static/src/scss/survey_templates_form.scss index cb04286e295..42919a4b225 100644 --- a/addons/survey/static/src/scss/survey_templates_form.scss +++ b/addons/survey/static/src/scss/survey_templates_form.scss @@ -114,7 +114,7 @@ _::-webkit-full-page-media, _:future, :root .o_survey_wrap { } } - .o_survey_form_date .input-group-append { + .o_survey_form_date [data-toggle="datetimepicker"] { right: 0; bottom: 5px; top: auto; diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index ba5583a238f..5527e9f2e63 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -381,9 +381,7 @@ t-att-name="question.id" t-att-placeholder="question.question_placeholder" t-att-value="format_date(answer_lines[0].value_date) if answer_lines else None" t-att-data-question-type="question.question_type"/> -
-
-
+
@@ -396,9 +394,7 @@ t-att-name="question.id" t-att-placeholder="question.question_placeholder" t-att-value="format_datetime(answer_lines[0].value_datetime) if answer_lines else None" t-att-data-question-type="question.question_type"/> -
-
-
+
@@ -460,7 +456,7 @@
-
-
@@ -2360,14 +2358,12 @@ Sitemap: sitemap.xml
Search... -
- -
+
diff --git a/addons/website/views/website_views.xml b/addons/website/views/website_views.xml index 340a14073c1..9099d659842 100644 --- a/addons/website/views/website_views.xml +++ b/addons/website/views/website_views.xml @@ -372,11 +372,9 @@
diff --git a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml index 8810ad42f31..1799eb0a865 100644 --- a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml +++ b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml @@ -624,9 +624,7 @@
-
-
-
+
@@ -634,9 +632,7 @@
-
-
%
-
+
%
@@ -672,11 +668,9 @@
-
- - - -
+ + +
@@ -699,11 +693,9 @@
-
- - - -
+ + +
diff --git a/addons/website_event_track_quiz/views/event_leaderboard_templates.xml b/addons/website_event_track_quiz/views/event_leaderboard_templates.xml index 6fa4aaba1e3..2a07ee3d371 100644 --- a/addons/website_event_track_quiz/views/event_leaderboard_templates.xml +++ b/addons/website_event_track_quiz/views/event_leaderboard_templates.xml @@ -98,11 +98,9 @@
- - - +
@@ -118,11 +116,9 @@