Commit Graph
36 Commits
Author SHA1 Message Date
Géry Debongnie 2af74a5f53 [REF] web_kanban_gauge: reimplement gauge widget with Chart.js
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
7bc550fb8d [REF] web_kanban_gauge: adapt code after jQuery update
Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:17 +01:00
Géry Debongnie abf32b8b21 [REF] *: update js test suite to use helpers
This rev. introduces robust helpers to use in the JS tests suite to
interact with DOM and components, and starts using them (almost)
everywhere.

All the helpers are exposed though testUtils.js.

There are 2 kinds of helpers:

1. Assertions
-------------
 * assert.containsNone, containsN, containsOnce check that the DOM
   (or a specific part of the DOM) contains a `selector`. It
   generates a correct error message automatically.
    ex: assert.strictEqual(form.$('.o_form_editable'), 1, "msg");
        -> assert.containsOnce(form, '.o_form_editable');
 * assert.isVisible, isNotVisible check that the DOM has an element
   visible or not. They also check that the element is actually in
   the DOM (before most tests didn't verify this).
 * assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific
   properties of a DOM element, and also validate that it is
   applied on a single existing DOM element (before most tests
   didn't verify this).
    ex: assert.notOk(form.$('button').hasClass('btn-primary'));
       -> assert.doesNotHaveClass(form.$('button'), 'btn-primary');

2. Utilities
------------
The goal of the utilities is to centralize the definition of many
standard components and interactions, ensuring that when we
refactor the JS framework, we do not need to change all the tests.

Existing mock utilities (addMockEnvironment, intercept, path,
patchDate, unpatch and fieldsViewGet) are moved to
'testUtils.mock.*'.
Existing DOM utilities are moved to 'testUtils.dom.*'.
New dom utilities are created for opendDatePicker, click,
clickFirst and clickLast. Helper `click` verifies that there is
exactly 1 element visible in the DOM you click on, `clickFirst`
and `clickLast` verify that there are more than one element on the
DOM.
 ex: form.$('button').click();
     -> testUtils.dom.click(form.$('button'));

New Form utilities: (testUtils.form.*)
 clickEdit, clickSave, clickCreate, clickDiscard, all clicks on
 the control panel buttons of the form.
 `reload` reloads the form data.

New modal, graph, kanban and pivot utils (testUtils.pivot.*,
testUtils.kanban.*, etc.).

New fields utils: (testUtils.fields.*)
 * editInput, editSelect: allow to change the value of a field,
   using a selector to identify it. They validate that the input
   exists and trigger the change event automatically.
 * editAndTrigger: allow to modify a field and trigger specific
   events after the value change
 * many2one (testUtils.fields.many2one.*)
   clickOpenDropdown, clickHighlightedItem, clickItem,
   searchAndClickItem: use a field name instead of a selector and
   do all the complex mechanism to open, filter and highlight
   many2one fields.

Joint work with aab, dam, ged, mge, svs and vsc.
2018-11-19 11:24:28 +00:00
Xavier Morel f1a85ba70a [FIX] *: fix a bunch of incorrectly documented docstring
Fix a bunch of ill-documented/incomplete/incorrect method docs
Without this, the automatic doc generation does not work.
2017-09-18 11:54:39 +02:00
Christophe Matthieu 95c2bd33a2 [IMP] web: lazy load nvd3, ace and fullCalendar lib to reduce asset size 2017-08-31 16:26:11 +02:00
Aaron Bohy 1efca8d073 [FIX] web_kanban_gauge: correctly render gauge widget
Before this rev., nothing was rendered when the 'gauge' widget was
set on a field (e.g. Sales > Leads Management > Team Assignation),
because the API of the fields in web evolved a lot recently, and
the rendering should now be done in a private function called
'_render', not 'render'.
2017-07-27 15:10:30 +02:00
Géry Debongnie 905e01921f [REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.

Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm
2017-04-11 19:44:38 +02:00
Christophe Matthieu 41d3c9b165 [FIX] web_kanban_gauge: max_value can be null 2016-02-17 16:06:57 +01:00
Christophe Matthieu 3cb7d907a3 [IMP] web_kanban_gauge: remove justgage lib and use d3 2016-02-17 09:47:46 +01:00
Géry Debongnie b1557efa9e [FIX] web_kanban_gauge: update to new kanban view 2015-06-15 16:30:35 +02:00
Christophe Simonis a9471c43b9 [MERGE] forward port of branch saas-6 up to e941c0f 2015-04-17 15:33:00 +02:00
Nicolas Lempereur 11cd2f38d3 [FIX] kanban: number missing in IE9
In IE9 there is a "dy" attribute of tspan svg elements which may be wrongly not
set to 0. These elements may then be lower than they should (and thus may
eventually not be seen at all if they are outside of the svg view area).

This fix adds IE9 in the range of browsers to which the "dy" must be set to 0.

This issue don't happen in the last official release (http://www.justgage.com/)
thanks to either a fix since RaphaelJS 2.0.2 or an update in justgage.
2015-04-07 13:37:52 +02:00
Nicolas Lempereur b8b8329044 Revert "[FIX] web: set_cache want unicode when caching css"
This reverts commit e75e2ce2e5.
2015-04-07 10:55:24 +02:00
Nicolas Lempereur e75e2ce2e5 [FIX] web: set_cache want unicode when caching css 2015-04-07 10:29:33 +02:00
Géry Debongnie 4fdf74fe21 [IMP] web+addons: improvement to module system
The module system needs to know the dependencies of a given module
before executing the function.  This is why the dependencies were
defined once in an array, and then were described one more times in the
call to require.

But a trick can simplify this: the boot function can parse the string
representation of the module and extract the calls to require from it.
It is more work for the processor, but it leads to simpler module
definitions.
2015-03-18 09:23:37 +01:00
Géry Debongnie c8a8fec622 [REF] web_X: update to the new module system 2015-03-18 09:01:49 +01:00
Olivier Dony 7b4846afd7 [FIX] wek_kanban_gauge: use field raw_value to avoid thousands separator etc. 2014-07-28 18:50:55 +02:00
Christophe Matthieu ac43bda48a [FIX] web_kanban_gauge: don't use fit=true for raphael.js because preserveAspectRatio svg attribute is wrong 2014-07-07 15:20:14 +02:00
xmo-odoo 74de2461a1 Merge pull request #926 from xmo-odoo/master-cleanup-gauge-xmo
Fix implicit globals in kanban_gauge JS
2014-07-07 09:50:48 +02:00
Thibault Delavallée f0ef8ac446 [FIX] web_kanban_sparkline, sales_team, stock: use char function field to transmit sparkline data; the data is now correctly dumped into json, and parsed in the widget. 2014-07-04 14:42:38 +02:00
Xavier Morel 13c03caea8 [FIX] web_kanban_gauge: bunch of implicit globals in JS code 2014-07-04 11:03:31 +02:00
Thibault Delavallée 0b43555b65 [IMP] web_kanban_gauge: fade update when changing the value
bzr revid: tde@openerp.com-20140211122622-5c3doi7vjp5fepfc
2014-02-11 13:26:22 +01:00
Thibault Delavallée f8b9f2a5c5 [IMP] web_kanban_gauge: action_change, renamed to on_click_action, now renamed to on_change, because because.
bzr revid: tde@openerp.com-20140211122240-rtb292sw0f0wngmv
2014-02-11 13:22:40 +01:00
Thibault Delavallée 5113c8bca6 [IMP] web_kanban_gauge: udpated parameters
- new parameters: input_value_field is now called gauge_value_field, this is the field
displayed under the gauge
- new parameter: force_set: whether to force setting a value when the value is nul
- new parameter: on_click_label: label under the input when editing the gauge value
- action_change renamed on_click_action

bzr revid: tde@openerp.com-20140211100445-289mvmr8grcgns8x
2014-02-11 11:04:45 +01:00
Turkesh Patel (Open ERP) fec6e017eb [MRG] merge with lp:openerp-web
bzr revid: tpa@tinyerp.com-20140210085313-gr6191npb2j1fktf
2014-02-10 14:23:13 +05:30
Quentin (OpenERP) f3737b122c [IMP] kanban_gauge: allow to set levelcolors in widget options instead of taking the default ones
bzr revid: qdp-launchpad@openerp.com-20131227164911-tk7og4pf37jmvj0c
2013-12-27 17:49:11 +01:00
Turkesh Patel (Open ERP) e5d02dd3af [MRG] merge with lp:openerp-web
bzr revid: tpa@tinyerp.com-20131206115720-owpc19jxmpcet3e3
bzr revid: tpa@tinyerp.com-20131211132353-h0mvip280u3qwsr3
2013-12-11 18:53:53 +05:30
Thibault Delavallée 84375d5a3e [MERGE] [FIX] web_kanban_gauge: check the value entered in the forecast
[IMP] web_kanban_sparkline: added an option to add a suffix in the sparkline tooltips

bzr revid: tde@openerp.com-20131205160010-8ecv8b618fa6rywj
2013-12-05 17:00:10 +01:00
Thibault Delavallée bd45d6b47b [CLEAN] web_kanban_gauge: removed unnecessary code before merging
bzr revid: tde@openerp.com-20131205150337-5lwc6w7whrtlwp5d
2013-12-05 16:03:37 +01:00
Turkesh Patel (Open ERP) 824e70c090 [MRG] merge with lp:openerp-web
bzr revid: tpa@tinyerp.com-20131111121021-6gl22x44n3nxg14f
bzr revid: tpa@tinyerp.com-20131122085429-9ee7ossuwtr494dz
bzr revid: tpa@tinyerp.com-20131126124409-yuuu0t7au7trd821
2013-11-26 18:14:09 +05:30
Turkesh Patel (Open ERP) 3b6aa6a369 [MRG] merge with lp:openerp-web
bzr revid: tpa@tinyerp.com-20131030052009-1x3ew8xckxzp1evq
bzr revid: tpa@tinyerp.com-20131115105319-tm0zp1jse6pry57o
bzr revid: tpa@tinyerp.com-20131126124131-g4stoj8uwbxk6d45
2013-11-26 18:11:31 +05:30
Denis Ledoux 8dd53f6652 [FIX]web_kanban_gauge, lib justgage.js: comptability problem with Firefox (25.0 tested) with elem.node.firstChild.attributes.dy.value = 0;
bzr revid: dle@openerp.com-20131107140202-inlbhj7zvfg7bqix
2013-11-07 15:02:02 +01:00
Turkesh Patel (Open ERP) 416c47f324 [FIX] replace integer with float in validation
bzr revid: tpa@tinyerp.com-20131023113652-rj74krv1lecyp2xf
2013-10-23 17:06:52 +05:30
Turkesh Patel (Open ERP) 3cdc986c0c [IMP] improved code to pass tooltip delay in option and added function so we can set requred help in inherited modules.
bzr revid: tpa@tinyerp.com-20130916130825-pciwsn0doshstrp2
2013-09-16 18:38:25 +05:30
Turkesh Patel (Open ERP) 39c04cf050 [ADD] added code to pass field to show in input value in just gage.
bzr revid: tpa@tinyerp.com-20130916063117-3bzavo1qs27317w2
2013-09-16 12:01:17 +05:30
Thibault Delavallée 5245e732bc [MOV] [ADD] Moved gauge and sparkline widgets into their own modules.
Introducing two new web modules: web_kanban_gauge and web_kanban_sparkline.

bzr revid: tde@openerp.com-20130906100528-rfk9u9op5u8kadl9
2013-09-06 12:05:28 +02:00