- Convert Moment.js to Luxon.
- Replace Underscore.js with native JavaScript code.
- Migrate legacy views to the new system and add an architecture parser to separate logic.
- added basic test
In addition to security rights (was already implemented), now follow
`create="0"` / `edit="0"` / `delete="0"` attributes one can set onto the
`timeline` tag, same as in other Odoo views.
This commit fixes redraw issues when setting a `mode` attribute in the
`timeline` view tag.
This mode specifies a default scale one would want to set; same as when
clicking on Day/Week/Month buttons at the top of the view.
Initial rendering had issues here because data was loaded too soon,
before the timeline component was rendered/ready. The fix is to load
data into the component only after initial redraw event, called
`changed` (see <https://visjs.github.io/vis-timeline/docs/timeline/#Events>).
There was old code attempting to call `on_scale_xxx_clicked` methods at
load time to simulate clicks on these Day/Week/Month buttons, but these
methods have been renamed so this code is no longer working.
This commit also removes the `current_window` instance variable, not
needed and actually confusing as the timeline component already
maintains its own start/end information (which we can query with
`timeline.getWindow()`).
When an item label does not fit in its date-range box, overflow
according to
https://visjs.github.io/vis-timeline/examples/timeline/items/rangeOverflowItem.html
Previous CSS code was already trying to do that, but was selecting
`.vis-item.vis-item-content` instead of `.vis-item .vis-item-content`.
Displaying overflow text brings up layout issues solved by removing the
forced-100% width instruction.
This change also adds highlight when hovering a box, which is useful on
text that has overflown (as it has no borders).
By contract the first argument of the `fields_get` method is supposed to
be a list. Before this fix, `web_timeline` would call `fields_get` with
a string instead of a list.
Fortunately in case only 1 field is being grouped, this worked as Odoo
does an `x in y` comparison in its `fields_get` implementation, which
does pass in a simple `"project_id" in "project_id"` case.
But that call remains invalid and can break when `fields_get` has been
tweaked by other modules.
On library version update a new feature was added at Timeline creation level to
allow modifying the xss. By keeping it active the css classes are not showed
As the view is on backend, has no sense to keep it active. So we deactivate the
feature to allow show the timeline correctly.
TT43238
Update README.rst
[FIX] Remove console.log
[ADD] Make timeline.fit optional
[FIX] Use stringified points
[IMP] Reversed the arrow head and fixed lint issues
[IMP] Use options parameter for line color and width
[FIX] Version number
[IMP] Minor improvements
* Update the vis.js framework to latest stable version (v4.20.1) to add new functionality and save almost
400ko of source code in odoo assets (the vis dev team has isolate the code for timeline widget from the
rest of their widgets)
* Add the possibility to display events with no duration (instantaneous) as the same time has regular events
* Add the possibility to choose between two scroll mode :
- zoom in time resolution (default)
or
- vertical scroll (web browser default behaviour)
Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>