From e0e4d38cdd21d66fe3b6fa76443b388b8be2f0e3 Mon Sep 17 00:00:00 2001 From: "Francois (fge)" Date: Thu, 16 Sep 2021 08:33:04 +0000 Subject: [PATCH] [MOV] web: move /commands to /core We move /commands to /core because DebugMenu depends on /command/command_hook. All the files in /commands depend only on /core or /commands except for menu_providers which we will move to /menus X-original-commit: eca8cd478b72d81b2293c22d2c9c41d1f94be16a Part-of: odoo/odoo#76777 --- .../static/tests/webclient/commands/mail_providers_tests.js | 4 ++-- addons/project/__manifest__.py | 3 +-- .../src/{webclient => core}/commands/command_category.js | 0 .../static/src/{webclient => core}/commands/command_hook.js | 0 .../src/{webclient => core}/commands/command_palette.js | 0 .../src/{webclient => core}/commands/command_palette.scss | 0 .../src/{webclient => core}/commands/command_palette.xml | 0 .../{webclient => core}/commands/command_palette_dialog.js | 0 .../{webclient => core}/commands/command_palette_dialog.xml | 0 .../src/{webclient => core}/commands/command_service.js | 0 .../src/{webclient => core}/commands/default_providers.js | 0 addons/web/static/src/core/debug/debug_menu.js | 2 +- .../src/webclient/{commands => menus}/menu_providers.js | 2 +- addons/web/static/src/webclient/{ => menus}/menu_service.js | 4 ++-- .../{webclient => core}/commands/command_palette_tests.js | 4 ++-- .../{webclient => core}/commands/command_service_tests.js | 6 +++--- .../{webclient => core}/commands/menu_provider_tests.js | 0 addons/web/static/tests/webclient/helpers.js | 4 ++-- addons/web/static/tests/webclient/navbar_tests.js | 2 +- addons/web/static/tests/webclient/webclient_tests.js | 2 +- 20 files changed, 16 insertions(+), 17 deletions(-) rename addons/web/static/src/{webclient => core}/commands/command_category.js (100%) rename addons/web/static/src/{webclient => core}/commands/command_hook.js (100%) rename addons/web/static/src/{webclient => core}/commands/command_palette.js (100%) rename addons/web/static/src/{webclient => core}/commands/command_palette.scss (100%) rename addons/web/static/src/{webclient => core}/commands/command_palette.xml (100%) rename addons/web/static/src/{webclient => core}/commands/command_palette_dialog.js (100%) rename addons/web/static/src/{webclient => core}/commands/command_palette_dialog.xml (100%) rename addons/web/static/src/{webclient => core}/commands/command_service.js (100%) rename addons/web/static/src/{webclient => core}/commands/default_providers.js (100%) rename addons/web/static/src/webclient/{commands => menus}/menu_providers.js (96%) rename addons/web/static/src/webclient/{ => menus}/menu_service.js (97%) rename addons/web/static/tests/{webclient => core}/commands/command_palette_tests.js (99%) rename addons/web/static/tests/{webclient => core}/commands/command_service_tests.js (99%) rename addons/web/static/tests/{webclient => core}/commands/menu_provider_tests.js (100%) diff --git a/addons/mail/static/tests/webclient/commands/mail_providers_tests.js b/addons/mail/static/tests/webclient/commands/mail_providers_tests.js index 31a463f262b..024f176e7b9 100644 --- a/addons/mail/static/tests/webclient/commands/mail_providers_tests.js +++ b/addons/mail/static/tests/webclient/commands/mail_providers_tests.js @@ -1,11 +1,11 @@ /** @odoo-module **/ import { afterEach, afterNextRender, beforeEach, start } from '@mail/utils/test_utils'; +import { editSearchBar } from '@web/../tests/core/commands/command_service_tests'; import { click, nextTick, patchWithCleanup, triggerHotkey } from "@web/../tests/helpers/utils"; -import { editSearchBar } from '@web/../tests/webclient/commands/command_service_tests'; import { browser } from '@web/core/browser/browser'; +import { commandService } from "@web/core/commands/command_service"; import { registry } from "@web/core/registry"; -import { commandService } from "@web/webclient/commands/command_service"; const serviceRegistry = registry.category("services"); diff --git a/addons/project/__manifest__.py b/addons/project/__manifest__.py index 6b99459a883..5d9fc081dd2 100644 --- a/addons/project/__manifest__.py +++ b/addons/project/__manifest__.py @@ -101,8 +101,7 @@ ], 'project.webclient': [ ('include', 'web.assets_backend'), - ('remove', 'web/static/src/webclient/menu_service.js'), - ('remove', 'web/static/src/webclient/commands/menu_providers.js'), + ('remove', 'web/static/src/webclient/menus/*.js'), # Remove Longpolling bus and packages needed this bus ('remove', 'bus/static/src/js/services/assets_watchdog_service.js'), diff --git a/addons/web/static/src/webclient/commands/command_category.js b/addons/web/static/src/core/commands/command_category.js similarity index 100% rename from addons/web/static/src/webclient/commands/command_category.js rename to addons/web/static/src/core/commands/command_category.js diff --git a/addons/web/static/src/webclient/commands/command_hook.js b/addons/web/static/src/core/commands/command_hook.js similarity index 100% rename from addons/web/static/src/webclient/commands/command_hook.js rename to addons/web/static/src/core/commands/command_hook.js diff --git a/addons/web/static/src/webclient/commands/command_palette.js b/addons/web/static/src/core/commands/command_palette.js similarity index 100% rename from addons/web/static/src/webclient/commands/command_palette.js rename to addons/web/static/src/core/commands/command_palette.js diff --git a/addons/web/static/src/webclient/commands/command_palette.scss b/addons/web/static/src/core/commands/command_palette.scss similarity index 100% rename from addons/web/static/src/webclient/commands/command_palette.scss rename to addons/web/static/src/core/commands/command_palette.scss diff --git a/addons/web/static/src/webclient/commands/command_palette.xml b/addons/web/static/src/core/commands/command_palette.xml similarity index 100% rename from addons/web/static/src/webclient/commands/command_palette.xml rename to addons/web/static/src/core/commands/command_palette.xml diff --git a/addons/web/static/src/webclient/commands/command_palette_dialog.js b/addons/web/static/src/core/commands/command_palette_dialog.js similarity index 100% rename from addons/web/static/src/webclient/commands/command_palette_dialog.js rename to addons/web/static/src/core/commands/command_palette_dialog.js diff --git a/addons/web/static/src/webclient/commands/command_palette_dialog.xml b/addons/web/static/src/core/commands/command_palette_dialog.xml similarity index 100% rename from addons/web/static/src/webclient/commands/command_palette_dialog.xml rename to addons/web/static/src/core/commands/command_palette_dialog.xml diff --git a/addons/web/static/src/webclient/commands/command_service.js b/addons/web/static/src/core/commands/command_service.js similarity index 100% rename from addons/web/static/src/webclient/commands/command_service.js rename to addons/web/static/src/core/commands/command_service.js diff --git a/addons/web/static/src/webclient/commands/default_providers.js b/addons/web/static/src/core/commands/default_providers.js similarity index 100% rename from addons/web/static/src/webclient/commands/default_providers.js rename to addons/web/static/src/core/commands/default_providers.js diff --git a/addons/web/static/src/core/debug/debug_menu.js b/addons/web/static/src/core/debug/debug_menu.js index 2aeef11d23d..c87c662dcef 100644 --- a/addons/web/static/src/core/debug/debug_menu.js +++ b/addons/web/static/src/core/debug/debug_menu.js @@ -1,7 +1,7 @@ /** @odoo-module **/ +import { useCommand } from "@web/core/commands/command_hook"; import { useService } from "@web/core/utils/hooks"; -import { useCommand } from "@web/webclient/commands/command_hook"; import { useEnvDebugContext } from "./debug_context"; const { Component } = owl; diff --git a/addons/web/static/src/webclient/commands/menu_providers.js b/addons/web/static/src/webclient/menus/menu_providers.js similarity index 96% rename from addons/web/static/src/webclient/commands/menu_providers.js rename to addons/web/static/src/webclient/menus/menu_providers.js index 55218a13bd4..592efffa429 100644 --- a/addons/web/static/src/webclient/commands/menu_providers.js +++ b/addons/web/static/src/webclient/menus/menu_providers.js @@ -2,7 +2,7 @@ import { _lt } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; -import { computeAppsAndMenuItems } from "@web/webclient/menu_service"; +import { computeAppsAndMenuItems } from "@web/webclient/menus/menu_service"; import { fuzzyLookup } from "@web/core/utils/search"; const { Component } = owl; diff --git a/addons/web/static/src/webclient/menu_service.js b/addons/web/static/src/webclient/menus/menu_service.js similarity index 97% rename from addons/web/static/src/webclient/menu_service.js rename to addons/web/static/src/webclient/menus/menu_service.js index 8be6daf208f..dc1c908395d 100644 --- a/addons/web/static/src/webclient/menu_service.js +++ b/addons/web/static/src/webclient/menus/menu_service.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import { browser } from "../core/browser/browser"; -import { registry } from "../core/registry"; +import { browser } from "../../core/browser/browser"; +import { registry } from "../../core/registry"; import { session } from "@web/session"; const loadMenusUrl = `/web/webclient/load_menus`; diff --git a/addons/web/static/tests/webclient/commands/command_palette_tests.js b/addons/web/static/tests/core/commands/command_palette_tests.js similarity index 99% rename from addons/web/static/tests/webclient/commands/command_palette_tests.js rename to addons/web/static/tests/core/commands/command_palette_tests.js index 56e14602834..7ce57fc1d1a 100644 --- a/addons/web/static/tests/webclient/commands/command_palette_tests.js +++ b/addons/web/static/tests/core/commands/command_palette_tests.js @@ -2,12 +2,12 @@ import { makeDeferred } from "@mail/utils/deferred/deferred"; import { browser } from "@web/core/browser/browser"; +import { CommandPaletteDialog } from "@web/core/commands/command_palette_dialog"; +import { commandService } from "@web/core/commands/command_service"; import { dialogService } from "@web/core/dialog/dialog_service"; import { hotkeyService } from "@web/core/hotkeys/hotkey_service"; import { registry } from "@web/core/registry"; import { uiService } from "@web/core/ui/ui_service"; -import { CommandPaletteDialog } from "@web/webclient/commands/command_palette_dialog"; -import { commandService } from "@web/webclient/commands/command_service"; import { makeTestEnv } from "../../helpers/mock_env"; import { click, getFixture, nextTick, patchWithCleanup, triggerHotkey } from "../../helpers/utils"; import { editSearchBar } from "./command_service_tests"; diff --git a/addons/web/static/tests/webclient/commands/command_service_tests.js b/addons/web/static/tests/core/commands/command_service_tests.js similarity index 99% rename from addons/web/static/tests/webclient/commands/command_service_tests.js rename to addons/web/static/tests/core/commands/command_service_tests.js index 938eaf5258d..690462c49eb 100644 --- a/addons/web/static/tests/webclient/commands/command_service_tests.js +++ b/addons/web/static/tests/core/commands/command_service_tests.js @@ -2,13 +2,13 @@ import { makeFakeLocalizationService } from "@web/../tests/helpers/mock_services"; import { browser } from "@web/core/browser/browser"; +import { useCommand } from "@web/core/commands/command_hook"; +import { commandService } from "@web/core/commands/command_service"; +import { HotkeyCommandItem } from "@web/core/commands/default_providers"; import { dialogService } from "@web/core/dialog/dialog_service"; import { hotkeyService } from "@web/core/hotkeys/hotkey_service"; import { registry } from "@web/core/registry"; import { uiService, useActiveElement } from "@web/core/ui/ui_service"; -import { useCommand } from "@web/webclient/commands/command_hook"; -import { commandService } from "@web/webclient/commands/command_service"; -import { HotkeyCommandItem } from "@web/webclient/commands/default_providers"; import testUtils from "web.test_utils"; import { clearRegistryWithCleanup, makeTestEnv } from "../../helpers/mock_env"; import { click, getFixture, nextTick, patchWithCleanup, triggerHotkey } from "../../helpers/utils"; diff --git a/addons/web/static/tests/webclient/commands/menu_provider_tests.js b/addons/web/static/tests/core/commands/menu_provider_tests.js similarity index 100% rename from addons/web/static/tests/webclient/commands/menu_provider_tests.js rename to addons/web/static/tests/core/commands/menu_provider_tests.js diff --git a/addons/web/static/tests/webclient/helpers.js b/addons/web/static/tests/webclient/helpers.js index 04765605ed6..ca55cd7cfe9 100644 --- a/addons/web/static/tests/webclient/helpers.js +++ b/addons/web/static/tests/webclient/helpers.js @@ -16,7 +16,7 @@ import { viewService } from "@web/views/view_service"; import { actionService } from "@web/webclient/actions/action_service"; import { effectService } from "@web/core/effects/effect_service"; import { hotkeyService } from "@web/core/hotkeys/hotkey_service"; -import { menuService } from "@web/webclient/menu_service"; +import { menuService } from "@web/webclient/menus/menu_service"; import { WebClient } from "@web/webclient/webclient"; // This import is needed because of it's sideeffects, for exemple : // web.test_utils easyload xml templates at line : 124:130. @@ -43,7 +43,7 @@ import Widget from "web.Widget"; import { userService } from "@web/core/user_service"; import { uiService } from "@web/core/ui/ui_service"; import { ClientActionAdapter, ViewAdapter } from "@web/legacy/action_adapters"; -import { commandService } from "@web/webclient/commands/command_service"; +import { commandService } from "@web/core/commands/command_service"; const { Component, mount, tags } = owl; diff --git a/addons/web/static/tests/webclient/navbar_tests.js b/addons/web/static/tests/webclient/navbar_tests.js index 07d39d6a452..b34c948ae4d 100644 --- a/addons/web/static/tests/webclient/navbar_tests.js +++ b/addons/web/static/tests/webclient/navbar_tests.js @@ -2,7 +2,7 @@ import { browser } from "@web/core/browser/browser"; import { notificationService } from "@web/core/notifications/notification_service"; -import { menuService } from "@web/webclient/menu_service"; +import { menuService } from "@web/webclient/menus/menu_service"; import { registry } from "@web/core/registry"; import { uiService } from "@web/core/ui/ui_service"; import { actionService } from "@web/webclient/actions/action_service"; diff --git a/addons/web/static/tests/webclient/webclient_tests.js b/addons/web/static/tests/webclient/webclient_tests.js index 9fedd7f0d9e..028df33cdbc 100644 --- a/addons/web/static/tests/webclient/webclient_tests.js +++ b/addons/web/static/tests/webclient/webclient_tests.js @@ -8,7 +8,7 @@ import { uiService } from "@web/core/ui/ui_service"; import { legacyServiceProvider } from "@web/legacy/legacy_service_provider"; import { actionService } from "@web/webclient/actions/action_service"; import { hotkeyService } from "@web/core/hotkeys/hotkey_service"; -import { menuService } from "@web/webclient/menu_service"; +import { menuService } from "@web/webclient/menus/menu_service"; import { WebClient } from "@web/webclient/webclient"; import { clearRegistryWithCleanup, makeTestEnv } from "../helpers/mock_env"; import { fakeTitleService } from "../helpers/mock_services";