diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-02-15 18:14:58 +0100 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-04-18 15:59:18 +0200 |
| commit | fbfd0119041ca7dc830796e76d9ae5c303459d4f (patch) | |
| tree | e30dd1a85988a97411a6d00945248fa1166cf465 /addons/base_import/static/src | |
| parent | 97aa0a8dec384ad75eb66045f43384b6e54f1d6e (diff) | |
[REF] *: get rid of introduced @extend
During first scss convertion, classes called as mixins were changed to
an @extend instruction which was the best approximation given the fact
there is no equivalent in sass to do that. The problem is that the
instruction is slowing the scss computation a lot and might also break
the style in unexpected ways because of the complex unwanted selectors
the instruction induces.
This commit removes the need of extends. This is done case per case.
Sometimes this involves adding classes in xml, sometimes to change the
style a little, ... The button rendering refactoring which was made
at the start of the LESS to SASS merge was also done in prevision of
this.
After this commit, sass computation is like 5-6 times faster than less
computation while it was like 10 times *slower* before this commit.
Diffstat (limited to 'addons/base_import/static/src')
| -rw-r--r-- | addons/base_import/static/src/js/import_action.js | 2 | ||||
| -rw-r--r-- | addons/base_import/static/src/scss/base_import.scss | 16 | ||||
| -rw-r--r-- | addons/base_import/static/src/xml/base_import.xml | 8 |
3 files changed, 5 insertions, 21 deletions
diff --git a/addons/base_import/static/src/js/import_action.js b/addons/base_import/static/src/js/import_action.js index 1e17798ae34..d995e9cf055 100644 --- a/addons/base_import/static/src/js/import_action.js +++ b/addons/base_import/static/src/js/import_action.js @@ -281,7 +281,7 @@ var DataImport = AbstractAction.extend(ControlPanelMixin, { // TODO: test that write // succeeded? this.$el.removeClass('oe_import_preview_error oe_import_error'); this.$el.toggleClass( - 'oe_import_noheaders', + 'oe_import_noheaders text-muted', !this.$('input.oe_import_has_header').prop('checked')); this._rpc({ model: 'base_import.import', diff --git a/addons/base_import/static/src/scss/base_import.scss b/addons/base_import/static/src/scss/base_import.scss index 72fe2651331..9a4ce56f5c2 100644 --- a/addons/base_import/static/src/scss/base_import.scss +++ b/addons/base_import/static/src/scss/base_import.scss @@ -84,10 +84,6 @@ display: block; } - .oe_import_noheaders { - @extend .text-muted; // FIXME was a mixin before scss convertion - } - /* ------------- ERRORS AND WARNINGS REPORT ------------ */ .oe_import_error_report { > ul { @@ -99,18 +95,6 @@ list-style: none; border-radius: $border-radius-base; } - .oe_import_report_error { - @extend .bg-danger; // FIXME was a mixin before scss convertion - @extend .text-danger; // FIXME was a mixin before scss convertion - } - .oe_import_report_warning { - @extend .bg-warning; // FIXME was a mixin before scss convertion - @extend .text-warning; // FIXME was a mixin before scss convertion - } - .oe_import_report_info { - @extend .bg-info; // FIXME was a mixin before scss convertion - @extend .text-info; // FIXME was a mixin before scss convertion - } } /* ------------- THE CSV TABLE ------------ */ diff --git a/addons/base_import/static/src/xml/base_import.xml b/addons/base_import/static/src/xml/base_import.xml index f882bf7f557..276d9ca0245 100644 --- a/addons/base_import/static/src/xml/base_import.xml +++ b/addons/base_import/static/src/xml/base_import.xml @@ -68,7 +68,7 @@ Track history during import </label> </div> - <div title="If the model uses parent/child relations, computing the + <div title="If the model uses parent/child relations, computing the parent / child relation occurs on every line, and lead to a slower import. Defering it can speed up import." class="oe_import_deferparentstore"> @@ -84,7 +84,7 @@ <input type="checkbox" class="oe_import_advanced_mode" checked="checked" id="oe_import_advanced_mode"/> <label for="oe_import_advanced_mode">Show fields of relation fields (advanced)</label> - <p class="oe_import_noheaders">If the file contains + <p class="oe_import_noheaders text-muted">If the file contains the column names, Odoo can try auto-detecting the field corresponding to the column. This makes imports simpler especially when the file has many columns.</p> @@ -124,7 +124,7 @@ </tbody> </t> <t t-name="ImportView.preview.error"> - <div class="oe_import_report oe_import_report_error"> + <div class="oe_import_report bg-danger text-danger"> <p>Import preview failed due to: <t t-esc="error"/>.</p> <p>For CSV files, the issue could be an incorrect encoding.</p> <p t-if="preview">Here is the start of the file we could not import:</p> @@ -133,7 +133,7 @@ </t> <ul t-name="ImportView.error"> <li t-foreach="errors" t-as="error" - t-attf-class="oe_import_report oe_import_report_#{error_value[0].type}"> + t-attf-class="oe_import_report bg-#{error_value[0].type} text-#{error_value[0].type}"> <t t-call="ImportView.error.each"> <t t-set="error" t-value="error_value[0]"/> </t> |
