From fa048082f2fece72625bbbadbb774c507b049d82 Mon Sep 17 00:00:00 2001 From: "Antoine (anso)" Date: Fri, 2 Sep 2022 07:37:41 +0000 Subject: [PATCH] [IMP] project : optimize SCSS SCSS optimization of the right side panel in project module. Remove custom SCSS and use Bootstrap classes instead. task : 2977963 X-original-commit: 9045dfbaece4e2cef153597632fd473cbb6cdb6f Part-of: odoo/odoo#102686 --- .../components/project_milestone.js | 2 +- .../components/project_milestone.xml | 26 +-- .../components/project_profitability.xml | 70 ++++---- .../project_right_side_panel_section.xml | 10 +- .../project_right_side_panel.scss | 166 +++--------------- .../project_right_side_panel.xml | 9 +- addons/project/views/project_update_views.xml | 6 +- .../project_right_side_panel.xml | 35 ++-- 8 files changed, 106 insertions(+), 218 deletions(-) diff --git a/addons/project/static/src/components/project_right_side_panel/components/project_milestone.js b/addons/project/static/src/components/project_right_side_panel/components/project_milestone.js index 97b41e4c778..3397e41c243 100644 --- a/addons/project/static/src/components/project_right_side_panel/components/project_milestone.js +++ b/addons/project/static/src/components/project_right_side_panel/components/project_milestone.js @@ -27,7 +27,7 @@ export class ProjectMilestone extends Component { } _getColorClass() { - return this.milestone.is_deadline_exceeded && !this.milestone.can_be_marked_as_done ? "o_milestone_danger" : this.milestone.can_be_marked_as_done ? "o_color_green" : ""; + return this.milestone.is_deadline_exceeded && !this.milestone.can_be_marked_as_done ? "text-danger" : this.milestone.can_be_marked_as_done ? "text-success" : ""; } _getCheckBoxIcon() { diff --git a/addons/project/static/src/components/project_right_side_panel/components/project_milestone.xml b/addons/project/static/src/components/project_right_side_panel/components/project_milestone.xml index 6e572adb2c2..b14fdca3a01 100644 --- a/addons/project/static/src/components/project_right_side_panel/components/project_milestone.xml +++ b/addons/project/static/src/components/project_right_side_panel/components/project_milestone.xml @@ -2,21 +2,23 @@ -
- - - -
-
- +
+
+ + + +
+
+ +
+ + +
- - + +
- - -
diff --git a/addons/project/static/src/components/project_right_side_panel/components/project_profitability.xml b/addons/project/static/src/components/project_right_side_panel/components/project_profitability.xml index a9ab5592146..5d1eb524d51 100644 --- a/addons/project/static/src/components/project_right_side_panel/components/project_profitability.xml +++ b/addons/project/static/src/components/project_right_side_panel/components/project_profitability.xml @@ -1,86 +1,86 @@ -
- +
+
- - - - + + + + - - - - + + + - + - - - + + +
RevenuesInvoicedTo InvoiceExpectedRevenuesInvoicedTo InvoiceExpected
- +
Total
-
- +
+
- - - - + + + + - - - - + + + - + - - - + + +
CostsBilledTo BillExpectedCostsBilledTo BillExpected
- +
Total
- +
- - - - + + + +
MarginMargin
diff --git a/addons/project/static/src/components/project_right_side_panel/components/project_right_side_panel_section.xml b/addons/project/static/src/components/project_right_side_panel/components/project_right_side_panel_section.xml index 867ed43f248..c5dfb6277a5 100644 --- a/addons/project/static/src/components/project_right_side_panel/components/project_right_side_panel_section.xml +++ b/addons/project/static/src/components/project_right_side_panel/components/project_right_side_panel_section.xml @@ -2,14 +2,14 @@ -
-
-
- +
+
+
+

