3
0
Fork 0

[MIG] Migrate web_widget_mermaid to 12.0

12.0
Jan Verbeek 2019-10-22 18:02:46 +02:00 committed by Dennis Sluijk
parent 6d984024af
commit 41cc599d92
8 changed files with 89 additions and 112 deletions

View File

@ -14,13 +14,13 @@ Mermaid flowchart widget
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/10.0/web_widget_mermaid :target: https://github.com/OCA/web/tree/12.0/web_widget_mermaid
:alt: OCA/web :alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-10-0/web-10-0-web_widget_mermaid :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_widget_mermaid
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/10.0 :target: https://runbot.odoo-community.org/runbot/162/12.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -60,7 +60,7 @@ As an example, this text::
Produces this flowchart: Produces this flowchart:
.. image:: https://raw.githubusercontent.com/OCA/web/10.0/web_widget_mermaid/static/description/flowchart_example.png .. image:: https://raw.githubusercontent.com/OCA/web/12.0/web_widget_mermaid/static/description/flowchart_example.png
:alt: Flowchart :alt: Flowchart
Demonstration Demonstration
@ -101,7 +101,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_mermaid%0Aversion:%2010.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_mermaid%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@ -131,6 +131,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/10.0/web_widget_mermaid>`_ project on GitHub. This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_widget_mermaid>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -1 +1 @@
# -*- coding: utf-8 -*- # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Therp BV <https://therp.nl> # Copyright 2019 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
@ -6,7 +5,7 @@
"name": "Mermaid flowchart widget", "name": "Mermaid flowchart widget",
"category": "Web", "category": "Web",
"author": "Therp BV,Odoo Community Association (OCA)", "author": "Therp BV,Odoo Community Association (OCA)",
"version": "10.0.8.4.0", "version": "12.0.8.4.0",
"license": "AGPL-3", "license": "AGPL-3",
"summary": "Render mermaid markdown flowcharts", "summary": "Render mermaid markdown flowcharts",
"website": "https://github.com/OCA/web", "website": "https://github.com/OCA/web",
@ -14,13 +13,6 @@
"data": [ "data": [
"view/web_widget_mermaid_view.xml", "view/web_widget_mermaid_view.xml",
], ],
"js": [
"static/lib/mermaid/mermaid.js",
"static/src/js/web_widget_mermaid.js",
],
"qweb": [
"static/src/xml/web_widget_mermaid.xml",
],
"demo": [ "demo": [
"demo/res_users_flowchart.xml", "demo/res_users_flowchart.xml",
], ],

View File

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/10.0/web_widget_mermaid"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-10-0/web-10-0-web_widget_mermaid"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/10.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_widget_mermaid"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_widget_mermaid"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds a basic widget for rendering text fields as flowcharts using <p>This module adds a basic widget for rendering text fields as flowcharts using
<a class="reference external" href="https://mermaidjs.github.io">mermaid</a>.</p> <a class="reference external" href="https://mermaidjs.github.io">mermaid</a>.</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
@ -409,7 +409,7 @@ graph LR
12.0 -.-&gt; 13.0 12.0 -.-&gt; 13.0
</pre> </pre>
<p>Produces this flowchart:</p> <p>Produces this flowchart:</p>
<img alt="Flowchart" src="https://raw.githubusercontent.com/OCA/web/10.0/web_widget_mermaid/static/description/flowchart_example.png" /> <img alt="Flowchart" src="https://raw.githubusercontent.com/OCA/web/12.0/web_widget_mermaid/static/description/flowchart_example.png" />
</div> </div>
<div class="section" id="demonstration"> <div class="section" id="demonstration">
<h1><a class="toc-backref" href="#id2">Demonstration</a></h1> <h1><a class="toc-backref" href="#id2">Demonstration</a></h1>
@ -455,7 +455,7 @@ targets: {
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_mermaid%0Aversion:%2010.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_mermaid%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@ -479,7 +479,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/10.0/web_widget_mermaid">OCA/web</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_widget_mermaid">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

View File

@ -2,7 +2,8 @@ odoo.define('web.web_widget_mermaid', function(require) {
"use strict"; "use strict";
var core = require('web.core'); var core = require('web.core');
var form_widgets = require('web.form_widgets'); var basic_fields = require('web.basic_fields');
var field_registry = require('web.field_registry');
// Calling mermaid.initialize() multiple times is ok. // Calling mermaid.initialize() multiple times is ok.
// But there's a catch: it will keep the config of previous calls unless // But there's a catch: it will keep the config of previous calls unless
@ -53,35 +54,31 @@ odoo.define('web.web_widget_mermaid', function(require) {
fontFamily: '"Lucida Grande", Helvetica, Verdana, Arial, ' fontFamily: '"Lucida Grande", Helvetica, Verdana, Arial, '
+ 'sans-serif', // Match Odoo's font choices + 'sans-serif', // Match Odoo's font choices
numberSectionStyles: 4, numberSectionStyles: 4,
// Match configured date format
axisFormat: core._t.database.parameters.date_format, axisFormat: core._t.database.parameters.date_format,
} }
}; };
var MermaidField = form_widgets.FieldChar.extend({ var MermaidField = basic_fields.FieldText.extend({
init: function() { init: function() {
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.chartId = _.uniqueId('mermaid_chart_'); this.chartId = _.uniqueId('mermaid_chart_');
}, },
template: "MermaidField", className: 'o_form_field_mermaid',
widget_class: 'o_form_field_mermaid', _renderReadonly: function() {
render_value: function() { if (!this.value) {
if (!this.get('effective_readonly')) {
return this._super();
}
var value = this.get('value');
if (!value) {
return; return;
} }
var config = _.extend( var config = _.extend(
{}, {},
defaultConfig, defaultConfig,
this.options this.attrs.options
); );
mermaid.mermaidAPI.initialize(config); mermaid.mermaidAPI.initialize(config);
try { try {
mermaid.mermaidAPI.render( mermaid.mermaidAPI.render(
this.chartId, this.chartId,
value, this.value,
this.$el.html.bind(this.$el) this.$el.html.bind(this.$el)
); );
} catch (e) { } catch (e) {
@ -92,9 +89,9 @@ odoo.define('web.web_widget_mermaid', function(require) {
// rid of it if it's still around. The id is based on the chartId. // rid of it if it's still around. The id is based on the chartId.
$('#d' + this.chartId).remove(); $('#d' + this.chartId).remove();
} }
}) });
core.form_widget_registry.add('mermaid', MermaidField); field_registry.add('mermaid', MermaidField);
return { return {
MermaidField: MermaidField, MermaidField: MermaidField,

View File

@ -8,43 +8,43 @@
.o_form_field_mermaid .node .label { .o_form_field_mermaid .node .label {
font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
color: @label-color; } color: $o-tooltip-color; }
.o_form_field_mermaid .cluster .label { .o_form_field_mermaid .cluster .label {
font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
color: @odoo-main-text-color; } color: $o-main-text-color; }
.o_form_field_mermaid .label text { .o_form_field_mermaid .label text {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid .node rect, .o_form_field_mermaid .node rect,
.o_form_field_mermaid .node circle, .o_form_field_mermaid .node circle,
.o_form_field_mermaid .node ellipse, .o_form_field_mermaid .node ellipse,
.o_form_field_mermaid .node polygon { .o_form_field_mermaid .node polygon {
fill: @odoo-brand-primary; fill: $o-brand-primary;
stroke: @odoo-brand-optional; stroke: $o-brand-primary;
stroke-width: 1px; } stroke-width: 1px; }
.o_form_field_mermaid .node.clickable { .o_form_field_mermaid .node.clickable {
cursor: pointer; } cursor: pointer; }
.o_form_field_mermaid .arrowheadPath { .o_form_field_mermaid .arrowheadPath {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid .edgePath .path { .o_form_field_mermaid .edgePath .path {
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1.5px; } stroke-width: 1.5px; }
.o_form_field_mermaid .edgeLabel { .o_form_field_mermaid .edgeLabel {
background-color: #e8e8e8; } background-color: #e8e8e8; }
.o_form_field_mermaid .cluster rect { .o_form_field_mermaid .cluster rect {
fill: @odoo-brand-secondary; fill: $o-brand-secondary;
stroke: @odoo-main-color-muted; stroke: $o-main-color-muted;
stroke-width: 1px; } stroke-width: 1px; }
.o_form_field_mermaid .cluster text { .o_form_field_mermaid .cluster text {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid div.mermaidTooltip { .o_form_field_mermaid div.mermaidTooltip {
position: absolute; position: absolute;
@ -53,15 +53,15 @@
padding: 2px; padding: 2px;
font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
font-size: 12px; font-size: 12px;
background: @odoo-brand-secondary; background: $o-brand-secondary;
border: 1px solid @odoo-main-color-muted; border: 1px solid $o-main-color-muted;
border-radius: 2px; border-radius: 2px;
pointer-events: none; pointer-events: none;
z-index: 100; } z-index: 100; }
.o_form_field_mermaid .actor { .o_form_field_mermaid .actor {
stroke: @odoo-brand-optional; stroke: $o-brand-primary;
fill: @odoo-brand-primary; } fill: $o-brand-primary; }
.o_form_field_mermaid text.actor { .o_form_field_mermaid text.actor {
fill: white; fill: white;
@ -73,33 +73,33 @@
.o_form_field_mermaid .messageLine0 { .o_form_field_mermaid .messageLine0 {
stroke-width: 1.5; stroke-width: 1.5;
stroke-dasharray: '2 2'; stroke-dasharray: '2 2';
stroke: @odoo-main-text-color; } stroke: $o-main-text-color; }
.o_form_field_mermaid .messageLine1 { .o_form_field_mermaid .messageLine1 {
stroke-width: 1.5; stroke-width: 1.5;
stroke-dasharray: '2 2'; stroke-dasharray: '2 2';
stroke: @odoo-main-text-color; } stroke: $o-main-text-color; }
.o_form_field_mermaid #arrowhead { .o_form_field_mermaid #arrowhead {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid .sequenceNumber { .o_form_field_mermaid .sequenceNumber {
fill: white; } fill: white; }
.o_form_field_mermaid #sequencenumber { .o_form_field_mermaid #sequencenumber {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid #crosshead path { .o_form_field_mermaid #crosshead path {
fill: @odoo-main-text-color !important; fill: $o-main-text-color !important;
stroke: @odoo-main-text-color !important; } stroke: $o-main-text-color !important; }
.o_form_field_mermaid .messageText { .o_form_field_mermaid .messageText {
fill: @odoo-main-text-color; fill: $o-main-text-color;
stroke: none; } stroke: none; }
.o_form_field_mermaid .labelBox { .o_form_field_mermaid .labelBox {
stroke: @odoo-brand-optional; stroke: $o-brand-primary;
fill: @odoo-brand-primary; } fill: $o-brand-primary; }
.o_form_field_mermaid .labelText { .o_form_field_mermaid .labelText {
fill: white; fill: white;
@ -112,10 +112,10 @@
.o_form_field_mermaid .loopLine { .o_form_field_mermaid .loopLine {
stroke-width: 2; stroke-width: 2;
stroke-dasharray: '2 2'; stroke-dasharray: '2 2';
stroke: @odoo-brand-optional; } stroke: $o-brand-primary; }
.o_form_field_mermaid .note { .o_form_field_mermaid .note {
stroke: @odoo-main-color-muted; stroke: $o-main-color-muted;
fill: #fff5ad; } fill: #fff5ad; }
.o_form_field_mermaid .noteText { .o_form_field_mermaid .noteText {
@ -153,16 +153,16 @@
opacity: 0.2; } opacity: 0.2; }
.o_form_field_mermaid .sectionTitle0 { .o_form_field_mermaid .sectionTitle0 {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid .sectionTitle1 { .o_form_field_mermaid .sectionTitle1 {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid .sectionTitle2 { .o_form_field_mermaid .sectionTitle2 {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid .sectionTitle3 { .o_form_field_mermaid .sectionTitle3 {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid .sectionTitle { .o_form_field_mermaid .sectionTitle {
text-anchor: start; text-anchor: start;
@ -194,12 +194,12 @@
font-size: 11px; } font-size: 11px; }
.o_form_field_mermaid .taskTextOutsideRight { .o_form_field_mermaid .taskTextOutsideRight {
fill: @odoo-main-text-color; fill: $o-main-text-color;
text-anchor: start; text-anchor: start;
font-size: 11px; } font-size: 11px; }
.o_form_field_mermaid .taskTextOutsideLeft { .o_form_field_mermaid .taskTextOutsideLeft {
fill: @odoo-main-text-color; fill: $o-main-text-color;
text-anchor: end; text-anchor: end;
font-size: 11px; } font-size: 11px; }
@ -233,16 +233,16 @@
.o_form_field_mermaid .task1, .o_form_field_mermaid .task1,
.o_form_field_mermaid .task2, .o_form_field_mermaid .task2,
.o_form_field_mermaid .task3 { .o_form_field_mermaid .task3 {
fill: @odoo-brand-primary; fill: $o-brand-primary;
stroke: @odoo-brand-primary; } stroke: $o-brand-primary; }
.o_form_field_mermaid .taskTextOutside0, .o_form_field_mermaid .taskTextOutside0,
.o_form_field_mermaid .taskTextOutside2 { .o_form_field_mermaid .taskTextOutside2 {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid .taskTextOutside1, .o_form_field_mermaid .taskTextOutside1,
.o_form_field_mermaid .taskTextOutside3 { .o_form_field_mermaid .taskTextOutside3 {
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
/* Active task */ /* Active task */
.o_form_field_mermaid .active0, .o_form_field_mermaid .active0,
@ -250,13 +250,13 @@
.o_form_field_mermaid .active2, .o_form_field_mermaid .active2,
.o_form_field_mermaid .active3 { .o_form_field_mermaid .active3 {
fill: #bfc7ff; fill: #bfc7ff;
stroke: @odoo-brand-primary; } stroke: $o-brand-primary; }
.o_form_field_mermaid .activeText0, .o_form_field_mermaid .activeText0,
.o_form_field_mermaid .activeText1, .o_form_field_mermaid .activeText1,
.o_form_field_mermaid .activeText2, .o_form_field_mermaid .activeText2,
.o_form_field_mermaid .activeText3 { .o_form_field_mermaid .activeText3 {
fill: @odoo-main-text-color !important; } fill: $o-main-text-color !important; }
/* Completed task */ /* Completed task */
.o_form_field_mermaid .done0, .o_form_field_mermaid .done0,
@ -271,7 +271,7 @@
.o_form_field_mermaid .doneText1, .o_form_field_mermaid .doneText1,
.o_form_field_mermaid .doneText2, .o_form_field_mermaid .doneText2,
.o_form_field_mermaid .doneText3 { .o_form_field_mermaid .doneText3 {
fill: @odoo-main-text-color !important; } fill: $o-main-text-color !important; }
/* Tasks on the critical line */ /* Tasks on the critical line */
.o_form_field_mermaid .crit0, .o_form_field_mermaid .crit0,
@ -310,18 +310,18 @@
.o_form_field_mermaid .doneCritText1, .o_form_field_mermaid .doneCritText1,
.o_form_field_mermaid .doneCritText2, .o_form_field_mermaid .doneCritText2,
.o_form_field_mermaid .doneCritText3 { .o_form_field_mermaid .doneCritText3 {
fill: @odoo-main-text-color !important; } fill: $o-main-text-color !important; }
.o_form_field_mermaid .activeCritText0, .o_form_field_mermaid .activeCritText0,
.o_form_field_mermaid .activeCritText1, .o_form_field_mermaid .activeCritText1,
.o_form_field_mermaid .activeCritText2, .o_form_field_mermaid .activeCritText2,
.o_form_field_mermaid .activeCritText3 { .o_form_field_mermaid .activeCritText3 {
fill: @odoo-main-text-color !important; } fill: $o-main-text-color !important; }
.o_form_field_mermaid .titleText { .o_form_field_mermaid .titleText {
text-anchor: middle; text-anchor: middle;
font-size: 18px; font-size: 18px;
fill: @odoo-main-text-color; } fill: $o-main-text-color; }
.o_form_field_mermaid g.classGroup text { .o_form_field_mermaid g.classGroup text {
fill: white; fill: white;
@ -330,74 +330,74 @@
font-size: 10px; } font-size: 10px; }
.o_form_field_mermaid g.classGroup rect { .o_form_field_mermaid g.classGroup rect {
fill: @odoo-brand-primary; fill: $o-brand-primary;
stroke: @odoo-main-text-color; } stroke: $o-main-text-color; }
.o_form_field_mermaid g.classGroup line { .o_form_field_mermaid g.classGroup line {
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; } stroke-width: 1; }
.o_form_field_mermaid .classLabel .box { .o_form_field_mermaid .classLabel .box {
stroke: none; stroke: none;
stroke-width: 0; stroke-width: 0;
fill: @odoo-brand-primary; fill: $o-brand-primary;
opacity: 0.5; } opacity: 0.5; }
.o_form_field_mermaid .classLabel .label { .o_form_field_mermaid .classLabel .label {
fill: @odoo-main-text-color; fill: $o-main-text-color;
font-size: 10px; font-size: 10px;
font-weight: normal; } font-weight: normal; }
.o_form_field_mermaid .relation { .o_form_field_mermaid .relation {
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; stroke-width: 1;
fill: none; } fill: none; }
.o_form_field_mermaid #compositionStart { .o_form_field_mermaid #compositionStart {
fill: @odoo-main-text-color; fill: $o-main-text-color;
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; } stroke-width: 1; }
.o_form_field_mermaid #compositionEnd { .o_form_field_mermaid #compositionEnd {
fill: @odoo-main-text-color; fill: $o-main-text-color;
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; } stroke-width: 1; }
.o_form_field_mermaid #aggregationStart { .o_form_field_mermaid #aggregationStart {
fill: @odoo-brand-primary; fill: $o-brand-primary;
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; } stroke-width: 1; }
.o_form_field_mermaid #aggregationEnd { .o_form_field_mermaid #aggregationEnd {
fill: @odoo-brand-primary; fill: $o-brand-primary;
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; } stroke-width: 1; }
.o_form_field_mermaid #dependencyStart { .o_form_field_mermaid #dependencyStart {
fill: @odoo-main-text-color; fill: $o-main-text-color;
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; } stroke-width: 1; }
.o_form_field_mermaid #dependencyEnd { .o_form_field_mermaid #dependencyEnd {
fill: @odoo-main-text-color; fill: $o-main-text-color;
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; } stroke-width: 1; }
.o_form_field_mermaid #extensionStart { .o_form_field_mermaid #extensionStart {
fill: @odoo-main-text-color; fill: $o-main-text-color;
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; } stroke-width: 1; }
.o_form_field_mermaid #extensionEnd { .o_form_field_mermaid #extensionEnd {
fill: @odoo-main-text-color; fill: $o-main-text-color;
stroke: @odoo-main-text-color; stroke: $o-main-text-color;
stroke-width: 1; } stroke-width: 1; }
.o_form_field_mermaid .commit-id, .o_form_field_mermaid .commit-id,
.o_form_field_mermaid .commit-msg, .o_form_field_mermaid .commit-msg,
.o_form_field_mermaid .branch-label { .o_form_field_mermaid .branch-label {
fill: lightgrey; fill: lightgrey;
color: @odoo-main-text-color; } color: $o-main-text-color; }
.o_form_field_mermaid .node-label p { .o_form_field_mermaid .node-label p {
margin-top: 9px; } margin-top: 9px; }
@ -405,4 +405,4 @@
.o_form_field_mermaid .pieTitleText { .o_form_field_mermaid .pieTitleText {
text-anchor: middle; text-anchor: middle;
font-size: 25px; font-size: 25px;
fill: @odoo-main-text-color; } fill: $o-main-text-color; }

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="MermaidField">
<t t-if="widget.get('effective_readonly')">
<span t-att-class="'o_form_field '+widget.widget_class" t-att-style="widget.node.attrs.style" />
</t>
<t t-if="!widget.get('effective_readonly')">
<t t-call="FieldText"/>
</t>
</t>
</templates>

View File

@ -4,7 +4,7 @@
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<script type="text/javascript" src="/web_widget_mermaid/static/lib/mermaid/mermaid.js"></script> <script type="text/javascript" src="/web_widget_mermaid/static/lib/mermaid/mermaid.js"></script>
<script type="text/javascript" src="/web_widget_mermaid/static/src/js/web_widget_mermaid.js"></script> <script type="text/javascript" src="/web_widget_mermaid/static/src/js/web_widget_mermaid.js"></script>
<link rel="stylesheet" type="text/less" href="/web_widget_mermaid/static/src/less/web_widget_mermaid_default_theme.less"/> <link rel="stylesheet" type="text/scss" href="/web_widget_mermaid/static/src/scss/web_widget_mermaid_default_theme.scss"/>
</xpath> </xpath>
</template> </template>
</odoo> </odoo>