From 9dba4e0d77187f0158243d314057f7aa3a19b543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Thu, 8 Jun 2023 16:51:40 +0000 Subject: [PATCH] [REF] mail, *: reorganize JS files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove "fake" feature sub-folders that make files harder to find. Note: If there are too many files in the main folder now, a new split that actually makes sense can be done at a later time: this would not just be code move, but removing coupling between said feature and the rest of the code. Apply consistent structure, where the top level folder is a feature (or core), and sub-folders are subdivision of the feature depending on context (closely related to assets bundles). ``` - core - common - public - web - feature - common - public - web ``` The opportunity is taken to reorganize the top of the files and imports: - Always use absolute path in imports to be able to find all usages of a file with a single search. - Reorganize imports to group them by module, and to sort them alphabetically by path/feature. - Always use single asterisk (*) for `odoo-module`: less characters yay! And double asterisk should be used for JSDoc comments, not for custom instructions. Part of task-3265211 closes odoo/odoo#124168 Related: odoo/enterprise#42121 Signed-off-by: Sébastien Theys (seb) --- .../activity_list_popover_item_patch.js | 2 +- .../src/activity/activity_menu_patch.js | 2 +- .../static/src/activity/activity_patch.js | 2 +- .../src/activity/activity_service_patch.js | 2 +- addons/crm/static/src/activity_menu_patch.js | 2 +- .../components/employee_chat/employee_chat.js | 2 +- .../hr/static/src/js/m2x_avatar_employee.js | 2 +- .../hr/static/src/messaging_service_patch.js | 2 +- addons/hr/static/src/thread_service_patch.js | 4 +- .../many2many_avatar_employee_field.js | 2 +- .../many2one_avatar_employee_field.js | 2 +- addons/hr/static/src/views/form_view.js | 2 +- addons/hr/static/src/views/open_chat_hook.js | 2 +- .../static/src/persona_service_patch.js | 2 +- addons/hr_holidays/static/src/thread_patch.js | 2 +- addons/im_livechat/__manifest__.py | 16 +-- .../src/chat_window/chat_window_patch.js | 5 +- .../src/composer/channel_commands_patch.js | 2 +- .../static/src/composer/composer_patch.js | 5 +- .../src/composer/suggestion_service_patch.js | 7 +- .../src/core/messaging_service_patch.js | 7 +- .../static/src/core/store_service_patch.js | 5 +- .../static/src/core/thread_model_patch.js | 7 +- .../static/src/core/thread_service_patch.js | 11 +- .../static/src/discuss_app/sidebar_patch.js | 5 +- .../static/src/embed/boot_helpers.js | 2 +- .../embed/chat_window/chat_window_patch.js | 15 ++- .../static/src/embed/chatbot/chatbot_model.js | 6 +- .../src/embed/chatbot/chatbot_service.js | 14 +-- .../src/embed/chatbot/chatbot_step_model.js | 2 +- .../src/embed/core/autopopup_service.js | 6 +- .../static/src/embed/core/composer_patch.js | 8 +- .../src/embed/core/disabled_features.js | 15 +-- .../static/src/embed/core/livechat_service.js | 12 +- .../src/embed/core/message_model_patch.js | 6 +- .../src/embed/core/message_service_patch.js | 8 +- .../src/embed/core/messaging_service_patch.js | 5 +- .../src/embed/core/thread_model_patch.js | 7 +- .../src/embed/core/thread_service_patch.js | 15 ++- .../src/embed/core_ui/livechat_button.js | 9 +- .../static/src/embed/core_ui/message_patch.js | 5 +- .../static/src/embed/core_ui/thread_patch.js | 4 +- .../static/src/embed/external/boot.js | 11 +- .../external/bus_parameters_service_patch.js | 2 +- .../src/embed/external/emoji_loader_patch.js | 6 +- .../embed/feedback_panel/feedback_panel.js | 10 +- .../embed/feedback_panel/transcript_sender.js | 8 +- .../static/src/embed/frontend/boot_service.js | 4 +- .../src/embed/frontend/livechat_root.js | 6 +- .../static/src/embed/livechat_data.js | 2 +- .../static/src/js/ajax_external.js | 2 +- .../colors_reset_button.js | 2 +- .../im_livechat_chatbot_script_answers_m2m.js | 2 +- .../js/im_livechat_chatbot_steps_one2many.js | 4 +- .../messaging_menu/messaging_menu_patch.js | 5 +- .../static/src/web/message_patch.js | 5 +- .../static/tests/chat_window_patch_tests.js | 2 +- .../static/tests/composer_patch_tests.js | 6 +- .../static/tests/discuss_patch_tests.js | 2 +- .../static/tests/embed/autopopup_tests.js | 2 +- .../tests/embed/feedback_panel_tests.js | 9 +- .../static/tests/embed/helper/test_utils.js | 8 +- .../tests/embed/livechat_button_tests.js | 9 +- .../tests/embed/livechat_service_tests.js | 6 +- .../tests/embed/livechat_session_tests.js | 5 +- .../tests/embed/model_definitions_setup.js | 2 +- .../tests/embed/transcript_sender_tests.js | 7 +- .../tests/embed/unread_messages_tests.js | 4 +- .../helpers/mock_server/controllers/main.js | 2 +- .../mock_server/models/discuss_channel.js | 2 +- .../models/discuss_channel_member.js | 2 +- .../mock_server/models/im_livechat_channel.js | 2 +- .../helpers/mock_server/models/res_partner.js | 2 +- .../tests/helpers/model_definitions_setup.js | 2 +- .../tests/messaging_menu_patch_tests.js | 2 +- .../tests/messaging_service_patch_tests.js | 4 +- .../mobile_messaging_menu_patch_tests.js | 2 +- .../static/tests/sidebar_patch_tests.js | 8 +- .../static/tests/thread_icon_patch_tests.js | 2 +- .../im_livechat_channel_creation_tour.js | 2 +- ...im_livechat_chatbot_steps_sequence_tour.js | 3 +- addons/mail/__manifest__.py | 37 +++--- .../common}/attachment_list.js | 21 ++-- .../common}/attachment_list.scss | 0 .../common}/attachment_list.xml | 0 .../common}/attachment_model.js | 11 +- .../common}/attachment_service.js | 11 +- .../common}/attachment_uploader_hook.js | 15 +-- .../common}/attachment_view.js | 4 +- .../common}/attachment_view.scss | 0 .../common}/attachment_view.xml | 0 .../common}/autoresize_input.js | 4 +- .../common}/autoresize_input.scss | 0 .../common}/autoresize_input.xml | 0 .../{ => common}/canned_response_model.js | 0 .../core/{ => common}/channel_member_model.js | 4 +- .../{ => common}/channel_member_service.js | 7 +- .../common}/channel_selector.js | 18 +-- .../common}/channel_selector.scss | 0 .../common}/channel_selector.xml | 0 .../common}/chat_window.js | 34 +++--- .../common}/chat_window.scss | 0 .../common}/chat_window.xml | 0 .../common}/chat_window_container.js | 8 +- .../common}/chat_window_container.scss | 0 .../common}/chat_window_container.xml | 0 .../common}/chat_window_model.js | 10 +- .../common}/chat_window_service.js | 9 +- .../src/{composer => core/common}/composer.js | 40 +++--- .../{composer => core/common}/composer.scss | 0 .../{composer => core/common}/composer.xml | 0 .../common}/composer_model.js | 8 +- .../src/{core_ui => core/common}/core.scss | 0 .../{discuss_app => core/common}/discuss.js | 26 ++-- .../{discuss_app => core/common}/discuss.scss | 0 .../{discuss_app => core/common}/discuss.xml | 0 .../src/{dropzone => core/common}/dropzone.js | 2 +- .../{dropzone => core/common}/dropzone.scss | 0 .../{dropzone => core/common}/dropzone.xml | 0 .../common}/dropzone_hook.js | 6 +- .../common}/emoji_data.js | 0 .../common}/emoji_picker.js | 13 +- .../common}/emoji_picker.scss | 0 .../common}/emoji_picker.xml | 0 .../src/core/{ => common}/follower_model.js | 10 +- .../{discuss_app => core/common}/im_status.js | 0 .../common}/im_status.scss | 0 .../common}/im_status.xml | 0 .../common}/link_preview.js | 8 +- .../common}/link_preview.scss | 0 .../common}/link_preview.xml | 0 .../common}/link_preview_confirm_delete.js | 5 +- .../common}/link_preview_confirm_delete.xml | 0 .../common}/link_preview_list.js | 5 +- .../common}/link_preview_list.xml | 0 .../core/{ => common}/link_preview_model.js | 0 .../src/{core_ui => core/common}/message.js | 52 ++++---- .../src/{core_ui => core/common}/message.scss | 0 .../src/{core_ui => core/common}/message.xml | 0 .../common}/message_confirm_dialog.js | 4 +- .../common}/message_confirm_dialog.xml | 0 .../common}/message_in_reply.js | 6 +- .../common}/message_in_reply.scss | 0 .../common}/message_in_reply.xml | 0 .../src/core/{ => common}/message_model.js | 16 +-- .../common}/message_notification_popover.js | 0 .../common}/message_notification_popover.xml | 0 .../common}/message_reaction_menu.js | 22 ++-- .../common}/message_reaction_menu.scss | 0 .../common}/message_reaction_menu.xml | 0 .../common}/message_reactions.js | 8 +- .../common}/message_reactions.scss | 0 .../common}/message_reactions.xml | 0 .../{ => common}/message_reactions_model.js | 12 +- .../common}/message_seen_indicator.js | 7 +- .../common}/message_seen_indicator.scss | 0 .../common}/message_seen_indicator.xml | 0 .../src/core/{ => common}/message_service.js | 27 ++-- .../src/core/{ => common}/messaging_hook.js | 5 +- .../core/{ => common}/messaging_service.js | 32 ++--- .../common}/navigable_list.js | 14 ++- .../common}/navigable_list.scss | 0 .../common}/navigable_list.xml | 0 .../{ => common}/notification_group_model.js | 6 +- .../core/{ => common}/notification_model.js | 4 +- .../notification_permission_service.js | 2 +- .../core/{ => common}/out_of_focus_service.js | 3 +- .../src/core/{ => common}/persona_model.js | 2 +- .../src/core/{ => common}/persona_service.js | 13 +- .../common}/primary_variables.scss | 0 .../{core_ui => core/common}/relative_time.js | 3 +- .../{ => common}/scroll_position_model.js | 2 +- .../{ => common}/sound_effects_service.js | 4 +- .../src/core/{ => common}/store_service.js | 36 +++--- .../common}/suggestion_hook.js | 3 +- .../common}/suggestion_service.js | 19 +-- .../src/{core_ui => core/common}/thread.js | 20 +-- .../src/{core_ui => core/common}/thread.scss | 0 .../src/{core_ui => core/common}/thread.xml | 0 .../src/core/{ => common}/thread_actions.js | 1 + .../common}/thread_icon.js | 7 +- .../common}/thread_icon.xml | 0 .../src/core/{ => common}/thread_model.js | 38 +++--- .../src/core/{ => common}/thread_service.js | 50 ++++---- .../{ => common}/user_settings_service.js | 2 +- .../mail/static/src/{ => core}/public/boot.js | 12 +- .../src/{ => core}/public/context_service.js | 2 +- .../src/{ => core}/public/discuss_public.js | 10 +- .../src/{ => core}/public/discuss_public.xml | 0 .../src/{ => core}/public/root_widget.js | 8 +- .../src/{ => core}/public/welcome_page.js | 8 +- .../src/{ => core}/public/welcome_page.xml | 0 .../{web/activity => core/web}/activity.js | 28 ++--- .../{web/activity => core/web}/activity.scss | 0 .../{web/activity => core/web}/activity.xml | 0 .../activity => core/web}/activity_button.js | 9 +- .../activity => core/web}/activity_button.xml | 0 .../activity => core/web}/activity_cell.js | 6 +- .../activity => core/web}/activity_cell.scss | 0 .../activity => core/web}/activity_cell.xml | 0 .../web}/activity_list_popover.js | 11 +- .../web}/activity_list_popover.xml | 0 .../web}/activity_list_popover_item.js | 19 ++- .../web}/activity_list_popover_item.xml | 0 .../web}/activity_list_view.scss | 0 .../web}/activity_list_view_item.scss | 0 .../web}/activity_mail_template.js | 2 +- .../web}/activity_mail_template.xml | 0 .../web}/activity_markasdone_popover.js | 4 +- .../web}/activity_markasdone_popover.xml | 0 .../activity => core/web}/activity_menu.js | 2 +- .../activity => core/web}/activity_menu.scss | 0 .../activity => core/web}/activity_menu.xml | 0 .../activity => core/web}/activity_model.js | 4 +- .../activity => core/web}/activity_service.js | 15 +-- .../web}/chat_window_patch.js | 6 +- .../web}/chat_window_patch.xml | 0 .../mail/static/src/{ => core}/web/chatter.js | 38 +++--- .../static/src/{ => core}/web/chatter.scss | 0 .../static/src/{ => core}/web/chatter.xml | 0 .../src/{ => core}/web/command_palette.js | 16 +-- .../web}/context_service.js | 2 +- .../web}/discuss_client_action.js | 2 +- .../web}/discuss_client_action.xml | 0 .../mail/static/src/core/web/discuss_patch.js | 11 ++ .../web}/discuss_patch.xml | 0 .../{ => core}/web/follower_subtype_dialog.js | 4 +- .../web/follower_subtype_dialog.scss | 0 .../web/follower_subtype_dialog.xml | 0 .../src/{ => core}/web/message_patch.js | 19 +-- .../src/{ => core}/web/message_patch.xml | 0 .../web}/messaging_menu.js | 22 ++-- .../web}/messaging_menu.scss | 0 .../web}/messaging_menu.xml | 0 .../{ => core}/web/messaging_service_patch.js | 13 +- .../web}/notification_item.js | 6 +- .../web}/notification_item.scss | 0 .../web}/notification_item.xml | 0 .../src/{ => core}/web/open_chat_hook.js | 0 .../{web/discuss_app => core/web}/sidebar.js | 21 ++-- .../discuss_app => core/web}/sidebar.scss | 0 .../{web/discuss_app => core/web}/sidebar.xml | 0 .../src/{ => core}/web/suggested_recipient.js | 7 +- .../{ => core}/web/suggested_recipient.xml | 0 .../web/suggested_recipient_list.js | 5 +- .../web/suggested_recipient_list.xml | 0 .../src/{ => core}/web/thread_actions.js | 3 +- .../src/{ => core}/web/thread_model_patch.js | 6 +- .../{ => core}/web/thread_service_patch.js | 30 ++--- .../src/discuss/call/chat_window_patch.js | 6 - .../discuss/call/{ => common}/blur_manager.js | 3 +- .../discuss/call/{ => common}/call.dark.scss | 0 .../src/discuss/call/{ => common}/call.js | 12 +- .../src/discuss/call/{ => common}/call.scss | 0 .../src/discuss/call/{ => common}/call.xml | 0 .../{ => common}/call_action_list.dark.scss | 0 .../call/{ => common}/call_action_list.js | 4 +- .../call/{ => common}/call_action_list.scss | 0 .../call/{ => common}/call_action_list.xml | 0 .../call/{ => common}/call_context_menu.js | 1 + .../call/{ => common}/call_context_menu.xml | 0 .../call/{ => common}/call_invitation.js | 1 + .../call/{ => common}/call_invitation.scss | 0 .../call/{ => common}/call_invitation.xml | 0 .../call/{ => common}/call_invitations.js | 8 +- .../call/{ => common}/call_invitations.scss | 0 .../call/{ => common}/call_invitations.xml | 0 .../discuss/call/{ => common}/call_menu.js | 4 +- .../discuss/call/{ => common}/call_menu.scss | 0 .../discuss/call/{ => common}/call_menu.xml | 0 .../call_participant_card.dark.scss | 0 .../{ => common}/call_participant_card.js | 14 ++- .../{ => common}/call_participant_card.scss | 0 .../{ => common}/call_participant_card.xml | 0 .../{ => common}/call_participant_video.js | 3 +- .../{ => common}/call_participant_video.xml | 0 .../call/{ => common}/call_settings.js | 4 +- .../call/{ => common}/call_settings.xml | 0 .../discuss/call/common/chat_window_patch.js | 6 + .../call/{ => common}/chat_window_patch.xml | 0 .../src/discuss/call/common/discuss_patch.js | 16 +++ .../call/{ => common}/discuss_patch.xml | 0 .../call/{ => common}/media_monitoring.js | 0 .../src/discuss/call/{ => common}/rtc_hook.js | 3 +- .../discuss/call/{ => common}/rtc_service.js | 32 ++--- .../call/{ => common}/rtc_session_model.js | 4 +- .../call/{ => common}/thread_actions.js | 8 +- .../static/src/discuss/call/discuss_patch.js | 15 --- .../call/public/discuss_public_patch.js | 7 +- .../discuss/call/web/discuss_sidebar_patch.js | 5 +- .../{ => common}/attachment_model_patch.js | 5 +- .../core/{ => common}/channel_commands.js | 2 +- .../core/{ => common}/channel_invitation.js | 9 +- .../core/{ => common}/channel_invitation.scss | 0 .../core/{ => common}/channel_invitation.xml | 0 .../core/{ => common}/channel_member_list.js | 6 +- .../{ => common}/channel_member_list.scss | 0 .../core/{ => common}/channel_member_list.xml | 0 .../{ => common}/suggestion_service_patch.js | 7 +- .../core/{ => common}/thread_actions.js | 8 +- .../core/{ => common}/thread_service_patch.js | 7 +- .../discuss/{ => core}/web/thread_actions.js | 3 +- .../message_pin/{ => common}/message_patch.js | 11 +- .../{ => common}/message_patch.xml | 0 .../{ => common}/message_pin_service.js | 17 +-- .../{ => common}/pinned_messages_panel.js | 8 +- .../{ => common}/pinned_messages_panel.scss | 0 .../{ => common}/pinned_messages_panel.xml | 0 .../{ => common}/thread_actions.js | 6 +- .../message_pin/{ => common}/thread_patch.js | 5 +- .../typing/{ => common}/composer_patch.js | 11 +- .../typing/{ => common}/composer_patch.xml | 0 .../{ => common}/primary_variables.scss | 0 .../typing/common/thread_icon_patch.js | 21 ++++ .../typing/{ => common}/thread_icon_patch.xml | 0 .../src/discuss/typing/{ => common}/typing.js | 8 +- .../discuss/typing/{ => common}/typing.scss | 0 .../discuss/typing/{ => common}/typing.xml | 0 .../typing/{ => common}/typing_service.js | 15 +-- .../src/discuss/typing/thread_icon_patch.js | 20 --- addons/mail/static/src/js/emojis_mixin.js | 7 +- .../mail/static/src/js/onchange_on_keydown.js | 2 +- .../mail/static/src/js/tools/debug_manager.js | 2 +- addons/mail/static/src/js/tours/mail.js | 6 +- addons/mail/static/src/js/utils.js | 6 +- .../static/src/utils/{ => common}/arrays.js | 0 .../static/src/utils/{ => common}/dates.js | 0 .../static/src/utils/{ => common}/format.js | 3 +- .../static/src/utils/{ => common}/hooks.js | 21 ++-- .../static/src/utils/{ => common}/misc.js | 0 .../activity/activity_arch_parser.js | 6 +- .../{ => web}/activity/activity_compiler.js | 4 +- .../{ => web}/activity/activity_controller.js | 14 +-- .../activity/activity_controller.scss | 0 .../activity/activity_controller.xml | 0 .../{ => web}/activity/activity_model.js | 2 +- .../{ => web}/activity/activity_record.js | 6 +- .../{ => web}/activity/activity_record.xml | 0 .../{ => web}/activity/activity_renderer.js | 10 +- .../{ => web}/activity/activity_renderer.xml | 0 .../views/{ => web}/activity/activity_view.js | 11 +- .../activity_exception/activity_exception.js | 4 +- .../activity_exception/activity_exception.xml | 0 .../web/fields/assign_user_command_hook.js | 6 +- .../{ => views}/web/fields/avatar/avatar.js | 5 +- .../{ => views}/web/fields/avatar/avatar.scss | 0 .../{ => views}/web/fields/avatar/avatar.xml | 0 .../emojis_char_field/emojis_char_field.js | 11 +- .../emojis_char_field/emojis_char_field.xml | 0 .../emojis_field_common.js | 5 +- .../emojis_field_common.xml | 0 .../emojis_text_field/emojis_text_field.js | 9 +- .../emojis_text_field/emojis_text_field.xml | 0 .../fields/kanban_activity/kanban_activity.js | 6 +- .../kanban_activity/kanban_activity.xml | 0 .../web/fields/list_activity/list_activity.js | 10 +- .../fields/list_activity/list_activity.xml | 0 .../{ => views}/web/fields/m2x_avatar_user.js | 4 +- .../many2many_avatar_user_field.js | 13 +- .../many2many_avatar_user_field.scss | 0 .../many2many_avatar_user_field.xml | 0 .../many2many_tags_email.js | 13 +- .../many2many_tags_email.xml | 0 .../web/fields}/many2one_avatar_user.xml | 0 .../many2one_avatar_user_field.js | 11 +- .../many2one_avatar_user_field.xml | 0 .../fields/properties_field/property_value.js | 9 +- .../properties_field/property_value.scss | 0 .../properties_field/property_value.xml | 0 .../src/views/{ => web}/form/form_compiler.js | 4 +- .../views/{ => web}/form/form_controller.xml | 0 .../src/views/{ => web}/form/form_renderer.js | 26 ++-- .../views/{ => web}/form/form_renderer.scss | 0 .../src/views/{ => web}/relational_model.js | 4 +- .../src/web/discuss_app/discuss_patch.js | 10 -- addons/mail/static/src/xml/activity.xml | 22 ---- .../static/src/xml/web_kanban_activity.xml | 115 ------------------ .../activity_mark_done_popover_tests.js | 2 +- .../tests/activity/activity_menu_tests.js | 2 +- .../static/tests/activity/activity_tests.js | 11 +- .../chat_window/chat_window_manager_tests.js | 8 +- .../chat_window_new_message_tests.js | 14 +-- .../tests/chat_window/chat_window_tests.js | 15 +-- .../static/tests/composer/composer_tests.js | 16 +-- .../composer/suggested_recipients_test.js | 2 +- .../static/tests/core/message_model_tests.js | 3 +- .../mail/static/tests/core/open_chat_test.js | 2 +- .../static/tests/core/out_of_focus_tests.js | 6 +- .../static/tests/crosstab/crosstab_tests.js | 2 +- .../discuss/call/call_settings_menu_tests.js | 1 + .../static/tests/discuss/call/call_tests.js | 1 + .../discuss/core/channel_member_list_tests.js | 3 +- .../tests/discuss/core/composer_tests.js | 3 +- .../tests/discuss/core/suggestion_tests.js | 3 +- .../message_pin/pinned_messages_tests.js | 3 +- .../tests/discuss/typing/typing_tests.js | 7 +- .../static/tests/discuss_app/discuss_tests.js | 13 +- .../tests/discuss_app/im_status_tests.js | 9 +- .../static/tests/discuss_app/inbox_tests.js | 2 +- .../discuss_app/jump_to_present_tests.js | 5 +- .../static/tests/discuss_app/sidebar_tests.js | 6 +- addons/mail/static/tests/emoji/emoji_tests.js | 2 +- .../static/tests/emoji/emojis_mixin_tests.js | 3 +- addons/mail/static/tests/helpers/command.js | 2 +- .../discuss/call/setup_manager_patch.js | 9 +- .../message_pin/setup_manager_patch.js | 3 +- .../discuss/typing/setup_manager_patch.js | 3 +- .../mock_server/controllers/discuss.js | 2 +- .../tests/helpers/mock_server/mock_server.js | 2 +- .../mock_server/models/discuss_channel.js | 4 +- .../models/discuss_channel_member.js | 2 +- .../models/discuss_channel_rtc_session.js | 2 +- .../mock_server/models/ir_attachment.js | 2 +- .../mock_server/models/ir_websocket.js | 8 +- .../mock_server/models/mail_activity.js | 4 +- .../mock_server/models/mail_link_preview.js | 2 +- .../mock_server/models/mail_message.js | 4 +- .../mock_server/models/mail_notification.js | 2 +- .../helpers/mock_server/models/mail_thread.js | 2 +- .../mock_server/models/mail_tracking_value.js | 2 +- .../helpers/mock_server/models/models.js | 2 +- .../helpers/mock_server/models/res_fake.js | 6 +- .../helpers/mock_server/models/res_partner.js | 2 +- .../helpers/mock_server/models/res_users.js | 5 +- .../mock_server/models/res_users_settings.js | 9 +- .../models/res_users_settings_volumes.js | 2 +- .../tests/helpers/model_definitions_setup.js | 6 +- .../tests/helpers/patch_notifications.js | 2 +- .../static/tests/helpers/patch_ui_size.js | 5 +- .../mail/static/tests/helpers/test_utils.js | 23 ++-- .../mail/static/tests/helpers/time_control.js | 4 +- .../static/tests/helpers/webclient_setup.js | 50 ++++---- addons/mail/static/tests/mail_utils_tests.js | 3 +- .../static/tests/message/link_preview_test.js | 2 +- .../tests/message/message_reply_tests.js | 2 +- .../message/message_seen_indicator_tests.js | 4 +- .../static/tests/message/message_tests.js | 15 +-- .../static/tests/messaging/messaging_tests.js | 4 +- .../messaging_menu/messaging_menu_tests.js | 13 +- .../messaging_menu/notification_tests.js | 5 +- .../mail/static/tests/mobile/mobile_tests.js | 2 +- .../tests/suggestion/suggestion_tests.js | 6 +- .../tests/thread/attachment_list_tests.js | 3 +- .../static/tests/thread/file_upload_tests.js | 3 +- .../mail/static/tests/thread/thread_tests.js | 6 +- .../tours/discuss_channel_as_guest_tour.js | 2 +- .../static/tests/tours/discuss_public_tour.js | 2 +- .../tests/tours/dynamic_placeholder_tour.js | 3 +- .../tours/mail_chatter_activity_test_tour.js | 1 - .../tours/mail_full_composer_test_tour.js | 5 +- .../tours/user_modify_own_profile_tour.js | 45 ++++--- .../web/activity/activity_widget_tests.js | 4 +- .../static/tests/web/attachment_box_tests.js | 2 +- addons/mail/static/tests/web/chatter_tests.js | 2 +- .../static/tests/web/chatter_topbar_tests.js | 5 +- .../static/tests/web/command_palette_tests.js | 9 +- .../mail/static/tests/web/debug_menu_tests.js | 5 +- .../static/tests/web/fields/avatar_tests.js | 5 +- .../tests/web/fields/emojis_fields_tests.js | 6 +- .../tests/web/fields/m2x_avatar_user_tests.js | 11 +- .../web/fields/many2many_tags_email_tests.js | 4 +- .../web/fields/onchange_on_keydown_tests.js | 2 +- .../static/tests/web/follow_button_tests.js | 2 +- .../tests/web/follower_list_menu_tests.js | 4 +- .../tests/web/follower_subtype_tests.js | 3 +- .../mail/static/tests/web/follower_tests.js | 2 +- .../static/tests/web/form_renderer_tests.js | 2 +- addons/project/__manifest__.py | 2 +- .../subtask_kanban_list.js | 2 +- .../project_activity/project_activity_view.js | 2 +- .../src/web/activity/activity_menu_patch.js | 4 +- .../static/src/notification_item_patch.js | 2 +- .../sms_widget/fields_sms_widget.js | 2 +- .../core/notification_group_model_patch.js | 2 +- .../src/core/notification_model_patch.js | 2 +- .../messaging_menu/messaging_menu_patch.js | 2 +- addons/sms/static/src/thread/message_patch.js | 3 +- .../core/notification_group_model_patch.js | 2 +- .../src/core/notification_model_patch.js | 2 +- .../static/src/core_ui/message_patch.js | 6 +- .../messaging_menu/messaging_menu_patch.js | 2 +- .../test_mail/static/tests/activity_tests.js | 4 +- .../src/services/chat_window_service_patch.js | 2 +- .../static/src/core/persona_model_patch.js | 2 +- .../static/src/core/persona_service_patch.js | 2 +- .../static/src/core/thread_service_patch.js | 8 +- .../static/src/core_ui/thread_patch.js | 4 +- .../static/src/activity/activity_patch.js | 4 +- 488 files changed, 1436 insertions(+), 1340 deletions(-) rename addons/mail/static/src/{attachments => core/common}/attachment_list.js (84%) rename addons/mail/static/src/{attachments => core/common}/attachment_list.scss (100%) rename addons/mail/static/src/{attachments => core/common}/attachment_list.xml (100%) rename addons/mail/static/src/{attachments => core/common}/attachment_model.js (91%) rename addons/mail/static/src/{attachments => core/common}/attachment_service.js (92%) rename addons/mail/static/src/{attachments => core/common}/attachment_uploader_hook.js (93%) rename addons/mail/static/src/{attachments => core/common}/attachment_view.js (92%) rename addons/mail/static/src/{attachments => core/common}/attachment_view.scss (100%) rename addons/mail/static/src/{attachments => core/common}/attachment_view.xml (100%) rename addons/mail/static/src/{discuss_app => core/common}/autoresize_input.js (96%) rename addons/mail/static/src/{discuss_app => core/common}/autoresize_input.scss (100%) rename addons/mail/static/src/{discuss_app => core/common}/autoresize_input.xml (100%) rename addons/mail/static/src/core/{ => common}/canned_response_model.js (100%) rename addons/mail/static/src/core/{ => common}/channel_member_model.js (84%) rename addons/mail/static/src/core/{ => common}/channel_member_service.js (94%) rename addons/mail/static/src/{discuss_app => core/common}/channel_selector.js (96%) rename addons/mail/static/src/{discuss_app => core/common}/channel_selector.scss (100%) rename addons/mail/static/src/{discuss_app => core/common}/channel_selector.xml (100%) rename addons/mail/static/src/{chat_window => core/common}/chat_window.js (83%) rename addons/mail/static/src/{chat_window => core/common}/chat_window.scss (100%) rename addons/mail/static/src/{chat_window => core/common}/chat_window.xml (100%) rename addons/mail/static/src/{chat_window => core/common}/chat_window_container.js (94%) rename addons/mail/static/src/{chat_window => core/common}/chat_window_container.scss (100%) rename addons/mail/static/src/{chat_window => core/common}/chat_window_container.xml (100%) rename addons/mail/static/src/{chat_window => core/common}/chat_window_model.js (66%) rename addons/mail/static/src/{chat_window => core/common}/chat_window_service.js (96%) rename addons/mail/static/src/{composer => core/common}/composer.js (93%) rename addons/mail/static/src/{composer => core/common}/composer.scss (100%) rename addons/mail/static/src/{composer => core/common}/composer.xml (100%) rename addons/mail/static/src/{composer => core/common}/composer_model.js (79%) rename addons/mail/static/src/{core_ui => core/common}/core.scss (100%) rename addons/mail/static/src/{discuss_app => core/common}/discuss.js (87%) rename addons/mail/static/src/{discuss_app => core/common}/discuss.scss (100%) rename addons/mail/static/src/{discuss_app => core/common}/discuss.xml (100%) rename addons/mail/static/src/{dropzone => core/common}/dropzone.js (90%) rename addons/mail/static/src/{dropzone => core/common}/dropzone.scss (100%) rename addons/mail/static/src/{dropzone => core/common}/dropzone.xml (100%) rename addons/mail/static/src/{dropzone => core/common}/dropzone_hook.js (93%) rename addons/mail/static/src/{emoji_picker => core/common}/emoji_data.js (100%) rename addons/mail/static/src/{emoji_picker => core/common}/emoji_picker.js (98%) rename addons/mail/static/src/{emoji_picker => core/common}/emoji_picker.scss (100%) rename addons/mail/static/src/{emoji_picker => core/common}/emoji_picker.xml (100%) rename addons/mail/static/src/core/{ => common}/follower_model.js (60%) rename addons/mail/static/src/{discuss_app => core/common}/im_status.js (100%) rename addons/mail/static/src/{discuss_app => core/common}/im_status.scss (100%) rename addons/mail/static/src/{discuss_app => core/common}/im_status.xml (100%) rename addons/mail/static/src/{core_ui/link_preview => core/common}/link_preview.js (77%) rename addons/mail/static/src/{core_ui/link_preview => core/common}/link_preview.scss (100%) rename addons/mail/static/src/{core_ui/link_preview => core/common}/link_preview.xml (100%) rename addons/mail/static/src/{core_ui/link_preview => core/common}/link_preview_confirm_delete.js (90%) rename addons/mail/static/src/{core_ui/link_preview => core/common}/link_preview_confirm_delete.xml (100%) rename addons/mail/static/src/{core_ui/link_preview => core/common}/link_preview_list.js (73%) rename addons/mail/static/src/{core_ui/link_preview => core/common}/link_preview_list.xml (100%) rename addons/mail/static/src/core/{ => common}/link_preview_model.js (100%) rename addons/mail/static/src/{core_ui => core/common}/message.js (91%) rename addons/mail/static/src/{core_ui => core/common}/message.scss (100%) rename addons/mail/static/src/{core_ui => core/common}/message.xml (100%) rename addons/mail/static/src/{core_ui => core/common}/message_confirm_dialog.js (91%) rename addons/mail/static/src/{core_ui => core/common}/message_confirm_dialog.xml (100%) rename addons/mail/static/src/{core_ui => core/common}/message_in_reply.js (85%) rename addons/mail/static/src/{core_ui => core/common}/message_in_reply.scss (100%) rename addons/mail/static/src/{core_ui => core/common}/message_in_reply.xml (100%) rename addons/mail/static/src/core/{ => common}/message_model.js (94%) rename addons/mail/static/src/{core_ui => core/common}/message_notification_popover.js (100%) rename addons/mail/static/src/{core_ui => core/common}/message_notification_popover.xml (100%) rename addons/mail/static/src/{core_ui => core/common}/message_reaction_menu.js (87%) rename addons/mail/static/src/{core_ui => core/common}/message_reaction_menu.scss (100%) rename addons/mail/static/src/{core_ui => core/common}/message_reaction_menu.xml (100%) rename addons/mail/static/src/{core_ui => core/common}/message_reactions.js (96%) rename addons/mail/static/src/{core_ui => core/common}/message_reactions.scss (100%) rename addons/mail/static/src/{core_ui => core/common}/message_reactions.xml (100%) rename addons/mail/static/src/core/{ => common}/message_reactions_model.js (51%) rename addons/mail/static/src/{core_ui => core/common}/message_seen_indicator.js (90%) rename addons/mail/static/src/{core_ui => core/common}/message_seen_indicator.scss (100%) rename addons/mail/static/src/{core_ui => core/common}/message_seen_indicator.xml (100%) rename addons/mail/static/src/core/{ => common}/message_service.js (95%) rename addons/mail/static/src/core/{ => common}/messaging_hook.js (68%) rename addons/mail/static/src/core/{ => common}/messaging_service.js (96%) rename addons/mail/static/src/{composer => core/common}/navigable_list.js (95%) rename addons/mail/static/src/{composer => core/common}/navigable_list.scss (100%) rename addons/mail/static/src/{composer => core/common}/navigable_list.xml (100%) rename addons/mail/static/src/core/{ => common}/notification_group_model.js (84%) rename addons/mail/static/src/core/{ => common}/notification_model.js (92%) rename addons/mail/static/src/core/{ => common}/notification_permission_service.js (99%) rename addons/mail/static/src/core/{ => common}/out_of_focus_service.js (98%) rename addons/mail/static/src/core/{ => common}/persona_model.js (92%) rename addons/mail/static/src/core/{ => common}/persona_service.js (89%) rename addons/mail/static/src/{core_ui => core/common}/primary_variables.scss (100%) rename addons/mail/static/src/{core_ui => core/common}/relative_time.js (94%) rename addons/mail/static/src/core/{ => common}/scroll_position_model.js (94%) rename addons/mail/static/src/core/{ => common}/sound_effects_service.js (99%) rename addons/mail/static/src/core/{ => common}/store_service.js (74%) rename addons/mail/static/src/{composer => core/common}/suggestion_hook.js (98%) rename addons/mail/static/src/{composer => core/common}/suggestion_service.js (94%) rename addons/mail/static/src/{core_ui => core/common}/thread.js (92%) rename addons/mail/static/src/{core_ui => core/common}/thread.scss (100%) rename addons/mail/static/src/{core_ui => core/common}/thread.xml (100%) rename addons/mail/static/src/core/{ => common}/thread_actions.js (99%) rename addons/mail/static/src/{discuss_app => core/common}/thread_icon.js (75%) rename addons/mail/static/src/{discuss_app => core/common}/thread_icon.xml (100%) rename addons/mail/static/src/core/{ => common}/thread_model.js (91%) rename addons/mail/static/src/core/{ => common}/thread_service.js (96%) rename addons/mail/static/src/core/{ => common}/user_settings_service.js (99%) rename addons/mail/static/src/{ => core}/public/boot.js (92%) rename addons/mail/static/src/{ => core}/public/context_service.js (91%) rename addons/mail/static/src/{ => core}/public/discuss_public.js (85%) rename addons/mail/static/src/{ => core}/public/discuss_public.xml (100%) rename addons/mail/static/src/{ => core}/public/root_widget.js (84%) rename addons/mail/static/src/{ => core}/public/welcome_page.js (95%) rename addons/mail/static/src/{ => core}/public/welcome_page.xml (100%) rename addons/mail/static/src/{web/activity => core/web}/activity.js (82%) rename addons/mail/static/src/{web/activity => core/web}/activity.scss (100%) rename addons/mail/static/src/{web/activity => core/web}/activity.xml (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_button.js (97%) rename addons/mail/static/src/{web/activity => core/web}/activity_button.xml (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_cell.js (95%) rename addons/mail/static/src/{web/activity => core/web}/activity_cell.scss (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_cell.xml (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_list_popover.js (87%) rename addons/mail/static/src/{web/activity => core/web}/activity_list_popover.xml (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_list_popover_item.js (90%) rename addons/mail/static/src/{web/activity => core/web}/activity_list_popover_item.xml (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_list_view.scss (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_list_view_item.scss (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_mail_template.js (96%) rename addons/mail/static/src/{web/activity => core/web}/activity_mail_template.xml (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_markasdone_popover.js (97%) rename addons/mail/static/src/{web/activity => core/web}/activity_markasdone_popover.xml (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_menu.js (97%) rename addons/mail/static/src/{web/activity => core/web}/activity_menu.scss (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_menu.xml (100%) rename addons/mail/static/src/{web/activity => core/web}/activity_model.js (95%) rename addons/mail/static/src/{web/activity => core/web}/activity_service.js (90%) rename addons/mail/static/src/{web/chat_window => core/web}/chat_window_patch.js (63%) rename addons/mail/static/src/{web/chat_window => core/web}/chat_window_patch.xml (100%) rename addons/mail/static/src/{ => core}/web/chatter.js (91%) rename addons/mail/static/src/{ => core}/web/chatter.scss (100%) rename addons/mail/static/src/{ => core}/web/chatter.xml (100%) rename addons/mail/static/src/{ => core}/web/command_palette.js (90%) rename addons/mail/static/src/{web/discuss_app => core/web}/context_service.js (90%) rename addons/mail/static/src/{discuss_app => core/web}/discuss_client_action.js (87%) rename addons/mail/static/src/{discuss_app => core/web}/discuss_client_action.xml (100%) create mode 100644 addons/mail/static/src/core/web/discuss_patch.js rename addons/mail/static/src/{web/discuss_app => core/web}/discuss_patch.xml (100%) rename addons/mail/static/src/{ => core}/web/follower_subtype_dialog.js (96%) rename addons/mail/static/src/{ => core}/web/follower_subtype_dialog.scss (100%) rename addons/mail/static/src/{ => core}/web/follower_subtype_dialog.xml (100%) rename addons/mail/static/src/{ => core}/web/message_patch.js (97%) rename addons/mail/static/src/{ => core}/web/message_patch.xml (100%) rename addons/mail/static/src/{web/messaging_menu => core/web}/messaging_menu.js (93%) rename addons/mail/static/src/{web/messaging_menu => core/web}/messaging_menu.scss (100%) rename addons/mail/static/src/{web/messaging_menu => core/web}/messaging_menu.xml (100%) rename addons/mail/static/src/{ => core}/web/messaging_service_patch.js (86%) rename addons/mail/static/src/{web/messaging_menu => core/web}/notification_item.js (86%) rename addons/mail/static/src/{web/messaging_menu => core/web}/notification_item.scss (100%) rename addons/mail/static/src/{web/messaging_menu => core/web}/notification_item.xml (100%) rename addons/mail/static/src/{ => core}/web/open_chat_hook.js (100%) rename addons/mail/static/src/{web/discuss_app => core/web}/sidebar.js (89%) rename addons/mail/static/src/{web/discuss_app => core/web}/sidebar.scss (100%) rename addons/mail/static/src/{web/discuss_app => core/web}/sidebar.xml (100%) rename addons/mail/static/src/{ => core}/web/suggested_recipient.js (89%) rename addons/mail/static/src/{ => core}/web/suggested_recipient.xml (100%) rename addons/mail/static/src/{ => core}/web/suggested_recipient_list.js (83%) rename addons/mail/static/src/{ => core}/web/suggested_recipient_list.xml (100%) rename addons/mail/static/src/{ => core}/web/thread_actions.js (95%) rename addons/mail/static/src/{ => core}/web/thread_model_patch.js (76%) rename addons/mail/static/src/{ => core}/web/thread_service_patch.js (87%) delete mode 100644 addons/mail/static/src/discuss/call/chat_window_patch.js rename addons/mail/static/src/discuss/call/{ => common}/blur_manager.js (98%) rename addons/mail/static/src/discuss/call/{ => common}/call.dark.scss (100%) rename addons/mail/static/src/discuss/call/{ => common}/call.js (95%) rename addons/mail/static/src/discuss/call/{ => common}/call.scss (100%) rename addons/mail/static/src/discuss/call/{ => common}/call.xml (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_action_list.dark.scss (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_action_list.js (96%) rename addons/mail/static/src/discuss/call/{ => common}/call_action_list.scss (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_action_list.xml (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_context_menu.js (99%) rename addons/mail/static/src/discuss/call/{ => common}/call_context_menu.xml (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_invitation.js (99%) rename addons/mail/static/src/discuss/call/{ => common}/call_invitation.scss (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_invitation.xml (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_invitations.js (69%) rename addons/mail/static/src/discuss/call/{ => common}/call_invitations.scss (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_invitations.xml (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_menu.js (88%) rename addons/mail/static/src/discuss/call/{ => common}/call_menu.scss (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_menu.xml (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_participant_card.dark.scss (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_participant_card.js (90%) rename addons/mail/static/src/discuss/call/{ => common}/call_participant_card.scss (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_participant_card.xml (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_participant_video.js (94%) rename addons/mail/static/src/discuss/call/{ => common}/call_participant_video.xml (100%) rename addons/mail/static/src/discuss/call/{ => common}/call_settings.js (98%) rename addons/mail/static/src/discuss/call/{ => common}/call_settings.xml (100%) create mode 100644 addons/mail/static/src/discuss/call/common/chat_window_patch.js rename addons/mail/static/src/discuss/call/{ => common}/chat_window_patch.xml (100%) create mode 100644 addons/mail/static/src/discuss/call/common/discuss_patch.js rename addons/mail/static/src/discuss/call/{ => common}/discuss_patch.xml (100%) rename addons/mail/static/src/discuss/call/{ => common}/media_monitoring.js (100%) rename addons/mail/static/src/discuss/call/{ => common}/rtc_hook.js (73%) rename addons/mail/static/src/discuss/call/{ => common}/rtc_service.js (98%) rename addons/mail/static/src/discuss/call/{ => common}/rtc_session_model.js (96%) rename addons/mail/static/src/discuss/call/{ => common}/thread_actions.js (87%) delete mode 100644 addons/mail/static/src/discuss/call/discuss_patch.js rename addons/mail/static/src/discuss/core/{ => common}/attachment_model_patch.js (77%) rename addons/mail/static/src/discuss/core/{ => common}/channel_commands.js (100%) rename addons/mail/static/src/discuss/core/{ => common}/channel_invitation.js (93%) rename addons/mail/static/src/discuss/core/{ => common}/channel_invitation.scss (100%) rename addons/mail/static/src/discuss/core/{ => common}/channel_invitation.xml (100%) rename addons/mail/static/src/discuss/core/{ => common}/channel_member_list.js (90%) rename addons/mail/static/src/discuss/core/{ => common}/channel_member_list.scss (100%) rename addons/mail/static/src/discuss/core/{ => common}/channel_member_list.xml (100%) rename addons/mail/static/src/discuss/core/{ => common}/suggestion_service_patch.js (93%) rename addons/mail/static/src/discuss/core/{ => common}/thread_actions.js (88%) rename addons/mail/static/src/discuss/core/{ => common}/thread_service_patch.js (80%) rename addons/mail/static/src/discuss/{ => core}/web/thread_actions.js (91%) rename addons/mail/static/src/discuss/message_pin/{ => common}/message_patch.js (88%) rename addons/mail/static/src/discuss/message_pin/{ => common}/message_patch.xml (100%) rename addons/mail/static/src/discuss/message_pin/{ => common}/message_pin_service.js (91%) rename addons/mail/static/src/discuss/message_pin/{ => common}/pinned_messages_panel.js (94%) rename addons/mail/static/src/discuss/message_pin/{ => common}/pinned_messages_panel.scss (100%) rename addons/mail/static/src/discuss/message_pin/{ => common}/pinned_messages_panel.xml (100%) rename addons/mail/static/src/discuss/message_pin/{ => common}/thread_actions.js (84%) rename addons/mail/static/src/discuss/message_pin/{ => common}/thread_patch.js (74%) rename addons/mail/static/src/discuss/typing/{ => common}/composer_patch.js (91%) rename addons/mail/static/src/discuss/typing/{ => common}/composer_patch.xml (100%) rename addons/mail/static/src/discuss/typing/{ => common}/primary_variables.scss (100%) create mode 100644 addons/mail/static/src/discuss/typing/common/thread_icon_patch.js rename addons/mail/static/src/discuss/typing/{ => common}/thread_icon_patch.xml (100%) rename addons/mail/static/src/discuss/typing/{ => common}/typing.js (86%) rename addons/mail/static/src/discuss/typing/{ => common}/typing.scss (100%) rename addons/mail/static/src/discuss/typing/{ => common}/typing.xml (100%) rename addons/mail/static/src/discuss/typing/{ => common}/typing_service.js (84%) delete mode 100644 addons/mail/static/src/discuss/typing/thread_icon_patch.js rename addons/mail/static/src/utils/{ => common}/arrays.js (100%) rename addons/mail/static/src/utils/{ => common}/dates.js (100%) rename addons/mail/static/src/utils/{ => common}/format.js (99%) rename addons/mail/static/src/utils/{ => common}/hooks.js (93%) rename addons/mail/static/src/utils/{ => common}/misc.js (100%) rename addons/mail/static/src/views/{ => web}/activity/activity_arch_parser.js (99%) rename addons/mail/static/src/views/{ => web}/activity/activity_compiler.js (99%) rename addons/mail/static/src/views/{ => web}/activity/activity_controller.js (98%) rename addons/mail/static/src/views/{ => web}/activity/activity_controller.scss (100%) rename addons/mail/static/src/views/{ => web}/activity/activity_controller.xml (100%) rename addons/mail/static/src/views/{ => web}/activity/activity_model.js (97%) rename addons/mail/static/src/views/{ => web}/activity/activity_record.js (93%) rename addons/mail/static/src/views/{ => web}/activity/activity_record.xml (100%) rename addons/mail/static/src/views/{ => web}/activity/activity_renderer.js (97%) rename addons/mail/static/src/views/{ => web}/activity/activity_renderer.xml (100%) rename addons/mail/static/src/views/{ => web}/activity/activity_view.js (69%) rename addons/mail/static/src/{ => views}/web/fields/activity_exception/activity_exception.js (100%) rename addons/mail/static/src/{ => views}/web/fields/activity_exception/activity_exception.xml (100%) rename addons/mail/static/src/{ => views}/web/fields/assign_user_command_hook.js (100%) rename addons/mail/static/src/{ => views}/web/fields/avatar/avatar.js (79%) rename addons/mail/static/src/{ => views}/web/fields/avatar/avatar.scss (100%) rename addons/mail/static/src/{ => views}/web/fields/avatar/avatar.xml (100%) rename addons/mail/static/src/views/{ => web}/fields/emojis_char_field/emojis_char_field.js (89%) rename addons/mail/static/src/views/{ => web}/fields/emojis_char_field/emojis_char_field.xml (100%) rename addons/mail/static/src/views/{ => web}/fields/emojis_field_common/emojis_field_common.js (95%) rename addons/mail/static/src/views/{ => web}/fields/emojis_field_common/emojis_field_common.xml (100%) rename addons/mail/static/src/views/{ => web}/fields/emojis_text_field/emojis_text_field.js (89%) rename addons/mail/static/src/views/{ => web}/fields/emojis_text_field/emojis_text_field.xml (100%) rename addons/mail/static/src/{ => views}/web/fields/kanban_activity/kanban_activity.js (93%) rename addons/mail/static/src/{ => views}/web/fields/kanban_activity/kanban_activity.xml (100%) rename addons/mail/static/src/{ => views}/web/fields/list_activity/list_activity.js (95%) rename addons/mail/static/src/{ => views}/web/fields/list_activity/list_activity.xml (100%) rename addons/mail/static/src/{ => views}/web/fields/m2x_avatar_user.js (99%) rename addons/mail/static/src/{ => views}/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.js (89%) rename addons/mail/static/src/{ => views}/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.scss (100%) rename addons/mail/static/src/{ => views}/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.xml (100%) rename addons/mail/static/src/{ => views}/web/fields/many2many_tags_email/many2many_tags_email.js (99%) rename addons/mail/static/src/{ => views}/web/fields/many2many_tags_email/many2many_tags_email.xml (100%) rename addons/mail/static/src/{xml => views/web/fields}/many2one_avatar_user.xml (100%) rename addons/mail/static/src/{ => views}/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.js (90%) rename addons/mail/static/src/{ => views}/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.xml (100%) rename addons/mail/static/src/views/{ => web}/fields/properties_field/property_value.js (91%) rename addons/mail/static/src/views/{ => web}/fields/properties_field/property_value.scss (100%) rename addons/mail/static/src/views/{ => web}/fields/properties_field/property_value.xml (100%) rename addons/mail/static/src/views/{ => web}/form/form_compiler.js (99%) rename addons/mail/static/src/views/{ => web}/form/form_controller.xml (100%) rename addons/mail/static/src/views/{ => web}/form/form_renderer.js (83%) rename addons/mail/static/src/views/{ => web}/form/form_renderer.scss (100%) rename addons/mail/static/src/views/{ => web}/relational_model.js (85%) delete mode 100644 addons/mail/static/src/web/discuss_app/discuss_patch.js delete mode 100644 addons/mail/static/src/xml/activity.xml delete mode 100644 addons/mail/static/src/xml/web_kanban_activity.xml diff --git a/addons/calendar/static/src/activity/activity_list_popover_item_patch.js b/addons/calendar/static/src/activity/activity_list_popover_item_patch.js index 23a41acd53a..4de8acefde0 100644 --- a/addons/calendar/static/src/activity/activity_list_popover_item_patch.js +++ b/addons/calendar/static/src/activity/activity_list_popover_item_patch.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import { ActivityListPopoverItem } from "@mail/web/activity/activity_list_popover_item"; +import { ActivityListPopoverItem } from "@mail/core/web/activity_list_popover_item"; import { patch } from "@web/core/utils/patch"; patch(ActivityListPopoverItem.prototype, "calendar", { diff --git a/addons/calendar/static/src/activity/activity_menu_patch.js b/addons/calendar/static/src/activity/activity_menu_patch.js index ccf028059ef..cc839593784 100644 --- a/addons/calendar/static/src/activity/activity_menu_patch.js +++ b/addons/calendar/static/src/activity/activity_menu_patch.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import { ActivityMenu } from "@mail/web/activity/activity_menu"; +import { ActivityMenu } from "@mail/core/web/activity_menu"; import { patch } from "@web/core/utils/patch"; import fieldUtils from "web.field_utils"; import { getLangTimeFormat } from "web.time"; diff --git a/addons/calendar/static/src/activity/activity_patch.js b/addons/calendar/static/src/activity/activity_patch.js index 02e87b42bea..5807b1ea545 100644 --- a/addons/calendar/static/src/activity/activity_patch.js +++ b/addons/calendar/static/src/activity/activity_patch.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import { Activity } from "@mail/web/activity/activity"; +import { Activity } from "@mail/core/web/activity"; import { useService } from "@web/core/utils/hooks"; import { patch } from "@web/core/utils/patch"; diff --git a/addons/calendar/static/src/activity/activity_service_patch.js b/addons/calendar/static/src/activity/activity_service_patch.js index 5bb8178ce77..75f995a887c 100644 --- a/addons/calendar/static/src/activity/activity_service_patch.js +++ b/addons/calendar/static/src/activity/activity_service_patch.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import { ActivityService } from "@mail/web/activity/activity_service"; +import { ActivityService } from "@mail/core/web/activity_service"; import { patch } from "@web/core/utils/patch"; patch(ActivityService.prototype, "calendar/activity_service", { diff --git a/addons/crm/static/src/activity_menu_patch.js b/addons/crm/static/src/activity_menu_patch.js index 6fa8c54e252..7055c05230b 100644 --- a/addons/crm/static/src/activity_menu_patch.js +++ b/addons/crm/static/src/activity_menu_patch.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import { ActivityMenu } from "@mail/web/activity/activity_menu"; +import { ActivityMenu } from "@mail/core/web/activity_menu"; import { patch } from "@web/core/utils/patch"; patch(ActivityMenu.prototype, "crm", { diff --git a/addons/hr/static/src/components/employee_chat/employee_chat.js b/addons/hr/static/src/components/employee_chat/employee_chat.js index 60939426c70..b360db59848 100644 --- a/addons/hr/static/src/components/employee_chat/employee_chat.js +++ b/addons/hr/static/src/components/employee_chat/employee_chat.js @@ -3,7 +3,7 @@ import { registry } from "@web/core/registry"; import { standardWidgetProps } from "@web/views/widgets/standard_widget_props"; -import { useOpenChat } from "@mail/web/open_chat_hook"; +import { useOpenChat } from "@mail/core/web/open_chat_hook"; const { Component } = owl; diff --git a/addons/hr/static/src/js/m2x_avatar_employee.js b/addons/hr/static/src/js/m2x_avatar_employee.js index a633843f63b..6b3a4ec19ca 100644 --- a/addons/hr/static/src/js/m2x_avatar_employee.js +++ b/addons/hr/static/src/js/m2x_avatar_employee.js @@ -8,7 +8,7 @@ import { KanbanMany2ManyAvatarUser, ListMany2ManyAvatarUser, Many2ManyAvatarUser, -} from "@mail/web/fields/m2x_avatar_user"; +} from "@mail/views/web/fields/m2x_avatar_user"; // This module defines variants of the Many2OneAvatarUser and Many2ManyAvatarUser // field widgets, to support fields pointing to 'hr.employee'. It also defines the diff --git a/addons/hr/static/src/messaging_service_patch.js b/addons/hr/static/src/messaging_service_patch.js index 711cd46802d..09a44a724fb 100644 --- a/addons/hr/static/src/messaging_service_patch.js +++ b/addons/hr/static/src/messaging_service_patch.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import { Messaging } from "@mail/core/messaging_service"; +import { Messaging } from "@mail/core/common/messaging_service"; import { patch } from "web.utils"; diff --git a/addons/hr/static/src/thread_service_patch.js b/addons/hr/static/src/thread_service_patch.js index 538337c6dbb..9da0f1b3bd9 100644 --- a/addons/hr/static/src/thread_service_patch.js +++ b/addons/hr/static/src/thread_service_patch.js @@ -1,10 +1,10 @@ /** @odoo-module */ import { _t } from "@web/core/l10n/translation"; -import { ThreadService } from "@mail/core/thread_service"; +import { ThreadService } from "@mail/core/common/thread_service"; import { patch } from "web.utils"; -/** @type {import("@mail/core/thread_service").ThreadService} */ +/** @type {import("@mail/core/common/thread_service").ThreadService} */ const threadServicePatch = { async getChat(person) { const { employeeId } = person; diff --git a/addons/hr/static/src/views/fields/many2many_avatar_employee_field/many2many_avatar_employee_field.js b/addons/hr/static/src/views/fields/many2many_avatar_employee_field/many2many_avatar_employee_field.js index e5b6165a152..219be96469a 100644 --- a/addons/hr/static/src/views/fields/many2many_avatar_employee_field/many2many_avatar_employee_field.js +++ b/addons/hr/static/src/views/fields/many2many_avatar_employee_field/many2many_avatar_employee_field.js @@ -7,7 +7,7 @@ import { many2ManyTagsAvatarUserField, kanbanMany2ManyTagsAvatarUserField, listMany2ManyTagsAvatarUserField, -} from "@mail/web/fields/many2many_avatar_user_field/many2many_avatar_user_field"; +} from "@mail/views/web/fields/many2many_avatar_user_field/many2many_avatar_user_field"; export class Many2ManyTagsAvatarEmployeeField extends Many2ManyTagsAvatarUserField { get relation() { diff --git a/addons/hr/static/src/views/fields/many2one_avatar_employee_field/many2one_avatar_employee_field.js b/addons/hr/static/src/views/fields/many2one_avatar_employee_field/many2one_avatar_employee_field.js index 2a338e33fa4..76c720d7231 100644 --- a/addons/hr/static/src/views/fields/many2one_avatar_employee_field/many2one_avatar_employee_field.js +++ b/addons/hr/static/src/views/fields/many2one_avatar_employee_field/many2one_avatar_employee_field.js @@ -6,7 +6,7 @@ import { KanbanMany2OneAvatarUserField, many2OneAvatarUserField, kanbanMany2OneAvatarUserField, -} from "@mail/web/fields/many2one_avatar_user_field/many2one_avatar_user_field"; +} from "@mail/views/web/fields/many2one_avatar_user_field/many2one_avatar_user_field"; export class Many2OneAvatarEmployeeField extends Many2OneAvatarUserField { get relation() { diff --git a/addons/hr/static/src/views/form_view.js b/addons/hr/static/src/views/form_view.js index 0569b69826a..581fbac5a78 100644 --- a/addons/hr/static/src/views/form_view.js +++ b/addons/hr/static/src/views/form_view.js @@ -7,7 +7,7 @@ import { FormController } from "@web/views/form/form_controller"; import { FormRenderer } from "@web/views/form/form_renderer"; import { useArchiveEmployee } from "@hr/views/archive_employee_hook"; -import { useOpenChat } from "@mail/web/open_chat_hook"; +import { useOpenChat } from "@mail/core/web/open_chat_hook"; export class EmployeeFormController extends FormController { setup() { diff --git a/addons/hr/static/src/views/open_chat_hook.js b/addons/hr/static/src/views/open_chat_hook.js index 360da4d2e53..10c6847135c 100644 --- a/addons/hr/static/src/views/open_chat_hook.js +++ b/addons/hr/static/src/views/open_chat_hook.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { helpers } from "@mail/web/open_chat_hook"; +import { helpers } from "@mail/core/web/open_chat_hook"; import { patch } from "@web/core/utils/patch"; patch(helpers, "hr_m2x_avatar_employee", { diff --git a/addons/hr_holidays/static/src/persona_service_patch.js b/addons/hr_holidays/static/src/persona_service_patch.js index 93981d3b936..0e70684eb38 100644 --- a/addons/hr_holidays/static/src/persona_service_patch.js +++ b/addons/hr_holidays/static/src/persona_service_patch.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import { personaService, PersonaService } from "@mail/core/persona_service"; +import { personaService, PersonaService } from "@mail/core/common/persona_service"; import { deserializeDateTime } from "@web/core/l10n/dates"; import { _t } from "@web/core/l10n/translation"; import { patch } from "@web/core/utils/patch"; diff --git a/addons/hr_holidays/static/src/thread_patch.js b/addons/hr_holidays/static/src/thread_patch.js index 35172ec2248..58cbbe7f54e 100644 --- a/addons/hr_holidays/static/src/thread_patch.js +++ b/addons/hr_holidays/static/src/thread_patch.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import { Thread } from "@mail/core_ui/thread"; +import { Thread } from "@mail/core/common/thread"; import { useService } from "@web/core/utils/hooks"; import { patch } from "@web/core/utils/patch"; diff --git a/addons/im_livechat/__manifest__.py b/addons/im_livechat/__manifest__.py index d35a42be676..d40538dc7e1 100644 --- a/addons/im_livechat/__manifest__.py +++ b/addons/im_livechat/__manifest__.py @@ -82,18 +82,10 @@ Help your customers with this chat, and analyse their feedback. 'im_livechat/static/tests/tours/**/*', ], 'im_livechat.assets_core': [ - 'mail/static/src/core/**/*', - 'mail/static/src/core_ui/**/*', - 'mail/static/src/utils/**/*', - 'mail/static/src/emoji_picker/**/*', - ('remove', 'mail/static/src/emoji_picker/emoji_data.js'), - 'mail/static/src/attachments/**/*', - 'mail/static/src/composer/**/*', - 'mail/static/src/dropzone/**/*', - 'mail/static/src/chat_window/**/*', - 'mail/static/src/web/discuss_app/context_service.js', - 'mail/static/src/discuss_app/im_status.*', - 'mail/static/src/discuss_app/thread_icon.*', + 'mail/static/src/core/common/**/*', + 'mail/static/src/utils/common/**/*', + 'mail/static/src/core/web/context_service.js', + ('remove', 'mail/static/src/core/common/emoji_data.js'), 'im_livechat/static/src/embed/**/*', 'im_livechat/static/src/embed/livechat_data.js', diff --git a/addons/im_livechat/static/src/chat_window/chat_window_patch.js b/addons/im_livechat/static/src/chat_window/chat_window_patch.js index 779156afecb..1a299cc5b5b 100644 --- a/addons/im_livechat/static/src/chat_window/chat_window_patch.js +++ b/addons/im_livechat/static/src/chat_window/chat_window_patch.js @@ -1,6 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { ChatWindow } from "@mail/core/common/chat_window"; -import { ChatWindow } from "@mail/chat_window/chat_window"; import { patch } from "@web/core/utils/patch"; patch(ChatWindow.prototype, "im_livechat", { diff --git a/addons/im_livechat/static/src/composer/channel_commands_patch.js b/addons/im_livechat/static/src/composer/channel_commands_patch.js index 1bcf87fe85f..a1d7b2a93da 100644 --- a/addons/im_livechat/static/src/composer/channel_commands_patch.js +++ b/addons/im_livechat/static/src/composer/channel_commands_patch.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; diff --git a/addons/im_livechat/static/src/composer/composer_patch.js b/addons/im_livechat/static/src/composer/composer_patch.js index 164857b8c45..4b0b0d90038 100644 --- a/addons/im_livechat/static/src/composer/composer_patch.js +++ b/addons/im_livechat/static/src/composer/composer_patch.js @@ -1,6 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Composer } from "@mail/core/common/composer"; -import { Composer } from "@mail/composer/composer"; import { patch } from "@web/core/utils/patch"; patch(Composer.prototype, "im_livechat", { diff --git a/addons/im_livechat/static/src/composer/suggestion_service_patch.js b/addons/im_livechat/static/src/composer/suggestion_service_patch.js index e0c74592276..1981e15606a 100644 --- a/addons/im_livechat/static/src/composer/suggestion_service_patch.js +++ b/addons/im_livechat/static/src/composer/suggestion_service_patch.js @@ -1,9 +1,10 @@ /* @odoo-module */ -import { patch } from "@web/core/utils/patch"; -import { SuggestionService } from "@mail/composer/suggestion_service"; -import { cleanTerm } from "@mail/utils/format"; +import { SuggestionService } from "@mail/core/common/suggestion_service"; +import { cleanTerm } from "@mail/utils/common/format"; + import { _t } from "@web/core/l10n/translation"; +import { patch } from "@web/core/utils/patch"; patch(SuggestionService.prototype, "im_livechat", { getSupportedDelimiters(thread) { diff --git a/addons/im_livechat/static/src/core/messaging_service_patch.js b/addons/im_livechat/static/src/core/messaging_service_patch.js index 1becfc0a9b6..60c16593935 100644 --- a/addons/im_livechat/static/src/core/messaging_service_patch.js +++ b/addons/im_livechat/static/src/core/messaging_service_patch.js @@ -1,8 +1,9 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Messaging } from "@mail/core/common/messaging_service"; +import { createLocalId } from "@mail/utils/common/misc"; import { patch } from "@web/core/utils/patch"; -import { Messaging } from "@mail/core/messaging_service"; -import { createLocalId } from "@mail/utils/misc"; patch(Messaging.prototype, "im_livechat", { initMessagingCallback(data) { diff --git a/addons/im_livechat/static/src/core/store_service_patch.js b/addons/im_livechat/static/src/core/store_service_patch.js index 628fd9f76cd..350d8a2fe7a 100644 --- a/addons/im_livechat/static/src/core/store_service_patch.js +++ b/addons/im_livechat/static/src/core/store_service_patch.js @@ -1,6 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Store } from "@mail/core/common/store_service"; -import { Store } from "@mail/core/store_service"; import { _t } from "@web/core/l10n/translation"; import { patch } from "@web/core/utils/patch"; diff --git a/addons/im_livechat/static/src/core/thread_model_patch.js b/addons/im_livechat/static/src/core/thread_model_patch.js index 6a12fe31157..d6522b26f2a 100644 --- a/addons/im_livechat/static/src/core/thread_model_patch.js +++ b/addons/im_livechat/static/src/core/thread_model_patch.js @@ -1,6 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Thread } from "@mail/core/common/thread_model"; -import { Thread } from "@mail/core/thread_model"; import { patch } from "@web/core/utils/patch"; patch(Thread.prototype, "im_livechat", { @@ -50,7 +51,7 @@ patch(Thread.prototype, "im_livechat", { /** * - * @param {import("@mail/core/persona_model").Persona} persona + * @param {import("@mail/core/common/persona_model").Persona} persona */ getMemberName(persona) { if (this.type !== "livechat") { diff --git a/addons/im_livechat/static/src/core/thread_service_patch.js b/addons/im_livechat/static/src/core/thread_service_patch.js index fdd07df58f9..35ec063edab 100644 --- a/addons/im_livechat/static/src/core/thread_service_patch.js +++ b/addons/im_livechat/static/src/core/thread_service_patch.js @@ -1,8 +1,9 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { ThreadService } from "@mail/core/common/thread_service"; +import { removeFromArray } from "@mail/utils/common/arrays"; +import { assignDefined, createLocalId } from "@mail/utils/common/misc"; -import { ThreadService } from "@mail/core/thread_service"; -import { removeFromArray } from "@mail/utils/arrays"; -import { assignDefined, createLocalId } from "@mail/utils/misc"; import { patch } from "@web/core/utils/patch"; patch(ThreadService.prototype, "im_livechat", { @@ -22,7 +23,7 @@ patch(ThreadService.prototype, "im_livechat", { }, /** * @override - * @param {import("@mail/core/thread_model").Thread} thread + * @param {import("@mail/core/common/thread_model").Thread} thread * @param {boolean} pushState */ setDiscussThread(thread, pushState) { diff --git a/addons/im_livechat/static/src/discuss_app/sidebar_patch.js b/addons/im_livechat/static/src/discuss_app/sidebar_patch.js index 1781faf78d6..ef7ab8fc698 100644 --- a/addons/im_livechat/static/src/discuss_app/sidebar_patch.js +++ b/addons/im_livechat/static/src/discuss_app/sidebar_patch.js @@ -1,6 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Sidebar } from "@mail/core/web/sidebar"; -import { Sidebar } from "@mail/web/discuss_app/sidebar"; import { patch } from "@web/core/utils/patch"; patch(Sidebar.prototype, "im_livechat", { diff --git a/addons/im_livechat/static/src/embed/boot_helpers.js b/addons/im_livechat/static/src/embed/boot_helpers.js index bc2290ebcb3..1cd793706b5 100644 --- a/addons/im_livechat/static/src/embed/boot_helpers.js +++ b/addons/im_livechat/static/src/embed/boot_helpers.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { serverUrl } from "@im_livechat/embed/livechat_data"; diff --git a/addons/im_livechat/static/src/embed/chat_window/chat_window_patch.js b/addons/im_livechat/static/src/embed/chat_window/chat_window_patch.js index e047249fe49..fe781641644 100644 --- a/addons/im_livechat/static/src/embed/chat_window/chat_window_patch.js +++ b/addons/im_livechat/static/src/embed/chat_window/chat_window_patch.js @@ -1,12 +1,15 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { SESSION_STATE } from "@im_livechat/embed/core/livechat_service"; +import { FeedbackPanel } from "@im_livechat/embed/feedback_panel/feedback_panel"; + +import { ChatWindow } from "@mail/core/common/chat_window"; -import { ChatWindow } from "@mail/chat_window/chat_window"; -import { FeedbackPanel } from "../feedback_panel/feedback_panel"; -import { patch } from "@web/core/utils/patch"; -import { useService } from "@web/core/utils/hooks"; -import { SESSION_STATE } from "../core/livechat_service"; import { useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { patch } from "@web/core/utils/patch"; + Object.assign(ChatWindow.components, { FeedbackPanel }); patch(ChatWindow.prototype, "im_livechat", { diff --git a/addons/im_livechat/static/src/embed/chatbot/chatbot_model.js b/addons/im_livechat/static/src/embed/chatbot/chatbot_model.js index d3ec487bfe9..067c7c301ec 100644 --- a/addons/im_livechat/static/src/embed/chatbot/chatbot_model.js +++ b/addons/im_livechat/static/src/embed/chatbot/chatbot_model.js @@ -1,13 +1,13 @@ /* @odoo-module */ -import { assignDefined } from "@mail/utils/misc"; +import { assignDefined } from "@mail/utils/common/misc"; /** * @typedef IChatbot * @property {string} chatbot_name * @property {number} chatbot_operator_partner_id * @property {number} chatbot_script_id - * @property {import("./chatbot_step_model").IChatbotStep[]} chatbot_welcome_steps + * @property {import("@im_livechat/embed/chatbot/chatbot_step_model").IChatbotStep[]} chatbot_welcome_steps * @property {number} [welcome_step_index] */ @@ -20,7 +20,7 @@ export class Chatbot { welcomeStepIndex = 0; /** @type {number} */ scriptId; - /** @type {import("./chatbot_step_model").IChatbotStep[]} */ + /** @type {import("@im_livechat/embed/chatbot/chatbot_step_model").IChatbotStep[]} */ welcomeSteps = []; /** diff --git a/addons/im_livechat/static/src/embed/chatbot/chatbot_service.js b/addons/im_livechat/static/src/embed/chatbot/chatbot_service.js index 33a6033a87f..00cc10f6968 100644 --- a/addons/im_livechat/static/src/embed/chatbot/chatbot_service.js +++ b/addons/im_livechat/static/src/embed/chatbot/chatbot_service.js @@ -1,15 +1,15 @@ /* @odoo-module */ -import { ChatbotStep } from "@im_livechat/embed/chatbot/chatbot_step_model"; import { Chatbot } from "@im_livechat/embed/chatbot/chatbot_model"; +import { ChatbotStep } from "@im_livechat/embed/chatbot/chatbot_step_model"; import { SESSION_STATE } from "@im_livechat/embed/core/livechat_service"; import { EventBus, markup, reactive } from "@odoo/owl"; -import { _t } from "@web/core/l10n/translation"; import { browser } from "@web/core/browser/browser"; -import { debounce } from "@web/core/utils/timing"; +import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; +import { debounce } from "@web/core/utils/timing"; const MESSAGE_DELAY = 1500; // Time between two messages coming from the bot. @@ -38,8 +38,8 @@ export class ChatBotService { * @param {import("@web/env").OdooEnv} env * @param {{ * "im_livechat.livechat": import("@im_livechat/embed/core/livechat_service").LivechatService, - * "mail.message": import("@mail/core/message_service").MessageService, - * "mail.store": import("@mail/core/store_service").Store, + * "mail.message": import("@mail/core/common/message_service").MessageService, + * "mail.store": import("@mail/core/common/store_service").Store, * rpc: typeof import("@web/core/network/rpc_service").rpcService.start, * }} services */ @@ -219,7 +219,7 @@ export class ChatBotService { /** * Process the user answer and trigger the next step. * - * @param {import("@mail/core/message_model").Message} message + * @param {import("@mail/core/common/message_model").Message} message */ async _processUserAnswer(message) { if ( @@ -269,7 +269,7 @@ export class ChatBotService { } /** - * @param {import("@mail/core/thread_model").Thread} thread + * @param {import("@mail/core/common/thread_model").Thread} thread */ isChatbotThread(thread) { return thread?.operator.id === this.chatbot?.partnerId; diff --git a/addons/im_livechat/static/src/embed/chatbot/chatbot_step_model.js b/addons/im_livechat/static/src/embed/chatbot/chatbot_step_model.js index bdea5c5c8f6..dc39ad693ea 100644 --- a/addons/im_livechat/static/src/embed/chatbot/chatbot_step_model.js +++ b/addons/im_livechat/static/src/embed/chatbot/chatbot_step_model.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import { assignDefined } from "@mail/utils/misc"; +import { assignDefined } from "@mail/utils/common/misc"; /** * @typedef StepAnswer diff --git a/addons/im_livechat/static/src/embed/core/autopopup_service.js b/addons/im_livechat/static/src/embed/core/autopopup_service.js index 2da652bdae3..cc1a1f3fe0c 100644 --- a/addons/im_livechat/static/src/embed/core/autopopup_service.js +++ b/addons/im_livechat/static/src/embed/core/autopopup_service.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { browser } from "@web/core/browser/browser"; import { registry } from "@web/core/registry"; @@ -11,8 +11,8 @@ export class AutopopupService { * @param {{ * "im_livechat.chatbot": import("@im_livechat/embed/chatbot/chatbot_service").ChatBotService, * "im_livechat.livechat": import("@im_livechat/embed/core/livechat_service").LivechatService, - * "mail.thread": import("@mail/core/thread_service").ThreadService, - * "mail.store": import("@mail/core/store_service").Store, + * "mail.thread": import("@mail/core/common/thread_service").ThreadService, + * "mail.store": import("@mail/core/common/store_service").Store, * cookie: typeof import("@web/core/browser/cookie_service").cookieService.start, * ui: typeof import("@web/core/ui/ui_service").uiService.start, * }} services diff --git a/addons/im_livechat/static/src/embed/core/composer_patch.js b/addons/im_livechat/static/src/embed/core/composer_patch.js index c7b5e1f78ac..1d4b9911d88 100644 --- a/addons/im_livechat/static/src/embed/core/composer_patch.js +++ b/addons/im_livechat/static/src/embed/core/composer_patch.js @@ -1,9 +1,11 @@ -/** @odoo-module */ +/* @odoo-module */ -import { Composer } from "@mail/composer/composer"; -import { patch } from "@web/core/utils/patch"; import { options } from "@im_livechat/embed/livechat_data"; + +import { Composer } from "@mail/core/common/composer"; + import { _t } from "@web/core/l10n/translation"; +import { patch } from "@web/core/utils/patch"; patch(Composer.prototype, "im_livechat", { get placeholder() { diff --git a/addons/im_livechat/static/src/embed/core/disabled_features.js b/addons/im_livechat/static/src/embed/core/disabled_features.js index 2e79942b3b3..6a4c3cacffd 100644 --- a/addons/im_livechat/static/src/embed/core/disabled_features.js +++ b/addons/im_livechat/static/src/embed/core/disabled_features.js @@ -1,12 +1,13 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { ChatWindowService } from "@mail/core/common/chat_window_service"; +import { Composer } from "@mail/core/common/composer"; +import { Message as MessageModel } from "@mail/core/common/message_model"; +import { Store } from "@mail/core/common/store_service"; +import { Thread } from "@mail/core/common/thread_model"; +import { ThreadService } from "@mail/core/common/thread_service"; -import { ChatWindowService } from "@mail/chat_window/chat_window_service"; -import { Composer } from "@mail/composer/composer"; -import { Message as MessageModel } from "@mail/core/message_model"; -import { Thread } from "@mail/core/thread_model"; import { patch } from "@web/core/utils/patch"; -import { ThreadService } from "@mail/core/thread_service"; -import { Store } from "@mail/core/store_service"; patch(ChatWindowService.prototype, "im_livechat/disabled", { notifyState() { diff --git a/addons/im_livechat/static/src/embed/core/livechat_service.js b/addons/im_livechat/static/src/embed/core/livechat_service.js index cc845c19495..8315b372bbf 100644 --- a/addons/im_livechat/static/src/embed/core/livechat_service.js +++ b/addons/im_livechat/static/src/embed/core/livechat_service.js @@ -2,11 +2,11 @@ import { reactive } from "@odoo/owl"; -import { registry } from "@web/core/registry"; import { _t } from "@web/core/l10n/translation"; -import { session } from "@web/session"; -import { sprintf } from "@web/core/utils/strings"; +import { registry } from "@web/core/registry"; import { Deferred } from "@web/core/utils/concurrency"; +import { sprintf } from "@web/core/utils/strings"; +import { session } from "@web/session"; /** * @typedef LivechatRule @@ -57,8 +57,8 @@ export class LivechatService { * cookie: typeof import("@web/core/browser/cookie_service").cookieService.start, * bus_service: typeof import("@bus/services/bus_service").busService.start, * rpc: typeof import("@web/core/network/rpc_service").rpcService.start, - * "mail.message": import("@mail/core/message_service").MessageService, - * "mail.store": import("@mail/core/store_service").Store + * "mail.message": import("@mail/core/common/message_service").MessageService, + * "mail.store": import("@mail/core/common/store_service").Store * }} services */ setup(env, services) { @@ -213,7 +213,7 @@ export class LivechatService { } /** - * @returns {import("@mail/core/thread_model").Thread|undefined} + * @returns {import("@mail/core/common/thread_model").Thread|undefined} */ get thread() { return Object.values(this.store.threads).find(({ type }) => type === "livechat"); diff --git a/addons/im_livechat/static/src/embed/core/message_model_patch.js b/addons/im_livechat/static/src/embed/core/message_model_patch.js index c052b0833c1..a33777f444b 100644 --- a/addons/im_livechat/static/src/embed/core/message_model_patch.js +++ b/addons/im_livechat/static/src/embed/core/message_model_patch.js @@ -1,6 +1,8 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Message } from "@mail/core/common/message_model"; + import { patch } from "@web/core/utils/patch"; -import { Message } from "@mail/core/message_model"; import { session } from "@web/session"; patch(Message.prototype, "im_livechat", { diff --git a/addons/im_livechat/static/src/embed/core/message_service_patch.js b/addons/im_livechat/static/src/embed/core/message_service_patch.js index 5bf0cb37280..42242af8a82 100644 --- a/addons/im_livechat/static/src/embed/core/message_service_patch.js +++ b/addons/im_livechat/static/src/embed/core/message_service_patch.js @@ -1,9 +1,11 @@ -/** @odoo-module */ +/* @odoo-module */ -import { MessageService } from "@mail/core/message_service"; -import { patch } from "@web/core/utils/patch"; import { ChatbotStep } from "@im_livechat/embed/chatbot/chatbot_step_model"; +import { MessageService } from "@mail/core/common/message_service"; + +import { patch } from "@web/core/utils/patch"; + patch(MessageService.prototype, "im_livechat", { insert(data) { const message = this._super(data); diff --git a/addons/im_livechat/static/src/embed/core/messaging_service_patch.js b/addons/im_livechat/static/src/embed/core/messaging_service_patch.js index 258dc6b3832..f9798edb3ea 100644 --- a/addons/im_livechat/static/src/embed/core/messaging_service_patch.js +++ b/addons/im_livechat/static/src/embed/core/messaging_service_patch.js @@ -1,6 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Messaging } from "@mail/core/common/messaging_service"; -import { Messaging } from "@mail/core/messaging_service"; import { patch } from "@web/core/utils/patch"; import { session } from "@web/session"; diff --git a/addons/im_livechat/static/src/embed/core/thread_model_patch.js b/addons/im_livechat/static/src/embed/core/thread_model_patch.js index 42b8cd5b78e..a97d3f2af40 100644 --- a/addons/im_livechat/static/src/embed/core/thread_model_patch.js +++ b/addons/im_livechat/static/src/embed/core/thread_model_patch.js @@ -1,8 +1,9 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Thread } from "@mail/core/common/thread_model"; -import { session } from "@web/session"; -import { Thread } from "@mail/core/thread_model"; import { patch } from "@web/core/utils/patch"; +import { session } from "@web/session"; patch(Thread.prototype, "im_livechat", { chatbotScriptId: null, diff --git a/addons/im_livechat/static/src/embed/core/thread_service_patch.js b/addons/im_livechat/static/src/embed/core/thread_service_patch.js index 010b4671870..1efea50a877 100644 --- a/addons/im_livechat/static/src/embed/core/thread_service_patch.js +++ b/addons/im_livechat/static/src/embed/core/thread_service_patch.js @@ -1,10 +1,13 @@ /* @odoo-module */ import { SESSION_STATE } from "@im_livechat/embed/core/livechat_service"; -import { ThreadService, threadService } from "@mail/core/thread_service"; -import { prettifyMessageContent } from "@mail/utils/format"; -import { createLocalId, onChange } from "@mail/utils/misc"; + +import { ThreadService, threadService } from "@mail/core/common/thread_service"; +import { prettifyMessageContent } from "@mail/utils/common/format"; +import { createLocalId, onChange } from "@mail/utils/common/misc"; + import { markup } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; import { patch } from "@web/core/utils/patch"; import { session } from "@web/session"; @@ -24,7 +27,7 @@ patch(ThreadService.prototype, "im_livechat", { * @param {{ * "im_livechat.chatbot": import("@im_livechat/embed/chatbot/chatbot_service").ChatBotService, * "im_livechat.livechat": import("@im_livechat/embed/core/livechat_service").LivechatService, - * "mail.chat_window": import("@mail/chat_window/chat_window_service").ChatWindowService, + * "mail.chat_window": import("@mail/core/common/chat_window_service").ChatWindowService, * notification: typeof import("@web/core/notifications/notification_service").notificationService.start, * }} services */ @@ -54,7 +57,7 @@ patch(ThreadService.prototype, "im_livechat", { }, /** - * @returns {Promise} + * @returns {Promise} */ async getLivechatThread({ persisted = false } = {}) { const session = await this.livechatService.getSession({ persisted }); diff --git a/addons/im_livechat/static/src/embed/core_ui/livechat_button.js b/addons/im_livechat/static/src/embed/core_ui/livechat_button.js index 224a971317f..e82f0c788a0 100644 --- a/addons/im_livechat/static/src/embed/core_ui/livechat_button.js +++ b/addons/im_livechat/static/src/embed/core_ui/livechat_button.js @@ -1,10 +1,13 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { SESSION_STATE } from "@im_livechat/embed/core/livechat_service"; + +import { useStore } from "@mail/core/common/messaging_hook"; -import { useStore } from "@mail/core/messaging_hook"; import { Component, useState } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; import { debounce } from "@web/core/utils/timing"; -import { SESSION_STATE } from "@im_livechat/embed/core/livechat_service"; export class LivechatButton extends Component { static template = "im_livechat.LivechatButton"; diff --git a/addons/im_livechat/static/src/embed/core_ui/message_patch.js b/addons/im_livechat/static/src/embed/core_ui/message_patch.js index 7f4c9c5727e..5a9fde798fc 100644 --- a/addons/im_livechat/static/src/embed/core_ui/message_patch.js +++ b/addons/im_livechat/static/src/embed/core_ui/message_patch.js @@ -1,6 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Message } from "@mail/core/common/message"; -import { Message } from "@mail/core_ui/message"; import { patch } from "@web/core/utils/patch"; import { session } from "@web/session"; diff --git a/addons/im_livechat/static/src/embed/core_ui/thread_patch.js b/addons/im_livechat/static/src/embed/core_ui/thread_patch.js index f7b4c510ee6..9d67f649661 100644 --- a/addons/im_livechat/static/src/embed/core_ui/thread_patch.js +++ b/addons/im_livechat/static/src/embed/core_ui/thread_patch.js @@ -1,7 +1,9 @@ /* @odoo-module */ -import { Thread } from "@mail/core_ui/thread"; +import { Thread } from "@mail/core/common/thread"; + import { useState } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; import { patch } from "@web/core/utils/patch"; import { session } from "@web/session"; diff --git a/addons/im_livechat/static/src/embed/external/boot.js b/addons/im_livechat/static/src/embed/external/boot.js index 43fac79c00e..027ed02bd88 100644 --- a/addons/im_livechat/static/src/embed/external/boot.js +++ b/addons/im_livechat/static/src/embed/external/boot.js @@ -1,16 +1,19 @@ /* @odoo-module */ -import { serverUrl } from "@im_livechat/embed/livechat_data"; -import { makeShadow, makeRoot } from "@im_livechat/embed/boot_helpers"; import { LivechatButton } from "@im_livechat/embed/core_ui/livechat_button"; -import { ChatWindowContainer } from "@mail/chat_window/chat_window_container"; +import { makeShadow, makeRoot } from "@im_livechat/embed/boot_helpers"; +import { serverUrl } from "@im_livechat/embed/livechat_data"; + +import { ChatWindowContainer } from "@mail/core/common/chat_window_container"; + import { mount, whenReady } from "@odoo/owl"; + +import { templates } from "@web/core/assets"; import { browser } from "@web/core/browser/browser"; import { MainComponentsContainer } from "@web/core/main_components_container"; import { jsonrpc } from "@web/core/network/rpc_service"; import { registry } from "@web/core/registry"; import { makeEnv, startServices } from "@web/env"; -import { templates } from "@web/core/assets"; import { session } from "@web/session"; (async function boot() { diff --git a/addons/im_livechat/static/src/embed/external/bus_parameters_service_patch.js b/addons/im_livechat/static/src/embed/external/bus_parameters_service_patch.js index d6236c60f8d..d10872985eb 100644 --- a/addons/im_livechat/static/src/embed/external/bus_parameters_service_patch.js +++ b/addons/im_livechat/static/src/embed/external/bus_parameters_service_patch.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { busParametersService } from "@bus/bus_parameters_service"; diff --git a/addons/im_livechat/static/src/embed/external/emoji_loader_patch.js b/addons/im_livechat/static/src/embed/external/emoji_loader_patch.js index 2a78e924d9a..ca2887fc7ab 100644 --- a/addons/im_livechat/static/src/embed/external/emoji_loader_patch.js +++ b/addons/im_livechat/static/src/embed/external/emoji_loader_patch.js @@ -1,10 +1,10 @@ -/** @odoo-module */ +/* @odoo-module */ -import { loader } from "@mail/emoji_picker/emoji_picker"; +import { loader } from "@mail/core/common/emoji_picker"; import { loadBundle } from "@web/core/assets"; -import { patch } from "@web/core/utils/patch"; import { memoize } from "@web/core/utils/functions"; +import { patch } from "@web/core/utils/patch"; import { session } from "@web/session"; patch(loader, "im_livechat/emoji_loader", { diff --git a/addons/im_livechat/static/src/embed/feedback_panel/feedback_panel.js b/addons/im_livechat/static/src/embed/feedback_panel/feedback_panel.js index 4802bc7a521..25ba1729973 100644 --- a/addons/im_livechat/static/src/embed/feedback_panel/feedback_panel.js +++ b/addons/im_livechat/static/src/embed/feedback_panel/feedback_panel.js @@ -1,15 +1,17 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { RATING } from "@im_livechat/embed/core/livechat_service"; +import { TranscriptSender } from "@im_livechat/embed/feedback_panel/transcript_sender"; import { Component, useState } from "@odoo/owl"; + import { session } from "@web/session"; -import { TranscriptSender } from "./transcript_sender"; -import { RATING } from "../core/livechat_service"; /** * @typedef {Object} Props * @property {Function} [onClickClose] * @property {Function} [sendFeedback] - * @property {import("@mail/core/thread_model").Thread} + * @property {import("@mail/core/common/thread_model").Thread} * @extends {Component} */ export class FeedbackPanel extends Component { diff --git a/addons/im_livechat/static/src/embed/feedback_panel/transcript_sender.js b/addons/im_livechat/static/src/embed/feedback_panel/transcript_sender.js index 8ec61ac89a7..8ae3fbb034b 100644 --- a/addons/im_livechat/static/src/embed/feedback_panel/transcript_sender.js +++ b/addons/im_livechat/static/src/embed/feedback_panel/transcript_sender.js @@ -1,12 +1,14 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { isValidEmail } from "@im_livechat/embed/core/misc"; import { Component, useState } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; -import { isValidEmail } from "../core/misc"; /** * @typedef {Object} Props - * @property {import("@mail/core/thread_model").Thread} + * @property {import("@mail/core/common/thread_model").Thread} * @extends {Component} */ export class TranscriptSender extends Component { diff --git a/addons/im_livechat/static/src/embed/frontend/boot_service.js b/addons/im_livechat/static/src/embed/frontend/boot_service.js index 001f5a9e540..80e4c56d2c1 100644 --- a/addons/im_livechat/static/src/embed/frontend/boot_service.js +++ b/addons/im_livechat/static/src/embed/frontend/boot_service.js @@ -1,9 +1,11 @@ -/** @odoo-module */ +/* @odoo-module */ import { makeRoot, makeShadow } from "@im_livechat/embed/boot_helpers"; import { LivechatRoot } from "@im_livechat/embed/frontend/livechat_root"; import { serverUrl, isAvailable } from "@im_livechat/embed/livechat_data"; + import { App } from "@odoo/owl"; + import { templates } from "@web/core/assets"; import { registry } from "@web/core/registry"; import { session } from "@web/session"; diff --git a/addons/im_livechat/static/src/embed/frontend/livechat_root.js b/addons/im_livechat/static/src/embed/frontend/livechat_root.js index 528178be5c6..81b392a0448 100644 --- a/addons/im_livechat/static/src/embed/frontend/livechat_root.js +++ b/addons/im_livechat/static/src/embed/frontend/livechat_root.js @@ -1,7 +1,9 @@ -/** @odoo-module */ +/* @odoo-module */ import { LivechatButton } from "@im_livechat/embed/core_ui/livechat_button"; -import { ChatWindowContainer } from "@mail/chat_window/chat_window_container"; + +import { ChatWindowContainer } from "@mail/core/common/chat_window_container"; + import { Component, xml } from "@odoo/owl"; export class LivechatRoot extends Component { diff --git a/addons/im_livechat/static/src/embed/livechat_data.js b/addons/im_livechat/static/src/embed/livechat_data.js index aab589fa9bb..522556ce564 100644 --- a/addons/im_livechat/static/src/embed/livechat_data.js +++ b/addons/im_livechat/static/src/embed/livechat_data.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { session } from "@web/session"; diff --git a/addons/im_livechat/static/src/js/ajax_external.js b/addons/im_livechat/static/src/js/ajax_external.js index 892423458e7..10ef2b9f512 100644 --- a/addons/im_livechat/static/src/js/ajax_external.js +++ b/addons/im_livechat/static/src/js/ajax_external.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { assets } from "@web/core/assets"; diff --git a/addons/im_livechat/static/src/js/colors_reset_button/colors_reset_button.js b/addons/im_livechat/static/src/js/colors_reset_button/colors_reset_button.js index b61c6ff0bd3..0c2c3499f5a 100644 --- a/addons/im_livechat/static/src/js/colors_reset_button/colors_reset_button.js +++ b/addons/im_livechat/static/src/js/colors_reset_button/colors_reset_button.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { registry } from "@web/core/registry"; import { standardWidgetProps } from "@web/views/widgets/standard_widget_props"; diff --git a/addons/im_livechat/static/src/js/im_livechat_chatbot_script_answers_m2m.js b/addons/im_livechat/static/src/js/im_livechat_chatbot_script_answers_m2m.js index 5c8c0873b92..2c05d2462c5 100644 --- a/addons/im_livechat/static/src/js/im_livechat_chatbot_script_answers_m2m.js +++ b/addons/im_livechat/static/src/js/im_livechat_chatbot_script_answers_m2m.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { registry } from "@web/core/registry"; import { diff --git a/addons/im_livechat/static/src/js/im_livechat_chatbot_steps_one2many.js b/addons/im_livechat/static/src/js/im_livechat_chatbot_steps_one2many.js index 1c87efd1e8b..3a613e4236d 100644 --- a/addons/im_livechat/static/src/js/im_livechat_chatbot_steps_one2many.js +++ b/addons/im_livechat/static/src/js/im_livechat_chatbot_steps_one2many.js @@ -1,6 +1,5 @@ -/** @odoo-module */ +/* @odoo-module */ -import { ListRenderer } from "@web/views/list/list_renderer"; import { registry } from "@web/core/registry"; import { patch } from "@web/core/utils/patch"; import { @@ -9,6 +8,7 @@ import { X2ManyFieldDialog, } from "@web/views/fields/relational_utils"; import { X2ManyField, x2ManyField } from "@web/views/fields/x2many/x2many_field"; +import { ListRenderer } from "@web/views/list/list_renderer"; const fieldRegistry = registry.category("fields"); diff --git a/addons/im_livechat/static/src/messaging_menu/messaging_menu_patch.js b/addons/im_livechat/static/src/messaging_menu/messaging_menu_patch.js index 1e0c8ec430a..ce422d93ef7 100644 --- a/addons/im_livechat/static/src/messaging_menu/messaging_menu_patch.js +++ b/addons/im_livechat/static/src/messaging_menu/messaging_menu_patch.js @@ -1,6 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { MessagingMenu } from "@mail/core/web/messaging_menu"; -import { MessagingMenu } from "@mail/web/messaging_menu/messaging_menu"; import { _t } from "@web/core/l10n/translation"; import { patch } from "@web/core/utils/patch"; diff --git a/addons/im_livechat/static/src/web/message_patch.js b/addons/im_livechat/static/src/web/message_patch.js index d2ea062d9fc..82e08ea4d3b 100644 --- a/addons/im_livechat/static/src/web/message_patch.js +++ b/addons/im_livechat/static/src/web/message_patch.js @@ -1,7 +1,8 @@ -/** @odoo-module **/ +/* @odoo-module */ + +import { Message } from "@mail/core/common/message"; import { patch } from "@web/core/utils/patch"; -import { Message } from "@mail/core_ui/message"; patch(Message.prototype, "im_livechat/web", { get hasAuthorClickable() { diff --git a/addons/im_livechat/static/tests/chat_window_patch_tests.js b/addons/im_livechat/static/tests/chat_window_patch_tests.js index ac81ddbfd79..cf922c4b296 100644 --- a/addons/im_livechat/static/tests/chat_window_patch_tests.js +++ b/addons/im_livechat/static/tests/chat_window_patch_tests.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { click, start, startServer } from "@mail/../tests/helpers/test_utils"; diff --git a/addons/im_livechat/static/tests/composer_patch_tests.js b/addons/im_livechat/static/tests/composer_patch_tests.js index 6010b26c320..04f033cc4de 100644 --- a/addons/im_livechat/static/tests/composer_patch_tests.js +++ b/addons/im_livechat/static/tests/composer_patch_tests.js @@ -1,13 +1,15 @@ -/** @odoo-module */ +/* @odoo-module */ import { startServer } from "@bus/../tests/helpers/mock_python_environment"; + import { afterNextRender, - insertText, click, dragenterFiles, + insertText, start, } from "@mail/../tests/helpers/test_utils"; + import { editInput, nextTick, triggerHotkey } from "@web/../tests/helpers/utils"; QUnit.module("composer (patch)"); diff --git a/addons/im_livechat/static/tests/discuss_patch_tests.js b/addons/im_livechat/static/tests/discuss_patch_tests.js index 441e154f1aa..5ca22855a43 100644 --- a/addons/im_livechat/static/tests/discuss_patch_tests.js +++ b/addons/im_livechat/static/tests/discuss_patch_tests.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { afterNextRender, diff --git a/addons/im_livechat/static/tests/embed/autopopup_tests.js b/addons/im_livechat/static/tests/embed/autopopup_tests.js index f20e208437b..78059377317 100644 --- a/addons/im_livechat/static/tests/embed/autopopup_tests.js +++ b/addons/im_livechat/static/tests/embed/autopopup_tests.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { startServer } from "@bus/../tests/helpers/mock_python_environment"; diff --git a/addons/im_livechat/static/tests/embed/feedback_panel_tests.js b/addons/im_livechat/static/tests/embed/feedback_panel_tests.js index 9c78664df69..91235c474d2 100644 --- a/addons/im_livechat/static/tests/embed/feedback_panel_tests.js +++ b/addons/im_livechat/static/tests/embed/feedback_panel_tests.js @@ -1,9 +1,12 @@ -/** @odoo-module **/ +/* @odoo-module */ + +import { startServer } from "@bus/../tests/helpers/mock_python_environment"; import { RATING, RATING_TO_EMOJI } from "@im_livechat/embed/core/livechat_service"; -import { start, loadDefaultConfig } from "@im_livechat/../tests/embed/helper/test_utils"; +import { loadDefaultConfig, start } from "@im_livechat/../tests/embed/helper/test_utils"; + import { afterNextRender, click, insertText } from "@mail/../tests/helpers/test_utils"; -import { startServer } from "@bus/../tests/helpers/mock_python_environment"; + import { triggerHotkey } from "@web/../tests/helpers/utils"; QUnit.module("feedback panel"); diff --git a/addons/im_livechat/static/tests/embed/helper/test_utils.js b/addons/im_livechat/static/tests/embed/helper/test_utils.js index 4edd0c51479..cff855e4e9a 100644 --- a/addons/im_livechat/static/tests/embed/helper/test_utils.js +++ b/addons/im_livechat/static/tests/embed/helper/test_utils.js @@ -3,11 +3,11 @@ import { getPyEnv } from "@bus/../tests/helpers/mock_python_environment"; import { chatBotService } from "@im_livechat/embed/chatbot/chatbot_service"; -import { livechatService } from "@im_livechat/embed/core/livechat_service"; import { autoPopupService } from "@im_livechat/embed/core/autopopup_service"; +import { livechatService } from "@im_livechat/embed/core/livechat_service"; import { LivechatButton } from "@im_livechat/embed/core_ui/livechat_button"; -import { ChatWindowContainer } from "@mail/chat_window/chat_window_container"; +import { ChatWindowContainer } from "@mail/core/common/chat_window_container"; import { setupManager } from "@mail/../tests/helpers/webclient_setup"; import { App, onMounted } from "@odoo/owl"; @@ -15,10 +15,10 @@ import { App, onMounted } from "@odoo/owl"; import { registry } from "@web/core/registry"; import { patch } from "@web/core/utils/patch"; import { session } from "@web/session"; -import { fakeCookieService } from "@web/../tests/helpers/mock_services"; -import { createWebClient } from "@web/../tests/webclient/helpers"; import { registerCleanup } from "@web/../tests/helpers/cleanup"; +import { fakeCookieService } from "@web/../tests/helpers/mock_services"; import { patchWithCleanup, makeDeferred } from "@web/../tests/helpers/utils"; +import { createWebClient } from "@web/../tests/webclient/helpers"; // ============================================================================= // HELPERS diff --git a/addons/im_livechat/static/tests/embed/livechat_button_tests.js b/addons/im_livechat/static/tests/embed/livechat_button_tests.js index 0d984053799..b4eee0de872 100644 --- a/addons/im_livechat/static/tests/embed/livechat_button_tests.js +++ b/addons/im_livechat/static/tests/embed/livechat_button_tests.js @@ -1,8 +1,11 @@ -/** @odoo-module */ +/* @odoo-module */ -import { start, loadDefaultConfig } from "@im_livechat/../tests/embed/helper/test_utils"; -import { afterNextRender, click, insertText } from "@mail/../tests/helpers/test_utils"; import { startServer } from "@bus/../tests/helpers/mock_python_environment"; + +import { loadDefaultConfig, start } from "@im_livechat/../tests/embed/helper/test_utils"; + +import { afterNextRender, click, insertText } from "@mail/../tests/helpers/test_utils"; + import { triggerHotkey } from "@web/../tests/helpers/utils"; QUnit.test("open/close temporary channel", async (assert) => { diff --git a/addons/im_livechat/static/tests/embed/livechat_service_tests.js b/addons/im_livechat/static/tests/embed/livechat_service_tests.js index 95360ca0774..98be5fb129d 100644 --- a/addons/im_livechat/static/tests/embed/livechat_service_tests.js +++ b/addons/im_livechat/static/tests/embed/livechat_service_tests.js @@ -1,11 +1,11 @@ -/** @odoo-module **/ +/* @odoo-module */ import { startServer } from "@bus/../tests/helpers/mock_python_environment"; -import { loadDefaultConfig, start, setCookie } from "@im_livechat/../tests/embed/helper/test_utils"; +import { loadDefaultConfig, setCookie, start } from "@im_livechat/../tests/embed/helper/test_utils"; -import { click } from "@mail/../tests/helpers/test_utils"; import { Command } from "@mail/../tests/helpers/command"; +import { click } from "@mail/../tests/helpers/test_utils"; QUnit.module("livechat service"); diff --git a/addons/im_livechat/static/tests/embed/livechat_session_tests.js b/addons/im_livechat/static/tests/embed/livechat_session_tests.js index e88d7ef4b75..f97e197574e 100644 --- a/addons/im_livechat/static/tests/embed/livechat_session_tests.js +++ b/addons/im_livechat/static/tests/embed/livechat_session_tests.js @@ -1,10 +1,11 @@ /* @odoo-module */ import { startServer } from "@bus/../tests/helpers/mock_python_environment"; -import { loadDefaultConfig, start, setCookie } from "@im_livechat/../tests/embed/helper/test_utils"; -import { afterNextRender, insertText } from "@mail/../tests/helpers/test_utils"; +import { loadDefaultConfig, setCookie, start } from "@im_livechat/../tests/embed/helper/test_utils"; + import { Command } from "@mail/../tests/helpers/command"; +import { afterNextRender, insertText } from "@mail/../tests/helpers/test_utils"; import { triggerHotkey } from "@web/../tests/helpers/utils"; diff --git a/addons/im_livechat/static/tests/embed/model_definitions_setup.js b/addons/im_livechat/static/tests/embed/model_definitions_setup.js index 6bf208a9db5..d4b0b36ce3f 100644 --- a/addons/im_livechat/static/tests/embed/model_definitions_setup.js +++ b/addons/im_livechat/static/tests/embed/model_definitions_setup.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { addModelNamesToFetch, diff --git a/addons/im_livechat/static/tests/embed/transcript_sender_tests.js b/addons/im_livechat/static/tests/embed/transcript_sender_tests.js index 8d0d459fe08..d0fcd926c0b 100644 --- a/addons/im_livechat/static/tests/embed/transcript_sender_tests.js +++ b/addons/im_livechat/static/tests/embed/transcript_sender_tests.js @@ -1,8 +1,11 @@ -/** @odoo-module **/ +/* @odoo-module */ import { startServer } from "@bus/../tests/helpers/mock_python_environment"; -import { start, loadDefaultConfig } from "@im_livechat/../tests/embed/helper/test_utils"; + +import { loadDefaultConfig, start } from "@im_livechat/../tests/embed/helper/test_utils"; + import { afterNextRender, click, insertText } from "@mail/../tests/helpers/test_utils"; + import { triggerHotkey } from "@web/../tests/helpers/utils"; QUnit.module("transcript sender"); diff --git a/addons/im_livechat/static/tests/embed/unread_messages_tests.js b/addons/im_livechat/static/tests/embed/unread_messages_tests.js index 8de07c054a0..16ab91f4ee4 100644 --- a/addons/im_livechat/static/tests/embed/unread_messages_tests.js +++ b/addons/im_livechat/static/tests/embed/unread_messages_tests.js @@ -1,8 +1,8 @@ -/** @odoo-module **/ +/* @odoo-module */ import { startServer } from "@bus/../tests/helpers/mock_python_environment"; -import { setCookie, start, loadDefaultConfig } from "@im_livechat/../tests/embed/helper/test_utils"; +import { loadDefaultConfig, setCookie, start } from "@im_livechat/../tests/embed/helper/test_utils"; import { Command } from "@mail/../tests/helpers/command"; import { afterNextRender, waitUntil } from "@mail/../tests/helpers/test_utils"; diff --git a/addons/im_livechat/static/tests/helpers/mock_server/controllers/main.js b/addons/im_livechat/static/tests/helpers/mock_server/controllers/main.js index a6f1527ba65..e40c7e073c6 100644 --- a/addons/im_livechat/static/tests/helpers/mock_server/controllers/main.js +++ b/addons/im_livechat/static/tests/helpers/mock_server/controllers/main.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { patch } from "@web/core/utils/patch"; import { MockServer } from "@web/../tests/helpers/mock_server"; diff --git a/addons/im_livechat/static/tests/helpers/mock_server/models/discuss_channel.js b/addons/im_livechat/static/tests/helpers/mock_server/models/discuss_channel.js index c3e7fa03349..e921db59c95 100644 --- a/addons/im_livechat/static/tests/helpers/mock_server/models/discuss_channel.js +++ b/addons/im_livechat/static/tests/helpers/mock_server/models/discuss_channel.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import "@mail/../tests/helpers/mock_server/models/discuss_channel"; // ensure mail overrides are applied first diff --git a/addons/im_livechat/static/tests/helpers/mock_server/models/discuss_channel_member.js b/addons/im_livechat/static/tests/helpers/mock_server/models/discuss_channel_member.js index 8a95725ed03..dd53606863e 100644 --- a/addons/im_livechat/static/tests/helpers/mock_server/models/discuss_channel_member.js +++ b/addons/im_livechat/static/tests/helpers/mock_server/models/discuss_channel_member.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import "@mail/../tests/helpers/mock_server/models/discuss_channel_member"; // ensure mail overrides are applied first diff --git a/addons/im_livechat/static/tests/helpers/mock_server/models/im_livechat_channel.js b/addons/im_livechat/static/tests/helpers/mock_server/models/im_livechat_channel.js index a71628cec6e..a79bb584ceb 100644 --- a/addons/im_livechat/static/tests/helpers/mock_server/models/im_livechat_channel.js +++ b/addons/im_livechat/static/tests/helpers/mock_server/models/im_livechat_channel.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { patch } from "@web/core/utils/patch"; import { MockServer } from "@web/../tests/helpers/mock_server"; diff --git a/addons/im_livechat/static/tests/helpers/mock_server/models/res_partner.js b/addons/im_livechat/static/tests/helpers/mock_server/models/res_partner.js index 35ee1a4d85a..095c23f086d 100644 --- a/addons/im_livechat/static/tests/helpers/mock_server/models/res_partner.js +++ b/addons/im_livechat/static/tests/helpers/mock_server/models/res_partner.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import "@mail/../tests/helpers/mock_server/models/res_partner"; // ensure mail overrides are applied first diff --git a/addons/im_livechat/static/tests/helpers/model_definitions_setup.js b/addons/im_livechat/static/tests/helpers/model_definitions_setup.js index b094c0e11d4..f4ae844927e 100644 --- a/addons/im_livechat/static/tests/helpers/model_definitions_setup.js +++ b/addons/im_livechat/static/tests/helpers/model_definitions_setup.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { addModelNamesToFetch, diff --git a/addons/im_livechat/static/tests/messaging_menu_patch_tests.js b/addons/im_livechat/static/tests/messaging_menu_patch_tests.js index 29a1fe10367..125463811ee 100644 --- a/addons/im_livechat/static/tests/messaging_menu_patch_tests.js +++ b/addons/im_livechat/static/tests/messaging_menu_patch_tests.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { click, start, startServer } from "@mail/../tests/helpers/test_utils"; diff --git a/addons/im_livechat/static/tests/messaging_service_patch_tests.js b/addons/im_livechat/static/tests/messaging_service_patch_tests.js index 632d6a851f5..5612d6197b8 100644 --- a/addons/im_livechat/static/tests/messaging_service_patch_tests.js +++ b/addons/im_livechat/static/tests/messaging_service_patch_tests.js @@ -1,8 +1,10 @@ -/** @odoo-module */ +/* @odoo-module */ import { startServer } from "@bus/../tests/helpers/mock_python_environment"; import { makeFakePresenceService } from "@bus/../tests/helpers/mock_services"; + import { start } from "@mail/../tests/helpers/test_utils"; + import { makeFakeNotificationService } from "@web/../tests/helpers/mock_services"; import { nextTick } from "@web/../tests/helpers/utils"; diff --git a/addons/im_livechat/static/tests/mobile_messaging_menu_patch_tests.js b/addons/im_livechat/static/tests/mobile_messaging_menu_patch_tests.js index f0620480e39..0105c3460bf 100644 --- a/addons/im_livechat/static/tests/mobile_messaging_menu_patch_tests.js +++ b/addons/im_livechat/static/tests/mobile_messaging_menu_patch_tests.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { patchUiSize, SIZES } from "@mail/../tests/helpers/patch_ui_size"; import { click, start, startServer } from "@mail/../tests/helpers/test_utils"; diff --git a/addons/im_livechat/static/tests/sidebar_patch_tests.js b/addons/im_livechat/static/tests/sidebar_patch_tests.js index 2fed3d78ad1..8db05c0b024 100644 --- a/addons/im_livechat/static/tests/sidebar_patch_tests.js +++ b/addons/im_livechat/static/tests/sidebar_patch_tests.js @@ -1,10 +1,10 @@ -/** @odoo-module */ - -import { nextTick } from "@web/../tests/helpers/utils"; -import { makeFakeNotificationService } from "@web/../tests/helpers/mock_services"; +/* @odoo-module */ import { afterNextRender, click, start, startServer } from "@mail/../tests/helpers/test_utils"; +import { makeFakeNotificationService } from "@web/../tests/helpers/mock_services"; +import { nextTick } from "@web/../tests/helpers/utils"; + QUnit.module("discuss sidebar (patch)"); QUnit.test("Unknown visitor", async (assert) => { diff --git a/addons/im_livechat/static/tests/thread_icon_patch_tests.js b/addons/im_livechat/static/tests/thread_icon_patch_tests.js index 7511ae5c350..dac374da418 100644 --- a/addons/im_livechat/static/tests/thread_icon_patch_tests.js +++ b/addons/im_livechat/static/tests/thread_icon_patch_tests.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { afterNextRender, start, startServer } from "@mail/../tests/helpers/test_utils"; diff --git a/addons/im_livechat/static/tests/tours/im_livechat_channel_creation_tour.js b/addons/im_livechat/static/tests/tours/im_livechat_channel_creation_tour.js index 5b525e0f0a5..7cc3481877c 100644 --- a/addons/im_livechat/static/tests/tours/im_livechat_channel_creation_tour.js +++ b/addons/im_livechat/static/tests/tours/im_livechat_channel_creation_tour.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { registry } from "@web/core/registry"; diff --git a/addons/im_livechat/static/tests/tours/im_livechat_chatbot_steps_sequence_tour.js b/addons/im_livechat/static/tests/tours/im_livechat_chatbot_steps_sequence_tour.js index 0d3131d4340..9ac8b9276e1 100644 --- a/addons/im_livechat/static/tests/tours/im_livechat_chatbot_steps_sequence_tour.js +++ b/addons/im_livechat/static/tests/tours/im_livechat_chatbot_steps_sequence_tour.js @@ -1,6 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ import { registry } from "@web/core/registry"; + import { stepUtils } from "@web_tour/tour_service/tour_utils"; const commonSteps = [ diff --git a/addons/mail/__manifest__.py b/addons/mail/__manifest__.py index 8b58c1e8d18..f5194319eea 100644 --- a/addons/mail/__manifest__.py +++ b/addons/mail/__manifest__.py @@ -125,15 +125,19 @@ For more specific needs, you may also assign custom-defined actions 'mail/static/src/scss/variables/derived_variables.scss', 'mail/static/src/scss/*.scss', 'mail/static/lib/**/*', - 'mail/static/src/**/*', - ('remove', 'mail/static/src/worklets/**/*'), - ('remove', 'mail/static/src/**/public/**/*'), + 'mail/static/src/js/**/*', + 'mail/static/src/core/common/**/*', + 'mail/static/src/core/web/**/*', + 'mail/static/src/**/common/**/*', + 'mail/static/src/**/web/**/*', ('remove', 'mail/static/src/**/*.dark.scss'), - ('remove', 'mail/static/src/emoji_picker/emoji_data.js'), + ('remove', 'mail/static/src/core/common/emoji_data.js'), # discuss (loaded last to fix dependencies) ('remove', 'mail/static/src/discuss/**/*'), - 'mail/static/src/discuss/**/*', - ('remove', 'mail/static/src/discuss/**/public/**/*'), + 'mail/static/src/discuss/core/common/**/*', + 'mail/static/src/discuss/core/web/**/*', + 'mail/static/src/discuss/**/common/**/*', + 'mail/static/src/discuss/**/web/**/*', ('remove', 'mail/static/src/discuss/**/*.dark.scss'), ], "web.dark_mode_assets_backend": [ @@ -156,7 +160,7 @@ For more specific needs, you may also assign custom-defined actions ('remove', 'mail/static/tests/helpers/**/*'), ], 'mail.assets_emoji': [ - 'mail/static/src/emoji_picker/emoji_data.js', + 'mail/static/src/core/common/emoji_data.js', ], 'mail.assets_public': [ ('include', 'web._assets_helpers'), @@ -180,19 +184,18 @@ For more specific needs, you may also assign custom-defined actions 'web/static/src/legacy/legacy_load_views.js', 'web/static/src/legacy/utils.js', - 'mail/static/src/**/*', - ('remove', 'mail/static/src/js/**/*'), - ('remove', 'mail/static/src/scss/**/*'), - ('remove', 'mail/static/src/xml/**/*'), - ('remove', 'mail/static/src/worklets/**/*'), - ('remove', 'mail/static/src/views/**/*'), - ('remove', 'mail/static/src/**/web/**/*'), - ('remove', 'mail/static/src/emoji_picker/emoji_data.js'), + 'mail/static/src/core/common/**/*', + 'mail/static/src/core/public/**/*', + 'mail/static/src/**/common/**/*', + 'mail/static/src/**/public/**/*', + ('remove', 'mail/static/src/core/common/emoji_data.js'), ('remove', 'mail/static/src/**/*.dark.scss'), # discuss (loaded last to fix dependencies) ('remove', 'mail/static/src/discuss/**/*'), - 'mail/static/src/discuss/**/*', - ('remove', 'mail/static/src/discuss/**/web/**/*'), + 'mail/static/src/discuss/core/common/**/*', + # 'mail/static/src/discuss/core/public/**/*', + 'mail/static/src/discuss/**/common/**/*', + 'mail/static/src/discuss/**/public/**/*', ('remove', 'mail/static/src/discuss/**/*.dark.scss'), ] }, diff --git a/addons/mail/static/src/attachments/attachment_list.js b/addons/mail/static/src/core/common/attachment_list.js similarity index 84% rename from addons/mail/static/src/attachments/attachment_list.js rename to addons/mail/static/src/core/common/attachment_list.js index 827d315ac7e..6ce82b6a850 100644 --- a/addons/mail/static/src/attachments/attachment_list.js +++ b/addons/mail/static/src/core/common/attachment_list.js @@ -3,16 +3,15 @@ import { Component } from "@odoo/owl"; import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; +import { useFileViewer } from "@web/core/file_viewer/file_viewer_hook"; +import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; import { sprintf } from "@web/core/utils/strings"; -import { useFileViewer } from "@web/core/file_viewer/file_viewer_hook"; - -import { _t } from "@web/core/l10n/translation"; import { url } from "@web/core/utils/urls"; /** * @typedef {Object} Props - * @property {import("@mail/core/attachment_model").Attachment[]} attachments + * @property {import("@mail/core/common/attachment_model").Attachment[]} attachments * @property {function} unlinkAttachment * @property {number} imagesHeight * @extends {Component} @@ -29,21 +28,21 @@ export class AttachmentList extends Component { } /** - * @return {import("@mail/attachments/attachment_model").Attachment[]} + * @return {import("@mail/core/common/attachment_model").Attachment[]} */ get nonImagesAttachments() { return this.props.attachments.filter((attachment) => !attachment.isImage); } /** - * @return {import("@mail/attachments/attachment_model").Attachment[]} + * @return {import("@mail/core/common/attachment_model").Attachment[]} */ get imagesAttachments() { return this.props.attachments.filter((attachment) => attachment.isImage); } /** - * @param {import("@mail/attachments/attachment_model").Attachment} attachment + * @param {import("@mail/core/common/attachment_model").Attachment} attachment */ getImageUrl(attachment) { if (attachment.uploading && attachment.tmpUrl) { @@ -57,14 +56,14 @@ export class AttachmentList extends Component { } /** - * @param {import("@mail/attachments/attachment_model").Attachment} attachment + * @param {import("@mail/core/common/attachment_model").Attachment} attachment */ canDownload(attachment) { return !attachment.uploading && !this.env.inComposer; } /** - * @param {import("@mail/attachments/attachment_model").Attachment} attachment + * @param {import("@mail/core/common/attachment_model").Attachment} attachment */ onClickDownload(attachment) { const downloadLink = document.createElement("a"); @@ -77,7 +76,7 @@ export class AttachmentList extends Component { } /** - * @param {import("@mail/attachments/attachment_model").Attachment} attachment + * @param {import("@mail/core/common/attachment_model").Attachment} attachment */ onClickUnlink(attachment) { if (this.env.inComposer) { @@ -91,7 +90,7 @@ export class AttachmentList extends Component { } /** - * @param {import("@mail/attachments/attachment_model").Attachment} attachment + * @param {import("@mail/core/common/attachment_model").Attachment} attachment */ onConfirmUnlink(attachment) { this.props.unlinkAttachment(attachment); diff --git a/addons/mail/static/src/attachments/attachment_list.scss b/addons/mail/static/src/core/common/attachment_list.scss similarity index 100% rename from addons/mail/static/src/attachments/attachment_list.scss rename to addons/mail/static/src/core/common/attachment_list.scss diff --git a/addons/mail/static/src/attachments/attachment_list.xml b/addons/mail/static/src/core/common/attachment_list.xml similarity index 100% rename from addons/mail/static/src/attachments/attachment_list.xml rename to addons/mail/static/src/core/common/attachment_list.xml diff --git a/addons/mail/static/src/attachments/attachment_model.js b/addons/mail/static/src/core/common/attachment_model.js similarity index 91% rename from addons/mail/static/src/attachments/attachment_model.js rename to addons/mail/static/src/core/common/attachment_model.js index 325623b5560..159a7c30419 100644 --- a/addons/mail/static/src/attachments/attachment_model.js +++ b/addons/mail/static/src/core/common/attachment_model.js @@ -1,10 +1,11 @@ /* @odoo-module */ -import { assignDefined } from "@mail/utils/misc"; +import { assignDefined } from "@mail/utils/common/misc"; + import { url } from "@web/core/utils/urls"; export class Attachment { - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; accessToken; checksum; @@ -21,10 +22,10 @@ export class Attachment { url; /** @type {boolean} */ uploading; - /** @type {import("@mail/core/message_model").Message} */ + /** @type {import("@mail/core/common/message_model").Message} */ message; - /** @type {import("@mail/core/thread_model").Thread} */ + /** @type {import("@mail/core/common/thread_model").Thread} */ get originThread() { return this._store.threads[this.originThreadLocalId]; } @@ -90,7 +91,7 @@ export class Attachment { get defaultSource() { const route = url(this.urlRoute, this.urlQueryParams); - const encodedRoute = encodeURIComponent(route) + const encodedRoute = encodeURIComponent(route); if (this.isPdf) { return `/web/static/lib/pdfjs/web/viewer.html?file=${encodedRoute}#pagemode=none`; } diff --git a/addons/mail/static/src/attachments/attachment_service.js b/addons/mail/static/src/core/common/attachment_service.js similarity index 92% rename from addons/mail/static/src/attachments/attachment_service.js rename to addons/mail/static/src/core/common/attachment_service.js index 7b7f3b91095..440630af27c 100644 --- a/addons/mail/static/src/attachments/attachment_service.js +++ b/addons/mail/static/src/core/common/attachment_service.js @@ -1,14 +1,15 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Attachment } from "@mail/core/common/attachment_model"; +import { removeFromArrayWithPredicate } from "@mail/utils/common/arrays"; +import { assignDefined, createLocalId } from "@mail/utils/common/misc"; -import { Attachment } from "./attachment_model"; -import { assignDefined, createLocalId } from "../utils/misc"; import { registry } from "@web/core/registry"; -import { removeFromArrayWithPredicate } from "../utils/arrays"; export class AttachmentService { constructor(env, services) { this.env = env; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = services["mail.store"]; this.rpc = services["rpc"]; } diff --git a/addons/mail/static/src/attachments/attachment_uploader_hook.js b/addons/mail/static/src/core/common/attachment_uploader_hook.js similarity index 93% rename from addons/mail/static/src/attachments/attachment_uploader_hook.js rename to addons/mail/static/src/core/common/attachment_uploader_hook.js index 7fe7ce4a94d..59be5bb0d15 100644 --- a/addons/mail/static/src/attachments/attachment_uploader_hook.js +++ b/addons/mail/static/src/core/common/attachment_uploader_hook.js @@ -1,10 +1,11 @@ /* @odoo-module */ import { useState } from "@odoo/owl"; + +import { _t } from "@web/core/l10n/translation"; import { Deferred } from "@web/core/utils/concurrency"; import { useBus, useService } from "@web/core/utils/hooks"; -import { createLocalId } from "@mail/utils/misc"; -import { _t } from "@web/core/l10n/translation"; +import { createLocalId } from "@mail/utils/common/misc"; function dataUrlToBlob(data, type) { const binData = window.atob(data); @@ -16,19 +17,19 @@ function dataUrlToBlob(data, type) { let nextId = -1; /** - * @param {import("@mail/core/thread_model").Thread} thread + * @param {import("@mail/core/common/thread_model").Thread} thread * @param {Object} [param1={}] - * @param {import("@mail/composer/composer_model").Composer} [param1.composer] + * @param {import("@mail/core/common/composer_model").Composer} [param1.composer] * @param {function} [param1.onFileUploaded] */ export function useAttachmentUploader(thread, { composer, onFileUploaded } = {}) { const { bus, upload } = useService("file_upload"); const notificationService = useService("notification"); - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ const store = useService("mail.store"); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ const threadService = useService("mail.thread"); - /** @type {import("@mail/attachments/attachment_service").AttachmentService} */ + /** @type {import("@mail/core/common/attachment_service").AttachmentService} */ const attachmentService = useService("mail.attachment"); const abortByAttachmentId = new Map(); const deferredByAttachmentId = new Map(); diff --git a/addons/mail/static/src/attachments/attachment_view.js b/addons/mail/static/src/core/common/attachment_view.js similarity index 92% rename from addons/mail/static/src/attachments/attachment_view.js rename to addons/mail/static/src/core/common/attachment_view.js index 5a554ee7bb6..b8ce304fa36 100644 --- a/addons/mail/static/src/attachments/attachment_view.js +++ b/addons/mail/static/src/core/common/attachment_view.js @@ -17,11 +17,11 @@ export class AttachmentView extends Component { static props = ["threadId", "threadModel"]; setup() { - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useService("mail.thread"); this.iframeViewerPdfRef = useRef("iframeViewerPdf"); this.state = useState({ - /** @type {import("@mail/core/thread_model").Thread} */ + /** @type {import("@mail/core/common/thread_model").Thread} */ thread: undefined, }); useEffect(() => { diff --git a/addons/mail/static/src/attachments/attachment_view.scss b/addons/mail/static/src/core/common/attachment_view.scss similarity index 100% rename from addons/mail/static/src/attachments/attachment_view.scss rename to addons/mail/static/src/core/common/attachment_view.scss diff --git a/addons/mail/static/src/attachments/attachment_view.xml b/addons/mail/static/src/core/common/attachment_view.xml similarity index 100% rename from addons/mail/static/src/attachments/attachment_view.xml rename to addons/mail/static/src/core/common/attachment_view.xml diff --git a/addons/mail/static/src/discuss_app/autoresize_input.js b/addons/mail/static/src/core/common/autoresize_input.js similarity index 96% rename from addons/mail/static/src/discuss_app/autoresize_input.js rename to addons/mail/static/src/core/common/autoresize_input.js index 401f76bd98b..5155b407997 100644 --- a/addons/mail/static/src/discuss_app/autoresize_input.js +++ b/addons/mail/static/src/core/common/autoresize_input.js @@ -1,7 +1,9 @@ /* @odoo-module */ -import { onExternalClick } from "@mail/utils/hooks"; +import { onExternalClick } from "@mail/utils/common/hooks"; + import { Component, useRef, useState, onWillUpdateProps } from "@odoo/owl"; + import { useAutoresize } from "@web/core/utils/autoresize"; export class AutoresizeInput extends Component { diff --git a/addons/mail/static/src/discuss_app/autoresize_input.scss b/addons/mail/static/src/core/common/autoresize_input.scss similarity index 100% rename from addons/mail/static/src/discuss_app/autoresize_input.scss rename to addons/mail/static/src/core/common/autoresize_input.scss diff --git a/addons/mail/static/src/discuss_app/autoresize_input.xml b/addons/mail/static/src/core/common/autoresize_input.xml similarity index 100% rename from addons/mail/static/src/discuss_app/autoresize_input.xml rename to addons/mail/static/src/core/common/autoresize_input.xml diff --git a/addons/mail/static/src/core/canned_response_model.js b/addons/mail/static/src/core/common/canned_response_model.js similarity index 100% rename from addons/mail/static/src/core/canned_response_model.js rename to addons/mail/static/src/core/common/canned_response_model.js diff --git a/addons/mail/static/src/core/channel_member_model.js b/addons/mail/static/src/core/common/channel_member_model.js similarity index 84% rename from addons/mail/static/src/core/channel_member_model.js rename to addons/mail/static/src/core/common/channel_member_model.js index 47b445fb328..6ff86d4a4da 100644 --- a/addons/mail/static/src/core/channel_member_model.js +++ b/addons/mail/static/src/core/common/channel_member_model.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import { createLocalId } from "../utils/misc"; +import { createLocalId } from "@mail/utils/common/misc"; /** * @class ChannelMember @@ -15,7 +15,7 @@ export class ChannelMember { personaLocalId; rtcSessionId; threadId; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; get persona() { diff --git a/addons/mail/static/src/core/channel_member_service.js b/addons/mail/static/src/core/common/channel_member_service.js similarity index 94% rename from addons/mail/static/src/core/channel_member_service.js rename to addons/mail/static/src/core/common/channel_member_service.js index b1362a64f35..f9b769e6974 100644 --- a/addons/mail/static/src/core/channel_member_service.js +++ b/addons/mail/static/src/core/common/channel_member_service.js @@ -1,8 +1,9 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { ChannelMember } from "@mail/core/common/channel_member_model"; +import { removeFromArray } from "@mail/utils/common/arrays"; import { registry } from "@web/core/registry"; -import { removeFromArray } from "../utils/arrays"; -import { ChannelMember } from "./channel_member_model"; export class ChannelMemberService { constructor(env, { "mail.store": store, "mail.persona": personaService }) { diff --git a/addons/mail/static/src/discuss_app/channel_selector.js b/addons/mail/static/src/core/common/channel_selector.js similarity index 96% rename from addons/mail/static/src/discuss_app/channel_selector.js rename to addons/mail/static/src/core/common/channel_selector.js index f9362e19593..961123c4a19 100644 --- a/addons/mail/static/src/discuss_app/channel_selector.js +++ b/addons/mail/static/src/core/common/channel_selector.js @@ -1,14 +1,16 @@ /* @odoo-module */ -import { useStore } from "../core/messaging_hook"; -import { TagsList } from "@web/core/tags_list/tags_list"; -import { NavigableList } from "../composer/navigable_list"; -import { useService } from "@web/core/utils/hooks"; -import { getActiveHotkey } from "@web/core/hotkeys/hotkey_service"; +import { useStore } from "@mail/core/common/messaging_hook"; +import { NavigableList } from "@mail/core/common/navigable_list"; +import { cleanTerm } from "@mail/utils/common/format"; +import { createLocalId, isEventHandled, markEventHandled } from "@mail/utils/common/misc"; + import { Component, onMounted, useRef, useState } from "@odoo/owl"; -import { cleanTerm } from "@mail/utils/format"; -import { createLocalId, isEventHandled, markEventHandled } from "@mail/utils/misc"; + +import { getActiveHotkey } from "@web/core/hotkeys/hotkey_service"; import { _t } from "@web/core/l10n/translation"; +import { TagsList } from "@web/core/tags_list/tags_list"; +import { useService } from "@web/core/utils/hooks"; export class ChannelSelector extends Component { static components = { TagsList, NavigableList }; @@ -20,7 +22,7 @@ export class ChannelSelector extends Component { this.store = useStore(); this.threadService = useState(useService("mail.thread")); this.personaService = useService("mail.persona"); - /** @type {import("@mail/composer/suggestion_service").SuggestionService} */ + /** @type {import("@mail/core/common/suggestion_service").SuggestionService} */ this.suggestionService = useService("mail.suggestion"); this.orm = useService("orm"); this.state = useState({ diff --git a/addons/mail/static/src/discuss_app/channel_selector.scss b/addons/mail/static/src/core/common/channel_selector.scss similarity index 100% rename from addons/mail/static/src/discuss_app/channel_selector.scss rename to addons/mail/static/src/core/common/channel_selector.scss diff --git a/addons/mail/static/src/discuss_app/channel_selector.xml b/addons/mail/static/src/core/common/channel_selector.xml similarity index 100% rename from addons/mail/static/src/discuss_app/channel_selector.xml rename to addons/mail/static/src/core/common/channel_selector.xml diff --git a/addons/mail/static/src/chat_window/chat_window.js b/addons/mail/static/src/core/common/chat_window.js similarity index 83% rename from addons/mail/static/src/chat_window/chat_window.js rename to addons/mail/static/src/core/common/chat_window.js index 1a756b5e943..88c0e68bd5f 100644 --- a/addons/mail/static/src/chat_window/chat_window.js +++ b/addons/mail/static/src/core/common/chat_window.js @@ -1,23 +1,29 @@ /* @odoo-module */ -import { Thread } from "@mail/core_ui/thread"; -import { Composer } from "@mail/composer/composer"; -import { useStore } from "@mail/core/messaging_hook"; -import { useThreadActions } from "@mail/core/thread_actions"; -import { useMessageEdition, useMessageHighlight, useMessageToReplyTo } from "@mail/utils/hooks"; +import { Composer } from "@mail/core/common/composer"; +import { ImStatus } from "@mail/core/common/im_status"; +import { useStore } from "@mail/core/common/messaging_hook"; +import { Thread } from "@mail/core/common/thread"; +import { useThreadActions } from "@mail/core/common/thread_actions"; +import { ThreadIcon } from "@mail/core/common/thread_icon"; +import { + useMessageEdition, + useMessageHighlight, + useMessageToReplyTo, +} from "@mail/utils/common/hooks"; +import { isEventHandled } from "@mail/utils/common/misc"; + import { Component, useChildSubEnv, useRef, useState } from "@odoo/owl"; -import { useService } from "@web/core/utils/hooks"; -import { localization } from "@web/core/l10n/localization"; -import { ThreadIcon } from "@mail/discuss_app/thread_icon"; -import { ImStatus } from "@mail/discuss_app/im_status"; -import { isEventHandled } from "@mail/utils/misc"; -import { _t } from "@web/core/l10n/translation"; + import { Dropdown } from "@web/core/dropdown/dropdown"; import { DropdownItem } from "@web/core/dropdown/dropdown_item"; +import { localization } from "@web/core/l10n/localization"; +import { _t } from "@web/core/l10n/translation"; +import { useService } from "@web/core/utils/hooks"; /** * @typedef {Object} Props - * @property {import("@mail/chat_window/chat_window_model").ChatWindow} chatWindow + * @property {import("@mail/core/common/chat_window_model").ChatWindow} chatWindow * @property {boolean} [right] * @extends {Component} */ @@ -35,9 +41,9 @@ export class ChatWindow extends Component { setup() { this.store = useStore(); - /** @type {import("@mail/chat_window/chat_window_service").ChatWindowService} */ + /** @type {import("@mail/core/common/chat_window_service").ChatWindowService} */ this.chatWindowService = useState(useService("mail.chat_window")); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useState(useService("mail.thread")); this.messageEdition = useMessageEdition(); this.messageHighlight = useMessageHighlight(); diff --git a/addons/mail/static/src/chat_window/chat_window.scss b/addons/mail/static/src/core/common/chat_window.scss similarity index 100% rename from addons/mail/static/src/chat_window/chat_window.scss rename to addons/mail/static/src/core/common/chat_window.scss diff --git a/addons/mail/static/src/chat_window/chat_window.xml b/addons/mail/static/src/core/common/chat_window.xml similarity index 100% rename from addons/mail/static/src/chat_window/chat_window.xml rename to addons/mail/static/src/core/common/chat_window.xml diff --git a/addons/mail/static/src/chat_window/chat_window_container.js b/addons/mail/static/src/core/common/chat_window_container.js similarity index 94% rename from addons/mail/static/src/chat_window/chat_window_container.js rename to addons/mail/static/src/core/common/chat_window_container.js index 96977606635..6e00fba4ecd 100644 --- a/addons/mail/static/src/chat_window/chat_window_container.js +++ b/addons/mail/static/src/core/common/chat_window_container.js @@ -1,12 +1,12 @@ /* @odoo-module */ -import { ChatWindow } from "@mail/chat_window/chat_window"; +import { ChatWindow } from "@mail/core/common/chat_window"; import { CHAT_WINDOW_END_GAP_WIDTH, CHAT_WINDOW_INBETWEEN_WIDTH, CHAT_WINDOW_WIDTH, -} from "@mail/chat_window/chat_window_service"; -import { useMessaging, useStore } from "@mail/core/messaging_hook"; +} from "@mail/core/common/chat_window_service"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; import { Component, @@ -20,9 +20,9 @@ import { import { browser } from "@web/core/browser/browser"; import { Dropdown } from "@web/core/dropdown/dropdown"; +import { localization } from "@web/core/l10n/localization"; import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; -import { localization } from "@web/core/l10n/localization"; export class ChatWindowContainer extends Component { static components = { ChatWindow, Dropdown }; diff --git a/addons/mail/static/src/chat_window/chat_window_container.scss b/addons/mail/static/src/core/common/chat_window_container.scss similarity index 100% rename from addons/mail/static/src/chat_window/chat_window_container.scss rename to addons/mail/static/src/core/common/chat_window_container.scss diff --git a/addons/mail/static/src/chat_window/chat_window_container.xml b/addons/mail/static/src/core/common/chat_window_container.xml similarity index 100% rename from addons/mail/static/src/chat_window/chat_window_container.xml rename to addons/mail/static/src/core/common/chat_window_container.xml diff --git a/addons/mail/static/src/chat_window/chat_window_model.js b/addons/mail/static/src/core/common/chat_window_model.js similarity index 66% rename from addons/mail/static/src/chat_window/chat_window_model.js rename to addons/mail/static/src/core/common/chat_window_model.js index 3541f693f74..7ca89453f4d 100644 --- a/addons/mail/static/src/chat_window/chat_window_model.js +++ b/addons/mail/static/src/core/common/chat_window_model.js @@ -1,21 +1,21 @@ /* @odoo-module */ -/** @typedef {{ thread?: import("@mail/core/thread_model").Thread, folded?: boolean, replaceNewMessageChatWindow?: boolean }} ChatWindowData */ - import { _t } from "@web/core/l10n/translation"; +/** @typedef {{ thread?: import("@mail/core/common/thread_model").Thread, folded?: boolean, replaceNewMessageChatWindow?: boolean }} ChatWindowData */ + export class ChatWindow { - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; - /** @type {import("@mail/core/thread_model").Thread.localId} */ + /** @type {import("@mail/core/common/thread_model").Thread.localId} */ threadLocalId; autofocus = 0; folded = false; hidden = false; /** - * @param {import("@mail/core/store_service").Store} store + * @param {import("@mail/core/common/store_service").Store} store * @param {ChatWindowData} data * @returns {ChatWindow} */ diff --git a/addons/mail/static/src/chat_window/chat_window_service.js b/addons/mail/static/src/core/common/chat_window_service.js similarity index 96% rename from addons/mail/static/src/chat_window/chat_window_service.js rename to addons/mail/static/src/core/common/chat_window_service.js index 85b48f3c81a..3a014482ddc 100644 --- a/addons/mail/static/src/chat_window/chat_window_service.js +++ b/addons/mail/static/src/core/common/chat_window_service.js @@ -1,8 +1,9 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { ChatWindow } from "@mail/core/common/chat_window_model"; +import { assignDefined } from "@mail/utils/common/misc"; import { browser } from "@web/core/browser/browser"; -import { ChatWindow } from "@mail/chat_window/chat_window_model"; -import { assignDefined } from "@mail/utils/misc"; import { registry } from "@web/core/registry"; export const CHAT_WINDOW_END_GAP_WIDTH = 10; // for a single end, multiply by 2 for left and right together. @@ -17,7 +18,7 @@ export class ChatWindowService { setup(env, services) { this.env = env; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = services["mail.store"]; this.orm = services.orm; this.ui = services.ui; diff --git a/addons/mail/static/src/composer/composer.js b/addons/mail/static/src/core/common/composer.js similarity index 93% rename from addons/mail/static/src/composer/composer.js rename to addons/mail/static/src/core/common/composer.js index 61943de6997..23569eeed7e 100644 --- a/addons/mail/static/src/composer/composer.js +++ b/addons/mail/static/src/core/common/composer.js @@ -1,29 +1,33 @@ /* @odoo-module */ -import { AttachmentList } from "@mail/attachments/attachment_list"; -import { useAttachmentUploader } from "@mail/attachments/attachment_uploader_hook"; -import { useSelection } from "@mail/utils/hooks"; -import { isDragSourceExternalFile, isEventHandled, markEventHandled } from "@mail/utils/misc"; -import { Component, onMounted, useChildSubEnv, useEffect, useRef, useState } from "@odoo/owl"; -import { useDropzone } from "../dropzone/dropzone_hook"; -import { useMessaging, useStore } from "../core/messaging_hook"; -import { useEmojiPicker } from "../emoji_picker/emoji_picker"; +import { AttachmentList } from "@mail/core/common/attachment_list"; +import { useAttachmentUploader } from "@mail/core/common/attachment_uploader_hook"; +import { useDropzone } from "@mail/core/common/dropzone_hook"; +import { useEmojiPicker } from "@mail/core/common/emoji_picker"; +import { MessageConfirmDialog } from "@mail/core/common/message_confirm_dialog"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { NavigableList } from "@mail/core/common/navigable_list"; +import { useSuggestion } from "@mail/core/common/suggestion_hook"; +import { escapeAndCompactTextContent } from "@mail/utils/common/format"; +import { useSelection } from "@mail/utils/common/hooks"; +import { + isDragSourceExternalFile, + isEventHandled, + markEventHandled, +} from "@mail/utils/common/misc"; -import { sprintf } from "@web/core/utils/strings"; -import { escapeAndCompactTextContent } from "../utils/format.js"; -import { FileUploader } from "@web/views/fields/file_handler"; -import { NavigableList } from "@mail/composer/navigable_list"; -import { useSuggestion } from "@mail/composer/suggestion_hook"; +import { Component, onMounted, useChildSubEnv, useEffect, useRef, useState } from "@odoo/owl"; import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; -import { MessageConfirmDialog } from "../core_ui/message_confirm_dialog"; +import { sprintf } from "@web/core/utils/strings"; +import { FileUploader } from "@web/views/fields/file_handler"; /** * @typedef {Object} Props - * @property {import("@mail/composer/composer_model").Composer} composer - * @property {import("@mail/utils/hooks").MessageToReplyTo} messageToReplyTo - * @property {import("@mail/utils/hooks").MessageEdition} [messageEdition] + * @property {import("@mail/core/common/composer_model").Composer} composer + * @property {import("@mail/utils/common/hooks").MessageToReplyTo} messageToReplyTo + * @property {import("@mail/utils/common/hooks").MessageEdition} [messageEdition] * @property {'compact'|'normal'|'extended'} [mode] default: 'normal' * @property {string} [placeholder] * @property {string} [className] @@ -71,7 +75,7 @@ export class Composer extends Component { ); } this.messageService = useState(useService("mail.message")); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useService("mail.thread"); this.ui = useState(useService("ui")); this.ref = useRef("textarea"); diff --git a/addons/mail/static/src/composer/composer.scss b/addons/mail/static/src/core/common/composer.scss similarity index 100% rename from addons/mail/static/src/composer/composer.scss rename to addons/mail/static/src/core/common/composer.scss diff --git a/addons/mail/static/src/composer/composer.xml b/addons/mail/static/src/core/common/composer.xml similarity index 100% rename from addons/mail/static/src/composer/composer.xml rename to addons/mail/static/src/core/common/composer.xml diff --git a/addons/mail/static/src/composer/composer_model.js b/addons/mail/static/src/core/common/composer_model.js similarity index 79% rename from addons/mail/static/src/composer/composer_model.js rename to addons/mail/static/src/core/common/composer_model.js index 55d2146abbb..bb612448cb8 100644 --- a/addons/mail/static/src/composer/composer_model.js +++ b/addons/mail/static/src/core/common/composer_model.js @@ -1,9 +1,9 @@ /* @odoo-module */ export class Composer { - /** @type {import("@mail/attachments/attachment_model").Attachment[]} */ + /** @type {import("@mail/core/common/attachment_model").Attachment[]} */ attachments = []; - /** @type {import("@mail/core/message_model").Message} */ + /** @type {import("@mail/core/common/message_model").Message} */ message; rawMentions = { partnerIds: new Set(), @@ -11,7 +11,7 @@ export class Composer { }; /** @type {string} */ textInputContent; - /** @type {import("@mail/core/thread_model").Thread */ + /** @type {import("@mail/core/common/thread_model").Thread */ thread; /** @type {{ start: number, end: number, direction: "forward" | "backward" | "none"}}*/ selection = { @@ -23,7 +23,7 @@ export class Composer { forceCursorMove; /** @typedef {'message' | 'note' | false} */ type; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; isFocused = false; diff --git a/addons/mail/static/src/core_ui/core.scss b/addons/mail/static/src/core/common/core.scss similarity index 100% rename from addons/mail/static/src/core_ui/core.scss rename to addons/mail/static/src/core/common/core.scss diff --git a/addons/mail/static/src/discuss_app/discuss.js b/addons/mail/static/src/core/common/discuss.js similarity index 87% rename from addons/mail/static/src/discuss_app/discuss.js rename to addons/mail/static/src/core/common/discuss.js index 5e171c07275..98eddb88720 100644 --- a/addons/mail/static/src/discuss_app/discuss.js +++ b/addons/mail/static/src/core/common/discuss.js @@ -1,14 +1,18 @@ /* @odoo-module */ -import { Composer } from "@mail/composer/composer"; -import { useMessaging, useStore } from "@mail/core/messaging_hook"; -import { useThreadActions } from "@mail/core/thread_actions"; -import { Thread } from "@mail/core_ui/thread"; -import { AutoresizeInput } from "@mail/discuss_app/autoresize_input"; -import { ImStatus } from "@mail/discuss_app/im_status"; -import { ThreadIcon } from "@mail/discuss_app/thread_icon"; -import { useMessageEdition, useMessageHighlight, useMessageToReplyTo } from "@mail/utils/hooks"; -import { FileUploader } from "@web/views/fields/file_handler"; +import { AutoresizeInput } from "@mail/core/common/autoresize_input"; +import { Composer } from "@mail/core/common/composer"; +import { ImStatus } from "@mail/core/common/im_status"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { Thread } from "@mail/core/common/thread"; +import { useThreadActions } from "@mail/core/common/thread_actions"; +import { ThreadIcon } from "@mail/core/common/thread_icon"; +import { + useMessageEdition, + useMessageHighlight, + useMessageToReplyTo, +} from "@mail/utils/common/hooks"; + import { Component, onWillStart, @@ -19,9 +23,11 @@ import { useState, useEffect, } from "@odoo/owl"; -import { useService } from "@web/core/utils/hooks"; + import { _t } from "@web/core/l10n/translation"; +import { useService } from "@web/core/utils/hooks"; import { url } from "@web/core/utils/urls"; +import { FileUploader } from "@web/views/fields/file_handler"; export class Discuss extends Component { static components = { diff --git a/addons/mail/static/src/discuss_app/discuss.scss b/addons/mail/static/src/core/common/discuss.scss similarity index 100% rename from addons/mail/static/src/discuss_app/discuss.scss rename to addons/mail/static/src/core/common/discuss.scss diff --git a/addons/mail/static/src/discuss_app/discuss.xml b/addons/mail/static/src/core/common/discuss.xml similarity index 100% rename from addons/mail/static/src/discuss_app/discuss.xml rename to addons/mail/static/src/core/common/discuss.xml diff --git a/addons/mail/static/src/dropzone/dropzone.js b/addons/mail/static/src/core/common/dropzone.js similarity index 90% rename from addons/mail/static/src/dropzone/dropzone.js rename to addons/mail/static/src/core/common/dropzone.js index 6b91023ef54..37c09b92c79 100644 --- a/addons/mail/static/src/dropzone/dropzone.js +++ b/addons/mail/static/src/core/common/dropzone.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import { Component, useRef, useState, useEffect } from "@odoo/owl"; +import { Component, useEffect, useRef, useState } from "@odoo/owl"; export class Dropzone extends Component { static props = { diff --git a/addons/mail/static/src/dropzone/dropzone.scss b/addons/mail/static/src/core/common/dropzone.scss similarity index 100% rename from addons/mail/static/src/dropzone/dropzone.scss rename to addons/mail/static/src/core/common/dropzone.scss diff --git a/addons/mail/static/src/dropzone/dropzone.xml b/addons/mail/static/src/core/common/dropzone.xml similarity index 100% rename from addons/mail/static/src/dropzone/dropzone.xml rename to addons/mail/static/src/core/common/dropzone.xml diff --git a/addons/mail/static/src/dropzone/dropzone_hook.js b/addons/mail/static/src/core/common/dropzone_hook.js similarity index 93% rename from addons/mail/static/src/dropzone/dropzone_hook.js rename to addons/mail/static/src/core/common/dropzone_hook.js index 4bb1957a105..6fe0ed2d246 100644 --- a/addons/mail/static/src/dropzone/dropzone_hook.js +++ b/addons/mail/static/src/core/common/dropzone_hook.js @@ -1,8 +1,10 @@ /* @odoo-module */ +import { Dropzone } from "@mail/core/common/dropzone"; + +import { useEffect, useExternalListener } from "@odoo/owl"; + import { registry } from "@web/core/registry"; -import { Dropzone } from "./dropzone"; -import { useExternalListener, useEffect } from "@odoo/owl"; const componentRegistry = registry.category("main_components"); diff --git a/addons/mail/static/src/emoji_picker/emoji_data.js b/addons/mail/static/src/core/common/emoji_data.js similarity index 100% rename from addons/mail/static/src/emoji_picker/emoji_data.js rename to addons/mail/static/src/core/common/emoji_data.js diff --git a/addons/mail/static/src/emoji_picker/emoji_picker.js b/addons/mail/static/src/core/common/emoji_picker.js similarity index 98% rename from addons/mail/static/src/emoji_picker/emoji_picker.js rename to addons/mail/static/src/core/common/emoji_picker.js index b6e5015de2b..d8451609a93 100644 --- a/addons/mail/static/src/emoji_picker/emoji_picker.js +++ b/addons/mail/static/src/core/common/emoji_picker.js @@ -1,18 +1,19 @@ /* @odoo-module */ -import { markEventHandled } from "@mail/utils/misc"; +import { markEventHandled } from "@mail/utils/common/misc"; import { Component, onMounted, + onPatched, + onWillPatch, onWillStart, + onWillUnmount, useEffect, useRef, useState, - onPatched, - onWillPatch, - onWillUnmount, } from "@odoo/owl"; + import { getBundle, loadBundle } from "@web/core/assets"; import { browser } from "@web/core/browser/browser"; import { _t } from "@web/core/l10n/translation"; @@ -108,12 +109,12 @@ export const loader = { }; /** - * @returns {import("@mail/emoji_picker/emoji_data")} + * @returns {import("@mail/core/common/emoji_data")} */ export async function loadEmoji() { try { await loader.loadEmoji(); - return odoo.runtimeImport("@mail/emoji_picker/emoji_data"); + return odoo.runtimeImport("@mail/core/common/emoji_data"); } catch { // Could be intentional (tour ended successfully while emoji still loading) return { emojis: [], categories: [] }; diff --git a/addons/mail/static/src/emoji_picker/emoji_picker.scss b/addons/mail/static/src/core/common/emoji_picker.scss similarity index 100% rename from addons/mail/static/src/emoji_picker/emoji_picker.scss rename to addons/mail/static/src/core/common/emoji_picker.scss diff --git a/addons/mail/static/src/emoji_picker/emoji_picker.xml b/addons/mail/static/src/core/common/emoji_picker.xml similarity index 100% rename from addons/mail/static/src/emoji_picker/emoji_picker.xml rename to addons/mail/static/src/core/common/emoji_picker.xml diff --git a/addons/mail/static/src/core/follower_model.js b/addons/mail/static/src/core/common/follower_model.js similarity index 60% rename from addons/mail/static/src/core/follower_model.js rename to addons/mail/static/src/core/common/follower_model.js index e0cda1ede43..ae1c8b1949b 100644 --- a/addons/mail/static/src/core/follower_model.js +++ b/addons/mail/static/src/core/common/follower_model.js @@ -2,22 +2,22 @@ /** * @typedef Data - * @property {import("@mail/core/thread_model").Thread} followedThread + * @property {import("@mail/core/common/thread_model").Thread} followedThread * @property {number} id * @property {Boolean} is_active - * @property {import("@mail/core/partner_model").Data} partner + * @property {import("@mail/core/common/partner_model").Data} partner */ export class Follower { - /** @type {import("@mail/core/thread_model").Thread} */ + /** @type {import("@mail/core/common/thread_model").Thread} */ followedThread; /** @type {number} */ id; /** @type {boolean} */ isActive; - /** @type {import("@mail/core/persona_model").Persona} */ + /** @type {import("@mail/core/common/persona_model").Persona} */ partner; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; /** diff --git a/addons/mail/static/src/discuss_app/im_status.js b/addons/mail/static/src/core/common/im_status.js similarity index 100% rename from addons/mail/static/src/discuss_app/im_status.js rename to addons/mail/static/src/core/common/im_status.js diff --git a/addons/mail/static/src/discuss_app/im_status.scss b/addons/mail/static/src/core/common/im_status.scss similarity index 100% rename from addons/mail/static/src/discuss_app/im_status.scss rename to addons/mail/static/src/core/common/im_status.scss diff --git a/addons/mail/static/src/discuss_app/im_status.xml b/addons/mail/static/src/core/common/im_status.xml similarity index 100% rename from addons/mail/static/src/discuss_app/im_status.xml rename to addons/mail/static/src/core/common/im_status.xml diff --git a/addons/mail/static/src/core_ui/link_preview/link_preview.js b/addons/mail/static/src/core/common/link_preview.js similarity index 77% rename from addons/mail/static/src/core_ui/link_preview/link_preview.js rename to addons/mail/static/src/core/common/link_preview.js index 7cfa46e0346..b63ab369eb6 100644 --- a/addons/mail/static/src/core_ui/link_preview/link_preview.js +++ b/addons/mail/static/src/core/common/link_preview.js @@ -1,12 +1,14 @@ /* @odoo-module */ -import { useService } from "@web/core/utils/hooks"; +import { LinkPreviewConfirmDelete } from "@mail/core/common/link_preview_confirm_delete"; + import { Component } from "@odoo/owl"; -import { LinkPreviewConfirmDelete } from "./link_preview_confirm_delete"; + +import { useService } from "@web/core/utils/hooks"; /** * @typedef {Object} Props - * @property {import("@mail/core/link_preview_model").LinkPreview} linkPreview + * @property {import("@mail/core/common/link_preview_model").LinkPreview} linkPreview * @property {boolean} [deletable] * @extends {Component} */ diff --git a/addons/mail/static/src/core_ui/link_preview/link_preview.scss b/addons/mail/static/src/core/common/link_preview.scss similarity index 100% rename from addons/mail/static/src/core_ui/link_preview/link_preview.scss rename to addons/mail/static/src/core/common/link_preview.scss diff --git a/addons/mail/static/src/core_ui/link_preview/link_preview.xml b/addons/mail/static/src/core/common/link_preview.xml similarity index 100% rename from addons/mail/static/src/core_ui/link_preview/link_preview.xml rename to addons/mail/static/src/core/common/link_preview.xml diff --git a/addons/mail/static/src/core_ui/link_preview/link_preview_confirm_delete.js b/addons/mail/static/src/core/common/link_preview_confirm_delete.js similarity index 90% rename from addons/mail/static/src/core_ui/link_preview/link_preview_confirm_delete.js rename to addons/mail/static/src/core/common/link_preview_confirm_delete.js index df5a93da22b..68eeaa36873 100644 --- a/addons/mail/static/src/core_ui/link_preview/link_preview_confirm_delete.js +++ b/addons/mail/static/src/core/common/link_preview_confirm_delete.js @@ -1,12 +1,13 @@ /* @odoo-module */ -import { useService } from "@web/core/utils/hooks"; import { Component } from "@odoo/owl"; + import { Dialog } from "@web/core/dialog/dialog"; +import { useService } from "@web/core/utils/hooks"; /** * @typedef {Object} Props - * @property {import("@mail/core/link_preview_model").LinkPreview} linkPreview + * @property {import("@mail/core/common/link_preview_model").LinkPreview} linkPreview * @property {function} close * @property {Component} LinkPreviewListComponent * @extends {Component} diff --git a/addons/mail/static/src/core_ui/link_preview/link_preview_confirm_delete.xml b/addons/mail/static/src/core/common/link_preview_confirm_delete.xml similarity index 100% rename from addons/mail/static/src/core_ui/link_preview/link_preview_confirm_delete.xml rename to addons/mail/static/src/core/common/link_preview_confirm_delete.xml diff --git a/addons/mail/static/src/core_ui/link_preview/link_preview_list.js b/addons/mail/static/src/core/common/link_preview_list.js similarity index 73% rename from addons/mail/static/src/core_ui/link_preview/link_preview_list.js rename to addons/mail/static/src/core/common/link_preview_list.js index e873d3d51ca..a91d4b9bc3f 100644 --- a/addons/mail/static/src/core_ui/link_preview/link_preview_list.js +++ b/addons/mail/static/src/core/common/link_preview_list.js @@ -1,11 +1,12 @@ /* @odoo-module */ +import { LinkPreview } from "@mail/core/common/link_preview"; + import { Component } from "@odoo/owl"; -import { LinkPreview } from "./link_preview"; /** * @typedef {Object} Props - * @property {import("@mail/core/link_preview_model").LinkPreview[]} linkPreviews + * @property {import("@mail/core/common/link_preview_model").LinkPreview[]} linkPreviews * @property {boolean} [deletable] * @extends {Component} */ diff --git a/addons/mail/static/src/core_ui/link_preview/link_preview_list.xml b/addons/mail/static/src/core/common/link_preview_list.xml similarity index 100% rename from addons/mail/static/src/core_ui/link_preview/link_preview_list.xml rename to addons/mail/static/src/core/common/link_preview_list.xml diff --git a/addons/mail/static/src/core/link_preview_model.js b/addons/mail/static/src/core/common/link_preview_model.js similarity index 100% rename from addons/mail/static/src/core/link_preview_model.js rename to addons/mail/static/src/core/common/link_preview_model.js diff --git a/addons/mail/static/src/core_ui/message.js b/addons/mail/static/src/core/common/message.js similarity index 91% rename from addons/mail/static/src/core_ui/message.js rename to addons/mail/static/src/core/common/message.js index c4094599daf..3d281b786e8 100644 --- a/addons/mail/static/src/core_ui/message.js +++ b/addons/mail/static/src/core/common/message.js @@ -1,11 +1,21 @@ /* @odoo-module */ -import { ImStatus } from "@mail/discuss_app/im_status"; -import { AttachmentList } from "@mail/attachments/attachment_list"; -import { MessageInReply } from "./message_in_reply"; -import { isEventHandled, markEventHandled } from "@mail/utils/misc"; -import { convertBrToLineBreak, htmlToTextContentInline } from "@mail/utils/format"; -import { MessageReactionMenu } from "@mail/core_ui/message_reaction_menu"; +import { AttachmentList } from "@mail/core/common/attachment_list"; +import { Composer } from "@mail/core/common/composer"; +import { useEmojiPicker } from "@mail/core/common/emoji_picker"; +import { ImStatus } from "@mail/core/common/im_status"; +import { LinkPreviewList } from "@mail/core/common/link_preview_list"; +import { MessageConfirmDialog } from "@mail/core/common/message_confirm_dialog"; +import { MessageInReply } from "@mail/core/common/message_in_reply"; +import { MessageNotificationPopover } from "@mail/core/common/message_notification_popover"; +import { MessageReactionMenu } from "@mail/core/common/message_reaction_menu"; +import { MessageReactions } from "@mail/core/common/message_reactions"; +import { MessageSeenIndicator } from "@mail/core/common/message_seen_indicator"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { RelativeTime } from "@mail/core/common/relative_time"; +import { convertBrToLineBreak, htmlToTextContentInline } from "@mail/utils/common/format"; +import { isEventHandled, markEventHandled } from "@mail/utils/common/misc"; + import { Component, onMounted, @@ -16,22 +26,14 @@ import { useRef, useState, } from "@odoo/owl"; -import { useService } from "@web/core/utils/hooks"; -import { Composer } from "../composer/composer"; -import { useMessaging, useStore } from "../core/messaging_hook"; -import { MessageConfirmDialog } from "./message_confirm_dialog"; -import { LinkPreviewList } from "./link_preview/link_preview_list"; -import { RelativeTime } from "./relative_time"; -import { MessageReactions } from "./message_reactions"; -import { useEmojiPicker } from "../emoji_picker/emoji_picker"; -import { usePopover } from "@web/core/popover/popover_hook"; -import { MessageNotificationPopover } from "./message_notification_popover"; -import { MessageSeenIndicator } from "./message_seen_indicator"; -import { _t } from "@web/core/l10n/translation"; + import { ActionSwiper } from "@web/core/action_swiper/action_swiper"; +import { hasTouch } from "@web/core/browser/feature_detection"; import { Dropdown } from "@web/core/dropdown/dropdown"; import { DropdownItem } from "@web/core/dropdown/dropdown_item"; -import { hasTouch } from "@web/core/browser/feature_detection"; +import { _t } from "@web/core/l10n/translation"; +import { usePopover } from "@web/core/popover/popover_hook"; +import { useService } from "@web/core/utils/hooks"; import { url } from "@web/core/utils/urls"; /** @@ -39,10 +41,10 @@ import { url } from "@web/core/utils/urls"; * @property {boolean} [hasActions=true] * @property {boolean} [highlighted] * @property {function} [onParentMessageClick] - * @property {import("@mail/core/message_model").Message} message - * @property {import("@mail/utils/hooks").MessageToReplyTo} [messageToReplyTo] + * @property {import("@mail/core/common/message_model").Message} message + * @property {import("@mail/utils/common/hooks").MessageToReplyTo} [messageToReplyTo] * @property {boolean} [squashed] - * @property {import("@mail/core/thread_model").Thread} [thread] + * @property {import("@mail/core/common/thread_model").Thread} [thread] * @extends {Component} */ export class Message extends Component { @@ -93,11 +95,11 @@ export class Message extends Component { this.messaging = useMessaging(); this.store = useStore(); this.rpc = useService("rpc"); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useState(useService("mail.thread")); - /** @type {import("@mail/core/message_service").MessageService} */ + /** @type {import("@mail/core/common/message_service").MessageService} */ this.messageService = useState(useService("mail.message")); - /** @type {import("@mail/attachments/attachment_service").AttachmentService} */ + /** @type {import("@mail/core/common/attachment_service").AttachmentService} */ this.attachmentService = useService("mail.attachment"); this.user = useService("user"); this.dialog = useService("dialog"); diff --git a/addons/mail/static/src/core_ui/message.scss b/addons/mail/static/src/core/common/message.scss similarity index 100% rename from addons/mail/static/src/core_ui/message.scss rename to addons/mail/static/src/core/common/message.scss diff --git a/addons/mail/static/src/core_ui/message.xml b/addons/mail/static/src/core/common/message.xml similarity index 100% rename from addons/mail/static/src/core_ui/message.xml rename to addons/mail/static/src/core/common/message.xml diff --git a/addons/mail/static/src/core_ui/message_confirm_dialog.js b/addons/mail/static/src/core/common/message_confirm_dialog.js similarity index 91% rename from addons/mail/static/src/core_ui/message_confirm_dialog.js rename to addons/mail/static/src/core/common/message_confirm_dialog.js index e097517ee5d..dd33f05cbca 100644 --- a/addons/mail/static/src/core_ui/message_confirm_dialog.js +++ b/addons/mail/static/src/core/common/message_confirm_dialog.js @@ -1,8 +1,8 @@ /* @odoo-module */ import { Component, useState } from "@odoo/owl"; -import { Dialog } from "@web/core/dialog/dialog"; +import { Dialog } from "@web/core/dialog/dialog"; import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; @@ -28,7 +28,7 @@ export class MessageConfirmDialog extends Component { static template = "mail.MessageConfirmDialog"; setup() { - /** @type {import("@mail/core/message_service").MessageService} */ + /** @type {import("@mail/core/common/message_service").MessageService} */ this.messageService = useState(useService("mail.message")); } diff --git a/addons/mail/static/src/core_ui/message_confirm_dialog.xml b/addons/mail/static/src/core/common/message_confirm_dialog.xml similarity index 100% rename from addons/mail/static/src/core_ui/message_confirm_dialog.xml rename to addons/mail/static/src/core/common/message_confirm_dialog.xml diff --git a/addons/mail/static/src/core_ui/message_in_reply.js b/addons/mail/static/src/core/common/message_in_reply.js similarity index 85% rename from addons/mail/static/src/core_ui/message_in_reply.js rename to addons/mail/static/src/core/common/message_in_reply.js index 45372ba28b7..f425625e68f 100644 --- a/addons/mail/static/src/core_ui/message_in_reply.js +++ b/addons/mail/static/src/core/common/message_in_reply.js @@ -1,10 +1,10 @@ /* @odoo-module */ +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; + import { Component } from "@odoo/owl"; import { useService } from "@web/core/utils/hooks"; - -import { useMessaging, useStore } from "@mail/core/messaging_hook"; import { url } from "@web/core/utils/urls"; export class MessageInReply extends Component { @@ -15,7 +15,7 @@ export class MessageInReply extends Component { this.messaging = useMessaging(); this.store = useStore(); this.user = useService("user"); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useService("mail.thread"); } diff --git a/addons/mail/static/src/core_ui/message_in_reply.scss b/addons/mail/static/src/core/common/message_in_reply.scss similarity index 100% rename from addons/mail/static/src/core_ui/message_in_reply.scss rename to addons/mail/static/src/core/common/message_in_reply.scss diff --git a/addons/mail/static/src/core_ui/message_in_reply.xml b/addons/mail/static/src/core/common/message_in_reply.xml similarity index 100% rename from addons/mail/static/src/core_ui/message_in_reply.xml rename to addons/mail/static/src/core/common/message_in_reply.xml diff --git a/addons/mail/static/src/core/message_model.js b/addons/mail/static/src/core/common/message_model.js similarity index 94% rename from addons/mail/static/src/core/message_model.js rename to addons/mail/static/src/core/common/message_model.js index 05ca7cbe1f5..4083e55544e 100644 --- a/addons/mail/static/src/core/message_model.js +++ b/addons/mail/static/src/core/common/message_model.js @@ -1,21 +1,21 @@ /* @odoo-module */ -import { htmlToTextContentInline } from "@mail/utils/format"; +import { htmlToTextContentInline } from "@mail/utils/common/format"; +import { createLocalId } from "@mail/utils/common/misc"; import { toRaw } from "@odoo/owl"; -import { _t } from "@web/core/l10n/translation"; -import { url } from "@web/core/utils/urls"; import { deserializeDateTime } from "@web/core/l10n/dates"; -import { createLocalId } from "../utils/misc"; +import { _t } from "@web/core/l10n/translation"; import { omit } from "@web/core/utils/objects"; +import { url } from "@web/core/utils/urls"; const { DateTime } = luxon; export class Message { /** @type {Object[]} */ attachments = []; - /** @type {import("@mail/core/persona_model").Persona} */ + /** @type {import("@mail/core/common/persona_model").Persona} */ author; /** @type {string} */ body; @@ -41,9 +41,9 @@ export class Message { parentMessage; /** @type {MessageReactions[]} */ reactions = []; - /** @type {import("@mail/core/notification_model").Notification[]} */ + /** @type {import("@mail/core/common/notification_model").Notification[]} */ notifications = []; - /** @type {import("@mail/core/persona_model").Persona[]} */ + /** @type {import("@mail/core/common/persona_model").Persona[]} */ recipients = []; /** @type {number|string} */ resId; @@ -75,7 +75,7 @@ export class Message { * have them. Message without date like transient message can be missordered */ now = DateTime.now().set({ milliseconds: 0 }); - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; /** diff --git a/addons/mail/static/src/core_ui/message_notification_popover.js b/addons/mail/static/src/core/common/message_notification_popover.js similarity index 100% rename from addons/mail/static/src/core_ui/message_notification_popover.js rename to addons/mail/static/src/core/common/message_notification_popover.js diff --git a/addons/mail/static/src/core_ui/message_notification_popover.xml b/addons/mail/static/src/core/common/message_notification_popover.xml similarity index 100% rename from addons/mail/static/src/core_ui/message_notification_popover.xml rename to addons/mail/static/src/core/common/message_notification_popover.xml diff --git a/addons/mail/static/src/core_ui/message_reaction_menu.js b/addons/mail/static/src/core/common/message_reaction_menu.js similarity index 87% rename from addons/mail/static/src/core_ui/message_reaction_menu.js rename to addons/mail/static/src/core/common/message_reaction_menu.js index 5369fccbba3..75cd7553d8a 100644 --- a/addons/mail/static/src/core_ui/message_reaction_menu.js +++ b/addons/mail/static/src/core/common/message_reaction_menu.js @@ -1,18 +1,20 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { loadEmoji } from "@mail/core/common/emoji_picker"; +import { useStore } from "@mail/core/common/messaging_hook"; +import { onExternalClick } from "@mail/utils/common/hooks"; import { Component, - useState, - useExternalListener, - useEffect, - useRef, onWillStart, + useEffect, + useExternalListener, + useRef, + useState, } from "@odoo/owl"; -import { useService } from "@web/core/utils/hooks"; + import { Dialog } from "@web/core/dialog/dialog"; -import { loadEmoji } from "@mail/emoji_picker/emoji_picker"; -import { onExternalClick } from "@mail/utils/hooks"; -import { useStore } from "../core/messaging_hook"; +import { useService } from "@web/core/utils/hooks"; export class MessageReactionMenu extends Component { static props = ["close", "message"]; @@ -20,7 +22,7 @@ export class MessageReactionMenu extends Component { static template = "mail.MessageReactionMenu"; setup() { - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useService("mail.thread"); this.root = useRef("root"); this.store = useStore(); diff --git a/addons/mail/static/src/core_ui/message_reaction_menu.scss b/addons/mail/static/src/core/common/message_reaction_menu.scss similarity index 100% rename from addons/mail/static/src/core_ui/message_reaction_menu.scss rename to addons/mail/static/src/core/common/message_reaction_menu.scss diff --git a/addons/mail/static/src/core_ui/message_reaction_menu.xml b/addons/mail/static/src/core/common/message_reaction_menu.xml similarity index 100% rename from addons/mail/static/src/core_ui/message_reaction_menu.xml rename to addons/mail/static/src/core/common/message_reaction_menu.xml diff --git a/addons/mail/static/src/core_ui/message_reactions.js b/addons/mail/static/src/core/common/message_reactions.js similarity index 96% rename from addons/mail/static/src/core_ui/message_reactions.js rename to addons/mail/static/src/core/common/message_reactions.js index 15e4d7fa608..e712826f8a1 100644 --- a/addons/mail/static/src/core_ui/message_reactions.js +++ b/addons/mail/static/src/core/common/message_reactions.js @@ -1,10 +1,12 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { useStore } from "@mail/core/common/messaging_hook"; import { Component, useState } from "@odoo/owl"; + +import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; import { sprintf } from "@web/core/utils/strings"; -import { _t } from "@web/core/l10n/translation"; -import { useStore } from "../core/messaging_hook"; export class MessageReactions extends Component { static props = ["message", "openReactionMenu"]; diff --git a/addons/mail/static/src/core_ui/message_reactions.scss b/addons/mail/static/src/core/common/message_reactions.scss similarity index 100% rename from addons/mail/static/src/core_ui/message_reactions.scss rename to addons/mail/static/src/core/common/message_reactions.scss diff --git a/addons/mail/static/src/core_ui/message_reactions.xml b/addons/mail/static/src/core/common/message_reactions.xml similarity index 100% rename from addons/mail/static/src/core_ui/message_reactions.xml rename to addons/mail/static/src/core/common/message_reactions.xml diff --git a/addons/mail/static/src/core/message_reactions_model.js b/addons/mail/static/src/core/common/message_reactions_model.js similarity index 51% rename from addons/mail/static/src/core/message_reactions_model.js rename to addons/mail/static/src/core/common/message_reactions_model.js index 290afbc4cf0..94195434bf4 100644 --- a/addons/mail/static/src/core/message_reactions_model.js +++ b/addons/mail/static/src/core/common/message_reactions_model.js @@ -1,18 +1,18 @@ -/** @odoo-module **/ +/* @odoo-module */ export class MessageReactions { /** @type {string} */ content; - /** @type {number} **/ + /** @type {number} */ count; - /** @type {number[]} **/ + /** @type {number[]} */ personaLocalIds = []; - /** @type {number} **/ + /** @type {number} */ messageId; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; - /** @type {import("@mail/core/persona_model").Persona[]} */ + /** @type {import("@mail/core/common/persona_model").Persona[]} */ get personas() { return this.personaLocalIds.map((localId) => this._store.personas[localId]); } diff --git a/addons/mail/static/src/core_ui/message_seen_indicator.js b/addons/mail/static/src/core/common/message_seen_indicator.js similarity index 90% rename from addons/mail/static/src/core_ui/message_seen_indicator.js rename to addons/mail/static/src/core/common/message_seen_indicator.js index 7675112b693..2fd8eca459b 100644 --- a/addons/mail/static/src/core_ui/message_seen_indicator.js +++ b/addons/mail/static/src/core/common/message_seen_indicator.js @@ -1,12 +1,13 @@ /* @odoo-module */ +import { useStore } from "@mail/core/common/messaging_hook"; + import { Component } from "@odoo/owl"; -import { useStore } from "../core/messaging_hook"; /** * @typedef {Object} Props - * @property {import("@mail/core/message_model").Message} message - * @property {import("@mail/core/thread_model").Thread} thread + * @property {import("@mail/core/common/message_model").Message} message + * @property {import("@mail/core/common/thread_model").Thread} thread * @extends {Component} */ export class MessageSeenIndicator extends Component { diff --git a/addons/mail/static/src/core_ui/message_seen_indicator.scss b/addons/mail/static/src/core/common/message_seen_indicator.scss similarity index 100% rename from addons/mail/static/src/core_ui/message_seen_indicator.scss rename to addons/mail/static/src/core/common/message_seen_indicator.scss diff --git a/addons/mail/static/src/core_ui/message_seen_indicator.xml b/addons/mail/static/src/core/common/message_seen_indicator.xml similarity index 100% rename from addons/mail/static/src/core_ui/message_seen_indicator.xml rename to addons/mail/static/src/core/common/message_seen_indicator.xml diff --git a/addons/mail/static/src/core/message_service.js b/addons/mail/static/src/core/common/message_service.js similarity index 95% rename from addons/mail/static/src/core/message_service.js rename to addons/mail/static/src/core/common/message_service.js index 0b513ae6a2a..7275684fd3f 100644 --- a/addons/mail/static/src/core/message_service.js +++ b/addons/mail/static/src/core/common/message_service.js @@ -1,30 +1,31 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { LinkPreview } from "@mail/core/common/link_preview_model"; +import { Message } from "@mail/core/common/message_model"; +import { MessageReactions } from "@mail/core/common/message_reactions_model"; +import { NotificationGroup } from "@mail/core/common/notification_group_model"; +import { Notification } from "@mail/core/common/notification_model"; +import { removeFromArrayWithPredicate, replaceArrayWithCompare } from "@mail/utils/common/arrays"; +import { convertBrToLineBreak, prettifyMessageContent } from "@mail/utils/common/format"; +import { assignDefined, createLocalId } from "@mail/utils/common/misc"; -import { Message } from "./message_model"; -import { removeFromArrayWithPredicate, replaceArrayWithCompare } from "../utils/arrays"; -import { convertBrToLineBreak, prettifyMessageContent } from "../utils/format"; import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; import { sprintf } from "@web/core/utils/strings"; -import { MessageReactions } from "./message_reactions_model"; -import { Notification } from "./notification_model"; -import { LinkPreview } from "./link_preview_model"; -import { NotificationGroup } from "./notification_group_model"; -import { assignDefined, createLocalId } from "../utils/misc"; const { DateTime } = luxon; export class MessageService { constructor(env, services) { this.env = env; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = services["mail.store"]; this.rpc = services.rpc; this.orm = services.orm; this.userService = services.user; - /** @type {import("@mail/core/persona_service").PersonaService} */ + /** @type {import("@mail/core/common/persona_service").PersonaService} */ this.personaService = services["mail.persona"]; - /** @type {import("@mail/attachments/attachment_service").AttachmentService} */ + /** @type {import("@mail/core/common/attachment_service").AttachmentService} */ this.attachmentService = services["mail.attachment"]; } @@ -225,7 +226,7 @@ export class MessageService { } /** - * @param {import("@mail/core/message_model").Message} message + * @param {import("@mail/core/common/message_model").Message} message * @param {Object} data */ update(message, data) { diff --git a/addons/mail/static/src/core/messaging_hook.js b/addons/mail/static/src/core/common/messaging_hook.js similarity index 68% rename from addons/mail/static/src/core/messaging_hook.js rename to addons/mail/static/src/core/common/messaging_hook.js index 124bc424b0e..fb3f606d72a 100644 --- a/addons/mail/static/src/core/messaging_hook.js +++ b/addons/mail/static/src/core/common/messaging_hook.js @@ -1,17 +1,18 @@ /* @odoo-module */ import { useState } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; /** - * @returns {import("@mail/core/messaging_service").Messaging} + * @returns {import("@mail/core/common/messaging_service").Messaging} */ export function useMessaging() { return useState(useService("mail.messaging")); } /** - * @returns {import("@mail/core/store_service").Store} + * @returns {import("@mail/core/common/store_service").Store} */ export function useStore() { return useState(useService("mail.store")); diff --git a/addons/mail/static/src/core/messaging_service.js b/addons/mail/static/src/core/common/messaging_service.js similarity index 96% rename from addons/mail/static/src/core/messaging_service.js rename to addons/mail/static/src/core/common/messaging_service.js index 788260e384c..17ff46fbb96 100644 --- a/addons/mail/static/src/core/messaging_service.js +++ b/addons/mail/static/src/core/common/messaging_service.js @@ -1,15 +1,17 @@ /* @odoo-module */ +import { CannedResponse } from "@mail/core/common/canned_response_model"; +import { LinkPreview } from "@mail/core/common/link_preview_model"; +import { removeFromArray, removeFromArrayWithPredicate } from "@mail/utils/common/arrays"; +import { cleanTerm } from "@mail/utils/common/format"; +import { createLocalId } from "@mail/utils/common/misc"; + import { markup, reactive } from "@odoo/owl"; -import { Deferred } from "@web/core/utils/concurrency"; -import { cleanTerm } from "@mail/utils/format"; -import { removeFromArray, removeFromArrayWithPredicate } from "@mail/utils/arrays"; -import { LinkPreview } from "./link_preview_model"; -import { CannedResponse } from "./canned_response_model"; -import { sprintf } from "@web/core/utils/strings"; + import { _t } from "@web/core/l10n/translation"; -import { createLocalId } from "../utils/misc"; import { registry } from "@web/core/registry"; +import { Deferred } from "@web/core/utils/concurrency"; +import { sprintf } from "@web/core/utils/strings"; /** * @typedef {Messaging} Messaging @@ -21,24 +23,24 @@ export class Messaging { setup(env, services) { this.env = env; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = services["mail.store"]; this.rpc = services.rpc; this.orm = services.orm; - /** @type {import("@mail/core/channel_member_service").ChannelMemberService} */ + /** @type {import("@mail/core/common/channel_member_service").ChannelMemberService} */ this.channelMemberService = services["discuss.channel.member"]; - /** @type {import("@mail/attachments/attachment_service").AttachmentService} */ + /** @type {import("@mail/core/common/attachment_service").AttachmentService} */ this.attachmentService = services["mail.attachment"]; this.notificationService = services.notification; - /** @type {import("@mail/core/user_settings_service").UserSettings} */ + /** @type {import("@mail/core/common/user_settings_service").UserSettings} */ this.userSettingsService = services["mail.user_settings"]; - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = services["mail.thread"]; - /** @type {import("@mail/core/message_service").MessageService} */ + /** @type {import("@mail/core/common/message_service").MessageService} */ this.messageService = services["mail.message"]; - /** @type {import("@mail/core/persona_service").PersonaService} */ + /** @type {import("@mail/core/common/persona_service").PersonaService} */ this.personaService = services["mail.persona"]; - /** @type {import("@mail/core/out_of_focus_service").OutOfFocusService} */ + /** @type {import("@mail/core/common/out_of_focus_service").OutOfFocusService} */ this.outOfFocusService = services["mail.out_of_focus"]; this.router = services.router; this.bus = services.bus_service; diff --git a/addons/mail/static/src/composer/navigable_list.js b/addons/mail/static/src/core/common/navigable_list.js similarity index 95% rename from addons/mail/static/src/composer/navigable_list.js rename to addons/mail/static/src/core/common/navigable_list.js index 988e99524e8..5c06f245eac 100644 --- a/addons/mail/static/src/composer/navigable_list.js +++ b/addons/mail/static/src/core/common/navigable_list.js @@ -1,12 +1,14 @@ -/* @odoo-module **/ +/* @odoo-module */ + +import { ImStatus } from "@mail/core/common/im_status"; +import { onExternalClick } from "@mail/utils/common/hooks"; +import { markEventHandled, isEventHandled } from "@mail/utils/common/misc"; + +import { Component, useEffect, useExternalListener, useRef, useState } from "@odoo/owl"; -import { useService } from "@web/core/utils/hooks"; import { getActiveHotkey } from "@web/core/hotkeys/hotkey_service"; import { usePosition } from "@web/core/position_hook"; -import { ImStatus } from "../discuss_app/im_status"; // Used in composer suggestion template -import { Component, useEffect, useExternalListener, useRef, useState } from "@odoo/owl"; -import { markEventHandled, isEventHandled } from "../utils/misc"; -import { onExternalClick } from "@mail/utils/hooks"; +import { useService } from "@web/core/utils/hooks"; export class NavigableList extends Component { static components = { ImStatus }; diff --git a/addons/mail/static/src/composer/navigable_list.scss b/addons/mail/static/src/core/common/navigable_list.scss similarity index 100% rename from addons/mail/static/src/composer/navigable_list.scss rename to addons/mail/static/src/core/common/navigable_list.scss diff --git a/addons/mail/static/src/composer/navigable_list.xml b/addons/mail/static/src/core/common/navigable_list.xml similarity index 100% rename from addons/mail/static/src/composer/navigable_list.xml rename to addons/mail/static/src/core/common/navigable_list.xml diff --git a/addons/mail/static/src/core/notification_group_model.js b/addons/mail/static/src/core/common/notification_group_model.js similarity index 84% rename from addons/mail/static/src/core/notification_group_model.js rename to addons/mail/static/src/core/common/notification_group_model.js index 9a4dac64ff4..eb9d362adec 100644 --- a/addons/mail/static/src/core/notification_group_model.js +++ b/addons/mail/static/src/core/common/notification_group_model.js @@ -1,10 +1,10 @@ -/** @odoo-module */ +/* @odoo-module */ import { _t } from "@web/core/l10n/translation"; let nextId = 1; export class NotificationGroup { - /** @type {import("@mail/core/notification_model").Notification[]} */ + /** @type {import("@mail/core/common/notification_model").Notification[]} */ notifications = []; /** @type {string} */ modelName; @@ -16,7 +16,7 @@ export class NotificationGroup { resIds = new Set(); /** @type {'sms' | 'email'} */ type; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; constructor(store) { diff --git a/addons/mail/static/src/core/notification_model.js b/addons/mail/static/src/core/common/notification_model.js similarity index 92% rename from addons/mail/static/src/core/notification_model.js rename to addons/mail/static/src/core/common/notification_model.js index cb0d03c6892..7c21d302b66 100644 --- a/addons/mail/static/src/core/notification_model.js +++ b/addons/mail/static/src/core/common/notification_model.js @@ -13,9 +13,9 @@ export class Notification { notification_type; /** @type {string} */ failure_type; - /** @type {import("@mail/core/persona_model").Persona} */ + /** @type {import("@mail/core/common/persona_model").Persona} */ persona; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; constructor(store, data) { diff --git a/addons/mail/static/src/core/notification_permission_service.js b/addons/mail/static/src/core/common/notification_permission_service.js similarity index 99% rename from addons/mail/static/src/core/notification_permission_service.js rename to addons/mail/static/src/core/common/notification_permission_service.js index ba9501f46b6..4dee20a7bf7 100644 --- a/addons/mail/static/src/core/notification_permission_service.js +++ b/addons/mail/static/src/core/common/notification_permission_service.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { reactive } from "@odoo/owl"; diff --git a/addons/mail/static/src/core/out_of_focus_service.js b/addons/mail/static/src/core/common/out_of_focus_service.js similarity index 98% rename from addons/mail/static/src/core/out_of_focus_service.js rename to addons/mail/static/src/core/common/out_of_focus_service.js index 06195fa5b36..873d924e96a 100644 --- a/addons/mail/static/src/core/out_of_focus_service.js +++ b/addons/mail/static/src/core/common/out_of_focus_service.js @@ -1,11 +1,12 @@ /* @odoo-module */ +import { htmlToTextContentInline } from "@mail/utils/common/format"; + import { browser } from "@web/core/browser/browser"; import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; import { escape, sprintf, unescapeHTML } from "@web/core/utils/strings"; import { url } from "@web/core/utils/urls"; -import { htmlToTextContentInline } from "../utils/format"; const PREVIEW_MSG_MAX_SIZE = 350; // optimal for native English speakers diff --git a/addons/mail/static/src/core/persona_model.js b/addons/mail/static/src/core/common/persona_model.js similarity index 92% rename from addons/mail/static/src/core/persona_model.js rename to addons/mail/static/src/core/common/persona_model.js index 01441b16de7..a4a4eb1b426 100644 --- a/addons/mail/static/src/core/persona_model.js +++ b/addons/mail/static/src/core/common/persona_model.js @@ -30,7 +30,7 @@ export class Persona { /** @type {ImStatus} */ im_status; isAdmin = false; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; get nameOrDisplayName() { diff --git a/addons/mail/static/src/core/persona_service.js b/addons/mail/static/src/core/common/persona_service.js similarity index 89% rename from addons/mail/static/src/core/persona_service.js rename to addons/mail/static/src/core/common/persona_service.js index 77b78d8ef6b..5d55ea0bd05 100644 --- a/addons/mail/static/src/core/persona_service.js +++ b/addons/mail/static/src/core/common/persona_service.js @@ -1,7 +1,8 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Persona } from "@mail/core/common/persona_model"; +import { assignDefined, createLocalId, nullifyClearCommands } from "@mail/utils/common/misc"; -import { Persona } from "@mail/core/persona_model"; -import { assignDefined, createLocalId, nullifyClearCommands } from "../utils/misc"; import { registry } from "@web/core/registry"; export const DEFAULT_AVATAR = "/mail/static/src/img/smiley/avatar.jpg"; @@ -14,7 +15,7 @@ export class PersonaService { setup(env, services) { this.env = env; this.rpc = services.rpc; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = services["mail.store"]; } @@ -26,8 +27,8 @@ export class PersonaService { } /** - * @param {import("@mail/core/persona_model").Data} data - * @returns {import("@mail/core/persona_model").Persona} + * @param {import("@mail/core/common/persona_model").Data} data + * @returns {import("@mail/core/common/persona_model").Persona} */ insert(data) { const localId = createLocalId(data.type, data.id); diff --git a/addons/mail/static/src/core_ui/primary_variables.scss b/addons/mail/static/src/core/common/primary_variables.scss similarity index 100% rename from addons/mail/static/src/core_ui/primary_variables.scss rename to addons/mail/static/src/core/common/primary_variables.scss diff --git a/addons/mail/static/src/core_ui/relative_time.js b/addons/mail/static/src/core/common/relative_time.js similarity index 94% rename from addons/mail/static/src/core_ui/relative_time.js rename to addons/mail/static/src/core/common/relative_time.js index a0259d2b96d..9441ef8e8c3 100644 --- a/addons/mail/static/src/core_ui/relative_time.js +++ b/addons/mail/static/src/core/common/relative_time.js @@ -1,7 +1,8 @@ /* @odoo-module */ +import { Component, onWillDestroy, xml } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; -import { Component, xml, onWillDestroy } from "@odoo/owl"; const MINUTE = 60 * 1000; const HOUR = 60 * MINUTE; diff --git a/addons/mail/static/src/core/scroll_position_model.js b/addons/mail/static/src/core/common/scroll_position_model.js similarity index 94% rename from addons/mail/static/src/core/scroll_position_model.js rename to addons/mail/static/src/core/common/scroll_position_model.js index b3da45ea718..af6546af3f4 100644 --- a/addons/mail/static/src/core/scroll_position_model.js +++ b/addons/mail/static/src/core/common/scroll_position_model.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ export class ScrollPosition { /** @type {number|undefined} */ diff --git a/addons/mail/static/src/core/sound_effects_service.js b/addons/mail/static/src/core/common/sound_effects_service.js similarity index 99% rename from addons/mail/static/src/core/sound_effects_service.js rename to addons/mail/static/src/core/common/sound_effects_service.js index 871b7c6d7ef..86b7a1f4560 100644 --- a/addons/mail/static/src/core/sound_effects_service.js +++ b/addons/mail/static/src/core/common/sound_effects_service.js @@ -1,7 +1,7 @@ -/** @odoo-module */ +/* @odoo-module */ -import { registry } from "@web/core/registry"; import { browser } from "@web/core/browser/browser"; +import { registry } from "@web/core/registry"; export class SoundEffects { constructor(env) { diff --git a/addons/mail/static/src/core/store_service.js b/addons/mail/static/src/core/common/store_service.js similarity index 74% rename from addons/mail/static/src/core/store_service.js rename to addons/mail/static/src/core/common/store_service.js index 06b1ea16c93..ba6e34bfaf3 100644 --- a/addons/mail/static/src/core/store_service.js +++ b/addons/mail/static/src/core/common/store_service.js @@ -1,9 +1,11 @@ /* @odoo-module */ +import { onChange } from "@mail/utils/common/misc"; + import { reactive } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; -import { onChange } from "@mail/utils/misc"; export class Store { constructor(env, { "mail.context": context }) { @@ -43,13 +45,13 @@ export class Store { /** * This is the current logged partner * - * @type {import("@mail/core/persona_model").Persona} + * @type {import("@mail/core/common/persona_model").Persona} */ user = null; /** * This is the current logged guest * - * @type {import("@mail/core/persona_model").Persona} + * @type {import("@mail/core/common/persona_model").Persona} */ guest = null; @@ -59,23 +61,23 @@ export class Store { */ inPublicPage = false; - /** @type {Object.} */ + /** @type {Object.} */ channelMembers = {}; companyName = ""; - /** @type {Object.} */ + /** @type {Object.} */ notifications = {}; notificationGroups = []; - /** @type {Object.} */ + /** @type {Object.} */ followers = {}; - /** @type {import("@mail/core/persona_model").Persona} */ + /** @type {import("@mail/core/common/persona_model").Persona} */ odoobot = null; - /** @type {Object.} */ + /** @type {Object.} */ personas = {}; - /** @type {Object.} */ + /** @type {Object.} */ rtcSessions = {}; users = {}; internalUserGroupId = null; @@ -117,28 +119,28 @@ export class Store { threads: [], // list of ids }, // mailboxes in sidebar - /** @type {import("@mail/core/thread_model").Thread} */ + /** @type {import("@mail/core/common/thread_model").Thread} */ inbox: null, - /** @type {import("@mail/core/thread_model").Thread} */ + /** @type {import("@mail/core/common/thread_model").Thread} */ starred: null, - /** @type {import("@mail/core/thread_model").Thread} */ + /** @type {import("@mail/core/common/thread_model").Thread} */ history: null, }; cannedResponses = []; - /** @type {Object.} */ + /** @type {Object.} */ activities = {}; activityCounter = 0; - /** @type {Object.} */ + /** @type {Object.} */ attachments = {}; - /** @type {import("@mail/chat_window/chat_window_model").ChatWindow[]} */ + /** @type {import("@mail/core/common/chat_window_model").ChatWindow[]} */ chatWindows = []; - /** @type {Object.} */ + /** @type {Object.} */ messages = {}; - /** @type {Object.} */ + /** @type {Object.} */ threads = {}; isMessagingReady = false; diff --git a/addons/mail/static/src/composer/suggestion_hook.js b/addons/mail/static/src/core/common/suggestion_hook.js similarity index 98% rename from addons/mail/static/src/composer/suggestion_hook.js rename to addons/mail/static/src/core/common/suggestion_hook.js index aa45119a21a..fca2a7bf250 100644 --- a/addons/mail/static/src/composer/suggestion_hook.js +++ b/addons/mail/static/src/core/common/suggestion_hook.js @@ -1,11 +1,12 @@ /* @odoo-module */ import { useComponent, useEffect, useState } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; export function useSuggestion() { const comp = useComponent(); - /** @type {import("@mail/composer/suggestion_service").SuggestionService} */ + /** @type {import("@mail/core/common/suggestion_service").SuggestionService} */ const suggestionService = useService("mail.suggestion"); const self = { clearRawMentions() { diff --git a/addons/mail/static/src/composer/suggestion_service.js b/addons/mail/static/src/core/common/suggestion_service.js similarity index 94% rename from addons/mail/static/src/composer/suggestion_service.js rename to addons/mail/static/src/core/common/suggestion_service.js index a96801551aa..dc1ef8e3c0b 100644 --- a/addons/mail/static/src/composer/suggestion_service.js +++ b/addons/mail/static/src/core/common/suggestion_service.js @@ -1,18 +1,19 @@ /* @odoo-module */ -import { cleanTerm } from "@mail/utils/format"; +import { cleanTerm } from "@mail/utils/common/format"; + import { registry } from "@web/core/registry"; export class SuggestionService { constructor(env, services) { this.orm = services.orm; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = services["mail.store"]; - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = services["mail.thread"]; - /** @type {import("@mail/core/persona_service").PersonaService} */ + /** @type {import("@mail/core/common/persona_service").PersonaService} */ this.personaService = services["mail.persona"]; - /** @type {import("@mail/core/channel_member_service").ChannelMemberService} */ + /** @type {import("@mail/core/common/channel_member_service").ChannelMemberService} */ this.channelMemberService = services["discuss.channel.member"]; } @@ -35,7 +36,7 @@ export class SuggestionService { /** * @param {string} term - * @param {import("@mail/core/thread_model").Thread} thread + * @param {import("@mail/core/common/thread_model").Thread} thread */ async fetchPartners(term, thread) { const kwargs = { search: term }; @@ -154,10 +155,10 @@ export class SuggestionService { } /** - * @param {[import("@mail/core/persona_model").Persona]} [partners] + * @param {[import("@mail/core/common/persona_model").Persona]} [partners] * @param {String} [searchTerm] - * @param {import("@mail/core/thread_model").Thread} thread - * @returns {[import("@mail/core/persona_model").Persona]} + * @param {import("@mail/core/common/thread_model").Thread} thread + * @returns {[import("@mail/core/common/persona_model").Persona]} */ sortPartnerSuggestions(partners, searchTerm = "", thread = undefined) { const cleanedSearchTerm = cleanTerm(searchTerm); diff --git a/addons/mail/static/src/core_ui/thread.js b/addons/mail/static/src/core/common/thread.js similarity index 92% rename from addons/mail/static/src/core_ui/thread.js rename to addons/mail/static/src/core/common/thread.js index 9813399197b..c2d942e7d88 100644 --- a/addons/mail/static/src/core_ui/thread.js +++ b/addons/mail/static/src/core/common/thread.js @@ -1,5 +1,14 @@ /* @odoo-module */ +import { Message } from "@mail/core/common/message"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { + useAutoScroll, + useScrollPosition, + useScrollSnapshot, + useVisible, +} from "@mail/utils/common/hooks"; + import { Component, onMounted, @@ -9,9 +18,6 @@ import { useRef, useState, } from "@odoo/owl"; -import { useMessaging, useStore } from "../core/messaging_hook"; -import { useAutoScroll, useScrollPosition, useScrollSnapshot, useVisible } from "@mail/utils/hooks"; -import { Message } from "./message"; import { Transition } from "@web/core/transition"; import { useService } from "@web/core/utils/hooks"; @@ -22,10 +28,10 @@ export const PRESENT_THRESHOLD = 2500; /** * @typedef {Object} Props * @property {boolean} [isInChatWindow=false] - * @property {import("@mail/utils/hooks").MessageEdition} [messageEdition] - * @property {import("@mail/utils/hooks").MessageToReplyTo} [messageToReplyTo] + * @property {import("@mail/utils/common/hooks").MessageEdition} [messageEdition] + * @property {import("@mail/utils/common/hooks").MessageToReplyTo} [messageToReplyTo] * @property {"asc"|"desc"} [order="asc"] - * @property {import("@mail/core/thread_model").Thread} thread + * @property {import("@mail/core/common/thread_model").Thread} thread * @extends {Component} */ export class Thread extends Component { @@ -50,7 +56,7 @@ export class Thread extends Component { this.messaging = useMessaging(); this.store = useStore(); this.state = useState({ isReplyingTo: false, showJumpPresent: false }); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useState(useService("mail.thread")); if (!this.env.inChatter || !this.props.hasScrollAdjust) { useAutoScroll("messages", () => { diff --git a/addons/mail/static/src/core_ui/thread.scss b/addons/mail/static/src/core/common/thread.scss similarity index 100% rename from addons/mail/static/src/core_ui/thread.scss rename to addons/mail/static/src/core/common/thread.scss diff --git a/addons/mail/static/src/core_ui/thread.xml b/addons/mail/static/src/core/common/thread.xml similarity index 100% rename from addons/mail/static/src/core_ui/thread.xml rename to addons/mail/static/src/core/common/thread.xml diff --git a/addons/mail/static/src/core/thread_actions.js b/addons/mail/static/src/core/common/thread_actions.js similarity index 99% rename from addons/mail/static/src/core/thread_actions.js rename to addons/mail/static/src/core/common/thread_actions.js index e7c87cc87d5..10fc80bbbb9 100644 --- a/addons/mail/static/src/core/thread_actions.js +++ b/addons/mail/static/src/core/common/thread_actions.js @@ -1,6 +1,7 @@ /* @odoo-module */ import { useComponent, useState } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; diff --git a/addons/mail/static/src/discuss_app/thread_icon.js b/addons/mail/static/src/core/common/thread_icon.js similarity index 75% rename from addons/mail/static/src/discuss_app/thread_icon.js rename to addons/mail/static/src/core/common/thread_icon.js index 31f3731ebd5..8ba62eaed66 100644 --- a/addons/mail/static/src/discuss_app/thread_icon.js +++ b/addons/mail/static/src/core/common/thread_icon.js @@ -1,12 +1,13 @@ /* @odoo-module */ -import { useStore } from "@mail/core/messaging_hook"; -import { createLocalId } from "@mail/utils/misc"; +import { useStore } from "@mail/core/common/messaging_hook"; +import { createLocalId } from "@mail/utils/common/misc"; + import { Component } from "@odoo/owl"; /** * @typedef {Object} Props - * @property {import("@mail/core/thread_model").Thread} thread + * @property {import("@mail/core/common/thread_model").Thread} thread * @property {string} size * @property {string} className * @extends {Component} diff --git a/addons/mail/static/src/discuss_app/thread_icon.xml b/addons/mail/static/src/core/common/thread_icon.xml similarity index 100% rename from addons/mail/static/src/discuss_app/thread_icon.xml rename to addons/mail/static/src/core/common/thread_icon.xml diff --git a/addons/mail/static/src/core/thread_model.js b/addons/mail/static/src/core/common/thread_model.js similarity index 91% rename from addons/mail/static/src/core/thread_model.js rename to addons/mail/static/src/core/common/thread_model.js index bbf927551d8..9500fab2495 100644 --- a/addons/mail/static/src/core/thread_model.js +++ b/addons/mail/static/src/core/common/thread_model.js @@ -1,11 +1,11 @@ /* @odoo-module */ -import { _t } from "@web/core/l10n/translation"; -import { sprintf } from "@web/core/utils/strings"; +import { ScrollPosition } from "@mail/core/common/scroll_position_model"; +import { createLocalId } from "@mail/utils/common/misc"; -import { ScrollPosition } from "@mail/core/scroll_position_model"; -import { createLocalId } from "../utils/misc"; +import { _t } from "@web/core/l10n/translation"; import { Deferred } from "@web/core/utils/concurrency"; +import { sprintf } from "@web/core/utils/strings"; /** * @typedef SeenInfo @@ -14,7 +14,7 @@ import { Deferred } from "@web/core/utils/concurrency"; * @property {{id: number}} partner * @typedef SuggestedRecipient * @property {string} email - * @property {import("@mail/core/persona_model").Persona|false} persona + * @property {import("@mail/core/common/persona_model").Persona|false} persona * @property {string} lang * @property {string} reason * @property {boolean} checked @@ -29,13 +29,13 @@ export class Thread { model; /** @type {boolean} */ areAttachmentsLoaded = false; - /** @type {import("@mail/attachments/attachment_model").Attachment[]} */ + /** @type {import("@mail/core/common/attachment_model").Attachment[]} */ attachments = []; /** @type {integer} */ activeRtcSessionId; /** @type {object|undefined} */ channel; - /** @type {import("@mail/core/channel_member_model").ChannelMember[]} */ + /** @type {import("@mail/core/common/channel_member_model").ChannelMember[]} */ channelMembers = []; /** @type {RtcSession{}} */ rtcSessions = {}; @@ -44,14 +44,14 @@ export class Thread { invitedMemberIds = new Set(); /** @type {integer} */ chatPartnerId; - /** @type {import("@mail/composer/composer_model").Composer} */ + /** @type {import("@mail/core/common/composer_model").Composer} */ composer; counter = 0; /** @type {string} */ customName; /** @type {string} */ description; - /** @type {import("@mail/core/follower_model").Follower[]} */ + /** @type {import("@mail/core/common/follower_model").Follower[]} */ followers = []; isAdmin = false; loadOlder = false; @@ -59,7 +59,7 @@ export class Thread { isLoadingAttachments = false; isLoadedDeferred = new Deferred(); isLoaded = false; - /** @type {import("@mail/attachments/attachment_model").Attachment} */ + /** @type {import("@mail/core/common/attachment_model").Attachment} */ mainAttachment; memberCount = 0; message_needaction_counter = 0; @@ -73,7 +73,7 @@ export class Thread { * * Content should be fetched and inserted in a controlled way. * - * @type {import("@mail/core/message_model").Message[]} + * @type {import("@mail/core/common/message_model").Message[]} */ messages = []; /** @@ -81,7 +81,7 @@ export class Thread { * `messages` list. This is a temporary storage to ensure nothing is lost * when fetching newer messages. * - * @type {import("@mail/core/message_model").Message[]} + * @type {import("@mail/core/common/message_model").Message[]} */ pendingNewMessages = []; /** @@ -93,7 +93,7 @@ export class Thread { * * Content should be fetched and inserted in a controlled way. * - * @type {import("@mail/core/message_model").Message[]} + * @type {import("@mail/core/common/message_model").Message[]} */ needactionMessages = []; /** @type {string} */ @@ -106,7 +106,7 @@ export class Thread { /** @type {ScrollPosition} */ scrollPosition = new ScrollPosition(); showOnlyVideo = false; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; /** @type {string} */ defaultDisplayMode; @@ -219,7 +219,7 @@ export class Thread { return this.name; } - /** @type {import("@mail/core/persona_model").Persona|undefined} */ + /** @type {import("@mail/core/common/persona_model").Persona|undefined} */ get correspondent() { if (this.type === "channel") { return undefined; @@ -243,7 +243,7 @@ export class Thread { } /** - * @returns {import("@mail/core/follower_model").Follower} + * @returns {import("@mail/core/common/follower_model").Follower} */ get followerOfSelf() { return this.followers.find((f) => f.partner === this._store.self); @@ -284,7 +284,7 @@ export class Thread { return createLocalId(this.model, this.id); } - /** @returns {import("@mail/core/message_model").Message | undefined} */ + /** @returns {import("@mail/core/common/message_model").Message | undefined} */ get newestMessage() { return [...this.messages].reverse().find((msg) => !msg.isEmpty); } @@ -312,7 +312,7 @@ export class Thread { } /** - * @param {import("@mail/core/message_model").Message} message + * @param {import("@mail/core/common/message_model").Message} message */ hasMessage(message) { return this.messages.some(({ id }) => id === message.id); @@ -427,7 +427,7 @@ export class Thread { /** * - * @param {import("@mail/core/persona_model").Persona} persona + * @param {import("@mail/core/common/persona_model").Persona} persona */ getMemberName(persona) { return persona.name; diff --git a/addons/mail/static/src/core/thread_service.js b/addons/mail/static/src/core/common/thread_service.js similarity index 96% rename from addons/mail/static/src/core/thread_service.js rename to addons/mail/static/src/core/common/thread_service.js index cded51f8f35..1f881c53e18 100644 --- a/addons/mail/static/src/core/thread_service.js +++ b/addons/mail/static/src/core/common/thread_service.js @@ -1,22 +1,24 @@ -/** @odoo-module */ +/* @odoo-module */ -import { markup } from "@odoo/owl"; -import { Thread } from "../core/thread_model"; -import { _t } from "@web/core/l10n/translation"; +import { Composer } from "@mail/core/common/composer_model"; +import { loadEmoji } from "@mail/core/common/emoji_picker"; +import { DEFAULT_AVATAR } from "@mail/core/common/persona_service"; +import { Thread } from "@mail/core/common/thread_model"; import { removeFromArray, removeFromArrayWithPredicate, replaceArrayWithCompare, -} from "@mail/utils/arrays"; -import { assignDefined, createLocalId, onChange } from "../utils/misc"; -import { Composer } from "../composer/composer_model"; -import { prettifyMessageContent } from "../utils/format"; -import { registry } from "@web/core/registry"; -import { url } from "@web/core/utils/urls"; -import { memoize } from "@web/core/utils/functions"; -import { DEFAULT_AVATAR } from "@mail/core/persona_service"; -import { loadEmoji } from "@mail/emoji_picker/emoji_picker"; +} from "@mail/utils/common/arrays"; +import { prettifyMessageContent } from "@mail/utils/common/format"; +import { assignDefined, createLocalId, onChange } from "@mail/utils/common/misc"; + +import { markup } from "@odoo/owl"; + import { browser } from "@web/core/browser/browser"; +import { _t } from "@web/core/l10n/translation"; +import { registry } from "@web/core/registry"; +import { memoize } from "@web/core/utils/functions"; +import { url } from "@web/core/utils/urls"; const FETCH_LIMIT = 30; @@ -29,20 +31,20 @@ export class ThreadService { setup(env, services) { this.env = env; - /** @type {import("@mail/core/channel_member_service").ChannelMemberService} */ + /** @type {import("@mail/core/common/channel_member_service").ChannelMemberService} */ this.channelMemberService = services["discuss.channel.member"]; - /** @type {import("@mail/attachments/attachment_service").AttachmentService} */ + /** @type {import("@mail/core/common/attachment_service").AttachmentService} */ this.attachmentsService = services["mail.attachment"]; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = services["mail.store"]; this.orm = services.orm; this.rpc = services.rpc; this.notificationService = services.notification; this.router = services.router; this.ui = services.ui; - /** @type {import("@mail/core/persona_service").PersonaService} */ + /** @type {import("@mail/core/common/persona_service").PersonaService} */ this.personaService = services["mail.persona"]; - /** @type {import("@mail/core/message_service").MessageService} */ + /** @type {import("@mail/core/common/message_service").MessageService} */ this.messageService = services["mail.message"]; // this prevents cyclic dependencies between mail.thread and other services this.env.bus.addEventListener("mail.thread/insert", ({ detail }) => { @@ -605,7 +607,7 @@ export class ThreadService { } /** - * @param {import("@mail/core/thread_model").Thread} thread + * @param {import("@mail/core/common/thread_model").Thread} thread * @param {boolean} pushState */ setDiscussThread(thread, pushState = true) { @@ -644,7 +646,7 @@ export class ThreadService { } /** - * @param {import("@mail/core/thread_model").Thread} thread + * @param {import("@mail/core/common/thread_model").Thread} thread * @param {Object} data */ update(thread, data) { @@ -1006,7 +1008,7 @@ export class ThreadService { } /** - * @param {import("@mail/core/thread_model").Thread} thread + * @param {import("@mail/core/common/thread_model").Thread} thread * @param {number} index */ async setMainAttachmentFromIndex(thread, index) { @@ -1017,7 +1019,7 @@ export class ThreadService { } /** - * @param {import("@mail/composer/composer_model").Composer} composer + * @param {import("@mail/core/common/composer_model").Composer} composer */ clearComposer(composer) { composer.attachments.length = 0; @@ -1030,8 +1032,8 @@ export class ThreadService { } /** - * @param {import("@mail/core/persona_model").Persona} persona - * @param {import("@mail/core/thread_model").Thread} [thread] + * @param {import("@mail/core/common/persona_model").Persona} persona + * @param {import("@mail/core/common/thread_model").Thread} [thread] */ avatarUrl(persona, thread) { if (!persona) { diff --git a/addons/mail/static/src/core/user_settings_service.js b/addons/mail/static/src/core/common/user_settings_service.js similarity index 99% rename from addons/mail/static/src/core/user_settings_service.js rename to addons/mail/static/src/core/common/user_settings_service.js index 3e4f5e3d74a..58b063c381c 100644 --- a/addons/mail/static/src/core/user_settings_service.js +++ b/addons/mail/static/src/core/common/user_settings_service.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { browser } from "@web/core/browser/browser"; import { registry } from "@web/core/registry"; diff --git a/addons/mail/static/src/public/boot.js b/addons/mail/static/src/core/public/boot.js similarity index 92% rename from addons/mail/static/src/public/boot.js rename to addons/mail/static/src/core/public/boot.js index ed3f9ca8d2f..c57e38dc925 100644 --- a/addons/mail/static/src/public/boot.js +++ b/addons/mail/static/src/core/public/boot.js @@ -1,16 +1,16 @@ -/** @odoo-module **/ +/* @odoo-module */ +import { DiscussPublic } from "@mail/core/public/discuss_public"; import { data } from "mail.discuss_public_template"; + +import { Component, mount, whenReady } from "@odoo/owl"; + +import { templates } from "@web/core/assets"; import { MainComponentsContainer } from "@web/core/main_components_container"; import { registry } from "@web/core/registry"; import { makeEnv, startServices } from "@web/env"; -import { templates } from "@web/core/assets"; - import { mapLegacyEnvToWowlEnv } from "@web/legacy/utils"; - import * as legacyEnv from "web.env"; -import { Component, mount, whenReady } from "@odoo/owl"; -import { DiscussPublic } from "@mail/public/discuss_public"; Component.env = legacyEnv; diff --git a/addons/mail/static/src/public/context_service.js b/addons/mail/static/src/core/public/context_service.js similarity index 91% rename from addons/mail/static/src/public/context_service.js rename to addons/mail/static/src/core/public/context_service.js index ae17227f775..bd7a54b718c 100644 --- a/addons/mail/static/src/public/context_service.js +++ b/addons/mail/static/src/core/public/context_service.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { registry } from "@web/core/registry"; diff --git a/addons/mail/static/src/public/discuss_public.js b/addons/mail/static/src/core/public/discuss_public.js similarity index 85% rename from addons/mail/static/src/public/discuss_public.js rename to addons/mail/static/src/core/public/discuss_public.js index 627817fc641..b4e861bd35b 100644 --- a/addons/mail/static/src/public/discuss_public.js +++ b/addons/mail/static/src/core/public/discuss_public.js @@ -1,9 +1,11 @@ /* @odoo-module */ +import { Discuss } from "@mail/core/common/discuss"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { WelcomePage } from "@mail/core/public/welcome_page"; + import { Component, useEffect, useState } from "@odoo/owl"; -import { WelcomePage } from "./welcome_page"; -import { Discuss } from "./../discuss_app/discuss"; -import { useMessaging, useStore } from "../core/messaging_hook"; + import { useService } from "@web/core/utils/hooks"; export class DiscussPublic extends Component { @@ -13,7 +15,7 @@ export class DiscussPublic extends Component { setup() { this.messaging = useMessaging(); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useService("mail.thread"); this.store = useStore(); this.state = useState({ diff --git a/addons/mail/static/src/public/discuss_public.xml b/addons/mail/static/src/core/public/discuss_public.xml similarity index 100% rename from addons/mail/static/src/public/discuss_public.xml rename to addons/mail/static/src/core/public/discuss_public.xml diff --git a/addons/mail/static/src/public/root_widget.js b/addons/mail/static/src/core/public/root_widget.js similarity index 84% rename from addons/mail/static/src/public/root_widget.js rename to addons/mail/static/src/core/public/root_widget.js index e2ad45840d1..5eaa633a342 100644 --- a/addons/mail/static/src/public/root_widget.js +++ b/addons/mail/static/src/core/public/root_widget.js @@ -1,12 +1,14 @@ -/** @odoo-module alias=root.widget **/ +/* @odoo-module alias=root.widget */ /** * This module exists so that web_tour can use it as the parent of the * TourManager so it can get access to _trigger_up. */ // need to wait for owl.Component.env to be set by new/public/boot before // we spawn the component adapter -import "@mail/public/boot"; -import { standaloneAdapter } from "web.OwlCompatibility"; +import "@mail/core/public/boot"; + import { Component } from "@odoo/owl"; +import { standaloneAdapter } from "web.OwlCompatibility"; + export default standaloneAdapter({ Component }); diff --git a/addons/mail/static/src/public/welcome_page.js b/addons/mail/static/src/core/public/welcome_page.js similarity index 95% rename from addons/mail/static/src/public/welcome_page.js rename to addons/mail/static/src/core/public/welcome_page.js index a12ec73a447..29d067c364c 100644 --- a/addons/mail/static/src/public/welcome_page.js +++ b/addons/mail/static/src/core/public/welcome_page.js @@ -1,9 +1,11 @@ /* @odoo-module */ +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; + import { Component, useRef, useState } from "@odoo/owl"; -import { useService } from "@web/core/utils/hooks"; -import { useMessaging, useStore } from "../core/messaging_hook"; + import { browser } from "@web/core/browser/browser"; +import { useService } from "@web/core/utils/hooks"; export class WelcomePage extends Component { static props = ["data?", "proceed?"]; @@ -13,7 +15,7 @@ export class WelcomePage extends Component { this.messaging = useMessaging(); this.store = useStore(); this.rpc = useService("rpc"); - /** @type {import("@mail/core/persona_service").PersonaService} */ + /** @type {import("@mail/core/common/persona_service").PersonaService} */ this.personaService = useService("mail.persona"); this.state = useState({ userName: "Guest", diff --git a/addons/mail/static/src/public/welcome_page.xml b/addons/mail/static/src/core/public/welcome_page.xml similarity index 100% rename from addons/mail/static/src/public/welcome_page.xml rename to addons/mail/static/src/core/public/welcome_page.xml diff --git a/addons/mail/static/src/web/activity/activity.js b/addons/mail/static/src/core/web/activity.js similarity index 82% rename from addons/mail/static/src/web/activity/activity.js rename to addons/mail/static/src/core/web/activity.js index e28132f4cab..88acadf89f7 100644 --- a/addons/mail/static/src/web/activity/activity.js +++ b/addons/mail/static/src/core/web/activity.js @@ -1,23 +1,23 @@ /* @odoo-module */ -import { Component, useState, onMounted, onWillUpdateProps } from "@odoo/owl"; +import { useAttachmentUploader } from "@mail/core/common/attachment_uploader_hook"; +import { useMessaging } from "@mail/core/common/messaging_hook"; +import { ActivityMailTemplate } from "@mail/core/web/activity_mail_template"; +import { ActivityMarkAsDone } from "@mail/core/web/activity_markasdone_popover"; +import { computeDelay, getMsToTomorrow } from "@mail/utils/common/dates"; + +import { Component, onMounted, onWillUpdateProps, useState } from "@odoo/owl"; + +import { browser } from "@web/core/browser/browser"; +import { _t } from "@web/core/l10n/translation"; +import { usePopover } from "@web/core/popover/popover_hook"; import { useService } from "@web/core/utils/hooks"; import { sprintf } from "@web/core/utils/strings"; -import { usePopover } from "@web/core/popover/popover_hook"; import { FileUploader } from "@web/views/fields/file_handler"; -import { browser } from "@web/core/browser/browser"; - -import { ActivityMailTemplate } from "@mail/web/activity/activity_mail_template"; -import { ActivityMarkAsDone } from "@mail/web/activity/activity_markasdone_popover"; -import { computeDelay, getMsToTomorrow } from "@mail/utils/dates"; -import { useAttachmentUploader } from "@mail/attachments/attachment_uploader_hook"; - -import { _t } from "@web/core/l10n/translation"; -import { useMessaging } from "@mail/core/messaging_hook"; /** * @typedef {Object} Props - * @property {import("./activity_model").Activity} data + * @property {import("@mail/core/web/activity_model").Activity} data * @property {function} [onUpdate] * @property {function} reloadParentView * @extends {Component} @@ -33,9 +33,9 @@ export class Activity extends Component { setup() { this.messaging = useMessaging(); - /** @type {import("@mail/web/activity/activity_service").ActivityService} */ + /** @type {import("@mail/core/web/activity_service").ActivityService} */ this.activityService = useService("mail.activity"); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useService("mail.thread"); this.state = useState({ showDetails: false, diff --git a/addons/mail/static/src/web/activity/activity.scss b/addons/mail/static/src/core/web/activity.scss similarity index 100% rename from addons/mail/static/src/web/activity/activity.scss rename to addons/mail/static/src/core/web/activity.scss diff --git a/addons/mail/static/src/web/activity/activity.xml b/addons/mail/static/src/core/web/activity.xml similarity index 100% rename from addons/mail/static/src/web/activity/activity.xml rename to addons/mail/static/src/core/web/activity.xml diff --git a/addons/mail/static/src/web/activity/activity_button.js b/addons/mail/static/src/core/web/activity_button.js similarity index 97% rename from addons/mail/static/src/web/activity/activity_button.js rename to addons/mail/static/src/core/web/activity_button.js index 852577c3ab6..626c2b4cdc1 100644 --- a/addons/mail/static/src/web/activity/activity_button.js +++ b/addons/mail/static/src/core/web/activity_button.js @@ -1,13 +1,12 @@ /* @odoo-module */ -import { ActivityListPopover } from "@mail/web/activity/activity_list_popover"; - -import { _t } from "@web/core/l10n/translation"; - -import { usePopover } from "@web/core/popover/popover_hook"; +import { ActivityListPopover } from "@mail/core/web/activity_list_popover"; import { Component, useRef } from "@odoo/owl"; +import { _t } from "@web/core/l10n/translation"; +import { usePopover } from "@web/core/popover/popover_hook"; + export class ActivityButton extends Component { static props = ["record"]; static template = "mail.ActivityButton"; diff --git a/addons/mail/static/src/web/activity/activity_button.xml b/addons/mail/static/src/core/web/activity_button.xml similarity index 100% rename from addons/mail/static/src/web/activity/activity_button.xml rename to addons/mail/static/src/core/web/activity_button.xml diff --git a/addons/mail/static/src/web/activity/activity_cell.js b/addons/mail/static/src/core/web/activity_cell.js similarity index 95% rename from addons/mail/static/src/web/activity/activity_cell.js rename to addons/mail/static/src/core/web/activity_cell.js index dd0b40335a6..99e7ca4a0ae 100644 --- a/addons/mail/static/src/web/activity/activity_cell.js +++ b/addons/mail/static/src/core/web/activity_cell.js @@ -1,11 +1,11 @@ /* @odoo-module */ -import { ActivityListPopover } from "@mail/web/activity/activity_list_popover"; - -import { usePopover } from "@web/core/popover/popover_hook"; +import { ActivityListPopover } from "@mail/core/web/activity_list_popover"; import { Component, useRef } from "@odoo/owl"; +import { usePopover } from "@web/core/popover/popover_hook"; + export class ActivityCell extends Component { static props = { activityIds: { diff --git a/addons/mail/static/src/web/activity/activity_cell.scss b/addons/mail/static/src/core/web/activity_cell.scss similarity index 100% rename from addons/mail/static/src/web/activity/activity_cell.scss rename to addons/mail/static/src/core/web/activity_cell.scss diff --git a/addons/mail/static/src/web/activity/activity_cell.xml b/addons/mail/static/src/core/web/activity_cell.xml similarity index 100% rename from addons/mail/static/src/web/activity/activity_cell.xml rename to addons/mail/static/src/core/web/activity_cell.xml diff --git a/addons/mail/static/src/web/activity/activity_list_popover.js b/addons/mail/static/src/core/web/activity_list_popover.js similarity index 87% rename from addons/mail/static/src/web/activity/activity_list_popover.js rename to addons/mail/static/src/core/web/activity_list_popover.js index 1caf21f9297..7146ea5f022 100644 --- a/addons/mail/static/src/web/activity/activity_list_popover.js +++ b/addons/mail/static/src/core/web/activity_list_popover.js @@ -1,8 +1,7 @@ /* @odoo-module */ -import { useMessaging, useStore } from "@mail/core/messaging_hook"; - -import { ActivityListPopoverItem } from "@mail/web/activity/activity_list_popover_item"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { ActivityListPopoverItem } from "@mail/core/web/activity_list_popover_item"; import { Component, onWillUpdateProps } from "@odoo/owl"; @@ -34,16 +33,16 @@ export class ActivityListPopover extends Component { this.orm = useService("orm"); this.messaging = useMessaging(); this.user = useService("user"); - /** @type {import("@mail/web/activity/activity_service").ActivityService} */ + /** @type {import("@mail/core/web/activity_service").ActivityService} */ this.activity = useService("mail.activity"); - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = useStore(); this.updateFromProps(this.props); onWillUpdateProps((props) => this.updateFromProps(props)); } get activities() { - /** @type {import("./activity_model").Activity[]} */ + /** @type {import("@mail/core/web/activity_model").Activity[]} */ const allActivities = Object.values(this.store.activities); return allActivities .filter((activity) => this.props.activityIds.includes(activity.id)) diff --git a/addons/mail/static/src/web/activity/activity_list_popover.xml b/addons/mail/static/src/core/web/activity_list_popover.xml similarity index 100% rename from addons/mail/static/src/web/activity/activity_list_popover.xml rename to addons/mail/static/src/core/web/activity_list_popover.xml diff --git a/addons/mail/static/src/web/activity/activity_list_popover_item.js b/addons/mail/static/src/core/web/activity_list_popover_item.js similarity index 90% rename from addons/mail/static/src/web/activity/activity_list_popover_item.js rename to addons/mail/static/src/core/web/activity_list_popover_item.js index 53610458015..67a741a05fd 100644 --- a/addons/mail/static/src/web/activity/activity_list_popover_item.js +++ b/addons/mail/static/src/core/web/activity_list_popover_item.js @@ -1,22 +1,21 @@ /* @odoo-module */ -import { ActivityMailTemplate } from "@mail/web/activity/activity_mail_template"; -import { ActivityMarkAsDone } from "@mail/web/activity/activity_markasdone_popover"; - -import { useService } from "@web/core/utils/hooks"; -import { sprintf } from "@web/core/utils/strings"; -import { FileUploader } from "@web/views/fields/file_handler"; - -import { computeDelay } from "@mail/utils/dates"; -import { useAttachmentUploader } from "@mail/attachments/attachment_uploader_hook"; +import { useAttachmentUploader } from "@mail/core/common/attachment_uploader_hook"; +import { ActivityMailTemplate } from "@mail/core/web/activity_mail_template"; +import { ActivityMarkAsDone } from "@mail/core/web/activity_markasdone_popover"; +import { computeDelay } from "@mail/utils/common/dates"; import { Component, useState } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; +import { useService } from "@web/core/utils/hooks"; +import { sprintf } from "@web/core/utils/strings"; import { url } from "@web/core/utils/urls"; +import { FileUploader } from "@web/views/fields/file_handler"; /** * @typedef {Object} Props - * @property {import("./activity_model").Activity} activity + * @property {import("@mail/core/web/activity_model").Activity} activity * @property {function} onActivityChanged * @property {function} [onClickDoneAndScheduleNext] * @property {function} onClickEditActivityButton diff --git a/addons/mail/static/src/web/activity/activity_list_popover_item.xml b/addons/mail/static/src/core/web/activity_list_popover_item.xml similarity index 100% rename from addons/mail/static/src/web/activity/activity_list_popover_item.xml rename to addons/mail/static/src/core/web/activity_list_popover_item.xml diff --git a/addons/mail/static/src/web/activity/activity_list_view.scss b/addons/mail/static/src/core/web/activity_list_view.scss similarity index 100% rename from addons/mail/static/src/web/activity/activity_list_view.scss rename to addons/mail/static/src/core/web/activity_list_view.scss diff --git a/addons/mail/static/src/web/activity/activity_list_view_item.scss b/addons/mail/static/src/core/web/activity_list_view_item.scss similarity index 100% rename from addons/mail/static/src/web/activity/activity_list_view_item.scss rename to addons/mail/static/src/core/web/activity_list_view_item.scss diff --git a/addons/mail/static/src/web/activity/activity_mail_template.js b/addons/mail/static/src/core/web/activity_mail_template.js similarity index 96% rename from addons/mail/static/src/web/activity/activity_mail_template.js rename to addons/mail/static/src/core/web/activity_mail_template.js index 99f2582e186..62a23fb6aae 100644 --- a/addons/mail/static/src/web/activity/activity_mail_template.js +++ b/addons/mail/static/src/core/web/activity_mail_template.js @@ -6,7 +6,7 @@ import { _t } from "@web/core/l10n/translation"; /** * @typedef {Object} Props - * @property {import("./activity_model").Activity} activity + * @property {import("@mail/core/web/activity_model").Activity} activity * @property {function} [onClickButtons] * @property {function} [onUpdate] * @extends {Component} diff --git a/addons/mail/static/src/web/activity/activity_mail_template.xml b/addons/mail/static/src/core/web/activity_mail_template.xml similarity index 100% rename from addons/mail/static/src/web/activity/activity_mail_template.xml rename to addons/mail/static/src/core/web/activity_mail_template.xml diff --git a/addons/mail/static/src/web/activity/activity_markasdone_popover.js b/addons/mail/static/src/core/web/activity_markasdone_popover.js similarity index 97% rename from addons/mail/static/src/web/activity/activity_markasdone_popover.js rename to addons/mail/static/src/core/web/activity_markasdone_popover.js index b40a8d4e544..a0e1ef962be 100644 --- a/addons/mail/static/src/web/activity/activity_markasdone_popover.js +++ b/addons/mail/static/src/core/web/activity_markasdone_popover.js @@ -1,7 +1,9 @@ /* @odoo-module */ -import { useMessaging } from "@mail/core/messaging_hook"; +import { useMessaging } from "@mail/core/common/messaging_hook"; + import { Component, onMounted, useExternalListener, useRef, useState } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; export class ActivityMarkAsDone extends Component { diff --git a/addons/mail/static/src/web/activity/activity_markasdone_popover.xml b/addons/mail/static/src/core/web/activity_markasdone_popover.xml similarity index 100% rename from addons/mail/static/src/web/activity/activity_markasdone_popover.xml rename to addons/mail/static/src/core/web/activity_markasdone_popover.xml diff --git a/addons/mail/static/src/web/activity/activity_menu.js b/addons/mail/static/src/core/web/activity_menu.js similarity index 97% rename from addons/mail/static/src/web/activity/activity_menu.js rename to addons/mail/static/src/core/web/activity_menu.js index 959d7bb4237..c2b1bb92210 100644 --- a/addons/mail/static/src/web/activity/activity_menu.js +++ b/addons/mail/static/src/core/web/activity_menu.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import { useMessaging, useStore } from "@mail/core/messaging_hook"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; import { Component, useState } from "@odoo/owl"; diff --git a/addons/mail/static/src/web/activity/activity_menu.scss b/addons/mail/static/src/core/web/activity_menu.scss similarity index 100% rename from addons/mail/static/src/web/activity/activity_menu.scss rename to addons/mail/static/src/core/web/activity_menu.scss diff --git a/addons/mail/static/src/web/activity/activity_menu.xml b/addons/mail/static/src/core/web/activity_menu.xml similarity index 100% rename from addons/mail/static/src/web/activity/activity_menu.xml rename to addons/mail/static/src/core/web/activity_menu.xml diff --git a/addons/mail/static/src/web/activity/activity_model.js b/addons/mail/static/src/core/web/activity_model.js similarity index 95% rename from addons/mail/static/src/web/activity/activity_model.js rename to addons/mail/static/src/core/web/activity_model.js index c53835fd0ae..3f5aa655a5c 100644 --- a/addons/mail/static/src/web/activity/activity_model.js +++ b/addons/mail/static/src/core/web/activity_model.js @@ -85,11 +85,11 @@ export class Activity { write_date; /** @type {[number, string]} */ write_uid; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; /** - * @param {import("@mail/core/store_service").Store} store + * @param {import("@mail/core/common/store_service").Store} store * @param {number} id * @returns {Activity} */ diff --git a/addons/mail/static/src/web/activity/activity_service.js b/addons/mail/static/src/core/web/activity_service.js similarity index 90% rename from addons/mail/static/src/web/activity/activity_service.js rename to addons/mail/static/src/core/web/activity_service.js index b11380f7f1e..a2307201fdc 100644 --- a/addons/mail/static/src/web/activity/activity_service.js +++ b/addons/mail/static/src/core/web/activity_service.js @@ -1,8 +1,9 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Activity } from "@mail/core/web/activity_model"; +import { assignDefined } from "@mail/utils/common/misc"; -import { Activity } from "@mail/web/activity/activity_model"; import { _t } from "@web/core/l10n/translation"; -import { assignDefined } from "@mail/utils/misc"; import { registry } from "@web/core/registry"; export class ActivityService { @@ -11,13 +12,13 @@ export class ActivityService { this.broadcastChannel = new BroadcastChannel("mail.activity.channel"); this.broadcastChannel.onmessage = this._onBroadcastChannelMessage.bind(this); this.env = env; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = services["mail.store"]; this.orm = services.orm; } /** - * @param {import("./activity_model").Activity} activity + * @param {import("@mail/core/web/activity_model").Activity} activity * @param {number[]} attachmentIds */ async markAsDone(activity, attachmentIds = []) { @@ -71,10 +72,10 @@ export class ActivityService { } /** - * @param {import("./activity_model").Data} data + * @param {import("@mail/core/web/activity_model").Data} data * @param {Object} [param1] * @param {boolean} param1.broadcast - * @returns {import("./activity_model").Activity} + * @returns {import("@mail/core/web/activity_model").Activity} */ insert(data, { broadcast = true } = {}) { const activity = this.store.activities[data.id] ?? new Activity(this.store, data.id); diff --git a/addons/mail/static/src/web/chat_window/chat_window_patch.js b/addons/mail/static/src/core/web/chat_window_patch.js similarity index 63% rename from addons/mail/static/src/web/chat_window/chat_window_patch.js rename to addons/mail/static/src/core/web/chat_window_patch.js index 887ce8978e3..4a5ffb05b79 100644 --- a/addons/mail/static/src/web/chat_window/chat_window_patch.js +++ b/addons/mail/static/src/core/web/chat_window_patch.js @@ -1,14 +1,14 @@ /* @odoo-module */ -import { ChatWindow } from "@mail/chat_window/chat_window"; -import { ChannelSelector } from "@mail/discuss_app/channel_selector"; +import { ChannelSelector } from "@mail/core/common/channel_selector"; +import { ChatWindow } from "@mail/core/common/chat_window"; import { useService } from "@web/core/utils/hooks"; import { patch } from "@web/core/utils/patch"; Object.assign(ChatWindow.components, { ChannelSelector }); -patch(ChatWindow.prototype, "mail/chat_window", { +patch(ChatWindow.prototype, "mail/core/web", { setup() { this._super(...arguments); this.actionService = useService("action"); diff --git a/addons/mail/static/src/web/chat_window/chat_window_patch.xml b/addons/mail/static/src/core/web/chat_window_patch.xml similarity index 100% rename from addons/mail/static/src/web/chat_window/chat_window_patch.xml rename to addons/mail/static/src/core/web/chat_window_patch.xml diff --git a/addons/mail/static/src/web/chatter.js b/addons/mail/static/src/core/web/chatter.js similarity index 91% rename from addons/mail/static/src/web/chatter.js rename to addons/mail/static/src/core/web/chatter.js index e644f1f8398..71ace15fa74 100644 --- a/addons/mail/static/src/web/chatter.js +++ b/addons/mail/static/src/core/web/chatter.js @@ -1,11 +1,17 @@ /* @odoo-module */ -import { Thread } from "../core_ui/thread"; -import { useMessaging, useStore } from "../core/messaging_hook"; -import { useDropzone } from "@mail/dropzone/dropzone_hook"; -import { AttachmentList } from "@mail/attachments/attachment_list"; -import { Composer } from "../composer/composer"; -import { Activity } from "@mail/web/activity/activity"; +import { AttachmentList } from "@mail/core/common/attachment_list"; +import { useAttachmentUploader } from "@mail/core/common/attachment_uploader_hook"; +import { Composer } from "@mail/core/common/composer"; +import { useDropzone } from "@mail/core/common/dropzone_hook"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { Thread } from "@mail/core/common/thread"; +import { Activity } from "@mail/core/web/activity"; +import { FollowerSubtypeDialog } from "@mail/core/web/follower_subtype_dialog"; +import { SuggestedRecipientsList } from "@mail/core/web/suggested_recipient_list"; +import { useHover, useScrollPosition } from "@mail/utils/common/hooks"; +import { isDragSourceExternalFile } from "@mail/utils/common/misc"; + import { Component, markup, @@ -17,16 +23,12 @@ import { useRef, useState, } from "@odoo/owl"; + import { Dropdown } from "@web/core/dropdown/dropdown"; -import { useService } from "@web/core/utils/hooks"; -import { FileUploader } from "@web/views/fields/file_handler"; -import { isDragSourceExternalFile } from "@mail/utils/misc"; -import { useAttachmentUploader } from "@mail/attachments/attachment_uploader_hook"; -import { useHover, useScrollPosition } from "@mail/utils/hooks"; -import { FollowerSubtypeDialog } from "./follower_subtype_dialog"; import { _t } from "@web/core/l10n/translation"; +import { useService } from "@web/core/utils/hooks"; import { escape, sprintf } from "@web/core/utils/strings"; -import { SuggestedRecipientsList } from "./suggested_recipient_list"; +import { FileUploader } from "@web/views/fields/file_handler"; /** * @typedef {Object} Props @@ -81,7 +83,7 @@ export class Chatter extends Component { this.messaging = useMessaging(); /** @type {import("@mail/activity/activity_service").ActivityService} */ this.activityService = useState(useService("mail.activity")); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useService("mail.thread"); this.store = useStore(); this.orm = useService("orm"); @@ -89,7 +91,7 @@ export class Chatter extends Component { this.state = useState({ isAttachmentBoxOpened: this.props.isAttachmentBoxVisibleInitially, showActivities: true, - /** @type {import("@mail/core/thread_model").Thread} */ + /** @type {import("@mail/core/common/thread_model").Thread} */ thread: undefined, }); this.unfollowHover = useHover("unfollow"); @@ -154,7 +156,7 @@ export class Chatter extends Component { } /** - * @returns {import("@mail/web/activity/activity_model").Activity[]} + * @returns {import("@mail/core/web/activity_model").Activity[]} */ get activities() { return this.state.thread.activities; @@ -248,7 +250,7 @@ export class Chatter extends Component { /** * @param {MouseEvent} ev - * @param {import("@mail/core/follower_model").Follower} follower + * @param {import("@mail/core/common/follower_model").Follower} follower */ async onClickEdit(ev, follower) { this.env.services.dialog.add(FollowerSubtypeDialog, { @@ -267,7 +269,7 @@ export class Chatter extends Component { /** * @param {MouseEvent} ev - * @param {import("@mail/core/follower_model").Follower} follower + * @param {import("@mail/core/common/follower_model").Follower} follower */ async onClickRemove(ev, follower) { await this.threadService.removeFollower(follower); diff --git a/addons/mail/static/src/web/chatter.scss b/addons/mail/static/src/core/web/chatter.scss similarity index 100% rename from addons/mail/static/src/web/chatter.scss rename to addons/mail/static/src/core/web/chatter.scss diff --git a/addons/mail/static/src/web/chatter.xml b/addons/mail/static/src/core/web/chatter.xml similarity index 100% rename from addons/mail/static/src/web/chatter.xml rename to addons/mail/static/src/core/web/chatter.xml diff --git a/addons/mail/static/src/web/command_palette.js b/addons/mail/static/src/core/web/command_palette.js similarity index 90% rename from addons/mail/static/src/web/command_palette.js rename to addons/mail/static/src/core/web/command_palette.js index 4f0137b981f..a64c9e74edb 100644 --- a/addons/mail/static/src/web/command_palette.js +++ b/addons/mail/static/src/core/web/command_palette.js @@ -1,10 +1,12 @@ -/** @odoo-module **/ +/* @odoo-module */ + +import { cleanTerm } from "@mail/utils/common/format"; -import { registry } from "@web/core/registry"; -import { _lt } from "@web/core/l10n/translation"; -import { cleanTerm } from "@mail/utils/format"; import { Component, xml } from "@odoo/owl"; +import { _lt } from "@web/core/l10n/translation"; +import { registry } from "@web/core/registry"; + const commandSetupRegistry = registry.category("command_setup"); const commandProviderRegistry = registry.category("command_provider"); @@ -29,10 +31,10 @@ DialogCommand.template = xml` commandProviderRegistry.add("mail.partner", { namespace: "@", async provide(env, options) { - /** @type {import("@mail/core/messaging_service").Messaging} */ + /** @type {import("@mail/core/common/messaging_service").Messaging} */ const messaging = env.services["mail.messaging"]; const threadService = env.services["mail.thread"]; - /** @type {import("@mail/composer/suggestion_service").SuggestionService} */ + /** @type {import("@mail/core/common/suggestion_service").SuggestionService} */ const suggestionService = env.services["mail.suggestion"]; const results = await messaging.searchPartners(options.searchValue); return suggestionService @@ -64,7 +66,7 @@ commandSetupRegistry.add("#", { commandProviderRegistry.add("discuss.channel", { namespace: "#", async provide(env, options) { - /** @type {import("@mail/core/messaging_service").Messaging} */ + /** @type {import("@mail/core/common/messaging_service").Messaging} */ const messaging = env.services["mail.messaging"]; const threadService = env.services["mail.thread"]; const domain = [ diff --git a/addons/mail/static/src/web/discuss_app/context_service.js b/addons/mail/static/src/core/web/context_service.js similarity index 90% rename from addons/mail/static/src/web/discuss_app/context_service.js rename to addons/mail/static/src/core/web/context_service.js index fde6ee9873d..95c77b5b6ab 100644 --- a/addons/mail/static/src/web/discuss_app/context_service.js +++ b/addons/mail/static/src/core/web/context_service.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { registry } from "@web/core/registry"; diff --git a/addons/mail/static/src/discuss_app/discuss_client_action.js b/addons/mail/static/src/core/web/discuss_client_action.js similarity index 87% rename from addons/mail/static/src/discuss_app/discuss_client_action.js rename to addons/mail/static/src/core/web/discuss_client_action.js index 0f289e5fcd4..bfb831cfdc2 100644 --- a/addons/mail/static/src/discuss_app/discuss_client_action.js +++ b/addons/mail/static/src/core/web/discuss_client_action.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import { Discuss } from "./discuss"; +import { Discuss } from "@mail/core/common/discuss"; import { Component } from "@odoo/owl"; diff --git a/addons/mail/static/src/discuss_app/discuss_client_action.xml b/addons/mail/static/src/core/web/discuss_client_action.xml similarity index 100% rename from addons/mail/static/src/discuss_app/discuss_client_action.xml rename to addons/mail/static/src/core/web/discuss_client_action.xml diff --git a/addons/mail/static/src/core/web/discuss_patch.js b/addons/mail/static/src/core/web/discuss_patch.js new file mode 100644 index 00000000000..84a36fd9a07 --- /dev/null +++ b/addons/mail/static/src/core/web/discuss_patch.js @@ -0,0 +1,11 @@ +/* @odoo-module */ + +import { Discuss } from "@mail/core/common/discuss"; +import { MessagingMenu } from "@mail/core/web/messaging_menu"; +import { Sidebar } from "@mail/core/web/sidebar"; + +import { patch } from "@web/core/utils/patch"; + +patch(Discuss, "mail/core/web", { + components: { ...Discuss.components, Sidebar, MessagingMenu }, +}); diff --git a/addons/mail/static/src/web/discuss_app/discuss_patch.xml b/addons/mail/static/src/core/web/discuss_patch.xml similarity index 100% rename from addons/mail/static/src/web/discuss_app/discuss_patch.xml rename to addons/mail/static/src/core/web/discuss_patch.xml diff --git a/addons/mail/static/src/web/follower_subtype_dialog.js b/addons/mail/static/src/core/web/follower_subtype_dialog.js similarity index 96% rename from addons/mail/static/src/web/follower_subtype_dialog.js rename to addons/mail/static/src/core/web/follower_subtype_dialog.js index 6070dcf8f7d..a77ec381ef3 100644 --- a/addons/mail/static/src/web/follower_subtype_dialog.js +++ b/addons/mail/static/src/core/web/follower_subtype_dialog.js @@ -3,9 +3,9 @@ import { Component, onWillStart, useState } from "@odoo/owl"; import { Dialog } from "@web/core/dialog/dialog"; +import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; import { sprintf } from "@web/core/utils/strings"; -import { _t } from "@web/core/l10n/translation"; /** * @typedef {Object} SubtypeData @@ -17,7 +17,7 @@ import { _t } from "@web/core/l10n/translation"; /** * @typedef {Object} Props * @property {function} close - * @property {import("@mail/core/follower_model").Follower} follower + * @property {import("@mail/core/common/follower_model").Follower} follower * @property {function} onFollowerChanged * @extends {Component} */ diff --git a/addons/mail/static/src/web/follower_subtype_dialog.scss b/addons/mail/static/src/core/web/follower_subtype_dialog.scss similarity index 100% rename from addons/mail/static/src/web/follower_subtype_dialog.scss rename to addons/mail/static/src/core/web/follower_subtype_dialog.scss diff --git a/addons/mail/static/src/web/follower_subtype_dialog.xml b/addons/mail/static/src/core/web/follower_subtype_dialog.xml similarity index 100% rename from addons/mail/static/src/web/follower_subtype_dialog.xml rename to addons/mail/static/src/core/web/follower_subtype_dialog.xml diff --git a/addons/mail/static/src/web/message_patch.js b/addons/mail/static/src/core/web/message_patch.js similarity index 97% rename from addons/mail/static/src/web/message_patch.js rename to addons/mail/static/src/core/web/message_patch.js index 59287c0b8fe..fce209e6852 100644 --- a/addons/mail/static/src/web/message_patch.js +++ b/addons/mail/static/src/core/web/message_patch.js @@ -1,17 +1,18 @@ -/** @odoo-module **/ +/* @odoo-module */ + +import { Message } from "@mail/core/common/message"; -import { patch } from "@web/core/utils/patch"; -import { Message } from "@mail/core_ui/message"; -import { useService } from "@web/core/utils/hooks"; -import { format } from "web.field_utils"; -import { deserializeDateTime } from "@web/core/l10n/dates"; -import { registry } from "@web/core/registry"; -import { _t } from "@web/core/l10n/translation"; import { getCurrency } from "@web/core/currency"; +import { deserializeDateTime } from "@web/core/l10n/dates"; +import { _t } from "@web/core/l10n/translation"; +import { registry } from "@web/core/registry"; +import { useService } from "@web/core/utils/hooks"; +import { patch } from "@web/core/utils/patch"; +import { format } from "web.field_utils"; const formatters = registry.category("formatters"); -patch(Message.prototype, "mail/web", { +patch(Message.prototype, "mail/core/web", { setup() { this._super(...arguments); this.action = useService("action"); diff --git a/addons/mail/static/src/web/message_patch.xml b/addons/mail/static/src/core/web/message_patch.xml similarity index 100% rename from addons/mail/static/src/web/message_patch.xml rename to addons/mail/static/src/core/web/message_patch.xml diff --git a/addons/mail/static/src/web/messaging_menu/messaging_menu.js b/addons/mail/static/src/core/web/messaging_menu.js similarity index 93% rename from addons/mail/static/src/web/messaging_menu/messaging_menu.js rename to addons/mail/static/src/core/web/messaging_menu.js index 347edb54533..ddc337d3b1d 100644 --- a/addons/mail/static/src/web/messaging_menu/messaging_menu.js +++ b/addons/mail/static/src/core/web/messaging_menu.js @@ -1,20 +1,20 @@ /* @odoo-module */ -import { ImStatus } from "@mail/discuss_app/im_status"; +import { ChannelSelector } from "@mail/core/common/channel_selector"; +import { ImStatus } from "@mail/core/common/im_status"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { NotificationItem } from "@mail/core/web/notification_item"; +import { onExternalClick } from "@mail/utils/common/hooks"; +import { createLocalId } from "@mail/utils/common/misc"; -import { useMessaging, useStore } from "@mail/core/messaging_hook"; -import { NotificationItem } from "@mail/web/messaging_menu/notification_item"; -import { ChannelSelector } from "@mail/discuss_app/channel_selector"; -import { createLocalId } from "@mail/utils/misc"; -import { onExternalClick } from "@mail/utils/hooks"; import { Component, useState } from "@odoo/owl"; +import { hasTouch } from "@web/core/browser/feature_detection"; import { Dropdown } from "@web/core/dropdown/dropdown"; import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; import { sprintf } from "@web/core/utils/strings"; -import { hasTouch } from "@web/core/browser/feature_detection"; export class MessagingMenu extends Component { static components = { Dropdown, NotificationItem, ImStatus, ChannelSelector }; @@ -26,9 +26,9 @@ export class MessagingMenu extends Component { this.store = useStore(); this.hasTouch = hasTouch; this.notification = useState(useService("mail.notification.permission")); - /** @type {import("@mail/chat_window/chat_window_service").ChatWindowService} */ + /** @type {import("@mail/core/common/chat_window_service").ChatWindowService} */ this.chatWindowService = useState(useService("mail.chat_window")); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useState(useService("mail.thread")); this.action = useService("action"); this.ui = useState(useService("ui")); @@ -103,7 +103,7 @@ export class MessagingMenu extends Component { } get threads() { - /** @type {import("@mail/core/thread_model").Thread[]} **/ + /** @type {import("@mail/core/common/thread_model").Thread[]} */ let threads = Object.values(this.store.threads).filter( (thread) => thread.is_pinned || (thread.hasNeedactionMessages && thread.type !== "mailbox") @@ -212,7 +212,7 @@ export class MessagingMenu extends Component { /** * - * @param {import("@mail/core/notification_group_model").NotificationGroup} failure + * @param {import("@mail/core/common/notification_group_model").NotificationGroup} failure */ onClickFailure(failure) { const originThreadIds = new Set( diff --git a/addons/mail/static/src/web/messaging_menu/messaging_menu.scss b/addons/mail/static/src/core/web/messaging_menu.scss similarity index 100% rename from addons/mail/static/src/web/messaging_menu/messaging_menu.scss rename to addons/mail/static/src/core/web/messaging_menu.scss diff --git a/addons/mail/static/src/web/messaging_menu/messaging_menu.xml b/addons/mail/static/src/core/web/messaging_menu.xml similarity index 100% rename from addons/mail/static/src/web/messaging_menu/messaging_menu.xml rename to addons/mail/static/src/core/web/messaging_menu.xml diff --git a/addons/mail/static/src/web/messaging_service_patch.js b/addons/mail/static/src/core/web/messaging_service_patch.js similarity index 86% rename from addons/mail/static/src/web/messaging_service_patch.js rename to addons/mail/static/src/core/web/messaging_service_patch.js index 60b6529049a..79abc7c57fc 100644 --- a/addons/mail/static/src/web/messaging_service_patch.js +++ b/addons/mail/static/src/core/web/messaging_service_patch.js @@ -1,15 +1,16 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { Messaging, messagingService } from "@mail/core/common/messaging_service"; +import { createLocalId } from "@mail/utils/common/misc"; -import { Messaging, messagingService } from "@mail/core/messaging_service"; -import { createLocalId } from "@mail/utils/misc"; import { _t } from "@web/core/l10n/translation"; import { patch } from "@web/core/utils/patch"; import { sprintf } from "@web/core/utils/strings"; -patch(Messaging.prototype, "mail/web", { +patch(Messaging.prototype, "mail/core/web", { setup(env, services, initialThreadLocalId) { this._super(env, services, initialThreadLocalId); - /** @type {import("@mail/chat/chat_window_service").ChatWindow} */ + /** @type {import("@mail/core/common/chat_window_service").ChatWindow} */ this.chatWindowService = services["mail.chat_window"]; this.ui = services["ui"]; this.bus.subscribe("res.users/connection", async ({ partnerId, username }) => { @@ -55,6 +56,6 @@ patch(Messaging.prototype, "mail/web", { }, }); -patch(messagingService, "mail/web", { +patch(messagingService, "mail/core/web", { dependencies: [...messagingService.dependencies, "mail.chat_window", "ui"], }); diff --git a/addons/mail/static/src/web/messaging_menu/notification_item.js b/addons/mail/static/src/core/web/notification_item.js similarity index 86% rename from addons/mail/static/src/web/messaging_menu/notification_item.js rename to addons/mail/static/src/core/web/notification_item.js index 13efabd55bf..9c103c34c1b 100644 --- a/addons/mail/static/src/web/messaging_menu/notification_item.js +++ b/addons/mail/static/src/core/web/notification_item.js @@ -1,8 +1,10 @@ /* @odoo-module */ +import { ImStatus } from "@mail/core/common/im_status"; +import { RelativeTime } from "@mail/core/common/relative_time"; + import { Component, useRef } from "@odoo/owl"; -import { ImStatus } from "@mail/discuss_app/im_status"; -import { RelativeTime } from "@mail/core_ui/relative_time"; + import { ActionSwiper } from "@web/core/action_swiper/action_swiper"; export class NotificationItem extends Component { diff --git a/addons/mail/static/src/web/messaging_menu/notification_item.scss b/addons/mail/static/src/core/web/notification_item.scss similarity index 100% rename from addons/mail/static/src/web/messaging_menu/notification_item.scss rename to addons/mail/static/src/core/web/notification_item.scss diff --git a/addons/mail/static/src/web/messaging_menu/notification_item.xml b/addons/mail/static/src/core/web/notification_item.xml similarity index 100% rename from addons/mail/static/src/web/messaging_menu/notification_item.xml rename to addons/mail/static/src/core/web/notification_item.xml diff --git a/addons/mail/static/src/web/open_chat_hook.js b/addons/mail/static/src/core/web/open_chat_hook.js similarity index 100% rename from addons/mail/static/src/web/open_chat_hook.js rename to addons/mail/static/src/core/web/open_chat_hook.js diff --git a/addons/mail/static/src/web/discuss_app/sidebar.js b/addons/mail/static/src/core/web/sidebar.js similarity index 89% rename from addons/mail/static/src/web/discuss_app/sidebar.js rename to addons/mail/static/src/core/web/sidebar.js index f7f358397fc..d0dcf9045a1 100644 --- a/addons/mail/static/src/web/discuss_app/sidebar.js +++ b/addons/mail/static/src/core/web/sidebar.js @@ -1,16 +1,17 @@ /* @odoo-module */ -import { useMessaging, useStore } from "@mail/core/messaging_hook"; -import { ThreadIcon } from "@mail/discuss_app/thread_icon"; -import { ChannelSelector } from "@mail/discuss_app/channel_selector"; -import { ImStatus } from "@mail/discuss_app/im_status"; -import { useService } from "@web/core/utils/hooks"; -import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; -import { onExternalClick } from "@mail/utils/hooks"; -import { Component, useState } from "@odoo/owl"; -import { markEventHandled } from "@mail/utils/misc"; +import { ChannelSelector } from "@mail/core/common/channel_selector"; +import { ImStatus } from "@mail/core/common/im_status"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { ThreadIcon } from "@mail/core/common/thread_icon"; +import { onExternalClick } from "@mail/utils/common/hooks"; +import { markEventHandled } from "@mail/utils/common/misc"; +import { Component, useState } from "@odoo/owl"; + +import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; import { _t } from "@web/core/l10n/translation"; +import { useService } from "@web/core/utils/hooks"; /** * @typedef {Object} Props @@ -24,7 +25,7 @@ export class Sidebar extends Component { setup() { this.messaging = useMessaging(); this.store = useStore(); - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = useState(useService("mail.thread")); this.actionService = useService("action"); this.dialogService = useService("dialog"); diff --git a/addons/mail/static/src/web/discuss_app/sidebar.scss b/addons/mail/static/src/core/web/sidebar.scss similarity index 100% rename from addons/mail/static/src/web/discuss_app/sidebar.scss rename to addons/mail/static/src/core/web/sidebar.scss diff --git a/addons/mail/static/src/web/discuss_app/sidebar.xml b/addons/mail/static/src/core/web/sidebar.xml similarity index 100% rename from addons/mail/static/src/web/discuss_app/sidebar.xml rename to addons/mail/static/src/core/web/sidebar.xml diff --git a/addons/mail/static/src/web/suggested_recipient.js b/addons/mail/static/src/core/web/suggested_recipient.js similarity index 89% rename from addons/mail/static/src/web/suggested_recipient.js rename to addons/mail/static/src/core/web/suggested_recipient.js index 39f07dcc1a0..2b210835ad4 100644 --- a/addons/mail/static/src/web/suggested_recipient.js +++ b/addons/mail/static/src/core/web/suggested_recipient.js @@ -1,6 +1,7 @@ /* @odoo-module */ import { Component } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; import { sprintf } from "@web/core/utils/strings"; @@ -8,8 +9,8 @@ import { FormViewDialog } from "@web/views/view_dialogs/form_view_dialog"; /** * @typedef {Object} Props - * @property {import("@mail/core/thread_model").Thread} thread - * @property {import("@mail/web/suggested_recipient").SuggestedRecipient} recipient + * @property {import("@mail/core/common/thread_model").Thread} thread + * @property {import("@mail/core/web/suggested_recipient").SuggestedRecipient} recipient * @extends {Component} */ export class SuggestedRecipient extends Component { @@ -18,7 +19,7 @@ export class SuggestedRecipient extends Component { setup() { this.dialogService = useService("dialog"); - /** @type {import("@mail/core/thread_service").ThreadService)}*/ + /** @type {import("@mail/core/common/thread_service").ThreadService)}*/ this.threadService = useService("mail.thread"); } diff --git a/addons/mail/static/src/web/suggested_recipient.xml b/addons/mail/static/src/core/web/suggested_recipient.xml similarity index 100% rename from addons/mail/static/src/web/suggested_recipient.xml rename to addons/mail/static/src/core/web/suggested_recipient.xml diff --git a/addons/mail/static/src/web/suggested_recipient_list.js b/addons/mail/static/src/core/web/suggested_recipient_list.js similarity index 83% rename from addons/mail/static/src/web/suggested_recipient_list.js rename to addons/mail/static/src/core/web/suggested_recipient_list.js index 6b0a8e73eeb..836cb7b7457 100644 --- a/addons/mail/static/src/web/suggested_recipient_list.js +++ b/addons/mail/static/src/core/web/suggested_recipient_list.js @@ -1,11 +1,12 @@ /* @odoo-module */ +import { SuggestedRecipient } from "@mail/core/web/suggested_recipient"; + import { Component, useState } from "@odoo/owl"; -import { SuggestedRecipient } from "@mail/web/suggested_recipient"; /** * @typedef {Object} Props - * @property {import("@mail/core/thread_model").Thread} thread + * @property {import("@mail/core/common/thread_model").Thread} thread * @property {string} className * @property {string} styleString * @extends {Component} diff --git a/addons/mail/static/src/web/suggested_recipient_list.xml b/addons/mail/static/src/core/web/suggested_recipient_list.xml similarity index 100% rename from addons/mail/static/src/web/suggested_recipient_list.xml rename to addons/mail/static/src/core/web/suggested_recipient_list.xml diff --git a/addons/mail/static/src/web/thread_actions.js b/addons/mail/static/src/core/web/thread_actions.js similarity index 95% rename from addons/mail/static/src/web/thread_actions.js rename to addons/mail/static/src/core/web/thread_actions.js index 991e35479f6..77df17b6ddc 100644 --- a/addons/mail/static/src/web/thread_actions.js +++ b/addons/mail/static/src/core/web/thread_actions.js @@ -1,6 +1,7 @@ /* @odoo-module */ -import { threadActionsRegistry } from "@mail/core/thread_actions"; +import { threadActionsRegistry } from "@mail/core/common/thread_actions"; + import { _t } from "@web/core/l10n/translation"; threadActionsRegistry diff --git a/addons/mail/static/src/web/thread_model_patch.js b/addons/mail/static/src/core/web/thread_model_patch.js similarity index 76% rename from addons/mail/static/src/web/thread_model_patch.js rename to addons/mail/static/src/core/web/thread_model_patch.js index 02e198f1d13..5d0187dd935 100644 --- a/addons/mail/static/src/web/thread_model_patch.js +++ b/addons/mail/static/src/core/web/thread_model_patch.js @@ -1,12 +1,12 @@ /* @odoo-module */ -import { Thread } from "@mail/core/thread_model"; +import { Thread } from "@mail/core/common/thread_model"; import { patch } from "@web/core/utils/patch"; -patch(Thread.prototype, "mail/web", { +patch(Thread.prototype, "mail/core/web", { /** - * @returns {import("@mail/web/activity/activity_model").Activity[]} + * @returns {import("@mail/core/web/activity_model").Activity[]} */ get activities() { return Object.values(this._store.activities) diff --git a/addons/mail/static/src/web/thread_service_patch.js b/addons/mail/static/src/core/web/thread_service_patch.js similarity index 87% rename from addons/mail/static/src/web/thread_service_patch.js rename to addons/mail/static/src/core/web/thread_service_patch.js index 089110ec1f6..cf3564dba94 100644 --- a/addons/mail/static/src/web/thread_service_patch.js +++ b/addons/mail/static/src/core/web/thread_service_patch.js @@ -1,9 +1,9 @@ -/** @odoo-module */ +/* @odoo-module */ -import { Follower } from "@mail/core/follower_model"; -import { ThreadService, threadService } from "@mail/core/thread_service"; -import { createLocalId } from "@mail/utils/misc"; +import { Follower } from "@mail/core/common/follower_model"; +import { ThreadService, threadService } from "@mail/core/common/thread_service"; import { parseEmail } from "@mail/js/utils"; +import { createLocalId } from "@mail/utils/common/misc"; import { markup } from "@odoo/owl"; @@ -12,18 +12,18 @@ import { patch } from "@web/core/utils/patch"; let nextId = 1; -patch(ThreadService.prototype, "mail/web", { +patch(ThreadService.prototype, "mail/core/web", { setup(env, services) { this._super(env, services); - /** @type {import("@mail/attachments/attachment_service").AttachmentService} */ + /** @type {import("@mail/core/common/attachment_service").AttachmentService} */ this.attachmentService = services["mail.attachment"]; - /** @type {import("@mail/web/activity/activity_service").ActivityService} */ + /** @type {import("@mail/core/web/activity_service").ActivityService} */ this.activityService = services["mail.activity"]; - /** @type {import("@mail/chat/chat_window_service").ChatWindowService} */ + /** @type {import("@mail/core/common/chat_window_service").ChatWindowService} */ this.chatWindowService = services["mail.chat_window"]; }, /** - * @param {import("@mail/core/thread_model").Thread} thread + * @param {import("@mail/core/common/thread_model").Thread} thread * @param {['activities'|'followers'|'attachments'|'messages'|'suggestedRecipients']} requestList */ async fetchData( @@ -122,8 +122,8 @@ patch(ThreadService.prototype, "mail/web", { return thread; }, /** - * @param {import("@mail/core/follower_model").Data} data - * @returns {import("@mail/core/follower_model").Follower} + * @param {import("@mail/core/common/follower_model").Data} data + * @returns {import("@mail/core/common/follower_model").Follower} */ insertFollower(data) { let follower = this.store.followers[data.id]; @@ -144,8 +144,8 @@ patch(ThreadService.prototype, "mail/web", { return follower; }, /** - * @param {import("@mail/core/thread_model").Thread} thread - * @param {import("@mail/web/suggested_recipient").SuggestedRecipient[]} dataList + * @param {import("@mail/core/common/thread_model").Thread} thread + * @param {import("@mail/core/web/suggested_recipient").SuggestedRecipient[]} dataList */ async insertSuggestedRecipients(thread, dataList) { const recipients = []; @@ -186,7 +186,7 @@ patch(ThreadService.prototype, "mail/web", { this._super(thread, replaceNewMessageChatWindow); }, /** - * @param {import("@mail/core/follower_model").Follower} follower + * @param {import("@mail/core/common/follower_model").Follower} follower */ async removeFollower(follower) { await this.orm.call(follower.followedThread.model, "message_unsubscribe", [ @@ -201,7 +201,7 @@ patch(ThreadService.prototype, "mail/web", { }, }); -patch(threadService, "mail/web", { +patch(threadService, "mail/core/web", { dependencies: [ ...threadService.dependencies, "mail.activity", diff --git a/addons/mail/static/src/discuss/call/chat_window_patch.js b/addons/mail/static/src/discuss/call/chat_window_patch.js deleted file mode 100644 index facfc23ffb1..00000000000 --- a/addons/mail/static/src/discuss/call/chat_window_patch.js +++ /dev/null @@ -1,6 +0,0 @@ -/* @odoo-module */ - -import { ChatWindow } from "@mail/chat_window/chat_window"; -import { Call } from "@mail/discuss/call/call"; - -Object.assign(ChatWindow.components, { Call }); diff --git a/addons/mail/static/src/discuss/call/blur_manager.js b/addons/mail/static/src/discuss/call/common/blur_manager.js similarity index 98% rename from addons/mail/static/src/discuss/call/blur_manager.js rename to addons/mail/static/src/discuss/call/common/blur_manager.js index 321c35b8db6..eaaf4d9c5d3 100644 --- a/addons/mail/static/src/discuss/call/blur_manager.js +++ b/addons/mail/static/src/discuss/call/common/blur_manager.js @@ -1,6 +1,7 @@ /* @odoo-module */ -import { closeStream } from "@mail/utils/misc"; +import { closeStream } from "@mail/utils/common/misc"; + import { browser } from "@web/core/browser/browser"; function drawAndBlurImageOnCanvas(image, blurAmount, canvas) { diff --git a/addons/mail/static/src/discuss/call/call.dark.scss b/addons/mail/static/src/discuss/call/common/call.dark.scss similarity index 100% rename from addons/mail/static/src/discuss/call/call.dark.scss rename to addons/mail/static/src/discuss/call/common/call.dark.scss diff --git a/addons/mail/static/src/discuss/call/call.js b/addons/mail/static/src/discuss/call/common/call.js similarity index 95% rename from addons/mail/static/src/discuss/call/call.js rename to addons/mail/static/src/discuss/call/common/call.js index 565da78283b..d869440a8f7 100644 --- a/addons/mail/static/src/discuss/call/call.js +++ b/addons/mail/static/src/discuss/call/common/call.js @@ -1,10 +1,11 @@ /* @odoo-module */ -import { useMessaging, useStore } from "@mail/core/messaging_hook"; -import { CallActionList } from "@mail/discuss/call/call_action_list"; -import { CallParticipantCard } from "@mail/discuss/call/call_participant_card"; -import { useRtc } from "@mail/discuss/call/rtc_hook"; -import { isEventHandled, markEventHandled } from "@mail/utils/misc"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; +import { CallActionList } from "@mail/discuss/call/common/call_action_list"; +import { CallParticipantCard } from "@mail/discuss/call/common/call_participant_card"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; +import { isEventHandled, markEventHandled } from "@mail/utils/common/misc"; + import { Component, onMounted, @@ -14,6 +15,7 @@ import { useRef, useState, } from "@odoo/owl"; + import { browser } from "@web/core/browser/browser"; import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; diff --git a/addons/mail/static/src/discuss/call/call.scss b/addons/mail/static/src/discuss/call/common/call.scss similarity index 100% rename from addons/mail/static/src/discuss/call/call.scss rename to addons/mail/static/src/discuss/call/common/call.scss diff --git a/addons/mail/static/src/discuss/call/call.xml b/addons/mail/static/src/discuss/call/common/call.xml similarity index 100% rename from addons/mail/static/src/discuss/call/call.xml rename to addons/mail/static/src/discuss/call/common/call.xml diff --git a/addons/mail/static/src/discuss/call/call_action_list.dark.scss b/addons/mail/static/src/discuss/call/common/call_action_list.dark.scss similarity index 100% rename from addons/mail/static/src/discuss/call/call_action_list.dark.scss rename to addons/mail/static/src/discuss/call/common/call_action_list.dark.scss diff --git a/addons/mail/static/src/discuss/call/call_action_list.js b/addons/mail/static/src/discuss/call/common/call_action_list.js similarity index 96% rename from addons/mail/static/src/discuss/call/call_action_list.js rename to addons/mail/static/src/discuss/call/common/call_action_list.js index 0669b21775a..290dc50dd88 100644 --- a/addons/mail/static/src/discuss/call/call_action_list.js +++ b/addons/mail/static/src/discuss/call/common/call_action_list.js @@ -1,7 +1,9 @@ /* @odoo-module */ -import { useRtc } from "@mail/discuss/call/rtc_hook"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; + import { Component } from "@odoo/owl"; + import { isMobileOS } from "@web/core/browser/feature_detection"; export class CallActionList extends Component { diff --git a/addons/mail/static/src/discuss/call/call_action_list.scss b/addons/mail/static/src/discuss/call/common/call_action_list.scss similarity index 100% rename from addons/mail/static/src/discuss/call/call_action_list.scss rename to addons/mail/static/src/discuss/call/common/call_action_list.scss diff --git a/addons/mail/static/src/discuss/call/call_action_list.xml b/addons/mail/static/src/discuss/call/common/call_action_list.xml similarity index 100% rename from addons/mail/static/src/discuss/call/call_action_list.xml rename to addons/mail/static/src/discuss/call/common/call_action_list.xml diff --git a/addons/mail/static/src/discuss/call/call_context_menu.js b/addons/mail/static/src/discuss/call/common/call_context_menu.js similarity index 99% rename from addons/mail/static/src/discuss/call/call_context_menu.js rename to addons/mail/static/src/discuss/call/common/call_context_menu.js index 9b958040775..37ee85d7e27 100644 --- a/addons/mail/static/src/discuss/call/call_context_menu.js +++ b/addons/mail/static/src/discuss/call/common/call_context_menu.js @@ -1,6 +1,7 @@ /* @odoo-module */ import { Component, onMounted, onWillUnmount, useState } from "@odoo/owl"; + import { browser } from "@web/core/browser/browser"; import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; diff --git a/addons/mail/static/src/discuss/call/call_context_menu.xml b/addons/mail/static/src/discuss/call/common/call_context_menu.xml similarity index 100% rename from addons/mail/static/src/discuss/call/call_context_menu.xml rename to addons/mail/static/src/discuss/call/common/call_context_menu.xml diff --git a/addons/mail/static/src/discuss/call/call_invitation.js b/addons/mail/static/src/discuss/call/common/call_invitation.js similarity index 99% rename from addons/mail/static/src/discuss/call/call_invitation.js rename to addons/mail/static/src/discuss/call/common/call_invitation.js index 88b5f9d1e60..eef10af7ba5 100644 --- a/addons/mail/static/src/discuss/call/call_invitation.js +++ b/addons/mail/static/src/discuss/call/common/call_invitation.js @@ -1,6 +1,7 @@ /* @odoo-module */ import { Component } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; export class CallInvitation extends Component { diff --git a/addons/mail/static/src/discuss/call/call_invitation.scss b/addons/mail/static/src/discuss/call/common/call_invitation.scss similarity index 100% rename from addons/mail/static/src/discuss/call/call_invitation.scss rename to addons/mail/static/src/discuss/call/common/call_invitation.scss diff --git a/addons/mail/static/src/discuss/call/call_invitation.xml b/addons/mail/static/src/discuss/call/common/call_invitation.xml similarity index 100% rename from addons/mail/static/src/discuss/call/call_invitation.xml rename to addons/mail/static/src/discuss/call/common/call_invitation.xml diff --git a/addons/mail/static/src/discuss/call/call_invitations.js b/addons/mail/static/src/discuss/call/common/call_invitations.js similarity index 69% rename from addons/mail/static/src/discuss/call/call_invitations.js rename to addons/mail/static/src/discuss/call/common/call_invitations.js index bba37e6b0a5..7fb054b24df 100644 --- a/addons/mail/static/src/discuss/call/call_invitations.js +++ b/addons/mail/static/src/discuss/call/common/call_invitations.js @@ -1,9 +1,11 @@ /* @odoo-module */ -import { useStore } from "@mail/core/messaging_hook"; -import { CallInvitation } from "@mail/discuss/call/call_invitation"; -import { useRtc } from "@mail/discuss/call/rtc_hook"; +import { useStore } from "@mail/core/common/messaging_hook"; +import { CallInvitation } from "@mail/discuss/call/common/call_invitation"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; + import { Component } from "@odoo/owl"; + import { registry } from "@web/core/registry"; export class CallInvitations extends Component { diff --git a/addons/mail/static/src/discuss/call/call_invitations.scss b/addons/mail/static/src/discuss/call/common/call_invitations.scss similarity index 100% rename from addons/mail/static/src/discuss/call/call_invitations.scss rename to addons/mail/static/src/discuss/call/common/call_invitations.scss diff --git a/addons/mail/static/src/discuss/call/call_invitations.xml b/addons/mail/static/src/discuss/call/common/call_invitations.xml similarity index 100% rename from addons/mail/static/src/discuss/call/call_invitations.xml rename to addons/mail/static/src/discuss/call/common/call_invitations.xml diff --git a/addons/mail/static/src/discuss/call/call_menu.js b/addons/mail/static/src/discuss/call/common/call_menu.js similarity index 88% rename from addons/mail/static/src/discuss/call/call_menu.js rename to addons/mail/static/src/discuss/call/common/call_menu.js index 3cb0ecbb3d4..aa045563094 100644 --- a/addons/mail/static/src/discuss/call/call_menu.js +++ b/addons/mail/static/src/discuss/call/common/call_menu.js @@ -1,7 +1,9 @@ /* @odoo-module */ -import { useRtc } from "@mail/discuss/call/rtc_hook"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; + import { Component } from "@odoo/owl"; + import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; diff --git a/addons/mail/static/src/discuss/call/call_menu.scss b/addons/mail/static/src/discuss/call/common/call_menu.scss similarity index 100% rename from addons/mail/static/src/discuss/call/call_menu.scss rename to addons/mail/static/src/discuss/call/common/call_menu.scss diff --git a/addons/mail/static/src/discuss/call/call_menu.xml b/addons/mail/static/src/discuss/call/common/call_menu.xml similarity index 100% rename from addons/mail/static/src/discuss/call/call_menu.xml rename to addons/mail/static/src/discuss/call/common/call_menu.xml diff --git a/addons/mail/static/src/discuss/call/call_participant_card.dark.scss b/addons/mail/static/src/discuss/call/common/call_participant_card.dark.scss similarity index 100% rename from addons/mail/static/src/discuss/call/call_participant_card.dark.scss rename to addons/mail/static/src/discuss/call/common/call_participant_card.dark.scss diff --git a/addons/mail/static/src/discuss/call/call_participant_card.js b/addons/mail/static/src/discuss/call/common/call_participant_card.js similarity index 90% rename from addons/mail/static/src/discuss/call/call_participant_card.js rename to addons/mail/static/src/discuss/call/common/call_participant_card.js index 6f1a8aa1195..28540376abc 100644 --- a/addons/mail/static/src/discuss/call/call_participant_card.js +++ b/addons/mail/static/src/discuss/call/common/call_participant_card.js @@ -1,12 +1,14 @@ /* @odoo-module */ -import { useStore } from "@mail/core/messaging_hook"; -import { CallContextMenu } from "@mail/discuss/call/call_context_menu"; -import { CallParticipantVideo } from "@mail/discuss/call/call_participant_video"; -import { useRtc } from "@mail/discuss/call/rtc_hook"; -import { useHover } from "@mail/utils/hooks"; -import { isEventHandled, markEventHandled } from "@mail/utils/misc"; +import { useStore } from "@mail/core/common/messaging_hook"; +import { CallContextMenu } from "@mail/discuss/call/common/call_context_menu"; +import { CallParticipantVideo } from "@mail/discuss/call/common/call_participant_video"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; +import { useHover } from "@mail/utils/common/hooks"; +import { isEventHandled, markEventHandled } from "@mail/utils/common/misc"; + import { Component, onMounted, onWillUnmount, useRef } from "@odoo/owl"; + import { usePopover } from "@web/core/popover/popover_hook"; import { useService } from "@web/core/utils/hooks"; diff --git a/addons/mail/static/src/discuss/call/call_participant_card.scss b/addons/mail/static/src/discuss/call/common/call_participant_card.scss similarity index 100% rename from addons/mail/static/src/discuss/call/call_participant_card.scss rename to addons/mail/static/src/discuss/call/common/call_participant_card.scss diff --git a/addons/mail/static/src/discuss/call/call_participant_card.xml b/addons/mail/static/src/discuss/call/common/call_participant_card.xml similarity index 100% rename from addons/mail/static/src/discuss/call/call_participant_card.xml rename to addons/mail/static/src/discuss/call/common/call_participant_card.xml diff --git a/addons/mail/static/src/discuss/call/call_participant_video.js b/addons/mail/static/src/discuss/call/common/call_participant_video.js similarity index 94% rename from addons/mail/static/src/discuss/call/call_participant_video.js rename to addons/mail/static/src/discuss/call/common/call_participant_video.js index 153fe33eeba..bde02a38da4 100644 --- a/addons/mail/static/src/discuss/call/call_participant_video.js +++ b/addons/mail/static/src/discuss/call/common/call_participant_video.js @@ -1,6 +1,7 @@ /* @odoo-module */ -import { useRtc } from "@mail/discuss/call/rtc_hook"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; + import { Component, onMounted, onPatched, useExternalListener, useRef } from "@odoo/owl"; export class CallParticipantVideo extends Component { diff --git a/addons/mail/static/src/discuss/call/call_participant_video.xml b/addons/mail/static/src/discuss/call/common/call_participant_video.xml similarity index 100% rename from addons/mail/static/src/discuss/call/call_participant_video.xml rename to addons/mail/static/src/discuss/call/common/call_participant_video.xml diff --git a/addons/mail/static/src/discuss/call/call_settings.js b/addons/mail/static/src/discuss/call/common/call_settings.js similarity index 98% rename from addons/mail/static/src/discuss/call/call_settings.js rename to addons/mail/static/src/discuss/call/common/call_settings.js index 3eababd2109..6819926b4ad 100644 --- a/addons/mail/static/src/discuss/call/call_settings.js +++ b/addons/mail/static/src/discuss/call/common/call_settings.js @@ -1,7 +1,9 @@ /* @odoo-module */ -import { useRtc } from "@mail/discuss/call/rtc_hook"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; + import { Component, onWillStart, useExternalListener, useState } from "@odoo/owl"; + import { browser } from "@web/core/browser/browser"; import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; diff --git a/addons/mail/static/src/discuss/call/call_settings.xml b/addons/mail/static/src/discuss/call/common/call_settings.xml similarity index 100% rename from addons/mail/static/src/discuss/call/call_settings.xml rename to addons/mail/static/src/discuss/call/common/call_settings.xml diff --git a/addons/mail/static/src/discuss/call/common/chat_window_patch.js b/addons/mail/static/src/discuss/call/common/chat_window_patch.js new file mode 100644 index 00000000000..59336bd7c57 --- /dev/null +++ b/addons/mail/static/src/discuss/call/common/chat_window_patch.js @@ -0,0 +1,6 @@ +/* @odoo-module */ + +import { ChatWindow } from "@mail/core/common/chat_window"; +import { Call } from "@mail/discuss/call/common/call"; + +Object.assign(ChatWindow.components, { Call }); diff --git a/addons/mail/static/src/discuss/call/chat_window_patch.xml b/addons/mail/static/src/discuss/call/common/chat_window_patch.xml similarity index 100% rename from addons/mail/static/src/discuss/call/chat_window_patch.xml rename to addons/mail/static/src/discuss/call/common/chat_window_patch.xml diff --git a/addons/mail/static/src/discuss/call/common/discuss_patch.js b/addons/mail/static/src/discuss/call/common/discuss_patch.js new file mode 100644 index 00000000000..5dedbc80c69 --- /dev/null +++ b/addons/mail/static/src/discuss/call/common/discuss_patch.js @@ -0,0 +1,16 @@ +/* @odoo-module */ + +import { Discuss } from "@mail/core/common/discuss"; +import { Call } from "@mail/discuss/call/common/call"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; + +import { patch } from "@web/core/utils/patch"; + +Object.assign(Discuss.components, { Call }); + +patch(Discuss.prototype, "discuss/call/common", { + setup() { + this._super(...arguments); + this.rtc = useRtc(); + }, +}); diff --git a/addons/mail/static/src/discuss/call/discuss_patch.xml b/addons/mail/static/src/discuss/call/common/discuss_patch.xml similarity index 100% rename from addons/mail/static/src/discuss/call/discuss_patch.xml rename to addons/mail/static/src/discuss/call/common/discuss_patch.xml diff --git a/addons/mail/static/src/discuss/call/media_monitoring.js b/addons/mail/static/src/discuss/call/common/media_monitoring.js similarity index 100% rename from addons/mail/static/src/discuss/call/media_monitoring.js rename to addons/mail/static/src/discuss/call/common/media_monitoring.js diff --git a/addons/mail/static/src/discuss/call/rtc_hook.js b/addons/mail/static/src/discuss/call/common/rtc_hook.js similarity index 73% rename from addons/mail/static/src/discuss/call/rtc_hook.js rename to addons/mail/static/src/discuss/call/common/rtc_hook.js index 92e77b9805e..9546bf3b342 100644 --- a/addons/mail/static/src/discuss/call/rtc_hook.js +++ b/addons/mail/static/src/discuss/call/common/rtc_hook.js @@ -1,10 +1,11 @@ /* @odoo-module */ import { useState } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; /** - * @returns {import("@mail/discuss/call/rtc_service").Rtc"} + * @returns {import("@mail/discuss/call/common/rtc_service").Rtc"} */ export function useRtc() { return useState(useService("discuss.rtc")); diff --git a/addons/mail/static/src/discuss/call/rtc_service.js b/addons/mail/static/src/discuss/call/common/rtc_service.js similarity index 98% rename from addons/mail/static/src/discuss/call/rtc_service.js rename to addons/mail/static/src/discuss/call/common/rtc_service.js index b1d379c1cda..43e21214921 100644 --- a/addons/mail/static/src/discuss/call/rtc_service.js +++ b/addons/mail/static/src/discuss/call/common/rtc_service.js @@ -1,11 +1,13 @@ /* @odoo-module */ -import { BlurManager } from "@mail/discuss/call/blur_manager"; -import { monitorAudio } from "@mail/discuss/call/media_monitoring"; -import { RtcSession } from "@mail/discuss/call/rtc_session_model"; -import { removeFromArray } from "@mail/utils/arrays"; -import { closeStream, createLocalId, onChange } from "@mail/utils/misc"; +import { BlurManager } from "@mail/discuss/call/common/blur_manager"; +import { monitorAudio } from "@mail/discuss/call/common/media_monitoring"; +import { RtcSession } from "@mail/discuss/call/common/rtc_session_model"; +import { removeFromArray } from "@mail/utils/common/arrays"; +import { closeStream, createLocalId, onChange } from "@mail/utils/common/misc"; + import { reactive } from "@odoo/owl"; + import { browser } from "@web/core/browser/browser"; import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; @@ -91,19 +93,19 @@ export class Rtc { constructor(env, services) { this.env = env; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ this.store = services["mail.store"]; this.notification = services.notification; this.rpc = services.rpc; - /** @type {import("@mail/core/channel_member_service").ChannelMemberService} */ + /** @type {import("@mail/core/common/channel_member_service").ChannelMemberService} */ this.channelMemberService = services["discuss.channel.member"]; - /** @type {import("@mail/core/sound_effects_service").SoundEffects} */ + /** @type {import("@mail/core/common/sound_effects_service").SoundEffects} */ this.soundEffectsService = services["mail.sound_effects"]; - /** @type {import("@mail/core/user_settings_service").UserSettings} */ + /** @type {import("@mail/core/common/user_settings_service").UserSettings} */ this.userSettingsService = services["mail.user_settings"]; - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ this.threadService = services["mail.thread"]; - /** @type {import("@mail/core/persona_service").PersonaService} */ + /** @type {import("@mail/core/common/persona_service").PersonaService} */ this.personaService = services["mail.persona"]; this.state = reactive({ hasPendingRequest: false, @@ -338,7 +340,7 @@ export class Rtc { } /** - * @param {import("@mail/core/thread_model").Thread} [channel] + * @param {import("@mail/core/common/thread_model").Thread} [channel] */ endCall(channel = this.state.channel) { channel.rtcInvitingSessionId = undefined; @@ -523,7 +525,7 @@ export class Rtc { } /** - * @param {import("@mail/core/thread_model").Thread} channel + * @param {import("@mail/core/common/thread_model").Thread} channel * @param {Object} [param1={}] * @param {boolean} [param1.video] */ @@ -753,7 +755,7 @@ export class Rtc { } /** - * @param {import("@mail/core/thread_model").Thread} + * @param {import("@mail/core/common/thread_model").Thread} */ async joinCall(channel, { video = false } = {}) { if (!IS_CLIENT_RTC_COMPATIBLE) { @@ -1429,7 +1431,7 @@ export class Rtc { } /** - * @param {import("@mail/discuss/call/rtc_session_model").id} id + * @param {import("@mail/discuss/call/common/rtc_session_model").id} id */ deleteSession(id) { const session = this.store.rtcSessions[id]; diff --git a/addons/mail/static/src/discuss/call/rtc_session_model.js b/addons/mail/static/src/discuss/call/common/rtc_session_model.js similarity index 96% rename from addons/mail/static/src/discuss/call/rtc_session_model.js rename to addons/mail/static/src/discuss/call/common/rtc_session_model.js index e3607f9ae61..7bd12d6b142 100644 --- a/addons/mail/static/src/discuss/call/rtc_session_model.js +++ b/addons/mail/static/src/discuss/call/common/rtc_session_model.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import { createLocalId } from "@mail/utils/misc"; +import { createLocalId } from "@mail/utils/common/misc"; export class RtcSession { // Server data @@ -29,7 +29,7 @@ export class RtcSession { videoComponentCount = 0; /** @type {MediaStream} */ videoStream; - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ _store; // RTC stats connectionState; diff --git a/addons/mail/static/src/discuss/call/thread_actions.js b/addons/mail/static/src/discuss/call/common/thread_actions.js similarity index 87% rename from addons/mail/static/src/discuss/call/thread_actions.js rename to addons/mail/static/src/discuss/call/common/thread_actions.js index 25d560cffd3..2156318a93f 100644 --- a/addons/mail/static/src/discuss/call/thread_actions.js +++ b/addons/mail/static/src/discuss/call/common/thread_actions.js @@ -1,9 +1,11 @@ /* @odoo-module */ -import { threadActionsRegistry } from "@mail/core/thread_actions"; -import { CallSettings } from "@mail/discuss/call/call_settings"; -import { useRtc } from "@mail/discuss/call/rtc_hook"; +import { threadActionsRegistry } from "@mail/core/common/thread_actions"; +import { CallSettings } from "@mail/discuss/call/common/call_settings"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; + import { useComponent } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; threadActionsRegistry diff --git a/addons/mail/static/src/discuss/call/discuss_patch.js b/addons/mail/static/src/discuss/call/discuss_patch.js deleted file mode 100644 index c9f6e74fd14..00000000000 --- a/addons/mail/static/src/discuss/call/discuss_patch.js +++ /dev/null @@ -1,15 +0,0 @@ -/* @odoo-module */ - -import { Call } from "@mail/discuss/call/call"; -import { useRtc } from "@mail/discuss/call/rtc_hook"; -import { Discuss } from "@mail/discuss_app/discuss"; -import { patch } from "@web/core/utils/patch"; - -Object.assign(Discuss.components, { Call }); - -patch(Discuss.prototype, "discuss/call", { - setup() { - this._super(...arguments); - this.rtc = useRtc(); - }, -}); diff --git a/addons/mail/static/src/discuss/call/public/discuss_public_patch.js b/addons/mail/static/src/discuss/call/public/discuss_public_patch.js index 6e6e44309d9..7b13751c2ac 100644 --- a/addons/mail/static/src/discuss/call/public/discuss_public_patch.js +++ b/addons/mail/static/src/discuss/call/public/discuss_public_patch.js @@ -1,11 +1,12 @@ /* @odoo-module */ -import { useRtc } from "@mail/discuss/call/rtc_hook"; -import { DiscussPublic } from "@mail/public/discuss_public"; +import { DiscussPublic } from "@mail/core/public/discuss_public"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; + import { browser } from "@web/core/browser/browser"; import { patch } from "@web/core/utils/patch"; -patch(DiscussPublic.prototype, "discuss/call/web", { +patch(DiscussPublic.prototype, "discuss/call/public", { setup() { this._super(...arguments); this.rtc = useRtc(); diff --git a/addons/mail/static/src/discuss/call/web/discuss_sidebar_patch.js b/addons/mail/static/src/discuss/call/web/discuss_sidebar_patch.js index 8dee90d72be..e6646b19564 100644 --- a/addons/mail/static/src/discuss/call/web/discuss_sidebar_patch.js +++ b/addons/mail/static/src/discuss/call/web/discuss_sidebar_patch.js @@ -1,7 +1,8 @@ /* @odoo-module */ -import { useRtc } from "@mail/discuss/call/rtc_hook"; -import { Sidebar } from "@mail/web/discuss_app/sidebar"; +import { Sidebar } from "@mail/core/web/sidebar"; +import { useRtc } from "@mail/discuss/call/common/rtc_hook"; + import { patch } from "@web/core/utils/patch"; patch(Sidebar.prototype, "discuss/call/web", { diff --git a/addons/mail/static/src/discuss/core/attachment_model_patch.js b/addons/mail/static/src/discuss/core/common/attachment_model_patch.js similarity index 77% rename from addons/mail/static/src/discuss/core/attachment_model_patch.js rename to addons/mail/static/src/discuss/core/common/attachment_model_patch.js index 2776535b8ea..e65b40e59c4 100644 --- a/addons/mail/static/src/discuss/core/attachment_model_patch.js +++ b/addons/mail/static/src/discuss/core/common/attachment_model_patch.js @@ -1,9 +1,10 @@ /* @odoo-module */ -import { Attachment } from "@mail/attachments/attachment_model"; +import { Attachment } from "@mail/core/common/attachment_model"; + import { patch } from "@web/core/utils/patch"; -patch(Attachment.prototype, "discuss", { +patch(Attachment.prototype, "discuss/core/common", { get urlRoute() { if (!this.accessToken && this.originThread?.model === "discuss.channel") { return this.isImage diff --git a/addons/mail/static/src/discuss/core/channel_commands.js b/addons/mail/static/src/discuss/core/common/channel_commands.js similarity index 100% rename from addons/mail/static/src/discuss/core/channel_commands.js rename to addons/mail/static/src/discuss/core/common/channel_commands.js index 1f65f1de143..977a4dfbe63 100644 --- a/addons/mail/static/src/discuss/core/channel_commands.js +++ b/addons/mail/static/src/discuss/core/common/channel_commands.js @@ -1,7 +1,7 @@ /* @odoo-module */ -import { registry } from "@web/core/registry"; import { _lt } from "@web/core/l10n/translation"; +import { registry } from "@web/core/registry"; const commandRegistry = registry.category("discuss.channel_commands"); diff --git a/addons/mail/static/src/discuss/core/channel_invitation.js b/addons/mail/static/src/discuss/core/common/channel_invitation.js similarity index 93% rename from addons/mail/static/src/discuss/core/channel_invitation.js rename to addons/mail/static/src/discuss/core/common/channel_invitation.js index 6cfc7a985d9..0545c2efac1 100644 --- a/addons/mail/static/src/discuss/core/channel_invitation.js +++ b/addons/mail/static/src/discuss/core/common/channel_invitation.js @@ -1,8 +1,9 @@ /* @odoo-module */ -import { Component, useRef, useState, onMounted, onWillStart } from "@odoo/owl"; -import { useMessaging, useStore } from "@mail/core/messaging_hook"; -import { ImStatus } from "@mail/discuss_app/im_status"; +import { ImStatus } from "@mail/core/common/im_status"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; + +import { Component, onMounted, onWillStart, useRef, useState } from "@odoo/owl"; import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; @@ -19,7 +20,7 @@ export class ChannelInvitation extends Component { this.notification = useService("notification"); this.threadService = useState(useService("mail.thread")); this.personaService = useService("mail.persona"); - /** @type {import("@mail/composer/suggestion_service").SuggestionService} */ + /** @type {import("@mail/core/common/suggestion_service").SuggestionService} */ this.suggestionService = useService("mail.suggestion"); this.ui = useService("ui"); this.inputRef = useRef("input"); diff --git a/addons/mail/static/src/discuss/core/channel_invitation.scss b/addons/mail/static/src/discuss/core/common/channel_invitation.scss similarity index 100% rename from addons/mail/static/src/discuss/core/channel_invitation.scss rename to addons/mail/static/src/discuss/core/common/channel_invitation.scss diff --git a/addons/mail/static/src/discuss/core/channel_invitation.xml b/addons/mail/static/src/discuss/core/common/channel_invitation.xml similarity index 100% rename from addons/mail/static/src/discuss/core/channel_invitation.xml rename to addons/mail/static/src/discuss/core/common/channel_invitation.xml diff --git a/addons/mail/static/src/discuss/core/channel_member_list.js b/addons/mail/static/src/discuss/core/common/channel_member_list.js similarity index 90% rename from addons/mail/static/src/discuss/core/channel_member_list.js rename to addons/mail/static/src/discuss/core/common/channel_member_list.js index c57aaf8f8a1..e57f4143bae 100644 --- a/addons/mail/static/src/discuss/core/channel_member_list.js +++ b/addons/mail/static/src/discuss/core/common/channel_member_list.js @@ -1,8 +1,10 @@ /* @odoo-module */ -import { useMessaging, useStore } from "@mail/core/messaging_hook"; -import { ImStatus } from "@mail/discuss_app/im_status"; +import { ImStatus } from "@mail/core/common/im_status"; +import { useMessaging, useStore } from "@mail/core/common/messaging_hook"; + import { Component, onWillUpdateProps, onWillStart, useState } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; export class ChannelMemberList extends Component { diff --git a/addons/mail/static/src/discuss/core/channel_member_list.scss b/addons/mail/static/src/discuss/core/common/channel_member_list.scss similarity index 100% rename from addons/mail/static/src/discuss/core/channel_member_list.scss rename to addons/mail/static/src/discuss/core/common/channel_member_list.scss diff --git a/addons/mail/static/src/discuss/core/channel_member_list.xml b/addons/mail/static/src/discuss/core/common/channel_member_list.xml similarity index 100% rename from addons/mail/static/src/discuss/core/channel_member_list.xml rename to addons/mail/static/src/discuss/core/common/channel_member_list.xml diff --git a/addons/mail/static/src/discuss/core/suggestion_service_patch.js b/addons/mail/static/src/discuss/core/common/suggestion_service_patch.js similarity index 93% rename from addons/mail/static/src/discuss/core/suggestion_service_patch.js rename to addons/mail/static/src/discuss/core/common/suggestion_service_patch.js index f48b3a17594..c51123a6b02 100644 --- a/addons/mail/static/src/discuss/core/suggestion_service_patch.js +++ b/addons/mail/static/src/discuss/core/common/suggestion_service_patch.js @@ -1,13 +1,14 @@ /* @odoo-module */ -import { SuggestionService } from "@mail/composer/suggestion_service"; -import { cleanTerm } from "@mail/utils/format"; +import { SuggestionService } from "@mail/core/common/suggestion_service"; +import { cleanTerm } from "@mail/utils/common/format"; + import { registry } from "@web/core/registry"; import { patch } from "@web/core/utils/patch"; const commandRegistry = registry.category("discuss.channel_commands"); -patch(SuggestionService.prototype, "discuss", { +patch(SuggestionService.prototype, "discuss/core/common", { getSupportedDelimiters(thread) { const res = this._super(thread); return thread?.model === "discuss.channel" ? [...res, ["/", 0]] : res; diff --git a/addons/mail/static/src/discuss/core/thread_actions.js b/addons/mail/static/src/discuss/core/common/thread_actions.js similarity index 88% rename from addons/mail/static/src/discuss/core/thread_actions.js rename to addons/mail/static/src/discuss/core/common/thread_actions.js index 399e8bee30b..fd8a5b5a92b 100644 --- a/addons/mail/static/src/discuss/core/thread_actions.js +++ b/addons/mail/static/src/discuss/core/common/thread_actions.js @@ -1,9 +1,11 @@ /* @odoo-module */ -import { threadActionsRegistry } from "@mail/core/thread_actions"; -import { ChannelInvitation } from "@mail/discuss/core/channel_invitation"; -import { ChannelMemberList } from "@mail/discuss/core/channel_member_list"; +import { threadActionsRegistry } from "@mail/core/common/thread_actions"; +import { ChannelInvitation } from "@mail/discuss/core/common/channel_invitation"; +import { ChannelMemberList } from "@mail/discuss/core/common/channel_member_list"; + import { useComponent } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; import { usePopover } from "@web/core/popover/popover_hook"; diff --git a/addons/mail/static/src/discuss/core/thread_service_patch.js b/addons/mail/static/src/discuss/core/common/thread_service_patch.js similarity index 80% rename from addons/mail/static/src/discuss/core/thread_service_patch.js rename to addons/mail/static/src/discuss/core/common/thread_service_patch.js index 6184e3f3bef..aa767df06d5 100644 --- a/addons/mail/static/src/discuss/core/thread_service_patch.js +++ b/addons/mail/static/src/discuss/core/common/thread_service_patch.js @@ -1,15 +1,16 @@ /* @odoo-module */ -import { ThreadService } from "@mail/core/thread_service"; +import { ThreadService } from "@mail/core/common/thread_service"; + import { registry } from "@web/core/registry"; import { patch } from "@web/core/utils/patch"; const commandRegistry = registry.category("discuss.channel_commands"); -patch(ThreadService.prototype, "discuss", { +patch(ThreadService.prototype, "discuss/core/common", { /** * @override - * @param {import("@mail/core/thread_model").Thread} thread + * @param {import("@mail/core/common/thread_model").Thread} thread * @param {string} body */ async post(thread, body) { diff --git a/addons/mail/static/src/discuss/web/thread_actions.js b/addons/mail/static/src/discuss/core/web/thread_actions.js similarity index 91% rename from addons/mail/static/src/discuss/web/thread_actions.js rename to addons/mail/static/src/discuss/core/web/thread_actions.js index 66a62a8e125..c0b8494f90f 100644 --- a/addons/mail/static/src/discuss/web/thread_actions.js +++ b/addons/mail/static/src/discuss/core/web/thread_actions.js @@ -1,6 +1,7 @@ /* @odoo-module */ -import { threadActionsRegistry } from "@mail/core/thread_actions"; +import { threadActionsRegistry } from "@mail/core/common/thread_actions"; + import { _t } from "@web/core/l10n/translation"; threadActionsRegistry.add("expand-discuss", { diff --git a/addons/mail/static/src/discuss/message_pin/message_patch.js b/addons/mail/static/src/discuss/message_pin/common/message_patch.js similarity index 88% rename from addons/mail/static/src/discuss/message_pin/message_patch.js rename to addons/mail/static/src/discuss/message_pin/common/message_patch.js index c33ee3b520c..15fee6c810f 100644 --- a/addons/mail/static/src/discuss/message_pin/message_patch.js +++ b/addons/mail/static/src/discuss/message_pin/common/message_patch.js @@ -1,17 +1,18 @@ /* @odoo-module */ -import { Message } from "@mail/core_ui/message"; -import { MessageConfirmDialog } from "@mail/core_ui/message_confirm_dialog"; -import { useMessagePinService } from "@mail/discuss/message_pin/message_pin_service"; +import { Message } from "@mail/core/common/message"; +import { MessageConfirmDialog } from "@mail/core/common/message_confirm_dialog"; +import { useMessagePinService } from "@mail/discuss/message_pin/common/message_pin_service"; + import { _t } from "@web/core/l10n/translation"; import { patch } from "@web/core/utils/patch"; import { sprintf } from "@web/core/utils/strings"; -patch(Message, "discuss/message_pin", { +patch(Message, "discuss/message_pin/common", { components: { ...Message.components }, }); -patch(Message.prototype, "discuss/message_pin", { +patch(Message.prototype, "discuss/message_pin/common", { setup() { this._super(); this.messagePinService = useMessagePinService(); diff --git a/addons/mail/static/src/discuss/message_pin/message_patch.xml b/addons/mail/static/src/discuss/message_pin/common/message_patch.xml similarity index 100% rename from addons/mail/static/src/discuss/message_pin/message_patch.xml rename to addons/mail/static/src/discuss/message_pin/common/message_patch.xml diff --git a/addons/mail/static/src/discuss/message_pin/message_pin_service.js b/addons/mail/static/src/discuss/message_pin/common/message_pin_service.js similarity index 91% rename from addons/mail/static/src/discuss/message_pin/message_pin_service.js rename to addons/mail/static/src/discuss/message_pin/common/message_pin_service.js index ccfbf7158ca..648a5037e5e 100644 --- a/addons/mail/static/src/discuss/message_pin/message_pin_service.js +++ b/addons/mail/static/src/discuss/message_pin/common/message_pin_service.js @@ -1,6 +1,7 @@ /* @odoo-module */ import { markup, reactive, useState } from "@odoo/owl"; + import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; @@ -8,7 +9,7 @@ export const OTHER_LONG_TYPING = 60000; export class MessagePin { busService; - /** @type {import("@mail/core/message_service").MessageService} */ + /** @type {import("@mail/core/common/message_service").MessageService} */ messageService; /** @type {Map} */ loadStateByChannelId = new Map(); @@ -18,7 +19,7 @@ export class MessagePin { channelIdByMessageId = new Map(); /** @type {Map} */ pinnedAtByMessageId = new Map(); - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ storeService; constructor( @@ -69,7 +70,7 @@ export class MessagePin { } /** - * @param {import("@mail/core/thread_model").Thread} channel + * @param {import("@mail/core/common/thread_model").Thread} channel */ async fetchPinnedMessages(channel) { if ( @@ -107,8 +108,8 @@ export class MessagePin { } /** - * @param {import("@mail/core/thread_model").Thread} channel - * @returns {import("@mail/core/message_model").Message[]} + * @param {import("@mail/core/common/thread_model").Thread} channel + * @returns {import("@mail/core/common/message_model").Message[]} */ getPinnedMessages(channel) { return [...(this.messageIdsByChannelId.get(channel.id) ?? new Set())] @@ -124,7 +125,7 @@ export class MessagePin { } /** - * @param {import("@mail/core/thread_model").Thread} channel + * @param {import("@mail/core/common/thread_model").Thread} channel * @returns {boolean} */ hasPinnedMessages(channel) { @@ -132,7 +133,7 @@ export class MessagePin { } /** - * @param {import("@mail/core/message_model").Message} + * @param {import("@mail/core/common/message_model").Message} * @param {Object} data */ onMessageUpdate(message, { pinned_at: pinnedAt }) { @@ -168,7 +169,7 @@ export class MessagePin { } /** - * @param {import("@mail/core/message_model").Message} + * @param {import("@mail/core/common/message_model").Message} * @param {boolean} pinned */ setPin(message, pinned) { diff --git a/addons/mail/static/src/discuss/message_pin/pinned_messages_panel.js b/addons/mail/static/src/discuss/message_pin/common/pinned_messages_panel.js similarity index 94% rename from addons/mail/static/src/discuss/message_pin/pinned_messages_panel.js rename to addons/mail/static/src/discuss/message_pin/common/pinned_messages_panel.js index 6985f72d198..8e7d122cc02 100644 --- a/addons/mail/static/src/discuss/message_pin/pinned_messages_panel.js +++ b/addons/mail/static/src/discuss/message_pin/common/pinned_messages_panel.js @@ -1,9 +1,11 @@ /* @odoo-module */ -import { Message } from "@mail/core_ui/message"; -import { MessageConfirmDialog } from "@mail/core_ui/message_confirm_dialog"; -import { useMessagePinService } from "@mail/discuss/message_pin/message_pin_service"; +import { Message } from "@mail/core/common/message"; +import { MessageConfirmDialog } from "@mail/core/common/message_confirm_dialog"; +import { useMessagePinService } from "@mail/discuss/message_pin/common/message_pin_service"; + import { Component, onWillStart, onWillUpdateProps, useState, useSubEnv } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; import { useService } from "@web/core/utils/hooks"; diff --git a/addons/mail/static/src/discuss/message_pin/pinned_messages_panel.scss b/addons/mail/static/src/discuss/message_pin/common/pinned_messages_panel.scss similarity index 100% rename from addons/mail/static/src/discuss/message_pin/pinned_messages_panel.scss rename to addons/mail/static/src/discuss/message_pin/common/pinned_messages_panel.scss diff --git a/addons/mail/static/src/discuss/message_pin/pinned_messages_panel.xml b/addons/mail/static/src/discuss/message_pin/common/pinned_messages_panel.xml similarity index 100% rename from addons/mail/static/src/discuss/message_pin/pinned_messages_panel.xml rename to addons/mail/static/src/discuss/message_pin/common/pinned_messages_panel.xml diff --git a/addons/mail/static/src/discuss/message_pin/thread_actions.js b/addons/mail/static/src/discuss/message_pin/common/thread_actions.js similarity index 84% rename from addons/mail/static/src/discuss/message_pin/thread_actions.js rename to addons/mail/static/src/discuss/message_pin/common/thread_actions.js index b569c794bfd..473593890de 100644 --- a/addons/mail/static/src/discuss/message_pin/thread_actions.js +++ b/addons/mail/static/src/discuss/message_pin/common/thread_actions.js @@ -1,8 +1,10 @@ /* @odoo-module */ -import { threadActionsRegistry } from "@mail/core/thread_actions"; -import { PinnedMessagesPanel } from "@mail/discuss/message_pin/pinned_messages_panel"; +import { threadActionsRegistry } from "@mail/core/common/thread_actions"; +import { PinnedMessagesPanel } from "@mail/discuss/message_pin/common/pinned_messages_panel"; + import { useChildSubEnv } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; threadActionsRegistry.add("pinned-messages", { diff --git a/addons/mail/static/src/discuss/message_pin/thread_patch.js b/addons/mail/static/src/discuss/message_pin/common/thread_patch.js similarity index 74% rename from addons/mail/static/src/discuss/message_pin/thread_patch.js rename to addons/mail/static/src/discuss/message_pin/common/thread_patch.js index f3ef9b06a59..182b28f76e5 100644 --- a/addons/mail/static/src/discuss/message_pin/thread_patch.js +++ b/addons/mail/static/src/discuss/message_pin/common/thread_patch.js @@ -1,9 +1,10 @@ /* @odoo-module */ -import { Thread } from "@mail/core_ui/thread"; +import { Thread } from "@mail/core/common/thread"; + import { patch } from "@web/core/utils/patch"; -patch(Thread.prototype, "discuss/message_pin", { +patch(Thread.prototype, "discuss/message_pin/common", { /** * @override * @param {MouseEvent} ev diff --git a/addons/mail/static/src/discuss/typing/composer_patch.js b/addons/mail/static/src/discuss/typing/common/composer_patch.js similarity index 91% rename from addons/mail/static/src/discuss/typing/composer_patch.js rename to addons/mail/static/src/discuss/typing/common/composer_patch.js index b9023320dc5..9dbbc2fdd5c 100644 --- a/addons/mail/static/src/discuss/typing/composer_patch.js +++ b/addons/mail/static/src/discuss/typing/common/composer_patch.js @@ -1,10 +1,11 @@ /* @odoo-module */ -import { Composer } from "@mail/composer/composer"; -import { Typing } from "@mail/discuss/typing/typing"; +import { Composer } from "@mail/core/common/composer"; +import { Typing } from "@mail/discuss/typing/common/typing"; + import { browser } from "@web/core/browser/browser"; -import { patch } from "@web/core/utils/patch"; import { registry } from "@web/core/registry"; +import { patch } from "@web/core/utils/patch"; import { useDebounced } from "@web/core/utils/timing"; const commandRegistry = registry.category("discuss.channel_commands"); @@ -12,11 +13,11 @@ const commandRegistry = registry.category("discuss.channel_commands"); export const SHORT_TYPING = 5000; export const LONG_TYPING = 50000; -patch(Composer, "discuss/typing", { +patch(Composer, "discuss/typing/common", { components: { ...Composer.components, Typing }, }); -patch(Composer.prototype, "discuss/typing", { +patch(Composer.prototype, "discuss/typing/common", { /** * @override */ diff --git a/addons/mail/static/src/discuss/typing/composer_patch.xml b/addons/mail/static/src/discuss/typing/common/composer_patch.xml similarity index 100% rename from addons/mail/static/src/discuss/typing/composer_patch.xml rename to addons/mail/static/src/discuss/typing/common/composer_patch.xml diff --git a/addons/mail/static/src/discuss/typing/primary_variables.scss b/addons/mail/static/src/discuss/typing/common/primary_variables.scss similarity index 100% rename from addons/mail/static/src/discuss/typing/primary_variables.scss rename to addons/mail/static/src/discuss/typing/common/primary_variables.scss diff --git a/addons/mail/static/src/discuss/typing/common/thread_icon_patch.js b/addons/mail/static/src/discuss/typing/common/thread_icon_patch.js new file mode 100644 index 00000000000..39d13a00e80 --- /dev/null +++ b/addons/mail/static/src/discuss/typing/common/thread_icon_patch.js @@ -0,0 +1,21 @@ +/* @odoo-module */ + +import { ThreadIcon } from "@mail/core/common/thread_icon"; +import { Typing } from "@mail/discuss/typing/common/typing"; +import { useTypingService } from "@mail/discuss/typing/common/typing_service"; + +import { patch } from "@web/core/utils/patch"; + +patch(ThreadIcon, "discuss/typing/common", { + components: { ...ThreadIcon.components, Typing }, +}); + +patch(ThreadIcon.prototype, "discuss/typing/common", { + /** + * @override + */ + setup() { + this._super(); + this.typingService = useTypingService(); + }, +}); diff --git a/addons/mail/static/src/discuss/typing/thread_icon_patch.xml b/addons/mail/static/src/discuss/typing/common/thread_icon_patch.xml similarity index 100% rename from addons/mail/static/src/discuss/typing/thread_icon_patch.xml rename to addons/mail/static/src/discuss/typing/common/thread_icon_patch.xml diff --git a/addons/mail/static/src/discuss/typing/typing.js b/addons/mail/static/src/discuss/typing/common/typing.js similarity index 86% rename from addons/mail/static/src/discuss/typing/typing.js rename to addons/mail/static/src/discuss/typing/common/typing.js index 234f2138456..e7e8f5cce9f 100644 --- a/addons/mail/static/src/discuss/typing/typing.js +++ b/addons/mail/static/src/discuss/typing/common/typing.js @@ -1,14 +1,16 @@ /* @odoo-module */ -import { useMessaging } from "@mail/core/messaging_hook"; -import { useTypingService } from "@mail/discuss/typing/typing_service"; +import { useMessaging } from "@mail/core/common/messaging_hook"; +import { useTypingService } from "@mail/discuss/typing/common/typing_service"; + import { Component } from "@odoo/owl"; + import { _t } from "@web/core/l10n/translation"; import { sprintf } from "@web/core/utils/strings"; /** * @typedef {Object} Props - * @property {import("@mail/core/thread_model").Thread} channel + * @property {import("@mail/core/common/thread_model").Thread} channel * @property {string} size * @property {boolean} displayText * @extends {Component} diff --git a/addons/mail/static/src/discuss/typing/typing.scss b/addons/mail/static/src/discuss/typing/common/typing.scss similarity index 100% rename from addons/mail/static/src/discuss/typing/typing.scss rename to addons/mail/static/src/discuss/typing/common/typing.scss diff --git a/addons/mail/static/src/discuss/typing/typing.xml b/addons/mail/static/src/discuss/typing/common/typing.xml similarity index 100% rename from addons/mail/static/src/discuss/typing/typing.xml rename to addons/mail/static/src/discuss/typing/common/typing.xml diff --git a/addons/mail/static/src/discuss/typing/typing_service.js b/addons/mail/static/src/discuss/typing/common/typing_service.js similarity index 84% rename from addons/mail/static/src/discuss/typing/typing_service.js rename to addons/mail/static/src/discuss/typing/common/typing_service.js index 05dee10b83a..6e7d2ca0466 100644 --- a/addons/mail/static/src/discuss/typing/typing_service.js +++ b/addons/mail/static/src/discuss/typing/common/typing_service.js @@ -1,6 +1,7 @@ /* @odoo-module */ import { reactive, useState } from "@odoo/owl"; + import { browser } from "@web/core/browser/browser"; import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; @@ -9,13 +10,13 @@ export const OTHER_LONG_TYPING = 60000; export class Typing { busService; - /** @type {import("@mail/core/channel_member_service").ChannelMemberService} */ + /** @type {import("@mail/core/common/channel_member_service").ChannelMemberService} */ channelMemberService; /** @type {Map>} */ memberIdsByChannelId = new Map(); /** @type {Map} */ timerByMemberId = new Map(); - /** @type {import("@mail/core/store_service").Store} */ + /** @type {import("@mail/core/common/store_service").Store} */ storeService; constructor({ @@ -39,7 +40,7 @@ export class Typing { } /** - * @param {import("@mail/core/channel_member_model").ChannelMember} member + * @param {import("@mail/core/common/channel_member_model").ChannelMember} member */ addTypingMember(member) { if (!this.memberIdsByChannelId.has(member.thread.id)) { @@ -55,8 +56,8 @@ export class Typing { } /** - * @param {import("@mail/core/thread_model").Thread} channel - * @returns {import("@mail/core/channel_member_model").ChannelMember[]} + * @param {import("@mail/core/common/thread_model").Thread} channel + * @returns {import("@mail/core/common/channel_member_model").ChannelMember[]} */ getTypingMembers(channel) { return [...(this.memberIdsByChannelId.get(channel.id) ?? new Set())] @@ -65,7 +66,7 @@ export class Typing { } /** - * @param {import("@mail/core/thread_model").Thread} channel + * @param {import("@mail/core/common/thread_model").Thread} channel * @returns {boolean} */ hasTypingMembers(channel) { @@ -73,7 +74,7 @@ export class Typing { } /** - * @param {import("@mail/core/channel_member_model").ChannelMember} member + * @param {import("@mail/core/common/channel_member_model").ChannelMember} member */ removeTypingMember(member) { const memberIds = this.memberIdsByChannelId.get(member.thread.id); diff --git a/addons/mail/static/src/discuss/typing/thread_icon_patch.js b/addons/mail/static/src/discuss/typing/thread_icon_patch.js deleted file mode 100644 index 84323ddbae1..00000000000 --- a/addons/mail/static/src/discuss/typing/thread_icon_patch.js +++ /dev/null @@ -1,20 +0,0 @@ -/* @odoo-module */ - -import { ThreadIcon } from "@mail/discuss_app/thread_icon"; -import { Typing } from "@mail/discuss/typing/typing"; -import { useTypingService } from "@mail/discuss/typing/typing_service"; -import { patch } from "@web/core/utils/patch"; - -patch(ThreadIcon, "discuss/typing", { - components: { ...ThreadIcon.components, Typing }, -}); - -patch(ThreadIcon.prototype, "discuss/typing", { - /** - * @override - */ - setup() { - this._super(); - this.typingService = useTypingService(); - }, -}); diff --git a/addons/mail/static/src/js/emojis_mixin.js b/addons/mail/static/src/js/emojis_mixin.js index 99dea495a6a..4edea5f5670 100644 --- a/addons/mail/static/src/js/emojis_mixin.js +++ b/addons/mail/static/src/js/emojis_mixin.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { escape } from "@web/core/utils/strings"; @@ -27,7 +27,10 @@ export default { */ _formatText(message) { message = escape(message); - message = message.replaceAll(/(\p{Emoji_Presentation}+)/ug, "$1"); + message = message.replaceAll( + /(\p{Emoji_Presentation}+)/gu, + "$1" + ); message = message.replace(/(?:\r\n|\r|\n)/g, "
"); return message; diff --git a/addons/mail/static/src/js/onchange_on_keydown.js b/addons/mail/static/src/js/onchange_on_keydown.js index a0ab1953e82..ff904245dee 100644 --- a/addons/mail/static/src/js/onchange_on_keydown.js +++ b/addons/mail/static/src/js/onchange_on_keydown.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { patch } from "@web/core/utils/patch"; import { debounce } from "@web/core/utils/timing"; diff --git a/addons/mail/static/src/js/tools/debug_manager.js b/addons/mail/static/src/js/tools/debug_manager.js index 05244e5d2fc..4cc2dc22959 100644 --- a/addons/mail/static/src/js/tools/debug_manager.js +++ b/addons/mail/static/src/js/tools/debug_manager.js @@ -1,4 +1,4 @@ -/** @odoo-module **/ +/* @odoo-module */ import { registry } from "@web/core/registry"; diff --git a/addons/mail/static/src/js/tours/mail.js b/addons/mail/static/src/js/tours/mail.js index c071502e5fa..5e8c521c1bc 100644 --- a/addons/mail/static/src/js/tours/mail.js +++ b/addons/mail/static/src/js/tours/mail.js @@ -1,8 +1,8 @@ -/** @odoo-module **/ +/* @odoo-module */ -import { _t } from "web.core"; -import { Markup } from "web.utils"; +import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; +import { Markup } from "web.utils"; registry.category("web_tour.tours").add("mail_tour", { url: "/web#action=mail.action_discuss", diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js index ed80dbf347b..aa97e65368c 100644 --- a/addons/mail/static/src/js/utils.js +++ b/addons/mail/static/src/js/utils.js @@ -1,10 +1,8 @@ -/** @odoo-module **/ +/* @odoo-module */ -import core from "web.core"; +import { _t } from "@web/core/l10n/translation"; import { escape } from "@web/core/utils/strings"; -var _t = core._t; - /** * WARNING: this is not enough to unescape potential XSS contained in htmlString, transformFunction * should handle it or it should be handled after/before calling parseAndTransform. So if the result diff --git a/addons/mail/static/src/utils/arrays.js b/addons/mail/static/src/utils/common/arrays.js similarity index 100% rename from addons/mail/static/src/utils/arrays.js rename to addons/mail/static/src/utils/common/arrays.js diff --git a/addons/mail/static/src/utils/dates.js b/addons/mail/static/src/utils/common/dates.js similarity index 100% rename from addons/mail/static/src/utils/dates.js rename to addons/mail/static/src/utils/common/dates.js diff --git a/addons/mail/static/src/utils/format.js b/addons/mail/static/src/utils/common/format.js similarity index 99% rename from addons/mail/static/src/utils/format.js rename to addons/mail/static/src/utils/common/format.js index 157a9223451..c1950247d9c 100644 --- a/addons/mail/static/src/utils/format.js +++ b/addons/mail/static/src/utils/common/format.js @@ -1,8 +1,9 @@ /* @odoo-module */ +import { loadEmoji } from "@mail/core/common/emoji_picker"; + import { escape, unaccent } from "@web/core/utils/strings"; import { url } from "@web/core/utils/urls"; -import { loadEmoji } from "@mail/emoji_picker/emoji_picker"; const urlRegexp = /\b(?:https?:\/\/\d{1,3}(?:\.\d{1,3}){3}|(?:https?:\/\/|(?:www\.))[-a-z0-9@:%_+~#=\u00C0-\u024F\u1E00-\u1EFF]{2,256}\.[a-z]{2,13})\b(?:[-a-z0-9@:%_+~#?&[\]^|{}`\\'$//=\u00C0-\u024F\u1E00-\u1EFF]|,(?!$| )|\.(?!$| |\.)|;(?!$| ))*/gi; diff --git a/addons/mail/static/src/utils/hooks.js b/addons/mail/static/src/utils/common/hooks.js similarity index 93% rename from addons/mail/static/src/utils/hooks.js rename to addons/mail/static/src/utils/common/hooks.js index b3ef2cfd6d8..41adc7d66e3 100644 --- a/addons/mail/static/src/utils/hooks.js +++ b/addons/mail/static/src/utils/common/hooks.js @@ -9,6 +9,7 @@ import { useRef, useState, } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; function useExternalListener(target, eventName, handler, eventParams) { @@ -347,8 +348,8 @@ export function useMessageEdition() { * @property {function} cancel * @property {function} isNotSelected * @property {function} isSelected - * @property {import("@mail/core/message_model").Message|null} message - * @property {import("@mail/core/thread_model").Thread|null} thread + * @property {import("@mail/core/common/message_model").Message|null} message + * @property {import("@mail/core/common/thread_model").Thread|null} thread * @property {function} toggle * @returns {MessageToReplyTo} */ @@ -358,28 +359,28 @@ export function useMessageToReplyTo() { Object.assign(this, { message: null, thread: null }); }, /** - * @param {import("@mail/core/thread_model").Thread} thread - * @param {import("@mail/core/message_model").Message} message + * @param {import("@mail/core/common/thread_model").Thread} thread + * @param {import("@mail/core/common/message_model").Message} message * @returns {boolean} */ isNotSelected(thread, message) { return this.thread === thread && this.message !== message; }, /** - * @param {import("@mail/core/thread_model").Thread} thread - * @param {import("@mail/core/message_model").Message} message + * @param {import("@mail/core/common/thread_model").Thread} thread + * @param {import("@mail/core/common/message_model").Message} message * @returns {boolean} */ isSelected(thread, message) { return this.thread === thread && this.message === message; }, - /** @type {import("@mail/core/message_model").Message|null} */ + /** @type {import("@mail/core/common/message_model").Message|null} */ message: null, - /** @type {import("@mail/core/thread_model").Thread|null} */ + /** @type {import("@mail/core/common/thread_model").Thread|null} */ thread: null, /** - * @param {import("@mail/core/thread_model").Thread} thread - * @param {import("@mail/core/message_model").Message} message + * @param {import("@mail/core/common/thread_model").Thread} thread + * @param {import("@mail/core/common/message_model").Message} message */ toggle(thread, message) { if (this.message === message) { diff --git a/addons/mail/static/src/utils/misc.js b/addons/mail/static/src/utils/common/misc.js similarity index 100% rename from addons/mail/static/src/utils/misc.js rename to addons/mail/static/src/utils/common/misc.js diff --git a/addons/mail/static/src/views/activity/activity_arch_parser.js b/addons/mail/static/src/views/web/activity/activity_arch_parser.js similarity index 99% rename from addons/mail/static/src/views/activity/activity_arch_parser.js rename to addons/mail/static/src/views/web/activity/activity_arch_parser.js index d304d3417cb..830de3bce7f 100644 --- a/addons/mail/static/src/views/activity/activity_arch_parser.js +++ b/addons/mail/static/src/views/web/activity/activity_arch_parser.js @@ -1,8 +1,8 @@ -/** @odoo-module */ +/* @odoo-module */ -import { addFieldDependencies } from "@web/views/utils"; -import { Field } from "@web/views/fields/field"; import { XMLParser } from "@web/core/utils/xml"; +import { Field } from "@web/views/fields/field"; +import { addFieldDependencies } from "@web/views/utils"; export class ActivityArchParser extends XMLParser { parse(arch, models, modelName) { diff --git a/addons/mail/static/src/views/activity/activity_compiler.js b/addons/mail/static/src/views/web/activity/activity_compiler.js similarity index 99% rename from addons/mail/static/src/views/activity/activity_compiler.js rename to addons/mail/static/src/views/web/activity/activity_compiler.js index be4b7a9c35f..5284e6af098 100644 --- a/addons/mail/static/src/views/activity/activity_compiler.js +++ b/addons/mail/static/src/views/web/activity/activity_compiler.js @@ -1,8 +1,8 @@ -/** @odoo-module **/ +/* @odoo-module */ import { createElement, extractAttributes } from "@web/core/utils/xml"; -import { toStringExpression } from "@web/views/utils"; import { toInterpolatedStringExpression, ViewCompiler } from "@web/views/view_compiler"; +import { toStringExpression } from "@web/views/utils"; export class ActivityCompiler extends ViewCompiler { /** diff --git a/addons/mail/static/src/views/activity/activity_controller.js b/addons/mail/static/src/views/web/activity/activity_controller.js similarity index 98% rename from addons/mail/static/src/views/activity/activity_controller.js rename to addons/mail/static/src/views/web/activity/activity_controller.js index e2ed7e3fa16..5f835196493 100644 --- a/addons/mail/static/src/views/activity/activity_controller.js +++ b/addons/mail/static/src/views/web/activity/activity_controller.js @@ -1,17 +1,17 @@ -/** @odoo-module */ +/* @odoo-module */ -import { useMessaging } from "@mail/core/messaging_hook"; +import { useMessaging } from "@mail/core/common/messaging_hook"; import { Component, useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { sprintf } from "@web/core/utils/strings"; +import { CogMenu } from "@web/search/cog_menu/cog_menu"; import { Layout } from "@web/search/layout"; +import { SearchBar } from "@web/search/search_bar/search_bar"; +import { useModel } from "@web/views/model"; import { standardViewProps } from "@web/views/standard_view_props"; import { SelectCreateDialog } from "@web/views/view_dialogs/select_create_dialog"; -import { sprintf } from "@web/core/utils/strings"; -import { useModel } from "@web/views/model"; -import { useService } from "@web/core/utils/hooks"; -import { SearchBar } from "@web/search/search_bar/search_bar"; -import { CogMenu } from "@web/search/cog_menu/cog_menu"; export class ActivityController extends Component { static components = { Layout, SearchBar, CogMenu }; diff --git a/addons/mail/static/src/views/activity/activity_controller.scss b/addons/mail/static/src/views/web/activity/activity_controller.scss similarity index 100% rename from addons/mail/static/src/views/activity/activity_controller.scss rename to addons/mail/static/src/views/web/activity/activity_controller.scss diff --git a/addons/mail/static/src/views/activity/activity_controller.xml b/addons/mail/static/src/views/web/activity/activity_controller.xml similarity index 100% rename from addons/mail/static/src/views/activity/activity_controller.xml rename to addons/mail/static/src/views/web/activity/activity_controller.xml diff --git a/addons/mail/static/src/views/activity/activity_model.js b/addons/mail/static/src/views/web/activity/activity_model.js similarity index 97% rename from addons/mail/static/src/views/activity/activity_model.js rename to addons/mail/static/src/views/web/activity/activity_model.js index dcae18f6ea8..be162054875 100644 --- a/addons/mail/static/src/views/activity/activity_model.js +++ b/addons/mail/static/src/views/web/activity/activity_model.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { DynamicRecordList, RelationalModel } from "@web/views/relational_model"; diff --git a/addons/mail/static/src/views/activity/activity_record.js b/addons/mail/static/src/views/web/activity/activity_record.js similarity index 93% rename from addons/mail/static/src/views/activity/activity_record.js rename to addons/mail/static/src/views/web/activity/activity_record.js index c45aa7b9bec..80b9d8135ce 100644 --- a/addons/mail/static/src/views/activity/activity_record.js +++ b/addons/mail/static/src/views/web/activity/activity_record.js @@ -1,7 +1,9 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { ActivityCompiler } from "@mail/views/web/activity/activity_compiler"; -import { ActivityCompiler } from "./activity_compiler"; import { Component } from "@odoo/owl"; + import { useService } from "@web/core/utils/hooks"; import { Field } from "@web/views/fields/field"; import { diff --git a/addons/mail/static/src/views/activity/activity_record.xml b/addons/mail/static/src/views/web/activity/activity_record.xml similarity index 100% rename from addons/mail/static/src/views/activity/activity_record.xml rename to addons/mail/static/src/views/web/activity/activity_record.xml diff --git a/addons/mail/static/src/views/activity/activity_renderer.js b/addons/mail/static/src/views/web/activity/activity_renderer.js similarity index 97% rename from addons/mail/static/src/views/activity/activity_renderer.js rename to addons/mail/static/src/views/web/activity/activity_renderer.js index b2a2c7510ee..020c436603a 100644 --- a/addons/mail/static/src/views/activity/activity_renderer.js +++ b/addons/mail/static/src/views/web/activity/activity_renderer.js @@ -1,13 +1,15 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { ActivityCell } from "@mail/core/web/activity_cell"; +import { ActivityRecord } from "@mail/views/web/activity/activity_record"; -import { ActivityCell } from "@mail/web/activity/activity_cell"; import { Component, useState } from "@odoo/owl"; + import { browser } from "@web/core/browser/browser"; import { CheckBox } from "@web/core/checkbox/checkbox"; -import { ColumnProgress } from "@web/views/view_components/column_progress"; import { Dropdown } from "@web/core/dropdown/dropdown"; import { DropdownItem } from "@web/core/dropdown/dropdown_item"; -import { ActivityRecord } from "./activity_record"; +import { ColumnProgress } from "@web/views/view_components/column_progress"; export class ActivityRenderer extends Component { static components = { diff --git a/addons/mail/static/src/views/activity/activity_renderer.xml b/addons/mail/static/src/views/web/activity/activity_renderer.xml similarity index 100% rename from addons/mail/static/src/views/activity/activity_renderer.xml rename to addons/mail/static/src/views/web/activity/activity_renderer.xml diff --git a/addons/mail/static/src/views/activity/activity_view.js b/addons/mail/static/src/views/web/activity/activity_view.js similarity index 69% rename from addons/mail/static/src/views/activity/activity_view.js rename to addons/mail/static/src/views/web/activity/activity_view.js index e66ad5cd1e8..90c765686b6 100644 --- a/addons/mail/static/src/views/activity/activity_view.js +++ b/addons/mail/static/src/views/web/activity/activity_view.js @@ -1,10 +1,11 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { ActivityArchParser } from "@mail/views/web/activity/activity_arch_parser"; +import { ActivityController } from "@mail/views/web/activity/activity_controller"; +import { ActivityModel } from "@mail/views/web/activity/activity_model"; +import { ActivityRenderer } from "@mail/views/web/activity/activity_renderer"; import { registry } from "@web/core/registry"; -import { ActivityController } from "./activity_controller"; -import { ActivityRenderer } from "./activity_renderer"; -import { ActivityModel } from "./activity_model"; -import { ActivityArchParser } from "./activity_arch_parser"; export const activityView = { type: "activity", diff --git a/addons/mail/static/src/web/fields/activity_exception/activity_exception.js b/addons/mail/static/src/views/web/fields/activity_exception/activity_exception.js similarity index 100% rename from addons/mail/static/src/web/fields/activity_exception/activity_exception.js rename to addons/mail/static/src/views/web/fields/activity_exception/activity_exception.js index 6b2bef0896a..56e931e5a55 100644 --- a/addons/mail/static/src/web/fields/activity_exception/activity_exception.js +++ b/addons/mail/static/src/views/web/fields/activity_exception/activity_exception.js @@ -1,10 +1,10 @@ /* @odoo-module */ +import { Component } from "@odoo/owl"; + import { registry } from "@web/core/registry"; import { standardFieldProps } from "@web/views/fields/standard_field_props"; -import { Component } from "@odoo/owl"; - class ActivityException extends Component { static props = standardFieldProps; static template = "mail.ActivityException"; diff --git a/addons/mail/static/src/web/fields/activity_exception/activity_exception.xml b/addons/mail/static/src/views/web/fields/activity_exception/activity_exception.xml similarity index 100% rename from addons/mail/static/src/web/fields/activity_exception/activity_exception.xml rename to addons/mail/static/src/views/web/fields/activity_exception/activity_exception.xml diff --git a/addons/mail/static/src/web/fields/assign_user_command_hook.js b/addons/mail/static/src/views/web/fields/assign_user_command_hook.js similarity index 100% rename from addons/mail/static/src/web/fields/assign_user_command_hook.js rename to addons/mail/static/src/views/web/fields/assign_user_command_hook.js index eddc5213607..26e12ca2938 100644 --- a/addons/mail/static/src/web/fields/assign_user_command_hook.js +++ b/addons/mail/static/src/views/web/fields/assign_user_command_hook.js @@ -1,11 +1,11 @@ /* @odoo-module */ +import { useComponent } from "@odoo/owl"; + import { useCommand } from "@web/core/commands/command_hook"; -import { useService } from "@web/core/utils/hooks"; import { Domain } from "@web/core/domain"; import { _t } from "@web/core/l10n/translation"; - -import { useComponent } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; /** * Use this hook to add "Assign to.." and "Assign/Unassign me" to the command palette. diff --git a/addons/mail/static/src/web/fields/avatar/avatar.js b/addons/mail/static/src/views/web/fields/avatar/avatar.js similarity index 79% rename from addons/mail/static/src/web/fields/avatar/avatar.js rename to addons/mail/static/src/views/web/fields/avatar/avatar.js index ca0e36c3d76..fc38e808918 100644 --- a/addons/mail/static/src/web/fields/avatar/avatar.js +++ b/addons/mail/static/src/views/web/fields/avatar/avatar.js @@ -1,7 +1,8 @@ -/** @odoo-module **/ +/* @odoo-module */ + +import { useOpenChat } from "@mail/core/web/open_chat_hook"; import { Component } from "@odoo/owl"; -import { useOpenChat } from "@mail/web/open_chat_hook"; export class Avatar extends Component { setup() { diff --git a/addons/mail/static/src/web/fields/avatar/avatar.scss b/addons/mail/static/src/views/web/fields/avatar/avatar.scss similarity index 100% rename from addons/mail/static/src/web/fields/avatar/avatar.scss rename to addons/mail/static/src/views/web/fields/avatar/avatar.scss diff --git a/addons/mail/static/src/web/fields/avatar/avatar.xml b/addons/mail/static/src/views/web/fields/avatar/avatar.xml similarity index 100% rename from addons/mail/static/src/web/fields/avatar/avatar.xml rename to addons/mail/static/src/views/web/fields/avatar/avatar.xml diff --git a/addons/mail/static/src/views/fields/emojis_char_field/emojis_char_field.js b/addons/mail/static/src/views/web/fields/emojis_char_field/emojis_char_field.js similarity index 89% rename from addons/mail/static/src/views/fields/emojis_char_field/emojis_char_field.js rename to addons/mail/static/src/views/web/fields/emojis_char_field/emojis_char_field.js index c22b7dd7092..a94558cbea0 100644 --- a/addons/mail/static/src/views/fields/emojis_char_field/emojis_char_field.js +++ b/addons/mail/static/src/views/web/fields/emojis_char_field/emojis_char_field.js @@ -1,13 +1,14 @@ -/** @odoo-module **/ +/* @odoo-module */ -import { CharField, charField } from "@web/views/fields/char/char_field"; -import { patch } from "@web/core/utils/patch"; import MailEmojisMixin from "@mail/js/emojis_mixin"; -import { EmojisFieldCommon } from "@mail/views/fields/emojis_field_common/emojis_field_common"; -import { registry } from "@web/core/registry"; +import { EmojisFieldCommon } from "@mail/views/web/fields/emojis_field_common/emojis_field_common"; import { useRef } from "@odoo/owl"; +import { registry } from "@web/core/registry"; +import { patch } from "@web/core/utils/patch"; +import { CharField, charField } from "@web/views/fields/char/char_field"; + /** * Extension of the FieldChar that will add emojis support */ diff --git a/addons/mail/static/src/views/fields/emojis_char_field/emojis_char_field.xml b/addons/mail/static/src/views/web/fields/emojis_char_field/emojis_char_field.xml similarity index 100% rename from addons/mail/static/src/views/fields/emojis_char_field/emojis_char_field.xml rename to addons/mail/static/src/views/web/fields/emojis_char_field/emojis_char_field.xml diff --git a/addons/mail/static/src/views/fields/emojis_field_common/emojis_field_common.js b/addons/mail/static/src/views/web/fields/emojis_field_common/emojis_field_common.js similarity index 95% rename from addons/mail/static/src/views/fields/emojis_field_common/emojis_field_common.js rename to addons/mail/static/src/views/web/fields/emojis_field_common/emojis_field_common.js index 0819af8e6de..5bf9d8ada8f 100644 --- a/addons/mail/static/src/views/fields/emojis_field_common/emojis_field_common.js +++ b/addons/mail/static/src/views/web/fields/emojis_field_common/emojis_field_common.js @@ -1,6 +1,7 @@ -/** @odoo-module **/ +/* @odoo-module */ + +import { useEmojiPicker } from "@mail/core/common/emoji_picker"; -import { useEmojiPicker } from "@mail/emoji_picker/emoji_picker"; import { useRef } from "@odoo/owl"; /* diff --git a/addons/mail/static/src/views/fields/emojis_field_common/emojis_field_common.xml b/addons/mail/static/src/views/web/fields/emojis_field_common/emojis_field_common.xml similarity index 100% rename from addons/mail/static/src/views/fields/emojis_field_common/emojis_field_common.xml rename to addons/mail/static/src/views/web/fields/emojis_field_common/emojis_field_common.xml diff --git a/addons/mail/static/src/views/fields/emojis_text_field/emojis_text_field.js b/addons/mail/static/src/views/web/fields/emojis_text_field/emojis_text_field.js similarity index 89% rename from addons/mail/static/src/views/fields/emojis_text_field/emojis_text_field.js rename to addons/mail/static/src/views/web/fields/emojis_text_field/emojis_text_field.js index ab33e106c75..dbb809b476e 100644 --- a/addons/mail/static/src/views/fields/emojis_text_field/emojis_text_field.js +++ b/addons/mail/static/src/views/web/fields/emojis_text_field/emojis_text_field.js @@ -1,10 +1,11 @@ -/** @odoo-module **/ +/* @odoo-module */ -import { TextField, textField } from "@web/views/fields/text/text_field"; -import { patch } from "@web/core/utils/patch"; import MailEmojisMixin from "@mail/js/emojis_mixin"; -import { EmojisFieldCommon } from "@mail/views/fields/emojis_field_common/emojis_field_common"; +import { EmojisFieldCommon } from "@mail/views/web/fields/emojis_field_common/emojis_field_common"; + import { registry } from "@web/core/registry"; +import { patch } from "@web/core/utils/patch"; +import { TextField, textField } from "@web/views/fields/text/text_field"; /** * Extension of the FieldText that will add emojis support diff --git a/addons/mail/static/src/views/fields/emojis_text_field/emojis_text_field.xml b/addons/mail/static/src/views/web/fields/emojis_text_field/emojis_text_field.xml similarity index 100% rename from addons/mail/static/src/views/fields/emojis_text_field/emojis_text_field.xml rename to addons/mail/static/src/views/web/fields/emojis_text_field/emojis_text_field.xml diff --git a/addons/mail/static/src/web/fields/kanban_activity/kanban_activity.js b/addons/mail/static/src/views/web/fields/kanban_activity/kanban_activity.js similarity index 93% rename from addons/mail/static/src/web/fields/kanban_activity/kanban_activity.js rename to addons/mail/static/src/views/web/fields/kanban_activity/kanban_activity.js index de1a5f7e769..243b0fd9fe8 100644 --- a/addons/mail/static/src/web/fields/kanban_activity/kanban_activity.js +++ b/addons/mail/static/src/views/web/fields/kanban_activity/kanban_activity.js @@ -1,12 +1,12 @@ /* @odoo-module */ -import { ActivityButton } from "@mail/web/activity/activity_button"; +import { ActivityButton } from "@mail/core/web/activity_button"; + +import { Component } from "@odoo/owl"; import { registry } from "@web/core/registry"; import { standardFieldProps } from "@web/views/fields/standard_field_props"; -import { Component } from "@odoo/owl"; - export class KanbanActivity extends Component { static components = { ActivityButton }; // used in children, in particular in ActivityButton diff --git a/addons/mail/static/src/web/fields/kanban_activity/kanban_activity.xml b/addons/mail/static/src/views/web/fields/kanban_activity/kanban_activity.xml similarity index 100% rename from addons/mail/static/src/web/fields/kanban_activity/kanban_activity.xml rename to addons/mail/static/src/views/web/fields/kanban_activity/kanban_activity.xml diff --git a/addons/mail/static/src/web/fields/list_activity/list_activity.js b/addons/mail/static/src/views/web/fields/list_activity/list_activity.js similarity index 95% rename from addons/mail/static/src/web/fields/list_activity/list_activity.js rename to addons/mail/static/src/views/web/fields/list_activity/list_activity.js index e238ffcc866..7206e7f5a88 100644 --- a/addons/mail/static/src/web/fields/list_activity/list_activity.js +++ b/addons/mail/static/src/views/web/fields/list_activity/list_activity.js @@ -1,13 +1,13 @@ /* @odoo-module */ -import { ActivityButton } from "@mail/web/activity/activity_button"; - -import { registry } from "@web/core/registry"; -import { standardFieldProps } from "@web/views/fields/standard_field_props"; -import { _t } from "@web/core/l10n/translation"; +import { ActivityButton } from "@mail/core/web/activity_button"; import { Component } from "@odoo/owl"; +import { _t } from "@web/core/l10n/translation"; +import { registry } from "@web/core/registry"; +import { standardFieldProps } from "@web/views/fields/standard_field_props"; + export class ListActivity extends Component { static components = { ActivityButton }; // also used in children, in particular in ActivityButton diff --git a/addons/mail/static/src/web/fields/list_activity/list_activity.xml b/addons/mail/static/src/views/web/fields/list_activity/list_activity.xml similarity index 100% rename from addons/mail/static/src/web/fields/list_activity/list_activity.xml rename to addons/mail/static/src/views/web/fields/list_activity/list_activity.xml diff --git a/addons/mail/static/src/web/fields/m2x_avatar_user.js b/addons/mail/static/src/views/web/fields/m2x_avatar_user.js similarity index 99% rename from addons/mail/static/src/web/fields/m2x_avatar_user.js rename to addons/mail/static/src/views/web/fields/m2x_avatar_user.js index 3145bbcd8af..d08522ece8f 100644 --- a/addons/mail/static/src/web/fields/m2x_avatar_user.js +++ b/addons/mail/static/src/views/web/fields/m2x_avatar_user.js @@ -1,5 +1,6 @@ /* @odoo-module */ +import { _t } from "@web/core/l10n/translation"; import core from "web.core"; import fieldRegistry from "web.field_registry"; import { @@ -9,7 +10,6 @@ import { Many2OneAvatar, } from "web.relational_fields"; import session from "web.session"; -import { _t } from "@web/core/l10n/translation"; // This module defines extensions of the Many2OneAvatar and Many2ManyAvatar // widgets, which are integrated with the messaging system. They are designed @@ -51,7 +51,7 @@ const M2XAvatarMixin = { * @param {Object} params */ async _openChat(params) { - /** @type {import("@mail/core/thread_service").ThreadService} */ + /** @type {import("@mail/core/common/thread_service").ThreadService} */ const threadService = await odoo.__WOWL_DEBUG__.root.env.services["mail.thread"]; threadService.openChat(params); }, diff --git a/addons/mail/static/src/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.js b/addons/mail/static/src/views/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.js similarity index 89% rename from addons/mail/static/src/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.js rename to addons/mail/static/src/views/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.js index 22531ad2bfe..7e0b0ed6ef6 100644 --- a/addons/mail/static/src/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.js +++ b/addons/mail/static/src/views/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.js @@ -1,8 +1,11 @@ /* @odoo-module */ -import { patch } from "@web/core/utils/patch"; +import { useOpenChat } from "@mail/core/web/open_chat_hook"; +import { useAssignUserCommand } from "@mail/views/web/fields/assign_user_command_hook"; + import { registry } from "@web/core/registry"; import { TagsList } from "@web/core/tags_list/tags_list"; +import { patch } from "@web/core/utils/patch"; import { Many2ManyTagsAvatarField, many2ManyTagsAvatarField, @@ -12,8 +15,6 @@ import { kanbanMany2ManyTagsAvatarField, KanbanMany2ManyTagsAvatarFieldTagsList, } from "@web/views/fields/many2many_tags_avatar/many2many_tags_avatar_field"; -import { useOpenChat } from "@mail/web/open_chat_hook"; -import { useAssignUserCommand } from "@mail/web/fields/assign_user_command_hook"; export class Many2ManyAvatarUserTagsList extends TagsList {} Many2ManyAvatarUserTagsList.template = "mail.Many2ManyAvatarUserTagsList"; @@ -40,7 +41,7 @@ export class Many2ManyTagsAvatarUserField extends Many2ManyTagsAvatarField { TagsList: Many2ManyAvatarUserTagsList, }; } -patch(Many2ManyTagsAvatarUserField.prototype, "mail", userChatter); +patch(Many2ManyTagsAvatarUserField.prototype, "mail/fields/web", userChatter); export const many2ManyTagsAvatarUserField = { ...many2ManyTagsAvatarField, @@ -64,7 +65,7 @@ export class KanbanMany2ManyTagsAvatarUserField extends KanbanMany2ManyTagsAvata return !this.props.readonly; } } -patch(KanbanMany2ManyTagsAvatarUserField.prototype, "mail", userChatter); +patch(KanbanMany2ManyTagsAvatarUserField.prototype, "mail/fields/web", userChatter); export const kanbanMany2ManyTagsAvatarUserField = { ...kanbanMany2ManyTagsAvatarField, component: KanbanMany2ManyTagsAvatarUserField, @@ -83,7 +84,7 @@ export class ListMany2ManyTagsAvatarUserField extends ListMany2ManyTagsAvatarFie return this.props.record.data[this.props.name].records.length === 1 || !this.props.readonly; } } -patch(ListMany2ManyTagsAvatarUserField.prototype, "mail", userChatter); +patch(ListMany2ManyTagsAvatarUserField.prototype, "mail/fields/web", userChatter); export const listMany2ManyTagsAvatarUserField = { ...listMany2ManyTagsAvatarField, diff --git a/addons/mail/static/src/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.scss b/addons/mail/static/src/views/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.scss similarity index 100% rename from addons/mail/static/src/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.scss rename to addons/mail/static/src/views/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.scss diff --git a/addons/mail/static/src/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.xml b/addons/mail/static/src/views/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.xml similarity index 100% rename from addons/mail/static/src/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.xml rename to addons/mail/static/src/views/web/fields/many2many_avatar_user_field/many2many_avatar_user_field.xml diff --git a/addons/mail/static/src/web/fields/many2many_tags_email/many2many_tags_email.js b/addons/mail/static/src/views/web/fields/many2many_tags_email/many2many_tags_email.js similarity index 99% rename from addons/mail/static/src/web/fields/many2many_tags_email/many2many_tags_email.js rename to addons/mail/static/src/views/web/fields/many2many_tags_email/many2many_tags_email.js index 053b0e827e3..27d3430cc2e 100644 --- a/addons/mail/static/src/web/fields/many2many_tags_email/many2many_tags_email.js +++ b/addons/mail/static/src/views/web/fields/many2many_tags_email/many2many_tags_email.js @@ -1,17 +1,16 @@ /* @odoo-module */ -import { registry } from "@web/core/registry"; -import { useOpenMany2XRecord } from "@web/views/fields/relational_utils"; -import { sprintf } from "@web/core/utils/strings"; +import { onMounted, onWillUpdateProps } from "@odoo/owl"; +import { _t } from "@web/core/l10n/translation"; +import { registry } from "@web/core/registry"; +import { TagsList } from "@web/core/tags_list/tags_list"; +import { sprintf } from "@web/core/utils/strings"; import { Many2ManyTagsField, many2ManyTagsField, } from "@web/views/fields/many2many_tags/many2many_tags_field"; -import { TagsList } from "@web/core/tags_list/tags_list"; -import { _t } from "@web/core/l10n/translation"; - -import { onMounted, onWillUpdateProps } from "@odoo/owl"; +import { useOpenMany2XRecord } from "@web/views/fields/relational_utils"; export class FieldMany2ManyTagsEmailTagsList extends TagsList {} FieldMany2ManyTagsEmailTagsList.template = "FieldMany2ManyTagsEmailTagsList"; diff --git a/addons/mail/static/src/web/fields/many2many_tags_email/many2many_tags_email.xml b/addons/mail/static/src/views/web/fields/many2many_tags_email/many2many_tags_email.xml similarity index 100% rename from addons/mail/static/src/web/fields/many2many_tags_email/many2many_tags_email.xml rename to addons/mail/static/src/views/web/fields/many2many_tags_email/many2many_tags_email.xml diff --git a/addons/mail/static/src/xml/many2one_avatar_user.xml b/addons/mail/static/src/views/web/fields/many2one_avatar_user.xml similarity index 100% rename from addons/mail/static/src/xml/many2one_avatar_user.xml rename to addons/mail/static/src/views/web/fields/many2one_avatar_user.xml diff --git a/addons/mail/static/src/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.js b/addons/mail/static/src/views/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.js similarity index 90% rename from addons/mail/static/src/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.js rename to addons/mail/static/src/views/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.js index 9dccde8ac71..3d9f5ab62f3 100644 --- a/addons/mail/static/src/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.js +++ b/addons/mail/static/src/views/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.js @@ -1,16 +1,17 @@ /* @odoo-module */ +import { useOpenChat } from "@mail/core/web/open_chat_hook"; +import { useAssignUserCommand } from "@mail/views/web/fields/assign_user_command_hook"; + import { _lt } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; +import { patch } from "@web/core/utils/patch"; import { Many2OneAvatarField, many2OneAvatarField, KanbanMany2OneAvatarField, kanbanMany2OneAvatarField, } from "@web/views/fields/many2one_avatar/many2one_avatar_field"; -import { useOpenChat } from "@mail/web/open_chat_hook"; -import { useAssignUserCommand } from "@mail/web/fields/assign_user_command_hook"; -import { patch } from "@web/core/utils/patch"; const userChatter = { setup() { @@ -38,7 +39,7 @@ export class Many2OneAvatarUserField extends Many2OneAvatarField { withCommand: { type: Boolean, optional: true }, }; } -patch(Many2OneAvatarUserField.prototype, "mail", userChatter); +patch(Many2OneAvatarUserField.prototype, "mail/fields/web", userChatter); export const many2OneAvatarUserField = { ...many2OneAvatarField, @@ -71,7 +72,7 @@ export class KanbanMany2OneAvatarUserField extends KanbanMany2OneAvatarField { return props; } } -patch(KanbanMany2OneAvatarUserField.prototype, "mail", userChatter); +patch(KanbanMany2OneAvatarUserField.prototype, "mail/fields/web", userChatter); export const kanbanMany2OneAvatarUserField = { ...kanbanMany2OneAvatarField, diff --git a/addons/mail/static/src/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.xml b/addons/mail/static/src/views/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.xml similarity index 100% rename from addons/mail/static/src/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.xml rename to addons/mail/static/src/views/web/fields/many2one_avatar_user_field/many2one_avatar_user_field.xml diff --git a/addons/mail/static/src/views/fields/properties_field/property_value.js b/addons/mail/static/src/views/web/fields/properties_field/property_value.js similarity index 91% rename from addons/mail/static/src/views/fields/properties_field/property_value.js rename to addons/mail/static/src/views/web/fields/properties_field/property_value.js index 91bbacfc2e7..ddfdf89ef8b 100644 --- a/addons/mail/static/src/views/fields/properties_field/property_value.js +++ b/addons/mail/static/src/views/web/fields/properties_field/property_value.js @@ -1,15 +1,16 @@ -/** @odoo-module **/ +/* @odoo-module */ +import { useOpenChat } from "@mail/core/web/open_chat_hook"; + +import { TagsList } from "@web/core/tags_list/tags_list"; import { patch } from "@web/core/utils/patch"; import { PropertyValue } from "@web/views/fields/properties/property_value"; -import { TagsList } from "@web/core/tags_list/tags_list"; -import { useOpenChat } from "@mail/web/open_chat_hook"; /** * Allow to open the chatter of the user when we click on the avatar of a Many2one * property (like we do for many2one_avatar_user widget). */ -patch(PropertyValue.prototype, "mail.PropertyValue", { +patch(PropertyValue.prototype, "mail/views/web", { setup() { this._super(); diff --git a/addons/mail/static/src/views/fields/properties_field/property_value.scss b/addons/mail/static/src/views/web/fields/properties_field/property_value.scss similarity index 100% rename from addons/mail/static/src/views/fields/properties_field/property_value.scss rename to addons/mail/static/src/views/web/fields/properties_field/property_value.scss diff --git a/addons/mail/static/src/views/fields/properties_field/property_value.xml b/addons/mail/static/src/views/web/fields/properties_field/property_value.xml similarity index 100% rename from addons/mail/static/src/views/fields/properties_field/property_value.xml rename to addons/mail/static/src/views/web/fields/properties_field/property_value.xml diff --git a/addons/mail/static/src/views/form/form_compiler.js b/addons/mail/static/src/views/web/form/form_compiler.js similarity index 99% rename from addons/mail/static/src/views/form/form_compiler.js rename to addons/mail/static/src/views/web/form/form_compiler.js index 7accd14c205..9885a737e39 100644 --- a/addons/mail/static/src/views/form/form_compiler.js +++ b/addons/mail/static/src/views/web/form/form_compiler.js @@ -1,4 +1,4 @@ -/** @odoo-module */ +/* @odoo-module */ import { evaluateExpr } from "@web/core/py_js/py"; import { registry } from "@web/core/registry"; @@ -80,7 +80,7 @@ registry.category("form_compilers").add("attachment_preview_compiler", { fn: compileAttachmentPreview, }); -patch(FormCompiler.prototype, "mail", { +patch(FormCompiler.prototype, "mail/views/web", { compile(node, params) { // TODO no chatter if in dialog? const res = this._super(node, params); diff --git a/addons/mail/static/src/views/form/form_controller.xml b/addons/mail/static/src/views/web/form/form_controller.xml similarity index 100% rename from addons/mail/static/src/views/form/form_controller.xml rename to addons/mail/static/src/views/web/form/form_controller.xml diff --git a/addons/mail/static/src/views/form/form_renderer.js b/addons/mail/static/src/views/web/form/form_renderer.js similarity index 83% rename from addons/mail/static/src/views/form/form_renderer.js rename to addons/mail/static/src/views/web/form/form_renderer.js index 3750b27f311..3afedc54ccd 100644 --- a/addons/mail/static/src/views/form/form_renderer.js +++ b/addons/mail/static/src/views/web/form/form_renderer.js @@ -1,16 +1,18 @@ -/** @odoo-module */ +/* @odoo-module */ + +import { AttachmentView } from "@mail/core/common/attachment_view"; +import { Chatter } from "@mail/core/web/chatter"; -import { Chatter } from "@mail/web/chatter"; -import { AttachmentView } from "@mail/attachments/attachment_view"; -import { patch } from "@web/core/utils/patch"; -import { FormRenderer } from "@web/views/form/form_renderer"; -import { browser } from "@web/core/browser/browser"; -import { useService } from "@web/core/utils/hooks"; -import { SIZES } from "@web/core/ui/ui_service"; -import { useDebounced } from "@web/core/utils/timing"; import { onMounted, onWillUnmount, useState } from "@odoo/owl"; -patch(FormRenderer.prototype, "mail", { +import { browser } from "@web/core/browser/browser"; +import { SIZES } from "@web/core/ui/ui_service"; +import { useService } from "@web/core/utils/hooks"; +import { patch } from "@web/core/utils/patch"; +import { useDebounced } from "@web/core/utils/timing"; +import { FormRenderer } from "@web/views/form/form_renderer"; + +patch(FormRenderer.prototype, "mail/views/web", { setup() { this._super(); this.mailComponents = { @@ -18,7 +20,7 @@ patch(FormRenderer.prototype, "mail", { Chatter, }; this.messagingState = useState({ - /** @type {import("@mail/core/thread_model").Thread} */ + /** @type {import("@mail/core/common/thread_model").Thread} */ thread: undefined, }); if (this.env.services["mail.thread"]) { @@ -46,7 +48,7 @@ patch(FormRenderer.prototype, "mail", { }, }); -patch(FormRenderer.props, "mail", { +patch(FormRenderer.props, "mail/views/web", { // Template props : added by the FormCompiler saveButtonClicked: { type: Function, optional: true }, }); diff --git a/addons/mail/static/src/views/form/form_renderer.scss b/addons/mail/static/src/views/web/form/form_renderer.scss similarity index 100% rename from addons/mail/static/src/views/form/form_renderer.scss rename to addons/mail/static/src/views/web/form/form_renderer.scss diff --git a/addons/mail/static/src/views/relational_model.js b/addons/mail/static/src/views/web/relational_model.js similarity index 85% rename from addons/mail/static/src/views/relational_model.js rename to addons/mail/static/src/views/web/relational_model.js index 6ae1a9cd4b7..2778e51b042 100644 --- a/addons/mail/static/src/views/relational_model.js +++ b/addons/mail/static/src/views/web/relational_model.js @@ -1,9 +1,9 @@ -/** @odoo-module **/ +/* @odoo-module */ import { patch } from "@web/core/utils/patch"; import { Record } from "@web/views/relational_model"; -patch(Record.prototype, "mail.Record", { +patch(Record.prototype, "mail/views/web", { _getWidgetFromDefinition(definition) { if (definition.comodel !== "res.users") { return this._super(...arguments); diff --git a/addons/mail/static/src/web/discuss_app/discuss_patch.js b/addons/mail/static/src/web/discuss_app/discuss_patch.js deleted file mode 100644 index 7e8bcbd5482..00000000000 --- a/addons/mail/static/src/web/discuss_app/discuss_patch.js +++ /dev/null @@ -1,10 +0,0 @@ -/** @odoo-module **/ - -import { patch } from "@web/core/utils/patch"; -import { Sidebar } from "@mail/web/discuss_app/sidebar"; -import { Discuss } from "@mail/discuss_app/discuss"; -import { MessagingMenu } from "@mail/web/messaging_menu/messaging_menu"; - -patch(Discuss, "mail/web", { - components: { ...Discuss.components, Sidebar, MessagingMenu }, -}); diff --git a/addons/mail/static/src/xml/activity.xml b/addons/mail/static/src/xml/activity.xml deleted file mode 100644 index 74735cf214c..00000000000 --- a/addons/mail/static/src/xml/activity.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - -
-