[FIX] runbot: export diff_match_patch properly

The lib exports its data through the global object, an odoo module then
re-exports the module to make it available to other odoo modules.
This commit is contained in:
William Braeckman 2025-03-10 14:39:40 +01:00
parent 7e5d21b9a0
commit 8c17b91452
4 changed files with 8 additions and 2 deletions

View File

@ -64,6 +64,7 @@
'assets': {
'web.assets_backend': [
'runbot/static/libs/diff_match_patch/diff_match_patch.js',
'runbot/static/src/diff_match_patch_module.js',
'runbot/static/src/fields/*',
],
},

View File

@ -2235,7 +2235,7 @@ var diff_match_patch = function() {
// /** @suppress {globalThis} */
// this['DIFF_EQUAL'] = DIFF_EQUAL;
export {
(typeof window !== "undefined" ? window : this).DiffMatchPatch = {
diff_match_patch,
DIFF_DELETE,
DIFF_INSERT,

View File

@ -0,0 +1,5 @@
odoo.define("@runbot/diff_match_patch", [], function () {
'use strict';
return DiffMatchPatch;
});

View File

@ -1,7 +1,7 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { Message } from "@mail/core/common/message";
import { diff_match_patch } from "@runbot/libs/diff_match_patch/diff_match_patch";
import { diff_match_patch } from "@runbot/diff_match_patch";
patch(Message.prototype, {
setup() {