[FIX] web: Aria attributes on buttons Export All & optional columns

Some aria attributes were missing or incorrectly set on these new
buttons:
- The button "Export All" was missing an `aria-label` attribute
- The button to show/hide optional columns was also missing an
  `aria-label` attribute, and its menu items (checkboxes to show/hide
  columns) were missing a proper role
- Ever since the debug manager was added in frontend on 73327db065,
  the `aria-label` attribute was not being rendered correctly on the
  button to open developer tools

closes odoo/odoo#70433

X-original-commit: ac3e0fcd32d66d6e0bacfabd2d224805d92dbfd1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
Luis González
2021-05-05 16:37:04 +00:00
committed by Nicolas Lempereur
parent fdc3b42554
commit fcfc83b66c
5 changed files with 25 additions and 3 deletions
+14
View File
@@ -2872,6 +2872,13 @@ msgstr ""
msgid "Only you"
msgstr ""
#. module: web
#. openerp-web
#: code:addons/web/static/src/xml/debug.xml:0
#, python-format
msgid "Open Developer Tools"
msgstr ""
#. module: web
#. openerp-web
#: code:addons/web/static/src/xml/debug.xml:0
@@ -2925,6 +2932,13 @@ msgstr ""
msgid "Open: "
msgstr ""
#. module: web
#. openerp-web
#: code:addons/web/static/src/js/views/list/list_renderer.js:0
#, python-format
msgid "Optional columns"
msgstr ""
#. module: web
#. openerp-web
#: code:addons/web/static/src/js/fields/basic_fields.js:0
+3
View File
@@ -485,6 +485,9 @@ var dom = {
if (options && options.prop) {
$input.prop(options.prop);
}
if (options && options.role) {
$input.attr('role', options.role);
}
return $container.append($input, $label);
},
/**
@@ -998,6 +998,7 @@ var ListRenderer = BasicRenderer.extend({
'data-toggle': "dropdown",
'data-display': "static",
'aria-expanded': false,
'aria-label': _t('Optional columns'),
});
$a.appendTo($optionalColumnsDropdown);
@@ -1016,6 +1017,7 @@ var ListRenderer = BasicRenderer.extend({
(config.isDebug() ? (' (' + col.attrs.name + ')') : '');
var $checkbox = dom.renderCheckbox({
text: txt,
role: "menuitemcheckbox",
prop: {
name: col.attrs.name,
checked: _.contains(self.optionalColumnsEnabled, col.attrs.name),
+1 -1
View File
@@ -824,7 +824,7 @@
</button>
</t>
<t t-if="widget.is_action_enabled('export_xlsx') and widget.isExportEnable">
<button type="button" class="btn btn-secondary fa fa-download o_list_export_xlsx" title="Export All"/>
<button type="button" class="btn btn-secondary fa fa-download o_list_export_xlsx" title="Export All" aria-label="Export All"/>
</t>
</div>
</t>
+5 -2
View File
@@ -3,8 +3,11 @@
<t t-name="WebClient.DebugManager">
<li class="o_debug_manager" role="menuitem">
<a role="button" href="#" class="o_debug_mode" t-attf-title="Open Developer Tools#{widget.debug_mode_help}"
t-att-data-debug-mode="widget.debug_mode" aria-label="Open Developer Tools#{widget.debug_mode_help}"
<t t-set="_devtool_button_title">Open Developer Tools</t>
<a role="button" href="#" class="o_debug_mode"
t-att-title="_devtool_button_title + widget.debug_mode_help"
t-att-aria-label="_devtool_button_title + widget.debug_mode_help"
t-att-data-debug-mode="widget.debug_mode"
data-toggle="dropdown" aria-expanded="false" tabindex="-1" data-display="static">
<span class="fa fa-bug"/>
</a>