From 7885cfe686dd1b33f16e71ed5555942633394fa7 Mon Sep 17 00:00:00 2001 From: HemanginiPatel Date: Tue, 8 Jun 2021 14:48:10 +0530 Subject: [PATCH] [IMP]Updated pre-commit code. --- .../odoo/addons/web_widget_mermaid | 1 + setup/web_widget_mermaid/setup.py | 6 ++++++ web_widget_mermaid/README.rst | 13 +++++++------ web_widget_mermaid/readme/CONTRIBUTORS.rst | 1 + web_widget_mermaid/static/description/index.html | 9 +++++---- .../static/src/js/web_widget_mermaid.js | 8 +++++--- 6 files changed, 25 insertions(+), 13 deletions(-) create mode 120000 setup/web_widget_mermaid/odoo/addons/web_widget_mermaid create mode 100644 setup/web_widget_mermaid/setup.py diff --git a/setup/web_widget_mermaid/odoo/addons/web_widget_mermaid b/setup/web_widget_mermaid/odoo/addons/web_widget_mermaid new file mode 120000 index 000000000..b8e019e4d --- /dev/null +++ b/setup/web_widget_mermaid/odoo/addons/web_widget_mermaid @@ -0,0 +1 @@ +../../../../web_widget_mermaid \ No newline at end of file diff --git a/setup/web_widget_mermaid/setup.py b/setup/web_widget_mermaid/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/web_widget_mermaid/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/web_widget_mermaid/README.rst b/web_widget_mermaid/README.rst index 901e9a2e8..f249c2687 100644 --- a/web_widget_mermaid/README.rst +++ b/web_widget_mermaid/README.rst @@ -14,13 +14,13 @@ Mermaid flowchart widget :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github - :target: https://github.com/OCA/web/tree/14.0/web_widget_mermaid + :target: https://github.com/OCA/web/tree/10.0/web_widget_mermaid :alt: OCA/web .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/web-14-0/web-14-0-web_widget_mermaid + :target: https://translation.odoo-community.org/projects/web-10-0/web-10-0-web_widget_mermaid :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/162/14.0 + :target: https://runbot.odoo-community.org/runbot/162/10.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -60,7 +60,7 @@ As an example, this text:: Produces this flowchart: -.. image:: https://raw.githubusercontent.com/OCA/web/14.0/web_widget_mermaid/static/description/flowchart_example.png +.. image:: https://raw.githubusercontent.com/OCA/web/10.0/web_widget_mermaid/static/description/flowchart_example.png :alt: Flowchart Demonstration @@ -101,7 +101,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -117,6 +117,7 @@ Contributors ~~~~~~~~~~~~ * Jan Verbeek +* Ammar Officewala Maintainers ~~~~~~~~~~~ @@ -131,6 +132,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/web `_ project on GitHub. +This module is part of the `OCA/web `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_widget_mermaid/readme/CONTRIBUTORS.rst b/web_widget_mermaid/readme/CONTRIBUTORS.rst index 672a6cc5a..6dc22589a 100644 --- a/web_widget_mermaid/readme/CONTRIBUTORS.rst +++ b/web_widget_mermaid/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Jan Verbeek +* Ammar Officewala diff --git a/web_widget_mermaid/static/description/index.html b/web_widget_mermaid/static/description/index.html index d9ae65c28..df209360e 100644 --- a/web_widget_mermaid/static/description/index.html +++ b/web_widget_mermaid/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runbot

This module adds a basic widget for rendering text fields as flowcharts using mermaid.

Table of contents

@@ -409,7 +409,7 @@ graph LR 12.0 -.-> 13.0

Produces this flowchart:

-Flowchart +Flowchart

Demonstration

@@ -455,7 +455,7 @@ targets: {

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -470,6 +470,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

Contributors

@@ -479,7 +480,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/web project on GitHub.

+

This module is part of the OCA/web project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/web_widget_mermaid/static/src/js/web_widget_mermaid.js b/web_widget_mermaid/static/src/js/web_widget_mermaid.js index 2a5c6d494..7888d203c 100644 --- a/web_widget_mermaid/static/src/js/web_widget_mermaid.js +++ b/web_widget_mermaid/static/src/js/web_widget_mermaid.js @@ -62,6 +62,8 @@ odoo.define("web.web_widget_mermaid", function (require) { init: function () { this._super.apply(this, arguments); this.chartId = _.uniqueId("mermaid_chart_"); + + this.mermaid = mermaid; // eslint-disable-line }, className: "o_form_field_mermaid", _renderReadonly: function () { @@ -69,9 +71,9 @@ odoo.define("web.web_widget_mermaid", function (require) { return; } var config = _.extend({}, defaultConfig, this.attrs.options); - mermaid.mermaidAPI.initialize(config); + this.mermaid.mermaidAPI.initialize(config); try { - mermaid.mermaidAPI.render( + this.mermaid.mermaidAPI.render( this.chartId, this.value, this.$el.html.bind(this.$el) @@ -89,7 +91,7 @@ odoo.define("web.web_widget_mermaid", function (require) { this.errorMessage.remove(); } try { - mermaid.parse(value); + this.mermaid.parse(value); } catch (e) { this.errorMessage = $("
").text(e.message || e.str);
                 this.$el.after(this.errorMessage);