From 6240617358ec1b9112c7f2f8fc521074ef51bdf2 Mon Sep 17 00:00:00 2001 From: "Didier (did)" Date: Fri, 25 Jun 2021 14:56:52 +0000 Subject: [PATCH] [IMP] mail, *: use explicit export instead of default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * = hr, hr_holidays, im_livechat, sms, snailmail, website_livechat, website_slides Exporting directly on the line of the class or variable definition is less lines of code and less repetition (and risk or mistake). Exporting with a name instead of default allows to catch typos more easily when importing and ensures the same name is used for consistency (and ease of grep). closes odoo/odoo#72597 Related: odoo/enterprise#19224 Signed-off-by: Sébastien Theys (seb) --- addons/hr/static/tests/helpers/mock_models.js | 2 +- .../partner_im_status_icon_tests.js | 6 ++-- .../thread_icon/thread_icon_tests.js | 6 ++-- .../src/components/thread_view/thread_view.js | 6 ++-- .../thread_view/thread_view_tests.js | 6 ++-- .../static/tests/helpers/mock_models.js | 9 ++---- .../src/components/composer/composer_tests.js | 2 +- .../static/src/components/discuss/discuss.js | 2 +- .../discuss_sidebar/discuss_sidebar.js | 2 +- .../discuss_sidebar_item.js | 2 +- .../notification_list/notification_list.js | 2 +- .../thread_icon/thread_icon_tests.js | 2 +- .../thread_needaction_preview.js | 3 +- .../thread_preview/thread_preview.js | 2 +- .../thread_textual_typing_status_tests.js | 2 +- .../static/src/widgets/discuss/discuss.js | 4 +-- .../static/tests/helpers/mock_models.js | 2 +- .../use_drag_visible_dropzone.js | 4 +-- .../src/component_hooks/use_refs/use_refs.js | 4 +-- .../use_rendered_values.js | 4 +-- .../use_should_update_based_on_props.js | 4 +-- .../component_hooks/use_store/use_store.js | 4 +-- .../use_store/use_store_tests.js | 2 +- .../component_hooks/use_update/use_update.js | 4 +-- .../src/components/activity/activity.js | 14 ++++------ .../src/components/activity/activity_tests.js | 5 ++-- .../components/activity_box/activity_box.js | 10 +++---- .../activity_mark_done_popover.js | 8 ++---- .../activity_mark_done_popover_tests.js | 3 +- .../src/components/attachment/attachment.js | 10 +++---- .../components/attachment/attachment_tests.js | 2 +- .../attachment_box/attachment_box.js | 19 ++++++------- .../attachment_box/attachment_box_tests.js | 2 +- .../attachment_delete_confirm_dialog.js | 10 +++---- .../attachment_list/attachment_list.js | 10 +++---- .../attachment_viewer/attachment_viewer.js | 10 +++---- .../autocomplete_input/autocomplete_input.js | 6 ++-- .../src/components/chat_window/chat_window.js | 16 +++++------ .../chat_window_header/chat_window_header.js | 10 +++---- .../chat_window_hidden_menu.js | 8 ++---- .../chat_window_manager.js | 12 ++++---- .../static/src/components/chatter/chatter.js | 20 ++++++------- .../chatter_suggested_recipient_tests.js | 4 +-- .../src/components/chatter/chatter_tests.js | 4 +-- .../chatter_container/chatter_container.js | 13 ++++----- .../chatter_topbar/chatter_topbar.js | 12 ++++---- .../chatter_topbar/chatter_topbar_tests.js | 6 ++-- .../src/components/composer/composer.js | 28 +++++++++---------- .../src/components/composer/composer.xml | 2 +- .../src/components/composer/composer_tests.js | 2 +- .../composer_suggested_recipient.js | 14 ++++------ .../composer_suggested_recipient_list.js | 10 +++---- .../composer_suggestion.js | 12 ++++---- ...mposer_suggestion_canned_response_tests.js | 2 +- .../composer_suggestion_channel_tests.js | 2 +- .../composer_suggestion_command_tests.js | 2 +- .../composer_suggestion_partner_tests.js | 2 +- .../composer_suggestion_list.js | 10 +++---- .../composer_text_input.js | 12 ++++---- .../static/src/components/dialog/dialog.js | 8 ++---- .../dialog_manager/dialog_manager.js | 10 +++---- .../static/src/components/discuss/discuss.js | 26 ++++++++--------- .../discuss_mobile_mailbox_selection.js | 8 ++---- .../discuss_sidebar/discuss_sidebar.js | 14 ++++------ .../discuss_sidebar_item.js | 14 ++++------ .../src/components/drop_zone/drop_zone.js | 6 ++-- .../components/editable_text/editable_text.js | 6 ++-- .../emojis_popover/emojis_popover.js | 8 ++---- .../components/file_uploader/file_uploader.js | 6 ++-- .../file_uploader/file_uploader_tests.js | 2 +- .../components/follow_button/follow_button.js | 8 ++---- .../follow_button/follow_button_tests.js | 2 +- .../src/components/follower/follower.js | 10 +++---- .../src/components/follower/follower_tests.js | 2 +- .../follower_list_menu/follower_list_menu.js | 10 +++---- .../follower_list_menu_tests.js | 2 +- .../follower_subtype/follower_subtype.js | 8 ++---- .../follower_subtype_tests.js | 2 +- .../follower_subtype_list.js | 10 +++---- .../components/mail_template/mail_template.js | 8 ++---- .../static/src/components/message/message.js | 24 ++++++++-------- .../src/components/message/message_tests.js | 2 +- .../message_author_prefix.js | 8 ++---- .../components/message_list/message_list.js | 16 +++++------ .../message_seen_indicator.js | 8 ++---- .../message_seen_indicator_tests.js | 6 ++-- .../messaging_menu/messaging_menu.js | 14 ++++------ .../mobile_messaging_navbar.js | 6 ++-- .../moderation_ban_dialog.js | 8 ++---- .../moderation_discard_dialog.js | 9 +++--- .../moderation_reject_dialog.js | 8 ++---- .../notification_alert/notification_alert.js | 8 ++---- .../notification_group/notification_group.js | 8 ++---- .../notification_list/notification_list.js | 16 +++++------ ...ification_list_notification_group_tests.js | 2 +- .../notification_list_tests.js | 2 +- .../notification_popover.js | 8 ++---- .../notification_request.js | 10 +++---- .../partner_im_status_icon.js | 8 ++---- .../partner_im_status_icon_tests.js | 2 +- .../src/components/thread_icon/thread_icon.js | 10 +++---- .../thread_icon/thread_icon_tests.js | 2 +- .../thread_needaction_preview.js | 13 ++++----- .../thread_needaction_preview_tests.js | 2 +- .../thread_preview/thread_preview.js | 13 ++++----- .../thread_preview/thread_preview_tests.js | 2 +- .../thread_textual_typing_status.js | 10 +++---- .../thread_textual_typing_status_tests.js | 2 +- .../thread_typing_icon/thread_typing_icon.js | 6 ++-- .../src/components/thread_view/thread_view.js | 14 ++++------ .../thread_view/thread_view_tests.js | 2 +- addons/mail/static/src/js/main.js | 2 +- addons/mail/static/src/model/model_field.js | 3 +- addons/mail/static/src/model/model_manager.js | 6 ++-- .../chat_window_service.js | 2 +- .../services/dialog_service/dialog_service.js | 2 +- addons/mail/static/src/utils/test_utils.js | 4 +-- .../static/src/widgets/discuss/discuss.js | 2 +- .../widgets/form_renderer/form_renderer.js | 2 +- .../widgets/messaging_menu/messaging_menu.js | 12 ++++---- .../notification_alert/notification_alert.js | 12 ++++---- .../mail/static/tests/helpers/mock_models.js | 4 +-- .../src/components/message/message_tests.js | 6 ++-- .../notification_group/notification_group.js | 6 ++-- ...ification_list_notification_group_tests.js | 7 ++--- .../static/src/components/message/message.js | 4 ++- .../src/components/message/message_tests.js | 6 ++-- .../notification_group/notification_group.js | 6 ++-- ...ification_list_notification_group_tests.js | 7 ++--- .../snailmail_error_dialog.js | 2 +- .../snailmail_notification_popover.js | 2 +- .../static/tests/helpers/mock_models.js | 9 ++---- .../static/src/components/discuss/discuss.js | 4 ++- .../visitor_banner/visitor_banner.js | 2 +- .../static/tests/helpers/mock_models.js | 2 +- .../src/components/activity/activity.js | 7 +++-- .../src/components/activity/activity_tests.js | 6 ++-- 137 files changed, 402 insertions(+), 542 deletions(-) diff --git a/addons/hr/static/tests/helpers/mock_models.js b/addons/hr/static/tests/helpers/mock_models.js index db3db8c386e..3a3d490b9ae 100644 --- a/addons/hr/static/tests/helpers/mock_models.js +++ b/addons/hr/static/tests/helpers/mock_models.js @@ -1,7 +1,7 @@ odoo.define('hr/static/tests/helpers/mock_models.js', function (require) { 'use strict'; -const MockModels = require('@mail/../tests/helpers/mock_models')[Symbol.for("default")]; +const { MockModels } = require('@mail/../tests/helpers/mock_models'); const { patch } = require('web.utils'); patch(MockModels, 'hr/static/tests/helpers/mock_models.js', { diff --git a/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon_tests.js b/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon_tests.js index 499f8c3ba54..191e9f8e3c6 100644 --- a/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon_tests.js +++ b/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon_tests.js @@ -1,9 +1,7 @@ odoo.define('hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon_tests.js', function (require) { 'use strict'; -const components = { - PartnerImStatusIcon: require('@mail/components/partner_im_status_icon/partner_im_status_icon')[Symbol.for("default")], -}; +const { PartnerImStatusIcon } = require('@mail/components/partner_im_status_icon/partner_im_status_icon'); const { afterEach, beforeEach, @@ -11,6 +9,8 @@ const { start, } = require('@mail/utils/test_utils'); +const components = { PartnerImStatusIcon }; + QUnit.module('hr_holidays', {}, function () { QUnit.module('components', {}, function () { QUnit.module('partner_im_status_icon', {}, function () { diff --git a/addons/hr_holidays/static/src/components/thread_icon/thread_icon_tests.js b/addons/hr_holidays/static/src/components/thread_icon/thread_icon_tests.js index 07b0021cd2c..1a7057aacbf 100644 --- a/addons/hr_holidays/static/src/components/thread_icon/thread_icon_tests.js +++ b/addons/hr_holidays/static/src/components/thread_icon/thread_icon_tests.js @@ -1,9 +1,7 @@ odoo.define('hr_holidays/static/src/components/thread_icon/thread_icon_tests.js', function (require) { 'use strict'; -const components = { - ThreadIcon: require('@mail/components/thread_icon/thread_icon')[Symbol.for("default")], -}; +const { ThreadIcon } = require('@mail/components/thread_icon/thread_icon'); const { afterEach, beforeEach, @@ -11,6 +9,8 @@ const { start, } = require('@mail/utils/test_utils'); +const components = { ThreadIcon }; + QUnit.module('mail', {}, function () { QUnit.module('components', {}, function () { QUnit.module('thread_icon', {}, function () { diff --git a/addons/hr_holidays/static/src/components/thread_view/thread_view.js b/addons/hr_holidays/static/src/components/thread_view/thread_view.js index 795b1000925..67c00d73be7 100644 --- a/addons/hr_holidays/static/src/components/thread_view/thread_view.js +++ b/addons/hr_holidays/static/src/components/thread_view/thread_view.js @@ -1,12 +1,12 @@ odoo.define('hr_holidays/static/src/components/thread_view/thread_view.js', function (require) { 'use strict'; -const components = { - ThreadView: require('@mail/components/thread_view/thread_view')[Symbol.for("default")], -}; +const { ThreadView } = require('@mail/components/thread_view/thread_view'); const { patch } = require('web.utils'); +const components = { ThreadView }; + patch(components.ThreadView.prototype, 'hr_holidays/static/src/components/thread_view/thread_view.js', { //-------------------------------------------------------------------------- // Private diff --git a/addons/hr_holidays/static/src/components/thread_view/thread_view_tests.js b/addons/hr_holidays/static/src/components/thread_view/thread_view_tests.js index d3b7154e904..54b70b61ea3 100644 --- a/addons/hr_holidays/static/src/components/thread_view/thread_view_tests.js +++ b/addons/hr_holidays/static/src/components/thread_view/thread_view_tests.js @@ -1,9 +1,7 @@ odoo.define('hr_holidays/static/src/components/thread_view/thread_view_tests.js', function (require) { 'use strict'; -const components = { - ThreadView: require('@mail/components/thread_view/thread_view')[Symbol.for("default")], -}; +const { ThreadView } = require('@mail/components/thread_view/thread_view'); const { link } = require('@mail/model/model_field_command'); const { afterEach, @@ -12,6 +10,8 @@ const { start, } = require('@mail/utils/test_utils'); +const components = { ThreadView }; + QUnit.module('hr_holidays', {}, function () { QUnit.module('components', {}, function () { QUnit.module('thread_view', {}, function () { diff --git a/addons/hr_holidays/static/tests/helpers/mock_models.js b/addons/hr_holidays/static/tests/helpers/mock_models.js index 07b54a661c4..be389316241 100644 --- a/addons/hr_holidays/static/tests/helpers/mock_models.js +++ b/addons/hr_holidays/static/tests/helpers/mock_models.js @@ -1,8 +1,7 @@ -odoo.define('hr_holidays/static/tests/helpers/mock_models.js', function (require) { -'use strict'; +/** @odoo-module **/ -const MockModels = require('@mail/../tests/helpers/mock_models')[Symbol.for("default")]; -const { patch } = require('web.utils'); +import { MockModels } from '@mail/../tests/helpers/mock_models'; +import { patch } from 'web.utils'; patch(MockModels, 'hr_holidays/static/tests/helpers/mock_models.js', { @@ -23,5 +22,3 @@ patch(MockModels, 'hr_holidays/static/tests/helpers/mock_models.js', { }, }); - -}); diff --git a/addons/im_livechat/static/src/components/composer/composer_tests.js b/addons/im_livechat/static/src/components/composer/composer_tests.js index f36e5f7a8fa..2914c599bb2 100644 --- a/addons/im_livechat/static/src/components/composer/composer_tests.js +++ b/addons/im_livechat/static/src/components/composer/composer_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import Composer from '@mail/components/composer/composer'; +import { Composer } from '@mail/components/composer/composer'; import { afterEach, afterNextRender, diff --git a/addons/im_livechat/static/src/components/discuss/discuss.js b/addons/im_livechat/static/src/components/discuss/discuss.js index b98c0b80947..2a18e8c1621 100644 --- a/addons/im_livechat/static/src/components/discuss/discuss.js +++ b/addons/im_livechat/static/src/components/discuss/discuss.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import Discuss from '@mail/components/discuss/discuss'; +import { Discuss } from '@mail/components/discuss/discuss'; import { patch } from 'web.utils'; diff --git a/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.js b/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.js index bbe66ddcf5e..2dc4a95cd63 100644 --- a/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.js +++ b/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import DiscussSidebar from '@mail/components/discuss_sidebar/discuss_sidebar'; +import { DiscussSidebar } from '@mail/components/discuss_sidebar/discuss_sidebar'; import { patch } from 'web.utils'; diff --git a/addons/im_livechat/static/src/components/discuss_sidebar_item/discuss_sidebar_item.js b/addons/im_livechat/static/src/components/discuss_sidebar_item/discuss_sidebar_item.js index 60bc437beb2..9cc8dbde071 100644 --- a/addons/im_livechat/static/src/components/discuss_sidebar_item/discuss_sidebar_item.js +++ b/addons/im_livechat/static/src/components/discuss_sidebar_item/discuss_sidebar_item.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import DiscussSidebarItem from '@mail/components/discuss_sidebar_item/discuss_sidebar_item'; +import { DiscussSidebarItem } from '@mail/components/discuss_sidebar_item/discuss_sidebar_item'; import { patch } from 'web.utils'; diff --git a/addons/im_livechat/static/src/components/notification_list/notification_list.js b/addons/im_livechat/static/src/components/notification_list/notification_list.js index 801408d857f..f668a7d8de2 100644 --- a/addons/im_livechat/static/src/components/notification_list/notification_list.js +++ b/addons/im_livechat/static/src/components/notification_list/notification_list.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import NotificationList from '@mail/components/notification_list/notification_list'; +import { NotificationList } from '@mail/components/notification_list/notification_list'; import { patch } from 'web.utils'; const components = { NotificationList }; diff --git a/addons/im_livechat/static/src/components/thread_icon/thread_icon_tests.js b/addons/im_livechat/static/src/components/thread_icon/thread_icon_tests.js index d85aae8932c..546724003af 100644 --- a/addons/im_livechat/static/src/components/thread_icon/thread_icon_tests.js +++ b/addons/im_livechat/static/src/components/thread_icon/thread_icon_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import ThreadIcon from '@mail/components/thread_icon/thread_icon'; +import { ThreadIcon } from '@mail/components/thread_icon/thread_icon'; import { afterEach, afterNextRender, diff --git a/addons/im_livechat/static/src/components/thread_needaction_preview/thread_needaction_preview.js b/addons/im_livechat/static/src/components/thread_needaction_preview/thread_needaction_preview.js index c8afb8cdd16..2760850225d 100644 --- a/addons/im_livechat/static/src/components/thread_needaction_preview/thread_needaction_preview.js +++ b/addons/im_livechat/static/src/components/thread_needaction_preview/thread_needaction_preview.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import ThreadNeedactionPreview from '@mail/components/thread_needaction_preview/thread_needaction_preview'; +import { ThreadNeedactionPreview } from '@mail/components/thread_needaction_preview/thread_needaction_preview'; import { patch } from 'web.utils'; @@ -23,4 +23,3 @@ patch(components.ThreadNeedactionPreview.prototype, 'thread_needaction_preview', } }); - diff --git a/addons/im_livechat/static/src/components/thread_preview/thread_preview.js b/addons/im_livechat/static/src/components/thread_preview/thread_preview.js index 54ca4be28c7..46b65eb6fdd 100644 --- a/addons/im_livechat/static/src/components/thread_preview/thread_preview.js +++ b/addons/im_livechat/static/src/components/thread_preview/thread_preview.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import ThreadPreview from '@mail/components/thread_preview/thread_preview'; +import { ThreadPreview } from '@mail/components/thread_preview/thread_preview'; import { patch } from 'web.utils'; diff --git a/addons/im_livechat/static/src/components/thread_textual_typing_status/thread_textual_typing_status_tests.js b/addons/im_livechat/static/src/components/thread_textual_typing_status/thread_textual_typing_status_tests.js index 438492afc2b..eac5f961141 100644 --- a/addons/im_livechat/static/src/components/thread_textual_typing_status/thread_textual_typing_status_tests.js +++ b/addons/im_livechat/static/src/components/thread_textual_typing_status/thread_textual_typing_status_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import ThreadTextualTypingStatus from '@mail/components/thread_textual_typing_status/thread_textual_typing_status'; +import { ThreadTextualTypingStatus } from '@mail/components/thread_textual_typing_status/thread_textual_typing_status'; import { afterEach, afterNextRender, diff --git a/addons/im_livechat/static/src/widgets/discuss/discuss.js b/addons/im_livechat/static/src/widgets/discuss/discuss.js index 1839e2737d8..7112cd7346f 100644 --- a/addons/im_livechat/static/src/widgets/discuss/discuss.js +++ b/addons/im_livechat/static/src/widgets/discuss/discuss.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import Discuss from '@mail/widgets/discuss/discuss'; +import DiscussWidget from '@mail/widgets/discuss/discuss'; -Discuss.include({ +DiscussWidget.include({ //---------------------------------------------------------------------- // Private //---------------------------------------------------------------------- diff --git a/addons/im_livechat/static/tests/helpers/mock_models.js b/addons/im_livechat/static/tests/helpers/mock_models.js index 05e9a3f10fe..6aa3cdfcb9b 100644 --- a/addons/im_livechat/static/tests/helpers/mock_models.js +++ b/addons/im_livechat/static/tests/helpers/mock_models.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import MockModels from '@mail/../tests/helpers/mock_models'; +import { MockModels } from '@mail/../tests/helpers/mock_models'; import { patch } from 'web.utils'; patch(MockModels, 'im_livechat/static/tests/helpers/mock_models.js', { diff --git a/addons/mail/static/src/component_hooks/use_drag_visible_dropzone/use_drag_visible_dropzone.js b/addons/mail/static/src/component_hooks/use_drag_visible_dropzone/use_drag_visible_dropzone.js index 207373f1b72..58b93627279 100644 --- a/addons/mail/static/src/component_hooks/use_drag_visible_dropzone/use_drag_visible_dropzone.js +++ b/addons/mail/static/src/component_hooks/use_drag_visible_dropzone/use_drag_visible_dropzone.js @@ -9,7 +9,7 @@ const { useState, onMounted, onWillUnmount } = owl.hooks; * * @returns {Object} */ -function useDragVisibleDropZone() { +export function useDragVisibleDropZone() { /** * Determine whether the drop zone should be visible or not. * Note that this is an observed value, and primitive types such as @@ -86,5 +86,3 @@ function useDragVisibleDropZone() { return isVisible; } - -export default useDragVisibleDropZone; diff --git a/addons/mail/static/src/component_hooks/use_refs/use_refs.js b/addons/mail/static/src/component_hooks/use_refs/use_refs.js index e4f8161c79c..6ecfd2b4ba3 100644 --- a/addons/mail/static/src/component_hooks/use_refs/use_refs.js +++ b/addons/mail/static/src/component_hooks/use_refs/use_refs.js @@ -8,11 +8,9 @@ const { Component } = owl; * @returns {function} returns object whose keys are t-ref values of active refs. * and values are refs. */ -function useRefs() { +export function useRefs() { const component = Component.current; return function () { return component.__owl__.refs || {}; }; } - -export default useRefs; diff --git a/addons/mail/static/src/component_hooks/use_rendered_values/use_rendered_values.js b/addons/mail/static/src/component_hooks/use_rendered_values/use_rendered_values.js index 3aacfda5b7b..930f16ecb29 100644 --- a/addons/mail/static/src/component_hooks/use_rendered_values/use_rendered_values.js +++ b/addons/mail/static/src/component_hooks/use_rendered_values/use_rendered_values.js @@ -12,7 +12,7 @@ const { onMounted, onPatched } = owl.hooks; * render and of which the result will be stored for future reference. * @returns {function} function to call to retrieve the last rendered values. */ -function useRenderedValues(selector) { +export function useRenderedValues(selector) { const component = Component.current; let renderedValues; let patchedValues; @@ -29,5 +29,3 @@ function useRenderedValues(selector) { } return () => patchedValues; } - -export default useRenderedValues; diff --git a/addons/mail/static/src/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props.js b/addons/mail/static/src/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props.js index c317cce172b..ea2b48eef00 100644 --- a/addons/mail/static/src/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props.js +++ b/addons/mail/static/src/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props.js @@ -53,7 +53,7 @@ function isEqual(a, b, compareDepth) { * @param {Object} [param0.compareDepth={}] allows to specify the comparison * depth to use for each prop. Default is shallow compare (depth = 0). */ -function useShouldUpdateBasedOnProps({ compareDepth = {} } = {}) { +export function useShouldUpdateBasedOnProps({ compareDepth = {} } = {}) { const component = Component.current; component.shouldUpdate = nextProps => { const allNewProps = Object.assign({}, nextProps); @@ -66,5 +66,3 @@ function useShouldUpdateBasedOnProps({ compareDepth = {} } = {}) { return !isEqual(component.props, allNewProps, compareDepth); }; } - -export default useShouldUpdateBasedOnProps; diff --git a/addons/mail/static/src/component_hooks/use_store/use_store.js b/addons/mail/static/src/component_hooks/use_store/use_store.js index f417e099dc6..d2ff1bde31f 100644 --- a/addons/mail/static/src/component_hooks/use_store/use_store.js +++ b/addons/mail/static/src/component_hooks/use_store/use_store.js @@ -14,7 +14,7 @@ * as number (applies to all keys) or as an object (depth for specific keys) * @returns {Proxy} @see owl.hooks.useStore */ -function useStore(selector, options = {}) { +export function useStore(selector, options = {}) { const store = options.store || owl.Component.current.env.store; const hashFn = store.observer.revNumber.bind(store.observer); const isEqual = options.isEqual || ((a, b) => a === b); @@ -119,5 +119,3 @@ function useStore(selector, options = {}) { isEqual: proxyComparatorDeep(options.compareDepth), })); } - -export default useStore; diff --git a/addons/mail/static/src/component_hooks/use_store/use_store_tests.js b/addons/mail/static/src/component_hooks/use_store/use_store_tests.js index 592c0b73490..22b1f7a4b3d 100644 --- a/addons/mail/static/src/component_hooks/use_store/use_store_tests.js +++ b/addons/mail/static/src/component_hooks/use_store/use_store_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import useStore from '@mail/component_hooks/use_store/use_store'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; import { afterNextRender, nextAnimationFrame, diff --git a/addons/mail/static/src/component_hooks/use_update/use_update.js b/addons/mail/static/src/component_hooks/use_update/use_update.js index efd8dd8de3c..e8cd4244d5a 100644 --- a/addons/mail/static/src/component_hooks/use_update/use_update.js +++ b/addons/mail/static/src/component_hooks/use_update/use_update.js @@ -8,9 +8,7 @@ const { onMounted, onPatched } = owl.hooks; * @param {Object} param0 * @param {function} param0.func the function to execute after the update. */ -function useUpdate({ func }) { +export function useUpdate({ func }) { onMounted(func); onPatched(func); } - -export default useUpdate; diff --git a/addons/mail/static/src/components/activity/activity.js b/addons/mail/static/src/components/activity/activity.js index cbdfeca2b1c..9b8b15efea5 100644 --- a/addons/mail/static/src/components/activity/activity.js +++ b/addons/mail/static/src/components/activity/activity.js @@ -1,10 +1,10 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import ActivityMarkDonePopover from '@mail/components/activity_mark_done_popover/activity_mark_done_popover'; -import FileUploader from '@mail/components/file_uploader/file_uploader'; -import MailTemplate from '@mail/components/mail_template/mail_template'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { ActivityMarkDonePopover } from '@mail/components/activity_mark_done_popover/activity_mark_done_popover'; +import { FileUploader } from '@mail/components/file_uploader/file_uploader'; +import { MailTemplate } from '@mail/components/mail_template/mail_template'; import { auto_str_to_date, @@ -21,7 +21,7 @@ const components = { MailTemplate, }; -class Activity extends Component { +export class Activity extends Component { /** * @override @@ -196,5 +196,3 @@ Object.assign(Activity, { }, template: 'mail.Activity', }); - -export default Activity; diff --git a/addons/mail/static/src/components/activity/activity_tests.js b/addons/mail/static/src/components/activity/activity_tests.js index 5a862964bff..10f9535aad3 100644 --- a/addons/mail/static/src/components/activity/activity_tests.js +++ b/addons/mail/static/src/components/activity/activity_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import useStore from '@mail/component_hooks/use_store/use_store'; -import Activity from '@mail/components/activity/activity'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { Activity } from '@mail/components/activity/activity'; import { insert } from '@mail/model/model_field_command'; import { afterEach, @@ -15,6 +15,7 @@ import Bus from 'web.Bus'; import { date_to_str } from 'web.time'; const { Component, tags: { xml } } = owl; + const components = { Activity }; QUnit.module('mail', {}, function () { diff --git a/addons/mail/static/src/components/activity_box/activity_box.js b/addons/mail/static/src/components/activity_box/activity_box.js index 4a53e94fc6a..61e0081e832 100644 --- a/addons/mail/static/src/components/activity_box/activity_box.js +++ b/addons/mail/static/src/components/activity_box/activity_box.js @@ -1,14 +1,14 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import Activity from '@mail/components/activity/activity'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { Activity } from '@mail/components/activity/activity'; const { Component } = owl; const components = { Activity }; -class ActivityBox extends Component { +export class ActivityBox extends Component { /** * @override @@ -57,5 +57,3 @@ Object.assign(ActivityBox, { }, template: 'mail.ActivityBox', }); - -export default ActivityBox; diff --git a/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover.js b/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover.js index f2d65f5cfc7..7c0583f5ee5 100644 --- a/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover.js +++ b/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover.js @@ -1,12 +1,12 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; const { Component } = owl; const { useRef } = owl.hooks; -class ActivityMarkDonePopover extends Component { +export class ActivityMarkDonePopover extends Component { /** * @override @@ -115,5 +115,3 @@ Object.assign(ActivityMarkDonePopover, { }, template: 'mail.ActivityMarkDonePopover', }); - -export default ActivityMarkDonePopover; diff --git a/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover_tests.js b/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover_tests.js index f804c311d40..86eb5e4f314 100644 --- a/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover_tests.js +++ b/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover_tests.js @@ -1,7 +1,6 @@ /** @odoo-module **/ -import ActivityMarkDonePopover from '@mail/components/activity_mark_done_popover/activity_mark_done_popover'; - +import { ActivityMarkDonePopover } from '@mail/components/activity_mark_done_popover/activity_mark_done_popover'; import { insert } from '@mail/model/model_field_command'; import { afterEach, diff --git a/addons/mail/static/src/components/attachment/attachment.js b/addons/mail/static/src/components/attachment/attachment.js index 7d1947e5363..db8030e15e4 100644 --- a/addons/mail/static/src/components/attachment/attachment.js +++ b/addons/mail/static/src/components/attachment/attachment.js @@ -1,14 +1,14 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import AttachmentDeleteConfirmDialog from '@mail/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { AttachmentDeleteConfirmDialog } from '@mail/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog'; const { Component, useState } = owl; const components = { AttachmentDeleteConfirmDialog }; -class Attachment extends Component { +export class Attachment extends Component { /** * @override @@ -195,5 +195,3 @@ Object.assign(Attachment, { }, template: 'mail.Attachment', }); - -export default Attachment; diff --git a/addons/mail/static/src/components/attachment/attachment_tests.js b/addons/mail/static/src/components/attachment/attachment_tests.js index 8453ecd6b7f..038038cd326 100644 --- a/addons/mail/static/src/components/attachment/attachment_tests.js +++ b/addons/mail/static/src/components/attachment/attachment_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import Attachment from '@mail/components/attachment/attachment'; +import { Attachment } from '@mail/components/attachment/attachment'; import { afterEach, afterNextRender, diff --git a/addons/mail/static/src/components/attachment_box/attachment_box.js b/addons/mail/static/src/components/attachment_box/attachment_box.js index 9cae823d1ae..24630530706 100644 --- a/addons/mail/static/src/components/attachment_box/attachment_box.js +++ b/addons/mail/static/src/components/attachment_box/attachment_box.js @@ -1,19 +1,19 @@ /** @odoo-module **/ -import useDragVisibleDropZone from '@mail/component_hooks/use_drag_visible_dropzone/use_drag_visible_dropzone'; -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import AttachmentList from '@mail/components/attachment_list/attachment_list'; -import DropZone from '@mail/components/drop_zone/drop_zone'; -import FileUploader from '@mail/components/file_uploader/file_uploader'; +import { useDragVisibleDropZone } from '@mail/component_hooks/use_drag_visible_dropzone/use_drag_visible_dropzone'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { AttachmentList } from '@mail/components/attachment_list/attachment_list'; +import { DropZone } from '@mail/components/drop_zone/drop_zone'; +import { FileUploader } from '@mail/components/file_uploader/file_uploader'; import { link } from '@mail/model/model_field_command'; const { Component } = owl; const { useRef } = owl.hooks; -const components = {AttachmentList, DropZone, FileUploader}; +const components = { AttachmentList, DropZone, FileUploader }; -class AttachmentBox extends Component { +export class AttachmentBox extends Component { /** * @override @@ -118,6 +118,3 @@ Object.assign(AttachmentBox, { }, template: 'mail.AttachmentBox', }); - -export default AttachmentBox; - diff --git a/addons/mail/static/src/components/attachment_box/attachment_box_tests.js b/addons/mail/static/src/components/attachment_box/attachment_box_tests.js index 69fea0bcb00..c01ad0be99f 100644 --- a/addons/mail/static/src/components/attachment_box/attachment_box_tests.js +++ b/addons/mail/static/src/components/attachment_box/attachment_box_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import AttachmentBox from '@mail/components/attachment_box/attachment_box'; +import { AttachmentBox } from '@mail/components/attachment_box/attachment_box'; import { insert } from '@mail/model/model_field_command'; import { afterEach, diff --git a/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js b/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js index 9843cb9304f..c1a693e22a0 100644 --- a/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js +++ b/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js @@ -1,16 +1,16 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; -import Dialog from 'web.OwlDialog' +import Dialog from 'web.OwlDialog'; const { Component } = owl; const { useRef } = owl.hooks; const components = { Dialog }; -class AttachmentDeleteConfirmDialog extends Component { +export class AttachmentDeleteConfirmDialog extends Component { /** * @override @@ -85,5 +85,3 @@ Object.assign(AttachmentDeleteConfirmDialog, { }, template: 'mail.AttachmentDeleteConfirmDialog', }); - -export default AttachmentDeleteConfirmDialog; diff --git a/addons/mail/static/src/components/attachment_list/attachment_list.js b/addons/mail/static/src/components/attachment_list/attachment_list.js index 2ec82cf9687..3a26b044e86 100644 --- a/addons/mail/static/src/components/attachment_list/attachment_list.js +++ b/addons/mail/static/src/components/attachment_list/attachment_list.js @@ -1,14 +1,14 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import Attachment from '@mail/components/attachment/attachment'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { Attachment } from '@mail/components/attachment/attachment'; const { Component } = owl; const components = { Attachment }; -class AttachmentList extends Component { +export class AttachmentList extends Component { /** * @override @@ -111,5 +111,3 @@ Object.assign(AttachmentList, { }, template: 'mail.AttachmentList', }); - -export default AttachmentList; diff --git a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js index 769232a3d9d..e43cdf9c5fc 100644 --- a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js +++ b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import useRefs from '@mail/component_hooks/use_refs/use_refs'; -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; +import { useRefs } from '@mail/component_hooks/use_refs/use_refs'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; import { link } from '@mail/model/model_field_command'; import { hidePDFJSButtons } from '@web/legacy/js/libs/pdfjs'; @@ -14,7 +14,7 @@ const MIN_SCALE = 0.5; const SCROLL_ZOOM_STEP = 0.1; const ZOOM_STEP = 0.5; -class AttachmentViewer extends Component { +export class AttachmentViewer extends Component { /** * @override @@ -614,5 +614,3 @@ Object.assign(AttachmentViewer, { }); QWeb.registerComponent('AttachmentViewer', AttachmentViewer); - -export default AttachmentViewer; diff --git a/addons/mail/static/src/components/autocomplete_input/autocomplete_input.js b/addons/mail/static/src/components/autocomplete_input/autocomplete_input.js index 3030d511dbf..6b604de71a0 100644 --- a/addons/mail/static/src/components/autocomplete_input/autocomplete_input.js +++ b/addons/mail/static/src/components/autocomplete_input/autocomplete_input.js @@ -1,10 +1,10 @@ /** @odoo-module **/; -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; const { Component } = owl; -class AutocompleteInput extends Component { +export class AutocompleteInput extends Component { constructor(...args) { super(...args); @@ -167,5 +167,3 @@ Object.assign(AutocompleteInput, { }, template: 'mail.AutocompleteInput', }); - -export default AutocompleteInput; diff --git a/addons/mail/static/src/components/chat_window/chat_window.js b/addons/mail/static/src/components/chat_window/chat_window.js index 0e0f3d8a927..cbaa3a82918 100644 --- a/addons/mail/static/src/components/chat_window/chat_window.js +++ b/addons/mail/static/src/components/chat_window/chat_window.js @@ -1,11 +1,11 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import useUpdate from '@mail/component_hooks/use_update/use_update'; -import AutocompleteInput from '@mail/components/autocomplete_input/autocomplete_input'; -import ChatWindowHeader from '@mail/components/chat_window_header/chat_window_header'; -import ThreadView from '@mail/components/thread_view/thread_view'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { useUpdate } from '@mail/component_hooks/use_update/use_update'; +import { AutocompleteInput } from '@mail/components/autocomplete_input/autocomplete_input'; +import { ChatWindowHeader } from '@mail/components/chat_window_header/chat_window_header'; +import { ThreadView } from '@mail/components/thread_view/thread_view'; import { isEventHandled } from '@mail/utils/utils'; const { Component } = owl; @@ -13,7 +13,7 @@ const { useRef } = owl.hooks; const components = { AutocompleteInput, ChatWindowHeader, ThreadView }; -class ChatWindow extends Component { +export class ChatWindow extends Component { /** * @override @@ -354,5 +354,3 @@ Object.assign(ChatWindow, { }, template: 'mail.ChatWindow', }); - -export default ChatWindow; diff --git a/addons/mail/static/src/components/chat_window_header/chat_window_header.js b/addons/mail/static/src/components/chat_window_header/chat_window_header.js index 7fa43bd989a..8a2402aa2a6 100644 --- a/addons/mail/static/src/components/chat_window_header/chat_window_header.js +++ b/addons/mail/static/src/components/chat_window_header/chat_window_header.js @@ -1,18 +1,18 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; import { isEventHandled, markEventHandled, } from '@mail/utils/utils'; -import ThreadIcon from '@mail/components/thread_icon/thread_icon'; +import { ThreadIcon } from '@mail/components/thread_icon/thread_icon'; const { Component } = owl; const components = { ThreadIcon }; -class ChatWindowHeader extends Component { +export class ChatWindowHeader extends Component { /** * @override @@ -141,5 +141,3 @@ Object.assign(ChatWindowHeader, { }, template: 'mail.ChatWindowHeader', }); - -export default ChatWindowHeader; diff --git a/addons/mail/static/src/components/chat_window_hidden_menu/chat_window_hidden_menu.js b/addons/mail/static/src/components/chat_window_hidden_menu/chat_window_hidden_menu.js index 84114e4236e..253c9da22fa 100644 --- a/addons/mail/static/src/components/chat_window_hidden_menu/chat_window_hidden_menu.js +++ b/addons/mail/static/src/components/chat_window_hidden_menu/chat_window_hidden_menu.js @@ -1,14 +1,14 @@ /** @odoo-module **/ -import useStore from '@mail/component_hooks/use_store/use_store'; -import ChatWindowHeader from '@mail/components/chat_window_header/chat_window_header'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { ChatWindowHeader } from '@mail/components/chat_window_header/chat_window_header'; const { Component } = owl; const { useRef } = owl.hooks; const components = { ChatWindowHeader }; -class ChatWindowHiddenMenu extends Component { +export class ChatWindowHiddenMenu extends Component { /** * @override @@ -133,5 +133,3 @@ Object.assign(ChatWindowHiddenMenu, { props: {}, template: 'mail.ChatWindowHiddenMenu', }); - -export default ChatWindowHiddenMenu; diff --git a/addons/mail/static/src/components/chat_window_manager/chat_window_manager.js b/addons/mail/static/src/components/chat_window_manager/chat_window_manager.js index fb64dc5cc9b..0ca20fb03f7 100644 --- a/addons/mail/static/src/components/chat_window_manager/chat_window_manager.js +++ b/addons/mail/static/src/components/chat_window_manager/chat_window_manager.js @@ -1,15 +1,15 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import ChatWindow from '@mail/components/chat_window/chat_window'; -import ChatWindowHiddenMenu from '@mail/components/chat_window_hidden_menu/chat_window_hidden_menu'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { ChatWindow } from '@mail/components/chat_window/chat_window'; +import { ChatWindowHiddenMenu } from '@mail/components/chat_window_hidden_menu/chat_window_hidden_menu'; const { Component } = owl; const components = { ChatWindow, ChatWindowHiddenMenu }; -class ChatWindowManager extends Component { +export class ChatWindowManager extends Component { /** * @override @@ -44,5 +44,3 @@ Object.assign(ChatWindowManager, { props: {}, template: 'mail.ChatWindowManager', }); - -export default ChatWindowManager; diff --git a/addons/mail/static/src/components/chatter/chatter.js b/addons/mail/static/src/components/chatter/chatter.js index 2a2b3a723f8..c006b56cd56 100644 --- a/addons/mail/static/src/components/chatter/chatter.js +++ b/addons/mail/static/src/components/chatter/chatter.js @@ -1,13 +1,13 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import useUpdate from '@mail/component_hooks/use_update/use_update'; -import ActivityBox from '@mail/components/activity_box/activity_box'; -import AttachmentBox from '@mail/components/attachment_box/attachment_box'; -import ChatterTopbar from '@mail/components/chatter_topbar/chatter_topbar'; -import Composer from '@mail/components/composer/composer'; -import ThreadView from '@mail/components/thread_view/thread_view'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { useUpdate } from '@mail/component_hooks/use_update/use_update'; +import { ActivityBox } from '@mail/components/activity_box/activity_box'; +import { AttachmentBox } from '@mail/components/attachment_box/attachment_box'; +import { ChatterTopbar } from '@mail/components/chatter_topbar/chatter_topbar'; +import { Composer } from '@mail/components/composer/composer'; +import { ThreadView } from '@mail/components/thread_view/thread_view'; const { Component } = owl; const { useRef } = owl.hooks; @@ -20,7 +20,7 @@ const components = { ThreadView, }; -class Chatter extends Component { +export class Chatter extends Component { /** * @override @@ -149,5 +149,3 @@ Object.assign(Chatter, { }, template: 'mail.Chatter', }); - -export default Chatter; diff --git a/addons/mail/static/src/components/chatter/chatter_suggested_recipient_tests.js b/addons/mail/static/src/components/chatter/chatter_suggested_recipient_tests.js index f6e697fc502..53986c7f096 100644 --- a/addons/mail/static/src/components/chatter/chatter_suggested_recipient_tests.js +++ b/addons/mail/static/src/components/chatter/chatter_suggested_recipient_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import Chatter from '@mail/components/chatter/chatter'; -import Composer from '@mail/components/composer/composer'; +import { Chatter } from '@mail/components/chatter/chatter'; +import { Composer } from '@mail/components/composer/composer'; import { afterEach, afterNextRender, diff --git a/addons/mail/static/src/components/chatter/chatter_tests.js b/addons/mail/static/src/components/chatter/chatter_tests.js index 6d30aae991f..7507a0dbecf 100644 --- a/addons/mail/static/src/components/chatter/chatter_tests.js +++ b/addons/mail/static/src/components/chatter/chatter_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import Chatter from '@mail/components/chatter/chatter'; -import Composer from '@mail/components/composer/composer'; +import { Chatter } from '@mail/components/chatter/chatter'; +import { Composer } from '@mail/components/composer/composer'; import { afterEach, afterNextRender, diff --git a/addons/mail/static/src/components/chatter_container/chatter_container.js b/addons/mail/static/src/components/chatter_container/chatter_container.js index c292e19c708..23bd34d27a2 100644 --- a/addons/mail/static/src/components/chatter_container/chatter_container.js +++ b/addons/mail/static/src/components/chatter_container/chatter_container.js @@ -1,9 +1,9 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import useUpdate from '@mail/component_hooks/use_update/use_update'; -import Chatter from '@mail/components/chatter/chatter'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { useUpdate } from '@mail/component_hooks/use_update/use_update'; +import { Chatter } from '@mail/components/chatter/chatter'; import { clear } from '@mail/model/model_field_command'; const { Component } = owl; @@ -18,7 +18,7 @@ const components = { Chatter }; * may attempt to create a chatter before messaging has been initialized, so * this component delays the mounting of chatter until it becomes initialized. */ -class ChatterContainer extends Component { +export class ChatterContainer extends Component { /** * @override @@ -131,6 +131,3 @@ Object.assign(ChatterContainer, { }, template: 'mail.ChatterContainer', }); - - -export default ChatterContainer; diff --git a/addons/mail/static/src/components/chatter_topbar/chatter_topbar.js b/addons/mail/static/src/components/chatter_topbar/chatter_topbar.js index 9f02300d288..994ea3eb359 100644 --- a/addons/mail/static/src/components/chatter_topbar/chatter_topbar.js +++ b/addons/mail/static/src/components/chatter_topbar/chatter_topbar.js @@ -1,15 +1,15 @@ /** @odoo-module **/ -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import FollowButton from '@mail/components/follow_button/follow_button'; -import FollowerListMenu from '@mail/components/follower_list_menu/follower_list_menu'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { FollowButton } from '@mail/components/follow_button/follow_button'; +import { FollowerListMenu } from '@mail/components/follower_list_menu/follower_list_menu'; const { Component } = owl; const components = { FollowButton, FollowerListMenu }; -class ChatterTopbar extends Component { +export class ChatterTopbar extends Component { /** * @override @@ -130,5 +130,3 @@ Object.assign(ChatterTopbar, { }, template: 'mail.ChatterTopbar', }); - -export default ChatterTopbar; diff --git a/addons/mail/static/src/components/chatter_topbar/chatter_topbar_tests.js b/addons/mail/static/src/components/chatter_topbar/chatter_topbar_tests.js index f189289d962..e7700e7c77c 100644 --- a/addons/mail/static/src/components/chatter_topbar/chatter_topbar_tests.js +++ b/addons/mail/static/src/components/chatter_topbar/chatter_topbar_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import ChatterTopBar from '@mail/components/chatter_topbar/chatter_topbar'; +import { ChatterTopbar } from '@mail/components/chatter_topbar/chatter_topbar'; import { afterEach, afterNextRender, @@ -11,7 +11,7 @@ import { import { makeTestPromise } from 'web.test_utils'; -const components = { ChatterTopBar }; +const components = { ChatterTopbar }; QUnit.module('mail', {}, function () { QUnit.module('components', {}, function () { @@ -22,7 +22,7 @@ QUnit.module('chatter_topbar_tests.js', { this.createChatterTopbarComponent = async (chatter, otherProps) => { const props = Object.assign({ chatterLocalId: chatter.localId }, otherProps); - await createRootComponent(this, components.ChatterTopBar, { + await createRootComponent(this, components.ChatterTopbar, { props, target: this.widget.el, }); diff --git a/addons/mail/static/src/components/composer/composer.js b/addons/mail/static/src/components/composer/composer.js index 153b0108ed8..09d91c5698e 100644 --- a/addons/mail/static/src/components/composer/composer.js +++ b/addons/mail/static/src/components/composer/composer.js @@ -1,16 +1,16 @@ /** @odoo-module **/ -import useDragVisibleDropZone from '@mail/component_hooks/use_drag_visible_dropzone/use_drag_visible_dropzone'; -import useShouldUpdateBasedOnProps from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; -import useStore from '@mail/component_hooks/use_store/use_store'; -import useUpdate from '@mail/component_hooks/use_update/use_update'; -import AttachmentList from '@mail/components/attachment_list/attachment_list'; -import ComposerSuggestedRecipientList from '@mail/components/composer_suggested_recipient_list/composer_suggested_recipient_list'; -import DropZone from '@mail/components/drop_zone/drop_zone'; -import EmojisPopover from '@mail/components/emojis_popover/emojis_popover'; -import FileUploader from '@mail/components/file_uploader/file_uploader'; -import TextInput from '@mail/components/composer_text_input/composer_text_input'; -import ThreadTextualTypingStatus from '@mail/components/thread_textual_typing_status/thread_textual_typing_status'; +import { useDragVisibleDropZone } from '@mail/component_hooks/use_drag_visible_dropzone/use_drag_visible_dropzone'; +import { useShouldUpdateBasedOnProps } from '@mail/component_hooks/use_should_update_based_on_props/use_should_update_based_on_props'; +import { useStore } from '@mail/component_hooks/use_store/use_store'; +import { useUpdate } from '@mail/component_hooks/use_update/use_update'; +import { AttachmentList } from '@mail/components/attachment_list/attachment_list'; +import { ComposerSuggestedRecipientList } from '@mail/components/composer_suggested_recipient_list/composer_suggested_recipient_list'; +import { ComposerTextInput } from '@mail/components/composer_text_input/composer_text_input'; +import { DropZone } from '@mail/components/drop_zone/drop_zone'; +import { EmojisPopover } from '@mail/components/emojis_popover/emojis_popover'; +import { FileUploader } from '@mail/components/file_uploader/file_uploader'; +import { ThreadTextualTypingStatus } from '@mail/components/thread_textual_typing_status/thread_textual_typing_status'; import { replace } from '@mail/model/model_field_command'; import { isEventHandled, @@ -23,14 +23,14 @@ const { useRef } = owl.hooks; const components = { AttachmentList, ComposerSuggestedRecipientList, + ComposerTextInput, DropZone, EmojisPopover, FileUploader, - TextInput, ThreadTextualTypingStatus, }; -class Composer extends Component { +export class Composer extends Component { /** * @override @@ -446,5 +446,3 @@ Object.assign(Composer, { }, template: 'mail.Composer', }); - -export default Composer; diff --git a/addons/mail/static/src/components/composer/composer.xml b/addons/mail/static/src/components/composer/composer.xml index cc7038d3a92..04a4e63e32c 100644 --- a/addons/mail/static/src/components/composer/composer.xml +++ b/addons/mail/static/src/components/composer/composer.xml @@ -69,7 +69,7 @@ 'o-composer-is-extended': composer.thread and composer.thread.mass_mailing, }" > - SystrayMenuItem.prototype.name === 'activity_menu'); if (activityMenuIndex > 0) { - SystrayMenu.Items.splice(activityMenuIndex, 0, MessagingMenu); + SystrayMenu.Items.splice(activityMenuIndex, 0, MessagingMenuWidget); } else { - SystrayMenu.Items.push(MessagingMenu); + SystrayMenu.Items.push(MessagingMenuWidget); } -export default MessagingMenu; +export default MessagingMenuWidget; diff --git a/addons/mail/static/src/widgets/notification_alert/notification_alert.js b/addons/mail/static/src/widgets/notification_alert/notification_alert.js index df125c2f3b5..5fdbbd970a3 100644 --- a/addons/mail/static/src/widgets/notification_alert/notification_alert.js +++ b/addons/mail/static/src/widgets/notification_alert/notification_alert.js @@ -1,19 +1,19 @@ /** @odoo-module **/ -import NotificationAlertComponent from '@mail/components/notification_alert/notification_alert'; +import { NotificationAlert } from '@mail/components/notification_alert/notification_alert'; import { ComponentWrapper, WidgetAdapterMixin } from 'web.OwlCompatibility'; import Widget from 'web.Widget'; import widgetRegistry from 'web.widget_registry'; -const components = { NotificationAlertComponent }; +const components = { NotificationAlert }; class NotificationAlertWrapper extends ComponentWrapper {} // ----------------------------------------------------------------------------- // Display Notification alert on user preferences form view // ----------------------------------------------------------------------------- -const NotificationAlert = Widget.extend(WidgetAdapterMixin, { +const NotificationAlertWidget = Widget.extend(WidgetAdapterMixin, { /** * @override */ @@ -29,13 +29,13 @@ const NotificationAlert = Widget.extend(WidgetAdapterMixin, { this.component = new NotificationAlertWrapper( this, - components.NotificationAlertComponent, + components.NotificationAlert, {} ); await this.component.mount(this.el); }, }); -widgetRegistry.add('notification_alert', NotificationAlert); +widgetRegistry.add('notification_alert', NotificationAlertWidget); -export default NotificationAlert; +export default NotificationAlertWidget; diff --git a/addons/mail/static/tests/helpers/mock_models.js b/addons/mail/static/tests/helpers/mock_models.js index 28f9b30f6ce..bed58a9ec65 100644 --- a/addons/mail/static/tests/helpers/mock_models.js +++ b/addons/mail/static/tests/helpers/mock_models.js @@ -6,7 +6,7 @@ * data object is generated every time to ensure any test can modify it without * impacting other tests. */ -class MockModels { +export class MockModels { //-------------------------------------------------------------------------- // Public @@ -249,5 +249,3 @@ class MockModels { } } - -export default MockModels; diff --git a/addons/sms/static/src/components/message/message_tests.js b/addons/sms/static/src/components/message/message_tests.js index c3927e37caa..d0e3759568a 100644 --- a/addons/sms/static/src/components/message/message_tests.js +++ b/addons/sms/static/src/components/message/message_tests.js @@ -1,9 +1,7 @@ odoo.define('sms/static/src/components/message/message_tests.js', function (require) { 'use strict'; -const components = { - Message: require('@mail/components/message/message')[Symbol.for("default")], -}; +const { Message } = require('@mail/components/message/message'); const { create, insert, link } = require('@mail/model/model_field_command'); const { makeDeferred } = require('@mail/utils/deferred/deferred'); const { @@ -16,6 +14,8 @@ const { const Bus = require('web.Bus'); +const components = { Message }; + QUnit.module('sms', {}, function () { QUnit.module('components', {}, function () { QUnit.module('message', {}, function () { diff --git a/addons/sms/static/src/components/notification_group/notification_group.js b/addons/sms/static/src/components/notification_group/notification_group.js index d82ef7a6894..6ada2503b0a 100644 --- a/addons/sms/static/src/components/notification_group/notification_group.js +++ b/addons/sms/static/src/components/notification_group/notification_group.js @@ -1,12 +1,12 @@ odoo.define('sms/static/src/components/notification_group/notification_group.js', function (require) { 'use strict'; -const components = { - NotificationGroup: require('@mail/components/notification_group/notification_group')[Symbol.for("default")], -}; +const { NotificationGroup } = require('@mail/components/notification_group/notification_group'); const { patch } = require('web.utils'); +const components = { NotificationGroup }; + patch(components.NotificationGroup.prototype, 'sms/static/src/components/notification_group/notification_group.js', { //-------------------------------------------------------------------------- diff --git a/addons/sms/static/src/components/notification_list/notification_list_notification_group_tests.js b/addons/sms/static/src/components/notification_list/notification_list_notification_group_tests.js index fbaf258a150..7280ffb361a 100644 --- a/addons/sms/static/src/components/notification_list/notification_list_notification_group_tests.js +++ b/addons/sms/static/src/components/notification_list/notification_list_notification_group_tests.js @@ -1,10 +1,7 @@ odoo.define('sms/static/src/components/notification_list/notification_list_notification_group_tests.js', function (require) { 'use strict'; -const components = { - NotificationList: require('@mail/components/notification_list/notification_list')[Symbol.for("default")], -}; - +const { NotificationList } = require('@mail/components/notification_list/notification_list'); const { afterEach, beforeEach, @@ -14,6 +11,8 @@ const { const Bus = require('web.Bus'); +const components = { NotificationList }; + QUnit.module('sms', {}, function () { QUnit.module('components', {}, function () { QUnit.module('notification_list', {}, function () { diff --git a/addons/snailmail/static/src/components/message/message.js b/addons/snailmail/static/src/components/message/message.js index b80759d25ec..fbf007dbeb7 100644 --- a/addons/snailmail/static/src/components/message/message.js +++ b/addons/snailmail/static/src/components/message/message.js @@ -1,8 +1,10 @@ odoo.define('snailmail/static/src/components/message/message.js', function (require) { 'use strict'; +const { Message } = require('@mail/components/message/message'); + const components = { - Message: require('@mail/components/message/message')[Symbol.for("default")], + Message, SnailmailErrorDialog: require('snailmail/static/src/components/snailmail_error_dialog/snailmail_error_dialog.js'), SnailmailNotificationPopover: require('snailmail/static/src/components/snailmail_notification_popover/snailmail_notification_popover.js'), }; diff --git a/addons/snailmail/static/src/components/message/message_tests.js b/addons/snailmail/static/src/components/message/message_tests.js index 8f5ebceec6e..6cd938e0794 100644 --- a/addons/snailmail/static/src/components/message/message_tests.js +++ b/addons/snailmail/static/src/components/message/message_tests.js @@ -1,9 +1,7 @@ odoo.define('snailmail/static/src/components/message/message_tests.js', function (require) { 'use strict'; -const components = { - Message: require('@mail/components/message/message')[Symbol.for("default")], -}; +const { Message } = require('@mail/components/message/message'); const { create, insert, link } = require('@mail/model/model_field_command'); const { afterEach, @@ -15,6 +13,8 @@ const { const Bus = require('web.Bus'); +const components = { Message }; + QUnit.module('snailmail', {}, function () { QUnit.module('components', {}, function () { QUnit.module('message', {}, function () { diff --git a/addons/snailmail/static/src/components/notification_group/notification_group.js b/addons/snailmail/static/src/components/notification_group/notification_group.js index 0d8f31e16d2..fcab2597fc6 100644 --- a/addons/snailmail/static/src/components/notification_group/notification_group.js +++ b/addons/snailmail/static/src/components/notification_group/notification_group.js @@ -1,12 +1,12 @@ odoo.define('snailmail/static/src/components/notification_group/notification_group.js', function (require) { 'use strict'; -const components = { - NotificationGroup: require('@mail/components/notification_group/notification_group')[Symbol.for("default")], -}; +const { NotificationGroup } = require('@mail/components/notification_group/notification_group'); const { patch } = require('web.utils'); +const components = { NotificationGroup }; + patch(components.NotificationGroup.prototype, 'snailmail/static/src/components/notification_group/notification_group.js', { //-------------------------------------------------------------------------- diff --git a/addons/snailmail/static/src/components/notification_list/notification_list_notification_group_tests.js b/addons/snailmail/static/src/components/notification_list/notification_list_notification_group_tests.js index 8b562bfedd7..35e926ab608 100644 --- a/addons/snailmail/static/src/components/notification_list/notification_list_notification_group_tests.js +++ b/addons/snailmail/static/src/components/notification_list/notification_list_notification_group_tests.js @@ -1,10 +1,7 @@ odoo.define('snailmail/static/src/components/notification_list/notification_list_notification_group_tests.js', function (require) { 'use strict'; -const components = { - NotificationList: require('@mail/components/notification_list/notification_list')[Symbol.for("default")], -}; - +const { NotificationList } = require('@mail/components/notification_list/notification_list'); const { afterEach, beforeEach, @@ -14,6 +11,8 @@ const { const Bus = require('web.Bus'); +const components = { NotificationList }; + QUnit.module('snailmail', {}, function () { QUnit.module('components', {}, function () { QUnit.module('notification_list', {}, function () { diff --git a/addons/snailmail/static/src/components/snailmail_error_dialog/snailmail_error_dialog.js b/addons/snailmail/static/src/components/snailmail_error_dialog/snailmail_error_dialog.js index 205b12d5d88..b2b623b68aa 100644 --- a/addons/snailmail/static/src/components/snailmail_error_dialog/snailmail_error_dialog.js +++ b/addons/snailmail/static/src/components/snailmail_error_dialog/snailmail_error_dialog.js @@ -1,7 +1,7 @@ odoo.define('snailmail/static/src/components/snailmail_error_dialog/snailmail_error_dialog.js', function (require) { 'use strict'; -const useStore = require('@mail/component_hooks/use_store/use_store')[Symbol.for("default")]; +const { useStore } = require('@mail/component_hooks/use_store/use_store'); const Dialog = require('web.OwlDialog'); diff --git a/addons/snailmail/static/src/components/snailmail_notification_popover/snailmail_notification_popover.js b/addons/snailmail/static/src/components/snailmail_notification_popover/snailmail_notification_popover.js index af3b033da1c..e481aa83ba2 100644 --- a/addons/snailmail/static/src/components/snailmail_notification_popover/snailmail_notification_popover.js +++ b/addons/snailmail/static/src/components/snailmail_notification_popover/snailmail_notification_popover.js @@ -2,7 +2,7 @@ odoo.define('snailmail/static/src/components/snailmail_notification_popover/snai 'use strict'; const { Component } = owl; -const useStore = require('@mail/component_hooks/use_store/use_store')[Symbol.for("default")]; +const { useStore } = require('@mail/component_hooks/use_store/use_store'); class SnailmailNotificationPopover extends Component { diff --git a/addons/snailmail/static/tests/helpers/mock_models.js b/addons/snailmail/static/tests/helpers/mock_models.js index 0f9f8fa8bc8..643062f9443 100644 --- a/addons/snailmail/static/tests/helpers/mock_models.js +++ b/addons/snailmail/static/tests/helpers/mock_models.js @@ -1,8 +1,7 @@ -odoo.define('snailmail/static/tests/helpers/mock_models.js', function (require) { -'use strict'; +/** @odoo-module **/ -const MockModels = require('@mail/../tests/helpers/mock_models')[Symbol.for("default")]; -const { patch } = require('web.utils'); +import { MockModels } from '@mail/../tests/helpers/mock_models'; +import { patch } from 'web.utils'; patch(MockModels, 'snailmail/static/tests/helpers/mock_models.js', { @@ -27,5 +26,3 @@ patch(MockModels, 'snailmail/static/tests/helpers/mock_models.js', { }, }); - -}); diff --git a/addons/website_livechat/static/src/components/discuss/discuss.js b/addons/website_livechat/static/src/components/discuss/discuss.js index b98f5dbdf2f..789267d6b0b 100644 --- a/addons/website_livechat/static/src/components/discuss/discuss.js +++ b/addons/website_livechat/static/src/components/discuss/discuss.js @@ -1,8 +1,10 @@ odoo.define('website_livechat/static/src/components/discuss/discuss.js', function (require) { 'use strict'; +const { Discuss } = require('@mail/components/discuss/discuss'); + const components = { - Discuss: require('@mail/components/discuss/discuss')[Symbol.for("default")], + Discuss, VisitorBanner: require('website_livechat/static/src/components/visitor_banner/visitor_banner.js'), }; const { patch } = require('web.utils'); diff --git a/addons/website_livechat/static/src/components/visitor_banner/visitor_banner.js b/addons/website_livechat/static/src/components/visitor_banner/visitor_banner.js index 24bf9caf2f3..c7497b76871 100644 --- a/addons/website_livechat/static/src/components/visitor_banner/visitor_banner.js +++ b/addons/website_livechat/static/src/components/visitor_banner/visitor_banner.js @@ -1,7 +1,7 @@ odoo.define('website_livechat/static/src/components/visitor_banner/visitor_banner.js', function (require) { 'use strict'; -const useStore = require('@mail/component_hooks/use_store/use_store')[Symbol.for("default")]; +const { useStore } = require('@mail/component_hooks/use_store/use_store'); const { Component } = owl; diff --git a/addons/website_livechat/static/tests/helpers/mock_models.js b/addons/website_livechat/static/tests/helpers/mock_models.js index 5f47b92ab29..fff3bd2da4d 100644 --- a/addons/website_livechat/static/tests/helpers/mock_models.js +++ b/addons/website_livechat/static/tests/helpers/mock_models.js @@ -1,7 +1,7 @@ odoo.define('website_livechat/static/tests/helpers/mock_models.js', function (require) { 'use strict'; -const MockModels = require('@mail/../tests/helpers/mock_models')[Symbol.for("default")]; +const { MockModels } = require('@mail/../tests/helpers/mock_models'); const { patch } = require('web.utils'); patch(MockModels, 'website_livechat/static/tests/helpers/mock_models.js', { diff --git a/addons/website_slides/static/src/components/activity/activity.js b/addons/website_slides/static/src/components/activity/activity.js index acc0b1bd6ef..0a09e358d13 100644 --- a/addons/website_slides/static/src/components/activity/activity.js +++ b/addons/website_slides/static/src/components/activity/activity.js @@ -1,11 +1,12 @@ odoo.define('website_slides/static/src/components/activity/activity.js', function (require) { 'use strict'; -const components = { - Activity: require('@mail/components/activity/activity')[Symbol.for("default")], -}; +const { Activity } = require('@mail/components/activity/activity'); + const { patch } = require('web.utils'); +const components = { Activity }; + patch(components.Activity.prototype, 'website_slides/static/src/components/activity/activity.js', { //-------------------------------------------------------------------------- diff --git a/addons/website_slides/static/src/components/activity/activity_tests.js b/addons/website_slides/static/src/components/activity/activity_tests.js index 3b8b39639f4..fa9defc9589 100644 --- a/addons/website_slides/static/src/components/activity/activity_tests.js +++ b/addons/website_slides/static/src/components/activity/activity_tests.js @@ -1,9 +1,7 @@ odoo.define('website_slides/static/src/tests/activity_tests.js', function (require) { 'use strict'; -const components = { - Activity: require('@mail/components/activity/activity')[Symbol.for("default")], -}; +const { Activity } = require('@mail/components/activity/activity'); const { insert } = require('@mail/model/model_field_command'); const { afterEach, @@ -12,6 +10,8 @@ const { start, } = require('@mail/utils/test_utils'); +const components = { Activity }; + QUnit.module('website_slides', {}, function () { QUnit.module('components', {}, function () { QUnit.module('activity', {}, function () {