Skip to content
Snippets Groups Projects

(eslint): update config to handle ES modules and Odoo JSDoc tags

Merged oury.balde requested to merge topic/18.0/ob into branch/18.0
2 unresolved threads
Files
3
/** @odoo-module */
import {CharField, charField} from "@web/views/fields/char/char_field";
import {patch} from "@web/core/utils/patch";
// Adding a new property for dynamic placeholder button visibility
CharField.props = {
...CharField.props,
@@ -3,10 +1,10 @@
import {CharField, charField} from "@web/views/fields/char/char_field";
import {patch} from "@web/core/utils/patch";
// Adding a new property for dynamic placeholder button visibility
CharField.props = {
...CharField.props,
rednerDynamicPlaceholder: {type: Boolean, optional: true}, // Dynamic placeholder flag
rednerDynamicPlaceholder: {type: Boolean, optional: true},
buttonVisibilityField: {type: String, optional: true},
converterField: {type: String, optional: true},
};
@@ -47,9 +45,9 @@
this.input.el.focus();
// Build placeholder based on converter type
let placeholder;
let placeholder = "";
switch (this.activeConverterType) {
case "field":
placeholder = `${chain}`;
break;
// Add other converter types here
@@ -51,11 +49,11 @@
switch (this.activeConverterType) {
case "field":
placeholder = `${chain}`;
break;
// Add other converter types here
default:
default: {
const defaultValuePart = defaultValue?.length
? ` ||| ${defaultValue}`
: "";
placeholder = `{{object.${chain}${defaultValuePart}}}`;
break;
@@ -57,8 +55,9 @@
const defaultValuePart = defaultValue?.length
? ` ||| ${defaultValue}`
: "";
placeholder = `{{object.${chain}${defaultValuePart}}}`;
break;
}
}
this.input.el.setRangeText(
placeholder,
@@ -66,7 +65,7 @@
this.selectionStart,
"end"
);
// trigger events to make the field dirty
// Trigger events to make the field dirty
this.input.el.dispatchEvent(new InputEvent("input"));
this.input.el.dispatchEvent(new KeyboardEvent("keydown"));
this.input.el.focus();
Loading