From 91394ed79d56644ce09a817bb9761c0917ef35ba Mon Sep 17 00:00:00 2001 From: FrancoisGe Date: Wed, 12 Jan 2022 12:58:37 +0000 Subject: [PATCH] [FIX] web: Command Palette FooterComponent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit solves a naming error introduced by commit 1e1b45ea62a180f01204be232677d28675a7e6ff, the name of a component always starts with a capital letter. closes odoo/odoo#82629 Related: odoo/enterprise#23285 Signed-off-by: Géry Debongnie --- addons/web/static/src/core/commands/command_palette.js | 6 +++--- addons/web/static/src/core/commands/command_palette.xml | 4 ++-- addons/web/static/src/core/commands/command_service.js | 2 +- .../static/tests/core/commands/command_palette_tests.js | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/web/static/src/core/commands/command_palette.js b/addons/web/static/src/core/commands/command_palette.js index 29b4e76dff9..229716e27fb 100644 --- a/addons/web/static/src/core/commands/command_palette.js +++ b/addons/web/static/src/core/commands/command_palette.js @@ -37,7 +37,7 @@ const FUZZY_NAMESPACES = ["default"]; * @typedef {{ * categoriesByNamespace?: {[namespace]: string[]}; * emptyMessageByNamespace?: {[namespace]: string}; - * footerComponent?: Component; + * FooterComponent?: Component; * placeholder?: string; * providers: Provider[]; * searchValue?: string; @@ -84,7 +84,7 @@ export class CommandPalette extends Component { /** * @type {{ commands: CommandItem[], * emptyMessage: string, - * footerComponent: Component, + * FooterComponent: Component, * placeholder: string, * searchValue: string, * selectedCommand: CommandItem }} @@ -132,7 +132,7 @@ export class CommandPalette extends Component { this.emptyMessageByNamespace = config.emptyMessageByNamespace || {}; this.providersByNamespace = result; - this.state.footerComponent = config.footerComponent; + this.state.FooterComponent = config.FooterComponent; this.state.placeholder = config.placeholder || DEFAULT_PLACEHOLDER.toString(); diff --git a/addons/web/static/src/core/commands/command_palette.xml b/addons/web/static/src/core/commands/command_palette.xml index 9b012387dd7..cd65c01cfeb 100644 --- a/addons/web/static/src/core/commands/command_palette.xml +++ b/addons/web/static/src/core/commands/command_palette.xml @@ -28,8 +28,8 @@ - diff --git a/addons/web/static/src/core/commands/command_service.js b/addons/web/static/src/core/commands/command_service.js index 308073a7452..7893dbd1b31 100644 --- a/addons/web/static/src/core/commands/command_service.js +++ b/addons/web/static/src/core/commands/command_service.js @@ -93,7 +93,7 @@ export const commandService = { { categoriesByNamespace, emptyMessageByNamespace, - footerComponent: DefaultFooter, + FooterComponent: DefaultFooter, placeholder: env._t("Search for a command..."), providers: commandProviderRegistry.getAll(), }, diff --git a/addons/web/static/tests/core/commands/command_palette_tests.js b/addons/web/static/tests/core/commands/command_palette_tests.js index 3ebfaa608f3..a0eff4d1620 100644 --- a/addons/web/static/tests/core/commands/command_palette_tests.js +++ b/addons/web/static/tests/core/commands/command_palette_tests.js @@ -26,8 +26,8 @@ let target; let testComponent; const serviceRegistry = registry.category("services"); -class footerComponent extends Component {} -footerComponent.template = xml`My footer`; +class FooterComponent extends Component {} +FooterComponent.template = xml`My footer`; class TestComponent extends Component { get DialogContainer() { @@ -154,7 +154,7 @@ QUnit.test("add a footer", async (assert) => { testComponent = await mount(TestComponent, { env, target }); const config = { providers: [], - footerComponent, + FooterComponent, }; env.services.dialog.add(CommandPaletteDialog, { config, @@ -963,7 +963,7 @@ QUnit.test("multi level command", async (assert) => { ]; const config = { emptyMessageByNamespace, - footerComponent, + FooterComponent, placeholder: "placeholder test", providers, };