-
+
diff --git a/addons/project/static/src/components/project_right_side_panel/project_right_side_panel.scss b/addons/project/static/src/components/project_right_side_panel/project_right_side_panel.scss index e2aa6548b72..78a917e71f7 100644 --- a/addons/project/static/src/components/project_right_side_panel/project_right_side_panel.scss +++ b/addons/project/static/src/components/project_right_side_panel/project_right_side_panel.scss @@ -29,71 +29,17 @@ $o-rightpanel-filter-default-color: #D59244; .o_rightpanel { flex: 0 0 37%; - overflow: auto; - height: 100%; padding: $o-rightpanel-p-small $o-rightpanel-p $o-rightpanel-p*2 $o-rightpanel-p; - border-left: 1px solid $gray-300; - background-color: white; min-width: 400px; max-width: 1140px; .o_rightpanel_section { - padding-bottom: $o-rightpanel-p; - padding-top: $o-rightpanel-p; - - &:nth-child(n+3){ - border-top: 1px solid $gray-300; - } - - &:first-child{ - padding-bottom: 0px; - } - - &:nth-child(2){ - padding-top: 0px; - } - - .o_rightpanel_button { - cursor: pointer; - font-size: small; - color: $o-brand-primary; - - &:hover { - color: #001d1f; - text-decoration: none; - } - } - - .o_rightpanel_header { - padding: $o-rightpanel-p-tiny 0 $o-rightpanel-p-small 0; - - .o_rightpanel_title { - padding: 8px 0; - font-weight: bold; - font-size: large; - display:inline; - } - - .o_rightpanel_button { - font-weight: bold; - float: right; - padding-top: $o-rightpanel-p-tiny; - } + &:nth-child(n+3) { + border-top: 1px solid $border-color; } + /* UNUSED SCSS TO REMOVE .o_rightpanel_data { - font-size: small; - .table-striped{ - tbody tr:nth-of-type(odd) { - background-color: $gray-100; - } - } - .o_rightpanel_data_row, table > tbody > tr { - &:not(.o_rightpanel_nohover):hover { - background-color: $gray-200; - border-radius: 5px; - } - } .o_rightpanel_left_col { font-size: small; padding-top: 0; @@ -106,99 +52,21 @@ $o-rightpanel-filter-default-color: #D59244; padding-right: $o-rightpanel-p-small; } } - .o_rightpanel_right_col { - float: right; - display: flex; - align-items: center; - .o_milestone_checkbox { - display: flex; - align-items: center; - } - } - - .o_rightpanel_center_col { - flex-grow: 1; - text-align: center; - display: flex; - justify-content: center; - align-items: center; - } - - .o_rightpanel_milestone { - margin-bottom: $o-rightpanel-p-small; - display: flex; - &.o_milestone_danger { - color: $red; - } - .o_milestone_checkbox { - cursor: pointer; - padding-right: $o-rightpanel-p-tiny; - } - .o_milestone_detail { - cursor: pointer; - display: flex; - justify-content: space-between; - flex-grow: 1; - .o_milestone_info { - display: flex; - flex-direction: column; - flex: 30%; - } - } - .o_delete_icon { - cursor: pointer; - padding-left: $o-rightpanel-p-tiny; - } - } - - .o_rightpanel_subsection { - &:not(:last-child) { - padding-bottom: 1rem; - } - } - - td.text-bold { - font-weight: bold; - } - - table > tfoot { - font-weight: bold; - border-top: 1px solid black; - } - } - + .o_rightpanel_hidden { display: none; } - - .o_color_red { - color: $red; - } - .o_color_green { - color: $green; - } + */ .o_form_view { .oe_button_box { - display: flex; - flex-wrap: wrap; - margin-left: -16px; - margin-right: -16px; - - @media screen and (max-device-width: 768px) { - margin-top: -4px; - margin-bottom: 0px; - } + margin: -1px (-$o-rightpanel-p) 0; .oe_stat_button { flex-basis: 25%; - border: 1px solid $border-color; - margin-top: -1px; - margin-left: -1px; - height: 57.5px; - &:nth-child(4n):not(:last-child){ - border-right-width: 0px; + &:nth-child(4n):not(:last-child) { + border-right-width: 0; } .o_stat_text { @@ -211,13 +79,25 @@ $o-rightpanel-filter-default-color: #D59244; flex-basis: 33.33%; &:nth-child(3n):not(:last-child) { - border-right-width: 0px; + border-right-width: 0px !important; + } + + &:nth-child(4n):not(:last-child){ + border-right-width: 1px; } } } - } } - } + .o_rightpanel_header { + @include media-breakpoint-down(md) { + cursor: pointer; + } + } + + tr th:not(:first-child) { + width: 20%; + } + } } diff --git a/addons/project/static/src/components/project_right_side_panel/project_right_side_panel.xml b/addons/project/static/src/components/project_right_side_panel/project_right_side_panel.xml index 1bf86644bdc..a7a32ce0554 100644 --- a/addons/project/static/src/components/project_right_side_panel/project_right_side_panel.xml +++ b/addons/project/static/src/components/project_right_side_panel/project_right_side_panel.xml @@ -2,18 +2,19 @@ -
- +
-
+
- + diff --git a/addons/project/views/project_update_views.xml b/addons/project/views/project_update_views.xml index e152f750817..1e5eff2ad84 100644 --- a/addons/project/views/project_update_views.xml +++ b/addons/project/views/project_update_views.xml @@ -80,15 +80,15 @@
-
+
-
+
Progress
-
+
Date
diff --git a/addons/sale_project/static/src/components/project_right_side_panel/project_right_side_panel.xml b/addons/sale_project/static/src/components/project_right_side_panel/project_right_side_panel.xml index 3950e17f34c..a05219d83ab 100644 --- a/addons/sale_project/static/src/components/project_right_side_panel/project_right_side_panel.xml +++ b/addons/sale_project/static/src/components/project_right_side_panel/project_right_side_panel.xml @@ -10,13 +10,13 @@ Sales - +
- - - - + + + + @@ -24,25 +24,30 @@ - - - + + + - - + + + - + + + +
Sales Order ItemsSoldDeliveredInvoicedSales Order ItemsSoldDeliveredInvoiced
- +
- +
+ Load more
+ All items have been loaded +