Skip to content

Commit

Permalink
[MIG] web_widget_bokeh_chart: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OriolMForgeFlow committed Jun 12, 2023
1 parent c6e2c39 commit 4639a13
Show file tree
Hide file tree
Showing 18 changed files with 1,451 additions and 1,334 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# generated from manifests external_dependencies
bokeh==3.1.1
plotly==5.13.1
bokeh==2.4.2
7 changes: 4 additions & 3 deletions web_widget_bokeh_chart/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@
"name": "Web Widget Bokeh Chart",
"category": "Hidden",
"summary": "This widget allows to display charts using Bokeh library.",
"author": "ForgeFlow, " "Odoo Community Association (OCA)",
"version": "15.0.1.1.1",
"author": "ForgeFlow, " "Odoo Community Association (OCA), " "Creu Blanca",
"version": "16.0.1.0.0",
"maintainers": ["LoisRForgeFlow", "ChrisOForgeFlow"],
"development_status": "Production/Stable",
"website": "https://github.com/OCA/web",
"depends": ["web"],
"data": [],
"external_dependencies": {"python": ["bokeh==2.4.2"]},
"external_dependencies": {"python": ["bokeh==3.1.1"]},
"auto_install": False,
"license": "LGPL-3",
"assets": {
"web.assets_backend": [
"web_widget_bokeh_chart/static/src/js/web_widget_bokeh_chart.esm.js",
"web_widget_bokeh_chart/static/src/xml/bokeh.xml",
],
},
}
3 changes: 3 additions & 0 deletions web_widget_bokeh_chart/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
* Lois Rilo Antelo <[email protected]>
* Artem Kostyuk <[email protected]>
* Christopher Ormaza <[email protected]>
* Enric Tobella <[email protected]>
* Oriol Miranda Garrido <[email protected]>
* Bernat Puig Font <[email protected]>
2 changes: 1 addition & 1 deletion web_widget_bokeh_chart/readme/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
You need to install the python bokeh library::

pip3 install bokeh==2.4.2
pip3 install bokeh==3.1.1
56 changes: 28 additions & 28 deletions web_widget_bokeh_chart/static/src/js/web_widget_bokeh_chart.esm.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/** @odoo-module **/

import basicFields from "web.basic_fields";
import fieldRegistry from "web.field_registry";

const BokehChartWidget = basicFields.FieldChar.extend({
jsLibs: [
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-2.4.2.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-2.4.2.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-2.4.2.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-2.4.2.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-2.4.2.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-2.4.2.min.js",
],
_renderReadonly: function () {
try {
const val = JSON.parse(this.value);
this.$el.html(val.div);
const script = document.createElement("script");
script.setAttribute("type", "text/javascript");
if ("textContent" in script) script.textContent = val.script;
else script.text = val.script;
this.$el.append(script);
} catch (error) {
return this._super(...arguments);
}
},
});

fieldRegistry.add("bokeh_chart", BokehChartWidget);
import {CharField} from "@web/views/fields/char/char_field";
import {registry} from "@web/core/registry";
import {loadBundle} from "@web/core/assets";
const {onWillStart, markup} = owl;
class BokehChartWidget extends CharField {
setup() {
super.setup();
onWillStart(() =>
loadBundle({
jsLibs: [
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-3.1.1.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-3.1.1.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-3.1.1.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-3.1.1.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-3.1.1.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-3.1.1.min.js",
],
})
);
}
get json_value() {
var value = JSON.parse(this.props.value);
value.div = markup(value.div.trim());
return value;
}
}
BokehChartWidget.template = "web_widget_bokeh_chart.BokehChartField";
registry.category("fields").add("bokeh_chart", BokehChartWidget);

export default BokehChartWidget;
596 changes: 0 additions & 596 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-2.4.2.min.js

This file was deleted.

690 changes: 690 additions & 0 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-3.1.1.min.js

Large diffs are not rendered by default.

53 changes: 0 additions & 53 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-2.4.2.min.js

This file was deleted.

60 changes: 60 additions & 0 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-3.1.1.min.js

Large diffs are not rendered by default.

74 changes: 0 additions & 74 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-2.4.2.min.js

This file was deleted.

67 changes: 67 additions & 0 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-3.1.1.min.js

Large diffs are not rendered by default.

328 changes: 0 additions & 328 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-2.4.2.min.js

This file was deleted.

329 changes: 329 additions & 0 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-3.1.1.min.js

Large diffs are not rendered by default.

132 changes: 0 additions & 132 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-2.4.2.min.js

This file was deleted.

132 changes: 132 additions & 0 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-3.1.1.min.js

Large diffs are not rendered by default.

118 changes: 0 additions & 118 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-2.4.2.min.js

This file was deleted.

129 changes: 129 additions & 0 deletions web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-3.1.1.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions web_widget_bokeh_chart/static/src/xml/bokeh.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<t t-name="web_widget_bokeh_chart.BokehChartField" owl="1">
<t t-out="json_value.div" />
<script type="text/javascript" t-out="json_value.script" />
</t>
</templates>

0 comments on commit 4639a13

Please sign in to comment.