-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MIG] web_timeline: Migration to 13.0 #1470
Conversation
Hi @tarteo, |
Please preserve commit history following technical method explained in https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-13.0 And also check new conventions in 13.0 branch for black/isort. |
* Avoid to display all items of group_by model * Remove unnecessary readgroup * Remove dependency on project. Modify module structure. Imporve readme file. * Add setup.py
* [FIX] Correct write when grouped by * Remove blank lines * Minor changes
* 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>
Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
…same as base Calendar view) In Odoo calendar view, the attribute date_delay is an alternative to date_stop, to provides the duration of the event instead of its end date. This commit integrate this attribute to the Timeline view, but contrary to the base Calendar view the Timeline view could use both arguments (date_stop and date_delay) simultaneously. Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
The default window display all the events (aka 'fit'), in case of events spread over the year, the events are invisibles (too small to be readable) Signed-off-by: adrien.didenot <adrien.didenot@horanet.com>
Change the attribute 'default_window' to 'mode' like the Odoo calendar view (to be iso functional)
CSS classes have changed with the updated version of vis.js
* Update Version in Manifest * Remove enconding in .py files * Rewrite the view definition according to version 11
[IMP] web_timeline: Templates implementation like kanban [ADD] Check if template exists Update README.rst
[UPD] Version number [UPD] README
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
[IMP] Prevent flickering [IMP] Fixed headers [ADD] Create new record by date range selection Remove roadmap item from readme [FIX] minimal height
Currently translated at 82.6% (19 of 23 strings) Translation: web-12.0/web-12.0-web_timeline Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_timeline/pt/
Currently translated at 100.0% (23 of 23 strings) Translation: web-12.0/web-12.0-web_timeline Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_timeline/zh_CN/
Currently translated at 87.0% (20 of 23 strings) Translation: web-12.0/web-12.0-web_timeline Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_timeline/hr/
5552127
to
2d98199
Compare
2d98199
to
cc35a0b
Compare
@pedrobaeza done, can you recheck again? |
Thanks for that, it seems Travis is still red. |
Refactored, passed check now. |
Great, thanks for the efforts. Now time for the reviewers to check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the efforts!
JS need be updated to ES6: odoo/odoo@9071a25
I comment some lines... but not all to avoid have 1000000 comments with the sames changes ;)
web_timeline/readme/DESCRIPTION.rst
Outdated
Define a new view displaying events in an interactive visualization chart. | ||
|
||
The widget is based on the external library | ||
http://visjs.org/timeline_examples.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page no longer exists...
@@ -0,0 +1,31 @@ | |||
/* Button style */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use scss.
if (xDiff > threshold) { | ||
points.push([x1 - breakAt, y1]); | ||
points.push([x1 - breakAt, y1 - yDiff]); | ||
} else if (xDiff <= threshold) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else if (xDiff <= threshold) { | |
} else { |
var n_group_bys = []; | ||
if (this.renderer.arch.attrs.default_group_by) { | ||
n_group_bys = this.renderer.arch.attrs.default_group_by.split(','); | ||
} | ||
if (group_bys.length) { | ||
n_group_bys = group_bys; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can avoid creating the empty list.
var n_group_bys = group_bys;
if (!n_group_bys.length && this.renderer.arch.attrs.default_group_by) {
n_group_bys = this.renderer.arch.attrs.default_group_by.split(',');
}
if (this.open_popup_action) { | ||
new dialogs.FormViewDialog(this, { | ||
res_model: this.model.modelName, | ||
res_id: parseInt(id, 10).toString() === id ? parseInt(id, 10) : id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res_id: parseInt(id, 10).toString() === id ? parseInt(id, 10) : id, | |
res_id: id, |
|
||
fieldsToGather.push(attrs.default_group_by); | ||
|
||
_.each(fieldsToGather, function (field) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_.each(fieldsToGather, function (field) { | |
for (const field of fieldsToGather) { |
for (var i = 0; i < this.colors.length; i++) { | ||
fieldNames.push(this.colors[i].field); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (const color of this.colors) {
fieldNames.push(color.field);
}
return -1; | ||
} | ||
if (grp2.id === -1) { | ||
return +1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return +1; | |
return 1; |
self.quick_create_instance = 'instance.' + attrs.quick_create_instance; | ||
} | ||
this.stack = true; | ||
if (!isNullOrUndef(attrs.stack) && !_.str.toBoolElse(attrs.stack, "true")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_.str.toBoolElse()
exists?
margin: JSON.parse(this.margin), | ||
zoomKey: this.zoomKey, | ||
}; | ||
if (isNullOrUndef(attrs.event_open_popup) || !_.str.toBoolElse(attrs.event_open_popup, true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_.str.toBoolElse()
exists?
Hi @Tardo Could you recheck it, I did some refactors |
@Tardo ping :) |
Hi, there are some unattended comments... can you check 'Files Changed' tab? Thanks! |
Well... no replies in ~1 month, i will supersede this PR 🌳 |
Superseded by #1557 |
The main goal is switching the library from
https://github.com/almende/vis
(no longer maintained) tohttps://github.com/visjs/vis-timeline