mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG]web_field_tooltip: Migration to 17.0
This commit is contained in:
@@ -427,6 +427,12 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Benoit Aimont <<a class="reference external" href="mailto:benoit.aimont@acsone.eu">benoit.aimont@acsone.eu</a>> (<a class="reference external" href="https://www.acsone.eu/">https://www.acsone.eu/</a>)</li>
|
||||
<li><a class="reference external" href="https://sygel.es">Sygel</a>:<ul>
|
||||
<li>Manuel Regidor <<a class="reference external" href="mailto:manuel.regidor@sygel.es">manuel.regidor@sygel.es</a>></li>
|
||||
<li>Harald Panten <<a class="reference external" href="mailto:harald.panten@sygel.es">harald.panten@sygel.es</a>></li>
|
||||
<li>Valentín Vinagre <<a class="reference external" href="mailto:valentin.vinagre@sygel.es">valentin.vinagre@sygel.es</a>></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
||||
@@ -4,7 +4,6 @@ import {Component, markup} from "@odoo/owl";
|
||||
|
||||
import {FormViewDialog} from "@web/views/view_dialogs/form_view_dialog";
|
||||
import {session} from "@web/session";
|
||||
import {usePopover} from "@web/core/popover/popover_hook";
|
||||
import {useService} from "@web/core/utils/hooks";
|
||||
|
||||
export class FieldTooltipPopover extends Component {}
|
||||
@@ -12,7 +11,7 @@ FieldTooltipPopover.template = "web_field_tooltip.FieldTooltipPopover";
|
||||
|
||||
export class FieldTooltip extends Component {
|
||||
setup() {
|
||||
this.popover = usePopover();
|
||||
this.popover = useService("popover");
|
||||
this.tooltipPopover = null;
|
||||
this.hasFieldTooltip = this.props.hasFieldTooltip;
|
||||
this.canManageTooltip = session.can_manage_tooltips;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
sup.field-tooltip {
|
||||
padding-top: 6px;
|
||||
.tooltip-icon {
|
||||
background: none;
|
||||
border: none;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import {FormController} from "@web/views/form/form_controller";
|
||||
import {_t} from "@web/core/l10n/translation";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
|
||||
import {session} from "@web/session";
|
||||
|
||||
patch(FormController.prototype, "web_field_tooltip", {
|
||||
getActionMenuItems() {
|
||||
const menuItems = this._super(...arguments);
|
||||
const otherMenuItems = menuItems.other;
|
||||
const web_field_tooltip = {
|
||||
get actionMenuItems() {
|
||||
const menuItems = super.actionMenuItems;
|
||||
const otherMenuItems = menuItems.action;
|
||||
if (session.can_manage_tooltips) {
|
||||
otherMenuItems.push({
|
||||
key: "manage_tooltips",
|
||||
description: this.env._t("Manage tooltips"),
|
||||
description: _t("Manage tooltips"),
|
||||
callback: () => this.manageTooltips(),
|
||||
});
|
||||
}
|
||||
@@ -31,4 +31,6 @@ patch(FormController.prototype, "web_field_tooltip", {
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
patch(FormController.prototype, web_field_tooltip);
|
||||
|
||||
@@ -7,7 +7,7 @@ import {patch} from "@web/core/utils/patch";
|
||||
|
||||
import {session} from "@web/session";
|
||||
|
||||
patch(FormLabel.prototype, "web_field_tooltip", {
|
||||
const web_field_tooltip = {
|
||||
get showTooltipAddHelper() {
|
||||
return session.tooltip_show_add_helper;
|
||||
},
|
||||
@@ -27,7 +27,9 @@ patch(FormLabel.prototype, "web_field_tooltip", {
|
||||
fieldName: props.fieldName,
|
||||
};
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
patch(FormLabel.prototype, web_field_tooltip);
|
||||
|
||||
FormLabel.components = Object.assign({}, FormLabel.components, {
|
||||
FieldTooltip,
|
||||
|
||||
@@ -7,7 +7,7 @@ import {patch} from "@web/core/utils/patch";
|
||||
|
||||
import {session} from "@web/session";
|
||||
|
||||
patch(ListRenderer.prototype, "web_field_tooltip", {
|
||||
const web_field_tooltip = {
|
||||
showTooltipAddHelper() {
|
||||
return session.tooltip_show_add_helper;
|
||||
},
|
||||
@@ -29,7 +29,9 @@ patch(ListRenderer.prototype, "web_field_tooltip", {
|
||||
fieldName: fieldName,
|
||||
};
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
patch(ListRenderer.prototype, web_field_tooltip);
|
||||
|
||||
ListRenderer.components = Object.assign({}, ListRenderer.components, {
|
||||
FieldTooltip,
|
||||
|
||||
Reference in New Issue
Block a user