[FIX] web_editor: properly hide fa sizes buttons that should be hidden

Commit [1] added buttons with a `data-dependency` equal to "fake",
thinking it would hide those buttons automatically as the "fake" widget
would not exist. Somehow this got merged despite the fact that was not
working (testing probably focused on the more important things [1] was
fixing). At some point, using a fake dependency was hiding an element
but this changed one year earlier with [2].

This commit explicitly hides widgets with `data-dependency="fake"`.

[1]: https://github.com/odoo/odoo/commit/f59affcdfe9529645a02680214f3d7d96ebacf6e
[2]: https://github.com/odoo/odoo/commit/e927d1e89bc124002bb5e0b69dee711ea0d8147c

task-3208632

closes odoo/odoo#113936

X-original-commit: 7a46759a529b2d781585e0dbcb99bf7084c88007
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
qsm-odoo
2023-03-01 20:55:02 +01:00
parent 1d309793d4
commit b20f120cab
@@ -3661,6 +3661,12 @@ const SnippetOptionWidget = Widget.extend({
}
const dependencies = widget.getDependencies();
if (dependencies.length === 1 && dependencies[0] === 'fake') {
widget.toggleVisibility(false);
return;
}
const dependenciesData = [];
dependencies.forEach(depName => {
const toBeActive = (depName[0] !== '!');