From 1239951fe069f7cf84351bf33cb0f9742f5ee4de Mon Sep 17 00:00:00 2001 From: luvi Date: Thu, 11 May 2023 11:33:38 +0000 Subject: [PATCH] [IMP] web: add missing documentation for widget options This commit simply adds documentation in the supportedOptions of the text field as well as the progressbar field. Since the support of documentation has been added recently, those options were not yet documented in the widget declaration. This will improve the usability of those options in places like Studio Part-of: odoo/odoo#121495 --- .../views/fields/progress_bar/progress_bar_field.js | 10 ++++++++++ addons/web/static/src/views/fields/text/text_field.js | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/addons/web/static/src/views/fields/progress_bar/progress_bar_field.js b/addons/web/static/src/views/fields/progress_bar/progress_bar_field.js index 67da11cb18b..ca7c78aba27 100644 --- a/addons/web/static/src/views/fields/progress_bar/progress_bar_field.js +++ b/addons/web/static/src/views/fields/progress_bar/progress_bar_field.js @@ -171,6 +171,16 @@ export const progressBarField = { type: "field", availableTypes: ["integer", "float"], }, + { + label: _lt("Overflow style"), + name: "overflow_class", + type: "string", + availableTypes: ["integer", "float"], + help: _lt( + "Bootstrap classname to customize the style of the progress bar when the maximum value is exceeded" + ), + default: "bg-secondary", + }, ], supportedTypes: ["integer", "float"], extractProps: ({ attrs, options }) => ({ diff --git a/addons/web/static/src/views/fields/text/text_field.js b/addons/web/static/src/views/fields/text/text_field.js index 26b2c664604..5ff4b8353c9 100644 --- a/addons/web/static/src/views/fields/text/text_field.js +++ b/addons/web/static/src/views/fields/text/text_field.js @@ -67,6 +67,14 @@ export class TextField extends Component { export const textField = { component: TextField, displayName: _lt("Multiline Text"), + supportedOptions: [ + { + label: _lt("Enable line breaks"), + name: "line_breaks", + type: "boolean", + default: true, + }, + ], supportedTypes: ["html", "text"], extractProps: ({ attrs, options }) => ({ placeholder: attrs.placeholder,