diff --git a/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.xml b/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.xml index a2e30d5f7e3..9dee8b5aca7 100644 --- a/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.xml +++ b/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.xml @@ -6,7 +6,7 @@ diff --git a/addons/mail/static/src/component_hooks/use_component_to_model/use_component_to_model.js b/addons/mail/static/src/component_hooks/use_component_to_model/use_component_to_model.js index 36ae5fec42b..02acdb29cea 100644 --- a/addons/mail/static/src/component_hooks/use_component_to_model/use_component_to_model.js +++ b/addons/mail/static/src/component_hooks/use_component_to_model/use_component_to_model.js @@ -12,29 +12,27 @@ const { onWillUpdateProps, useComponent } = owl.hooks; * @param {Object} param0 * @param {string} param0.fieldName Name of the field on the target record. * @param {string} param0.modelName Name of the model of the target record. - * @param {string} param0.propNameAsRecordLocalId Name of the prop of this - * component containing the localId of the target record. */ -export function useComponentToModel({ fieldName, modelName, propNameAsRecordLocalId }) { +export function useComponentToModel({ fieldName, modelName }) { const component = useComponent(); const { modelManager } = component.env.services.messaging; - const record = modelManager.models[modelName].get(component.props[propNameAsRecordLocalId]); + const record = modelManager.models[modelName].get(component.props.localId); if (record) { record.update({ [fieldName]: component }); } onWillUpdateProps(nextProps => { - const currentRecord = modelManager.models[modelName].get(component.props[propNameAsRecordLocalId]); + const currentRecord = modelManager.models[modelName].get(component.props.localId); if (currentRecord) { currentRecord.update({ [fieldName]: clear() }); } - const nextRecord = modelManager.models[modelName].get(nextProps[propNameAsRecordLocalId]); + const nextRecord = modelManager.models[modelName].get(nextProps.localId); if (nextRecord) { nextRecord.update({ [fieldName]: component }); } }); const __destroy = component.__destroy; component.__destroy = parent => { - const record = modelManager.models[modelName].get(component.props[propNameAsRecordLocalId]); + const record = modelManager.models[modelName].get(component.props.localId); if (record) { record.update({ [fieldName]: clear() }); } diff --git a/addons/mail/static/src/component_hooks/use_ref_to_model/use_ref_to_model.js b/addons/mail/static/src/component_hooks/use_ref_to_model/use_ref_to_model.js index 439910e919d..85862c1671d 100644 --- a/addons/mail/static/src/component_hooks/use_ref_to_model/use_ref_to_model.js +++ b/addons/mail/static/src/component_hooks/use_ref_to_model/use_ref_to_model.js @@ -12,31 +12,29 @@ const { onWillUpdateProps, useComponent, useRef } = owl.hooks; * @param {Object} param0 * @param {string} param0.fieldName Name of the field on the target record. * @param {string} param0.modelName Name of the model of the target record. - * @param {string} param0.propNameAsRecordLocalId Name of the prop of this - * component containing the localId of the target record. * @param {string} param0.refName Name of the t-ref on this component. */ -export function useRefToModel({ fieldName, modelName, propNameAsRecordLocalId, refName }) { +export function useRefToModel({ fieldName, modelName, refName }) { const component = useComponent(); const { modelManager } = component.env.services.messaging; - const record = modelManager.models[modelName].get(component.props[propNameAsRecordLocalId]); + const record = modelManager.models[modelName].get(component.props.localId); const ref = useRef(refName); if (record) { record.update({ [fieldName]: ref }); } onWillUpdateProps(nextProps => { - const currentRecord = modelManager.models[modelName].get(component.props[propNameAsRecordLocalId]); + const currentRecord = modelManager.models[modelName].get(component.props.localId); if (currentRecord) { currentRecord.update({ [fieldName]: clear() }); } - const nextRecord = modelManager.models[modelName].get(nextProps[propNameAsRecordLocalId]); + const nextRecord = modelManager.models[modelName].get(nextProps.localId); if (nextRecord) { nextRecord.update({ [fieldName]: ref }); } }); const __destroy = component.__destroy; component.__destroy = parent => { - const record = modelManager.models[modelName].get(component.props[propNameAsRecordLocalId]); + const record = modelManager.models[modelName].get(component.props.localId); if (record) { record.update({ [fieldName]: clear() }); } diff --git a/addons/mail/static/src/component_hooks/use_update_to_model/use_update_to_model.js b/addons/mail/static/src/component_hooks/use_update_to_model/use_update_to_model.js index f9521474ec6..c91271c1678 100644 --- a/addons/mail/static/src/component_hooks/use_update_to_model/use_update_to_model.js +++ b/addons/mail/static/src/component_hooks/use_update_to_model/use_update_to_model.js @@ -11,13 +11,11 @@ const { useComponent } = owl.hooks; * @param {Object} param0 * @param {string} param0.methodName Name of the method on the target record. * @param {string} param0.modelName Name of the model of the target record. - * @param {string} param0.propNameAsRecordLocalId Name of the prop of this component - * containing the localId of the target record. */ -export function useUpdateToModel({ methodName, modelName, propNameAsRecordLocalId }) { +export function useUpdateToModel({ methodName, modelName }) { const component = useComponent(); useUpdate({ func: () => { - const record = component.env.services.messaging.modelManager.models[modelName].get(component.props[propNameAsRecordLocalId]); + const record = component.env.services.messaging.modelManager.models[modelName].get(component.props.localId); if (record) { record[methodName](); } diff --git a/addons/mail/static/src/components/activity/activity.js b/addons/mail/static/src/components/activity/activity.js index 24a73a855bf..bee292814c1 100644 --- a/addons/mail/static/src/components/activity/activity.js +++ b/addons/mail/static/src/components/activity/activity.js @@ -6,23 +6,17 @@ const { Component } = owl; export class Activity extends Component { - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** * @returns {ActivityView} */ get activityView() { - return this.messaging && this.messaging.models['ActivityView'].get(this.props.activityViewLocalId); + return this.messaging && this.messaging.models['ActivityView'].get(this.props.localId); } } Object.assign(Activity, { - props: { - activityViewLocalId: String, - }, + props: { localId: String }, template: 'mail.Activity', }); diff --git a/addons/mail/static/src/components/activity_box/activity_box.js b/addons/mail/static/src/components/activity_box/activity_box.js index e7c22670339..39c9b6a63c9 100644 --- a/addons/mail/static/src/components/activity_box/activity_box.js +++ b/addons/mail/static/src/components/activity_box/activity_box.js @@ -6,23 +6,17 @@ const { Component } = owl; export class ActivityBox extends Component { - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** - * @returns {Chatter} + * @returns {ActivityBoxView} */ get activityBoxView() { - return this.messaging && this.messaging.models['ActivityBoxView'].get(this.props.activityBoxViewLocalId); + return this.messaging && this.messaging.models['ActivityBoxView'].get(this.props.localId); } } Object.assign(ActivityBox, { - props: { - activityBoxViewLocalId: String, - }, + props: { localId: String }, template: 'mail.ActivityBox', }); diff --git a/addons/mail/static/src/components/activity_box/activity_box.xml b/addons/mail/static/src/components/activity_box/activity_box.xml index 94731bae602..7c6364f745d 100644 --- a/addons/mail/static/src/components/activity_box/activity_box.xml +++ b/addons/mail/static/src/components/activity_box/activity_box.xml @@ -34,7 +34,7 @@
- +
diff --git a/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover.js b/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover.js index 91389b3bbcc..c49eb9ec6c6 100644 --- a/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover.js +++ b/addons/mail/static/src/components/activity_mark_done_popover/activity_mark_done_popover.js @@ -14,8 +14,8 @@ export class ActivityMarkDonePopover extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'ActivityMarkDonePopoverView', propNameAsRecordLocalId: 'localId' }); - useRefToModel({ fieldName: 'feedbackTextareaRef', modelName: 'ActivityMarkDonePopoverView', propNameAsRecordLocalId: 'localId', refName: 'feedbackTextarea' }); + useComponentToModel({ fieldName: 'component', modelName: 'ActivityMarkDonePopoverView' }); + useRefToModel({ fieldName: 'feedbackTextareaRef', modelName: 'ActivityMarkDonePopoverView', refName: 'feedbackTextarea' }); this._feedbackTextareaRef = useRef('feedbackTextarea'); onMounted(() => this._mounted()); } @@ -41,9 +41,7 @@ export class ActivityMarkDonePopover extends Component { } Object.assign(ActivityMarkDonePopover, { - props: { - localId: String, - }, + props: { localId: String }, template: 'mail.ActivityMarkDonePopover', }); diff --git a/addons/mail/static/src/components/attachment_box/attachment_box.js b/addons/mail/static/src/components/attachment_box/attachment_box.js index 88a91a4a900..975d9886174 100644 --- a/addons/mail/static/src/components/attachment_box/attachment_box.js +++ b/addons/mail/static/src/components/attachment_box/attachment_box.js @@ -14,7 +14,7 @@ export class AttachmentBox extends Component { setup() { super.setup(); this.isDropZoneVisible = useDragVisibleDropZone(); - useComponentToModel({ fieldName: 'component', modelName: 'AttachmentBoxView', propNameAsRecordLocalId: 'attachmentBoxViewLocalId' }); + useComponentToModel({ fieldName: 'component', modelName: 'AttachmentBoxView' }); this._onDropZoneFilesDropped = this._onDropZoneFilesDropped.bind(this); } @@ -26,7 +26,7 @@ export class AttachmentBox extends Component { * @returns {AttachmentBoxView|undefined} */ get attachmentBoxView() { - return this.messaging && this.messaging.models['AttachmentBoxView'].get(this.props.attachmentBoxViewLocalId); + return this.messaging && this.messaging.models['AttachmentBoxView'].get(this.props.localId); } //-------------------------------------------------------------------------- @@ -46,9 +46,7 @@ export class AttachmentBox extends Component { } Object.assign(AttachmentBox, { - props: { - attachmentBoxViewLocalId: String, - }, + props: { localId: String }, template: 'mail.AttachmentBox', }); diff --git a/addons/mail/static/src/components/attachment_box/attachment_box.xml b/addons/mail/static/src/components/attachment_box/attachment_box.xml index dcfee7e5d73..49e1fa07b31 100644 --- a/addons/mail/static/src/components/attachment_box/attachment_box.xml +++ b/addons/mail/static/src/components/attachment_box/attachment_box.xml @@ -21,7 +21,7 @@ diff --git a/addons/mail/static/src/components/attachment_box/tests/attachment_box_tests.js b/addons/mail/static/src/components/attachment_box/tests/attachment_box_tests.js index 17be2a42331..75bb9db5227 100644 --- a/addons/mail/static/src/components/attachment_box/tests/attachment_box_tests.js +++ b/addons/mail/static/src/components/attachment_box/tests/attachment_box_tests.js @@ -30,7 +30,7 @@ QUnit.module('attachment_box_tests.js', { threadModel: thread.model, }); const props = { - attachmentBoxViewLocalId: chatter.attachmentBoxView.localId, + localId: chatter.attachmentBoxView.localId, ...otherProps, }; await createRootMessagingComponent(this, "AttachmentBox", { diff --git a/addons/mail/static/src/components/attachment_card/attachment_card.js b/addons/mail/static/src/components/attachment_card/attachment_card.js index 0c199c37c42..a8a9d14cc88 100644 --- a/addons/mail/static/src/components/attachment_card/attachment_card.js +++ b/addons/mail/static/src/components/attachment_card/attachment_card.js @@ -11,7 +11,7 @@ export class AttachmentCard extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'AttachmentCard', propNameAsRecordLocalId: 'attachmentCardLocalId' }); + useComponentToModel({ fieldName: 'component', modelName: 'AttachmentCard' }); } //-------------------------------------------------------------------------- @@ -22,14 +22,14 @@ export class AttachmentCard extends Component { * @returns {AttachmentCard} */ get attachmentCard() { - return this.messaging && this.messaging.models['AttachmentCard'].get(this.props.attachmentCardLocalId); + return this.messaging && this.messaging.models['AttachmentCard'].get(this.props.localId); } } Object.assign(AttachmentCard, { props: { - attachmentCardLocalId: String, + localId: String, onAttachmentRemoved: { type: Function, optional: true, diff --git a/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js b/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js index 7b6eda7faa4..629f5595555 100644 --- a/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js +++ b/addons/mail/static/src/components/attachment_delete_confirm_dialog/attachment_delete_confirm_dialog.js @@ -5,7 +5,6 @@ import { registerMessagingComponent } from '@mail/utils/messaging_component'; import Dialog from 'web.OwlDialog'; const { Component } = owl; -const { useRef } = owl.hooks; export class AttachmentDeleteConfirmDialog extends Component { @@ -57,7 +56,7 @@ export class AttachmentDeleteConfirmDialog extends Component { if (this.props.onAttachmentRemoved) { this.props.onAttachmentRemoved({ attachmentLocalId: this.props.attachmentLocalId, - }) + }); } } diff --git a/addons/mail/static/src/components/attachment_image/attachment_image.js b/addons/mail/static/src/components/attachment_image/attachment_image.js index 34a621127a6..5ef48a0e84f 100644 --- a/addons/mail/static/src/components/attachment_image/attachment_image.js +++ b/addons/mail/static/src/components/attachment_image/attachment_image.js @@ -11,25 +11,21 @@ export class AttachmentImage extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'AttachmentImage', propNameAsRecordLocalId: 'attachmentImageLocalId' }); + useComponentToModel({ fieldName: 'component', modelName: 'AttachmentImage' }); } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** * @returns {AttachmentImage} */ get attachmentImage() { - return this.messaging && this.messaging.models['AttachmentImage'].get(this.props.attachmentImageLocalId); + return this.messaging && this.messaging.models['AttachmentImage'].get(this.props.localId); } } Object.assign(AttachmentImage, { props: { - attachmentImageLocalId: String, + localId: String, onAttachmentRemoved: { type: Function, optional: true, diff --git a/addons/mail/static/src/components/attachment_list/attachment_list.js b/addons/mail/static/src/components/attachment_list/attachment_list.js index c91230c3db2..352cd279609 100644 --- a/addons/mail/static/src/components/attachment_list/attachment_list.js +++ b/addons/mail/static/src/components/attachment_list/attachment_list.js @@ -10,14 +10,14 @@ export class AttachmentList extends Component { * @returns {AttachmentList} */ get attachmentList() { - return this.messaging && this.messaging.models['AttachmentList'].get(this.props.attachmentListLocalId); + return this.messaging && this.messaging.models['AttachmentList'].get(this.props.localId); } } Object.assign(AttachmentList, { props: { - attachmentListLocalId: String, + localId: String, onAttachmentRemoved: { type: Function, optional: true, diff --git a/addons/mail/static/src/components/attachment_list/attachment_list.xml b/addons/mail/static/src/components/attachment_list/attachment_list.xml index d1724b094ba..cf96b01b208 100644 --- a/addons/mail/static/src/components/attachment_list/attachment_list.xml +++ b/addons/mail/static/src/components/attachment_list/attachment_list.xml @@ -6,12 +6,12 @@
- +
- +
diff --git a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js index 4eaa380543e..f4ea6e8b58d 100644 --- a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js +++ b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js @@ -21,7 +21,7 @@ export class AttachmentViewer extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'AttachmentViewer', propNameAsRecordLocalId: 'localId' }); + useComponentToModel({ fieldName: 'component', modelName: 'AttachmentViewer' }); this.MIN_SCALE = MIN_SCALE; /** * Used to ensure that the ref is always up to date, which seems to be needed if the element @@ -589,9 +589,7 @@ export class AttachmentViewer extends Component { } Object.assign(AttachmentViewer, { - props: { - localId: String, - }, + props: { localId: String }, template: 'mail.AttachmentViewer', }); diff --git a/addons/mail/static/src/components/channel_invitation_form/channel_invitation_form.js b/addons/mail/static/src/components/channel_invitation_form/channel_invitation_form.js index 3901e022e2d..859e1a6376d 100644 --- a/addons/mail/static/src/components/channel_invitation_form/channel_invitation_form.js +++ b/addons/mail/static/src/components/channel_invitation_form/channel_invitation_form.js @@ -14,15 +14,11 @@ export class ChannelInvitationForm extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'ChannelInvitationForm', propNameAsRecordLocalId: 'localId' }); - useRefToModel({ fieldName: 'searchInputRef', modelName: 'ChannelInvitationForm', propNameAsRecordLocalId: 'localId', refName: 'searchInput' }); - useUpdateToModel({ methodName: 'onComponentUpdate', modelName: 'ChannelInvitationForm', propNameAsRecordLocalId: 'localId' }); + useComponentToModel({ fieldName: 'component', modelName: 'ChannelInvitationForm' }); + useRefToModel({ fieldName: 'searchInputRef', modelName: 'ChannelInvitationForm', refName: 'searchInput' }); + useUpdateToModel({ methodName: 'onComponentUpdate', modelName: 'ChannelInvitationForm' }); } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - get channelInvitationForm() { return this.messaging && this.messaging.models['ChannelInvitationForm'].get(this.props.localId); } @@ -30,11 +26,7 @@ export class ChannelInvitationForm extends Component { } Object.assign(ChannelInvitationForm, { - props: { - localId: { - type: String, - }, - }, + props: { localId: String }, template: 'mail.ChannelInvitationForm', }); diff --git a/addons/mail/static/src/components/channel_member_list/channel_member_list.js b/addons/mail/static/src/components/channel_member_list/channel_member_list.js index 58a713e677a..e1b3dfdc578 100644 --- a/addons/mail/static/src/components/channel_member_list/channel_member_list.js +++ b/addons/mail/static/src/components/channel_member_list/channel_member_list.js @@ -16,9 +16,7 @@ export class ChannelMemberList extends Component { } Object.assign(ChannelMemberList, { - props: { - channelLocalId: String, - }, + props: { channelLocalId: String }, template: 'mail.ChannelMemberList', }); diff --git a/addons/mail/static/src/components/chat_window/chat_window.js b/addons/mail/static/src/components/chat_window/chat_window.js index e23fc92320e..ee228b0bdcc 100644 --- a/addons/mail/static/src/components/chat_window/chat_window.js +++ b/addons/mail/static/src/components/chat_window/chat_window.js @@ -41,7 +41,7 @@ export class ChatWindow extends Component { * @returns {ChatWindow} */ get chatWindow() { - return this.messaging && this.messaging.models['ChatWindow'].get(this.props.chatWindowLocalId); + return this.messaging && this.messaging.models['ChatWindow'].get(this.props.localId); } /** @@ -257,7 +257,7 @@ Object.assign(ChatWindow, { isFullscreen: false, }, props: { - chatWindowLocalId: String, + localId: String, hasCloseAsBackButton: Boolean, isExpandable: Boolean, isFullscreen: Boolean, diff --git a/addons/mail/static/src/components/chat_window/chat_window.xml b/addons/mail/static/src/components/chat_window/chat_window.xml index fd17eb668f6..2259683aaec 100644 --- a/addons/mail/static/src/components/chat_window/chat_window.xml +++ b/addons/mail/static/src/components/chat_window/chat_window.xml @@ -30,7 +30,7 @@ className="'o_ChatWindow_thread'" hasComposerCurrentPartnerAvatar="false" hasComposerSendButton="messaging.device.isMobile" - threadViewLocalId="chatWindow.threadView.localId" + localId="chatWindow.threadView.localId" onFocusin="_onFocusinThread" t-ref="thread" /> diff --git a/addons/mail/static/src/components/chat_window_manager/chat_window_manager.xml b/addons/mail/static/src/components/chat_window_manager/chat_window_manager.xml index bd4b9839501..52b6a340795 100644 --- a/addons/mail/static/src/components/chat_window_manager/chat_window_manager.xml +++ b/addons/mail/static/src/components/chat_window_manager/chat_window_manager.xml @@ -10,7 +10,7 @@ this._update() }); - useComponentToModel({ fieldName: 'component', modelName: 'Chatter', propNameAsRecordLocalId: 'chatterLocalId' }); - useRefToModel({ fieldName: 'threadRef', modelName: 'Chatter', propNameAsRecordLocalId: 'chatterLocalId', refName: 'thread' }); + useComponentToModel({ fieldName: 'component', modelName: 'Chatter' }); + useRefToModel({ fieldName: 'threadRef', modelName: 'Chatter', refName: 'thread' }); /** * Reference of the scroll Panel (Real scroll element). Useful to pass the Scroll element to * child component to handle proper scrollable element. @@ -34,7 +34,7 @@ export class Chatter extends Component { * @returns {Chatter} */ get chatter() { - return this.messaging && this.messaging.models['Chatter'].get(this.props.chatterLocalId); + return this.messaging && this.messaging.models['Chatter'].get(this.props.localId); } /** @@ -76,9 +76,7 @@ export class Chatter extends Component { } Object.assign(Chatter, { - props: { - chatterLocalId: String, - }, + props: { localId: String }, template: 'mail.Chatter', }); diff --git a/addons/mail/static/src/components/chatter/chatter.xml b/addons/mail/static/src/components/chatter/chatter.xml index 3a785e873af..d6979478628 100644 --- a/addons/mail/static/src/components/chatter/chatter.xml +++ b/addons/mail/static/src/components/chatter/chatter.xml @@ -13,7 +13,7 @@ @@ -39,7 +39,7 @@ className="'o_Chatter_thread'" getScrollableElement="getScrollableElement" hasScrollAdjust="chatter.hasMessageListScrollAdjust" - threadViewLocalId="chatter.threadView.localId" + localId="chatter.threadView.localId" t-ref="thread" /> diff --git a/addons/mail/static/src/components/chatter/tests/chatter_suggested_recipient_tests.js b/addons/mail/static/src/components/chatter/tests/chatter_suggested_recipient_tests.js index 4fe54070cdb..9d5bb235053 100644 --- a/addons/mail/static/src/components/chatter/tests/chatter_suggested_recipient_tests.js +++ b/addons/mail/static/src/components/chatter/tests/chatter_suggested_recipient_tests.js @@ -16,7 +16,7 @@ QUnit.module('chatter_suggested_recipients_tests.js', { beforeEach(this); this.createChatterComponent = async ({ chatter }, otherProps) => { - const props = Object.assign({ chatterLocalId: chatter.localId }, otherProps); + const props = Object.assign({ localId: chatter.localId }, otherProps); await createRootMessagingComponent(this, "Chatter", { props, target: this.widget.el, diff --git a/addons/mail/static/src/components/chatter/tests/chatter_tests.js b/addons/mail/static/src/components/chatter/tests/chatter_tests.js index df28e5496d3..98801c3ff6d 100644 --- a/addons/mail/static/src/components/chatter/tests/chatter_tests.js +++ b/addons/mail/static/src/components/chatter/tests/chatter_tests.js @@ -17,7 +17,7 @@ QUnit.module('chatter_tests.js', { beforeEach(this); this.createChatterComponent = async ({ chatter }, otherProps) => { - const props = Object.assign({ chatterLocalId: chatter.localId }, otherProps); + const props = Object.assign({ localId: chatter.localId }, otherProps); await createRootMessagingComponent(this, "Chatter", { props, target: this.widget.el, diff --git a/addons/mail/static/src/components/chatter_container/chatter_container.xml b/addons/mail/static/src/components/chatter_container/chatter_container.xml index 3fad3932904..8c90a14aa63 100644 --- a/addons/mail/static/src/components/chatter_container/chatter_container.xml +++ b/addons/mail/static/src/components/chatter_container/chatter_container.xml @@ -4,7 +4,7 @@
- +
Please wait...
diff --git a/addons/mail/static/src/components/chatter_topbar/chatter_topbar.js b/addons/mail/static/src/components/chatter_topbar/chatter_topbar.js index 4e851f6b120..79f35b6131d 100644 --- a/addons/mail/static/src/components/chatter_topbar/chatter_topbar.js +++ b/addons/mail/static/src/components/chatter_topbar/chatter_topbar.js @@ -16,9 +16,7 @@ export class ChatterTopbar extends Component { } Object.assign(ChatterTopbar, { - props: { - chatterLocalId: String, - }, + props: { chatterLocalId: String }, template: 'mail.ChatterTopbar', }); diff --git a/addons/mail/static/src/components/composer/composer.js b/addons/mail/static/src/components/composer/composer.js index fed5d4227db..53ba89839e3 100644 --- a/addons/mail/static/src/components/composer/composer.js +++ b/addons/mail/static/src/components/composer/composer.js @@ -16,8 +16,8 @@ export class Composer extends Component { setup() { super.setup(); this.isDropZoneVisible = useDragVisibleDropZone(); - useComponentToModel({ fieldName: 'component', modelName: 'ComposerView', propNameAsRecordLocalId: 'composerViewLocalId' }); - useRefToModel({ fieldName: 'buttonEmojisRef', modelName: 'ComposerView', propNameAsRecordLocalId: 'composerViewLocalId', refName: 'buttonEmojis' }); + useComponentToModel({ fieldName: 'component', modelName: 'ComposerView' }); + useRefToModel({ fieldName: 'buttonEmojisRef', modelName: 'ComposerView', refName: 'buttonEmojis' }); this._onDropZoneFilesDropped = this._onDropZoneFilesDropped.bind(this); this._onComposerTextInputSendShortcut = this._onComposerTextInputSendShortcut.bind(this); this._onPasteTextInput = this._onPasteTextInput.bind(this); @@ -31,7 +31,7 @@ export class Composer extends Component { * @returns {ComposerView} */ get composerView() { - return this.messaging && this.messaging.models['ComposerView'].get(this.props.composerViewLocalId); + return this.messaging && this.messaging.models['ComposerView'].get(this.props.localId); } /** @@ -218,7 +218,7 @@ Object.assign(Composer, { isExpandable: false, }, props: { - composerViewLocalId: String, + localId: String, hasCurrentPartnerAvatar: Boolean, hasDiscardButton: Boolean, hasFollowers: Boolean, diff --git a/addons/mail/static/src/components/composer/composer.xml b/addons/mail/static/src/components/composer/composer.xml index 3ce038005be..d139d74c9e5 100644 --- a/addons/mail/static/src/components/composer/composer.xml +++ b/addons/mail/static/src/components/composer/composer.xml @@ -76,7 +76,7 @@ 'o_Composer_textInput-mobile': messaging.device.isMobile, 'o-has-current-partner-avatar': props.hasCurrentPartnerAvatar, }" - composerViewLocalId="composerView.localId" + localId="composerView.localId" hasMentionSuggestionsBelowPosition="props.hasMentionSuggestionsBelowPosition" isCompact="props.isCompact" onComposerTextInputSendShortcut="_onComposerTextInputSendShortcut" @@ -105,7 +105,7 @@ > - +
@@ -128,7 +128,7 @@ t-if="composerView.attachmentList" className="'o_Composer_attachmentList'" classNameObj="{ 'o-composer-is-compact': props.isCompact }" - attachmentListLocalId="composerView.attachmentList.localId" + localId="composerView.attachmentList.localId" /> diff --git a/addons/mail/static/src/components/composer_suggested_recipient_list/composer_suggested_recipient_list.js b/addons/mail/static/src/components/composer_suggested_recipient_list/composer_suggested_recipient_list.js index 5f009332fd1..d1eb9bbe068 100644 --- a/addons/mail/static/src/components/composer_suggested_recipient_list/composer_suggested_recipient_list.js +++ b/addons/mail/static/src/components/composer_suggested_recipient_list/composer_suggested_recipient_list.js @@ -49,9 +49,7 @@ export class ComposerSuggestedRecipientList extends Component { } Object.assign(ComposerSuggestedRecipientList, { - props: { - threadLocalId: String, - }, + props: { threadLocalId: String }, template: 'mail.ComposerSuggestedRecipientList', }); diff --git a/addons/mail/static/src/components/composer_text_input/composer_text_input.js b/addons/mail/static/src/components/composer_text_input/composer_text_input.js index fdbe7b126ae..42dbe9ced09 100644 --- a/addons/mail/static/src/components/composer_text_input/composer_text_input.js +++ b/addons/mail/static/src/components/composer_text_input/composer_text_input.js @@ -15,7 +15,7 @@ export class ComposerTextInput extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'textInputComponent', modelName: 'ComposerView', propNameAsRecordLocalId: 'composerViewLocalId' }); + useComponentToModel({ fieldName: 'textInputComponent', modelName: 'ComposerView' }); /** * Updates the composer text input content when composer is mounted * as textarea content can't be changed from the DOM. @@ -46,7 +46,7 @@ export class ComposerTextInput extends Component { * @returns {ComposerView} */ get composerView() { - return this.messaging && this.messaging.models['ComposerView'].get(this.props.composerViewLocalId); + return this.messaging && this.messaging.models['ComposerView'].get(this.props.localId); } /** @@ -404,7 +404,7 @@ Object.assign(ComposerTextInput, { hasMentionSuggestionsBelowPosition: false, }, props: { - composerViewLocalId: String, + localId: String, hasMentionSuggestionsBelowPosition: Boolean, isCompact: Boolean, onComposerTextInputSendShortcut: { diff --git a/addons/mail/static/src/components/composer_text_input/composer_text_input.xml b/addons/mail/static/src/components/composer_text_input/composer_text_input.xml index d674f8792be..5c94af1851f 100644 --- a/addons/mail/static/src/components/composer_text_input/composer_text_input.xml +++ b/addons/mail/static/src/components/composer_text_input/composer_text_input.xml @@ -6,7 +6,7 @@ diff --git a/addons/mail/static/src/components/delete_message_confirm_dialog/delete_message_confirm_dialog.js b/addons/mail/static/src/components/delete_message_confirm_dialog/delete_message_confirm_dialog.js index fa90a198459..54d26e76f90 100644 --- a/addons/mail/static/src/components/delete_message_confirm_dialog/delete_message_confirm_dialog.js +++ b/addons/mail/static/src/components/delete_message_confirm_dialog/delete_message_confirm_dialog.js @@ -5,7 +5,6 @@ import { registerMessagingComponent } from '@mail/utils/messaging_component'; import Dialog from 'web.OwlDialog'; const { Component } = owl; -const { useRef } = owl.hooks; export class DeleteMessageConfirmDialog extends Component { @@ -21,7 +20,7 @@ export class DeleteMessageConfirmDialog extends Component { * @returns {MessageActionList} */ get messageActionList() { - return this.messaging && this.messaging.models['MessageActionList'].get(this.props.messageActionListLocalId); + return this.messaging && this.messaging.models['MessageActionList'].get(this.props.localId); } } @@ -30,7 +29,7 @@ Object.assign(DeleteMessageConfirmDialog, { Dialog, }, props: { - messageActionListLocalId: String, + localId: String, }, template: 'mail.DeleteMessageConfirmDialog', }); diff --git a/addons/mail/static/src/components/dialog/dialog.js b/addons/mail/static/src/components/dialog/dialog.js index 612b3fb66b6..8dd7cc8496f 100644 --- a/addons/mail/static/src/components/dialog/dialog.js +++ b/addons/mail/static/src/components/dialog/dialog.js @@ -36,7 +36,7 @@ export class Dialog extends Component { * @returns {Dialog} */ get dialog() { - return this.messaging && this.messaging.models['Dialog'].get(this.props.dialogLocalId); + return this.messaging && this.messaging.models['Dialog'].get(this.props.localId); } //-------------------------------------------------------------------------- @@ -83,9 +83,7 @@ export class Dialog extends Component { } Object.assign(Dialog, { - props: { - dialogLocalId: String, - }, + props: { localId: String }, template: 'mail.Dialog', }); diff --git a/addons/mail/static/src/components/dialog_manager/dialog_manager.xml b/addons/mail/static/src/components/dialog_manager/dialog_manager.xml index 1549c6635f1..5a02e610597 100644 --- a/addons/mail/static/src/components/dialog_manager/dialog_manager.xml +++ b/addons/mail/static/src/components/dialog_manager/dialog_manager.xml @@ -7,7 +7,7 @@ diff --git a/addons/mail/static/src/components/discuss/discuss.xml b/addons/mail/static/src/components/discuss/discuss.xml index 1e52dde7ea8..6556e7444d3 100644 --- a/addons/mail/static/src/components/discuss/discuss.xml +++ b/addons/mail/static/src/components/discuss/discuss.xml @@ -52,7 +52,7 @@ hasComposerDiscardButton="discuss.thread === messaging.inbox" hasComposerThreadName="discuss.thread === messaging.inbox" hasComposerThreadTyping="true" - threadViewLocalId="discuss.threadView.localId" + localId="discuss.threadView.localId" /> @@ -78,7 +78,7 @@ diff --git a/addons/mail/static/src/components/discuss_public_view/discuss_public_view.xml b/addons/mail/static/src/components/discuss_public_view/discuss_public_view.xml index a498ec0307f..a987f1e5bc3 100644 --- a/addons/mail/static/src/components/discuss_public_view/discuss_public_view.xml +++ b/addons/mail/static/src/components/discuss_public_view/discuss_public_view.xml @@ -5,7 +5,7 @@ diff --git a/addons/mail/static/src/components/discuss_sidebar_category/discuss_sidebar_category.js b/addons/mail/static/src/components/discuss_sidebar_category/discuss_sidebar_category.js index e6deb0cd832..3347cec4fdc 100644 --- a/addons/mail/static/src/components/discuss_sidebar_category/discuss_sidebar_category.js +++ b/addons/mail/static/src/components/discuss_sidebar_category/discuss_sidebar_category.js @@ -6,22 +6,16 @@ const { Component } = owl; export class DiscussSidebarCategory extends Component { - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** * @returns {DiscussSidebarCategory} */ get category() { - return this.messaging.models['DiscussSidebarCategory'].get(this.props.categoryLocalId); + return this.messaging.models['DiscussSidebarCategory'].get(this.props.localId); } } Object.assign(DiscussSidebarCategory, { - props: { - categoryLocalId: String, - }, + props: { localId: String }, template: 'mail.DiscussSidebarCategory', }); diff --git a/addons/mail/static/src/components/discuss_sidebar_category/discuss_sidebar_category.xml b/addons/mail/static/src/components/discuss_sidebar_category/discuss_sidebar_category.xml index cbf51174ee9..7385b7f2f0a 100644 --- a/addons/mail/static/src/components/discuss_sidebar_category/discuss_sidebar_category.xml +++ b/addons/mail/static/src/components/discuss_sidebar_category/discuss_sidebar_category.xml @@ -42,14 +42,14 @@ diff --git a/addons/mail/static/src/components/discuss_sidebar_category_item/discuss_sidebar_category_item.js b/addons/mail/static/src/components/discuss_sidebar_category_item/discuss_sidebar_category_item.js index 86d22a715c3..58fa6320c1f 100644 --- a/addons/mail/static/src/components/discuss_sidebar_category_item/discuss_sidebar_category_item.js +++ b/addons/mail/static/src/components/discuss_sidebar_category_item/discuss_sidebar_category_item.js @@ -6,22 +6,17 @@ const { Component } = owl; export class DiscussSidebarCategoryItem extends Component { - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** * @returns {DiscussSidebarCategoryItem} */ get categoryItem() { - return this.messaging.models['DiscussSidebarCategoryItem'].get(this.props.categoryItemLocalId); + return this.messaging.models['DiscussSidebarCategoryItem'].get(this.props.localId); } + } Object.assign(DiscussSidebarCategoryItem, { - props: { - categoryItemLocalId: String, - }, + props: { localId: String }, template: 'mail.DiscussSidebarCategoryItem', }); diff --git a/addons/mail/static/src/components/discuss_sidebar_mailbox/discuss_sidebar_mailbox.js b/addons/mail/static/src/components/discuss_sidebar_mailbox/discuss_sidebar_mailbox.js index 9468044bb42..2b914c025df 100644 --- a/addons/mail/static/src/components/discuss_sidebar_mailbox/discuss_sidebar_mailbox.js +++ b/addons/mail/static/src/components/discuss_sidebar_mailbox/discuss_sidebar_mailbox.js @@ -6,10 +6,6 @@ const { Component } = owl; export class DiscussSidebarMailbox extends Component { - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** * @returns {Thread} */ @@ -20,9 +16,7 @@ export class DiscussSidebarMailbox extends Component { } Object.assign(DiscussSidebarMailbox, { - props: { - threadLocalId: String, - }, + props: { threadLocalId: String }, template: 'mail.DiscussSidebarMailbox', }); diff --git a/addons/mail/static/src/components/emoji_list/emoji_list.js b/addons/mail/static/src/components/emoji_list/emoji_list.js index d611329fdbb..0cb5ea9579b 100644 --- a/addons/mail/static/src/components/emoji_list/emoji_list.js +++ b/addons/mail/static/src/components/emoji_list/emoji_list.js @@ -53,9 +53,7 @@ export class EmojiList extends Component { } Object.assign(EmojiList, { - props: { - localId: String, - }, + props: { localId: String }, template: 'mail.EmojiList', }); diff --git a/addons/mail/static/src/components/file_uploader/file_uploader.js b/addons/mail/static/src/components/file_uploader/file_uploader.js index d8caa483e45..e90e89fdd83 100644 --- a/addons/mail/static/src/components/file_uploader/file_uploader.js +++ b/addons/mail/static/src/components/file_uploader/file_uploader.js @@ -12,13 +12,9 @@ export class FileUploader extends Component { */ setup() { super.setup(); - useRefToModel({ fieldName: 'fileInputRef', modelName: 'FileUploaderView', propNameAsRecordLocalId: 'localId', refName: 'fileInput' }); + useRefToModel({ fieldName: 'fileInputRef', modelName: 'FileUploaderView', refName: 'fileInput' }); } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - get fileUploaderView() { return this.messaging && this.messaging.models['FileUploaderView'].get(this.props.localId); } diff --git a/addons/mail/static/src/components/follower_subtype_list/follower_subtype_list.js b/addons/mail/static/src/components/follower_subtype_list/follower_subtype_list.js index b083c756caf..31d04bc7c68 100644 --- a/addons/mail/static/src/components/follower_subtype_list/follower_subtype_list.js +++ b/addons/mail/static/src/components/follower_subtype_list/follower_subtype_list.js @@ -12,7 +12,7 @@ export class FollowerSubtypeList extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'FollowerSubtypeList', propNameAsRecordLocalId: 'localId' }); + useComponentToModel({ fieldName: 'component', modelName: 'FollowerSubtypeList' }); } //-------------------------------------------------------------------------- @@ -53,9 +53,7 @@ export class FollowerSubtypeList extends Component { } Object.assign(FollowerSubtypeList, { - props: { - localId: String, - }, + props: { localId: String }, template: 'mail.FollowerSubtypeList', }); diff --git a/addons/mail/static/src/components/media_preview/media_preview.js b/addons/mail/static/src/components/media_preview/media_preview.js index c699f34c368..f7adc3cb1f2 100644 --- a/addons/mail/static/src/components/media_preview/media_preview.js +++ b/addons/mail/static/src/components/media_preview/media_preview.js @@ -10,8 +10,8 @@ export class MediaPreview extends owl.Component { */ setup() { super.setup(); - useRefToModel({ fieldName: 'audioRef', modelName: 'MediaPreview', propNameAsRecordLocalId: 'localId', refName: 'audio' }); - useRefToModel({ fieldName: 'videoRef', modelName: 'MediaPreview', propNameAsRecordLocalId: 'localId', refName: 'video' }); + useRefToModel({ fieldName: 'audioRef', modelName: 'MediaPreview', refName: 'audio' }); + useRefToModel({ fieldName: 'videoRef', modelName: 'MediaPreview', refName: 'video' }); } /** diff --git a/addons/mail/static/src/components/message/message.js b/addons/mail/static/src/components/message/message.js index 53a86a293e9..11ccb39874a 100644 --- a/addons/mail/static/src/components/message/message.js +++ b/addons/mail/static/src/components/message/message.js @@ -23,8 +23,8 @@ export class Message extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'MessageView', propNameAsRecordLocalId: 'localId' }); - useUpdateToModel({ methodName: 'onComponentUpdate', modelName: 'MessageView', propNameAsRecordLocalId: 'localId' }); + useComponentToModel({ fieldName: 'component', modelName: 'MessageView' }); + useUpdateToModel({ methodName: 'onComponentUpdate', modelName: 'MessageView' }); this.state = useState({ /** * Determine whether the message is hovered. When message is hovered diff --git a/addons/mail/static/src/components/message/message.xml b/addons/mail/static/src/components/message/message.xml index c8f511ba216..48253937e20 100644 --- a/addons/mail/static/src/components/message/message.xml +++ b/addons/mail/static/src/components/message/message.xml @@ -22,7 +22,7 @@
- +
@@ -131,7 +131,7 @@
- +
- +
diff --git a/addons/mail/static/src/components/message_action_list/message_action_list.js b/addons/mail/static/src/components/message_action_list/message_action_list.js index 3de13d43525..c892cef1caa 100644 --- a/addons/mail/static/src/components/message_action_list/message_action_list.js +++ b/addons/mail/static/src/components/message_action_list/message_action_list.js @@ -12,7 +12,7 @@ export class MessageActionList extends Component { */ setup() { super.setup(); - useRefToModel({ fieldName: 'actionReactionRef', modelName: 'MessageActionList', propNameAsRecordLocalId: 'messageActionListLocalId', refName: 'actionReaction' }); + useRefToModel({ fieldName: 'actionReactionRef', modelName: 'MessageActionList', refName: 'actionReaction' }); this.ADD_A_REACTION = this.env._t("Add a Reaction"); } @@ -20,15 +20,13 @@ export class MessageActionList extends Component { * @returns {MessageActionList} */ get messageActionList() { - return this.messaging && this.messaging.models['MessageActionList'].get(this.props.messageActionListLocalId); + return this.messaging && this.messaging.models['MessageActionList'].get(this.props.localId); } } Object.assign(MessageActionList, { - props: { - messageActionListLocalId: String, - }, + props: { localId: String }, template: "mail.MessageActionList", }); diff --git a/addons/mail/static/src/components/message_action_list/message_action_list.xml b/addons/mail/static/src/components/message_action_list/message_action_list.xml index 23a9784800a..524d8723a56 100644 --- a/addons/mail/static/src/components/message_action_list/message_action_list.xml +++ b/addons/mail/static/src/components/message_action_list/message_action_list.xml @@ -4,7 +4,7 @@
- + - +
diff --git a/addons/mail/static/src/components/message_author_prefix/message_author_prefix.js b/addons/mail/static/src/components/message_author_prefix/message_author_prefix.js index afc0945e4b7..6ba41518e02 100644 --- a/addons/mail/static/src/components/message_author_prefix/message_author_prefix.js +++ b/addons/mail/static/src/components/message_author_prefix/message_author_prefix.js @@ -6,10 +6,6 @@ const { Component } = owl; export class MessageAuthorPrefix extends Component { - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** * @returns {Message} */ diff --git a/addons/mail/static/src/components/message_reaction_group/message_reaction_group.js b/addons/mail/static/src/components/message_reaction_group/message_reaction_group.js index a2d90cf89e9..054d9fc0e10 100644 --- a/addons/mail/static/src/components/message_reaction_group/message_reaction_group.js +++ b/addons/mail/static/src/components/message_reaction_group/message_reaction_group.js @@ -6,15 +6,13 @@ import { registerMessagingComponent } from '@mail/utils/messaging_component'; export class MessageReactionGroup extends Component { get messageReactionGroup() { - return this.messaging.models['MessageReactionGroup'].get(this.props.messageReactionGroupLocalId); + return this.messaging.models['MessageReactionGroup'].get(this.props.localId); } } Object.assign(MessageReactionGroup, { - props: { - messageReactionGroupLocalId: String, - }, + props: { localId: String }, template: 'mail.MessageReactionGroup', }); diff --git a/addons/mail/static/src/components/messaging_menu/messaging_menu.xml b/addons/mail/static/src/components/messaging_menu/messaging_menu.xml index 6c19d088ceb..0c5bd5d9ca4 100644 --- a/addons/mail/static/src/components/messaging_menu/messaging_menu.xml +++ b/addons/mail/static/src/components/messaging_menu/messaging_menu.xml @@ -55,7 +55,7 @@
diff --git a/addons/mail/static/src/components/mobile_messaging_navbar/mobile_messaging_navbar.js b/addons/mail/static/src/components/mobile_messaging_navbar/mobile_messaging_navbar.js index fd9e5e4854d..da740484af2 100644 --- a/addons/mail/static/src/components/mobile_messaging_navbar/mobile_messaging_navbar.js +++ b/addons/mail/static/src/components/mobile_messaging_navbar/mobile_messaging_navbar.js @@ -10,15 +10,13 @@ export class MobileMessagingNavbar extends Component { * @returns {MobileMessagingNavbarView} */ get mobileMessagingNavbarView() { - return this.messaging && this.messaging.models['MobileMessagingNavbarView'].get(this.props.mobileMessagingNavbarViewLocalId); + return this.messaging && this.messaging.models['MobileMessagingNavbarView'].get(this.props.localId); } } Object.assign(MobileMessagingNavbar, { - props: { - mobileMessagingNavbarViewLocalId: String, - }, + props: { localId: String }, template: 'mail.MobileMessagingNavbar', }); diff --git a/addons/mail/static/src/components/notification_group/notification_group.js b/addons/mail/static/src/components/notification_group/notification_group.js index ab427799a77..0a16fa64dcd 100644 --- a/addons/mail/static/src/components/notification_group/notification_group.js +++ b/addons/mail/static/src/components/notification_group/notification_group.js @@ -73,9 +73,7 @@ export class NotificationGroup extends Component { } Object.assign(NotificationGroup, { - props: { - localId: String, - }, + props: { localId: String }, template: 'mail.NotificationGroup', }); diff --git a/addons/mail/static/src/components/notification_popover/notification_popover.js b/addons/mail/static/src/components/notification_popover/notification_popover.js index 517a233049d..b9cda34e071 100644 --- a/addons/mail/static/src/components/notification_popover/notification_popover.js +++ b/addons/mail/static/src/components/notification_popover/notification_popover.js @@ -16,9 +16,7 @@ export class NotificationPopover extends Component { } Object.assign(NotificationPopover, { - props: { - messageViewLocalId: String, - }, + props: { messageViewLocalId: String }, template: 'mail.NotificationPopover', }); diff --git a/addons/mail/static/src/components/popover_view/popover_view.js b/addons/mail/static/src/components/popover_view/popover_view.js index 86f035d5e8d..eca2381873f 100644 --- a/addons/mail/static/src/components/popover_view/popover_view.js +++ b/addons/mail/static/src/components/popover_view/popover_view.js @@ -14,7 +14,7 @@ export class PopoverView extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'PopoverView', propNameAsRecordLocalId: 'popoverViewLocalId' }); + useComponentToModel({ fieldName: 'component', modelName: 'PopoverView' }); usePosition( () => this.popoverView && this.popoverView.anchorRef && this.popoverView.anchorRef.el, { @@ -24,23 +24,17 @@ export class PopoverView extends Component { ); } - //-------------------------------------------------------------------------- - // Getters / Setters - //-------------------------------------------------------------------------- - /** * @returns {PopoverView|undefined} */ get popoverView() { - return this.messaging && this.messaging.models['PopoverView'].get(this.props.popoverViewLocalId); + return this.messaging && this.messaging.models['PopoverView'].get(this.props.localId); } } Object.assign(PopoverView, { - props: { - popoverViewLocalId: String, - }, + props: { localId: String }, template: 'mail.PopoverView', }); diff --git a/addons/mail/static/src/components/rtc_call_participant_card/rtc_call_participant_card.js b/addons/mail/static/src/components/rtc_call_participant_card/rtc_call_participant_card.js index ad63e31753c..695407153c2 100644 --- a/addons/mail/static/src/components/rtc_call_participant_card/rtc_call_participant_card.js +++ b/addons/mail/static/src/components/rtc_call_participant_card/rtc_call_participant_card.js @@ -23,7 +23,7 @@ export class RtcCallParticipantCard extends Component { * @returns {Thread|undefined} */ get callParticipantCard() { - return this.messaging.models['RtcCallParticipantCard'].get(this.props.callParticipantCardLocalId); + return this.messaging.models['RtcCallParticipantCard'].get(this.props.localId); } //-------------------------------------------------------------------------- @@ -47,11 +47,7 @@ export class RtcCallParticipantCard extends Component { } Object.assign(RtcCallParticipantCard, { - props: { - callParticipantCardLocalId: { - type: String, - }, - }, + props: { localId: String }, template: 'mail.RtcCallParticipantCard', }); diff --git a/addons/mail/static/src/components/rtc_call_viewer/rtc_call_viewer.js b/addons/mail/static/src/components/rtc_call_viewer/rtc_call_viewer.js index 7820a7ad8dd..ae60d9bab7d 100644 --- a/addons/mail/static/src/components/rtc_call_viewer/rtc_call_viewer.js +++ b/addons/mail/static/src/components/rtc_call_viewer/rtc_call_viewer.js @@ -129,9 +129,7 @@ export class RtcCallViewer extends Component { Object.assign(RtcCallViewer, { components, - props: { - localId: String, - }, + props: { localId: String }, template: 'mail.RtcCallViewer', }); diff --git a/addons/mail/static/src/components/rtc_call_viewer/rtc_call_viewer.xml b/addons/mail/static/src/components/rtc_call_viewer/rtc_call_viewer.xml index 337644b0a1d..32a19a75ef5 100644 --- a/addons/mail/static/src/components/rtc_call_viewer/rtc_call_viewer.xml +++ b/addons/mail/static/src/components/rtc_call_viewer/rtc_call_viewer.xml @@ -13,7 +13,7 @@
- +
@@ -32,7 +32,7 @@
diff --git a/addons/mail/static/src/components/rtc_controller/rtc_controller.js b/addons/mail/static/src/components/rtc_controller/rtc_controller.js index 67245f8bcda..0d1e70a95ef 100644 --- a/addons/mail/static/src/components/rtc_controller/rtc_controller.js +++ b/addons/mail/static/src/components/rtc_controller/rtc_controller.js @@ -6,10 +6,6 @@ const { Component } = owl; export class RtcController extends Component { - //-------------------------------------------------------------------------- - // Getters / Setters - //-------------------------------------------------------------------------- - /** * @returns {RtcController} */ @@ -20,11 +16,7 @@ export class RtcController extends Component { } Object.assign(RtcController, { - props: { - localId: { - type: String, - }, - }, + props: { localId: String }, template: 'mail.RtcController', }); diff --git a/addons/mail/static/src/components/rtc_invitation_card/rtc_invitation_card.js b/addons/mail/static/src/components/rtc_invitation_card/rtc_invitation_card.js index bd7664fac52..6dd7a34f949 100644 --- a/addons/mail/static/src/components/rtc_invitation_card/rtc_invitation_card.js +++ b/addons/mail/static/src/components/rtc_invitation_card/rtc_invitation_card.js @@ -55,9 +55,7 @@ export class RtcInvitationCard extends Component { } Object.assign(RtcInvitationCard, { - props: { - threadLocalId: String, - }, + props: { threadLocalId: String }, template: 'mail.RtcInvitationCard', }); diff --git a/addons/mail/static/src/components/rtc_layout_menu/rtc_layout_menu.js b/addons/mail/static/src/components/rtc_layout_menu/rtc_layout_menu.js index 26bc484a5db..7a06b0b0ac0 100644 --- a/addons/mail/static/src/components/rtc_layout_menu/rtc_layout_menu.js +++ b/addons/mail/static/src/components/rtc_layout_menu/rtc_layout_menu.js @@ -12,13 +12,9 @@ export class RtcLayoutMenu extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'RtcLayoutMenu', propNameAsRecordLocalId: 'localId' }); + useComponentToModel({ fieldName: 'component', modelName: 'RtcLayoutMenu' }); } - //-------------------------------------------------------------------------- - // Getters / Setters - //-------------------------------------------------------------------------- - /** * @returns {RtcLayoutMenu} */ @@ -29,9 +25,7 @@ export class RtcLayoutMenu extends Component { } Object.assign(RtcLayoutMenu, { - props: { - localId: String, - }, + props: { localId: String }, template: 'mail.RtcLayoutMenu', }); diff --git a/addons/mail/static/src/components/rtc_option_list/rtc_option_list.js b/addons/mail/static/src/components/rtc_option_list/rtc_option_list.js index b9fb52e5734..595d4c328c6 100644 --- a/addons/mail/static/src/components/rtc_option_list/rtc_option_list.js +++ b/addons/mail/static/src/components/rtc_option_list/rtc_option_list.js @@ -12,13 +12,9 @@ export class RtcOptionList extends Component { */ setup() { super.setup(); - useComponentToModel({ fieldName: 'component', modelName: 'RtcOptionList', propNameAsRecordLocalId: 'localId' }); + useComponentToModel({ fieldName: 'component', modelName: 'RtcOptionList' }); } - //-------------------------------------------------------------------------- - // Getters / Setters - //-------------------------------------------------------------------------- - /** * @returns {RtcOptionList} */ @@ -29,9 +25,7 @@ export class RtcOptionList extends Component { } Object.assign(RtcOptionList, { - props: { - localId: String, - }, + props: { localId: String }, template: 'mail.RtcOptionList', }); diff --git a/addons/mail/static/src/components/rtc_video/rtc_video.js b/addons/mail/static/src/components/rtc_video/rtc_video.js index 0f36001f3e3..af8e7cc1dad 100644 --- a/addons/mail/static/src/components/rtc_video/rtc_video.js +++ b/addons/mail/static/src/components/rtc_video/rtc_video.js @@ -4,7 +4,6 @@ import { registerMessagingComponent } from '@mail/utils/messaging_component'; import { useUpdate } from '@mail/component_hooks/use_update/use_update'; const { Component } = owl; -const { useRef } = owl.hooks; export class RtcVideo extends Component { @@ -80,11 +79,7 @@ export class RtcVideo extends Component { } Object.assign(RtcVideo, { - props: { - rtcSessionLocalId: { - type: String, - }, - }, + props: { rtcSessionLocalId: String }, template: 'mail.RtcVideo', }); diff --git a/addons/mail/static/src/components/thread_icon/thread_icon.js b/addons/mail/static/src/components/thread_icon/thread_icon.js index b4ea0c2d301..bfc24d887b1 100644 --- a/addons/mail/static/src/components/thread_icon/thread_icon.js +++ b/addons/mail/static/src/components/thread_icon/thread_icon.js @@ -6,10 +6,6 @@ const { Component } = owl; export class ThreadIcon extends Component { - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** * @returns {Thread} */ @@ -20,9 +16,7 @@ export class ThreadIcon extends Component { } Object.assign(ThreadIcon, { - props: { - threadLocalId: String, - }, + props: { threadLocalId: String }, template: 'mail.ThreadIcon', }); diff --git a/addons/mail/static/src/components/thread_textual_typing_status/thread_textual_typing_status.js b/addons/mail/static/src/components/thread_textual_typing_status/thread_textual_typing_status.js index c25801ea8f8..64e3806d9f4 100644 --- a/addons/mail/static/src/components/thread_textual_typing_status/thread_textual_typing_status.js +++ b/addons/mail/static/src/components/thread_textual_typing_status/thread_textual_typing_status.js @@ -6,10 +6,6 @@ const { Component } = owl; export class ThreadTextualTypingStatus extends Component { - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** * @returns {Thread} */ @@ -20,9 +16,7 @@ export class ThreadTextualTypingStatus extends Component { } Object.assign(ThreadTextualTypingStatus, { - props: { - threadLocalId: String, - }, + props: { threadLocalId: String }, template: 'mail.ThreadTextualTypingStatus', }); diff --git a/addons/mail/static/src/components/thread_view/thread_view.js b/addons/mail/static/src/components/thread_view/thread_view.js index b8db98c63df..b38e774698e 100644 --- a/addons/mail/static/src/components/thread_view/thread_view.js +++ b/addons/mail/static/src/components/thread_view/thread_view.js @@ -61,7 +61,7 @@ export class ThreadView extends Component { * @returns {ThreadView} */ get threadView() { - return this.messaging && this.messaging.models['ThreadView'].get(this.props.threadViewLocalId); + return this.messaging && this.messaging.models['ThreadView'].get(this.props.localId); } //-------------------------------------------------------------------------- @@ -128,13 +128,13 @@ Object.assign(ThreadView, { type: Boolean, optional: true, }, + localId: String, onFocusin: { type: Function, optional: true, }, showComposerAttachmentsExtensions: Boolean, showComposerAttachmentsFilenames: Boolean, - threadViewLocalId: String, }, template: 'mail.ThreadView', }); diff --git a/addons/mail/static/src/components/thread_view/thread_view.xml b/addons/mail/static/src/components/thread_view/thread_view.xml index 15f13bb47fe..14a1d6d6ea4 100644 --- a/addons/mail/static/src/components/thread_view/thread_view.xml +++ b/addons/mail/static/src/components/thread_view/thread_view.xml @@ -42,7 +42,7 @@ - + diff --git a/addons/mail/static/src/components/welcome_view/welcome_view.js b/addons/mail/static/src/components/welcome_view/welcome_view.js index 22d55ede779..220fb04e15a 100644 --- a/addons/mail/static/src/components/welcome_view/welcome_view.js +++ b/addons/mail/static/src/components/welcome_view/welcome_view.js @@ -11,8 +11,8 @@ export class WelcomeView extends owl.Component { */ setup() { super.setup(); - useRefToModel({ fieldName: 'guestNameInputRef', modelName: 'WelcomeView', propNameAsRecordLocalId: 'localId', refName: 'guestNameInput' }); - useUpdateToModel({ methodName: 'onComponentUpdate', modelName: 'WelcomeView', propNameAsRecordLocalId: 'localId' }); + useRefToModel({ fieldName: 'guestNameInputRef', modelName: 'WelcomeView', refName: 'guestNameInput' }); + useUpdateToModel({ methodName: 'onComponentUpdate', modelName: 'WelcomeView' }); } /** diff --git a/addons/mail/static/src/models/attachment_card/attachment_card.js b/addons/mail/static/src/models/attachment_card/attachment_card.js index 759e0853a61..fcdce7a75a6 100644 --- a/addons/mail/static/src/models/attachment_card/attachment_card.js +++ b/addons/mail/static/src/models/attachment_card/attachment_card.js @@ -10,8 +10,6 @@ registerModel({ recordMethods: { /** * Opens the attachment viewer when clicking on viewable attachment. - * - * @param {String} attachmentlistLocalId */ onClickImage() { if (!this.attachment || !this.attachment.isViewable) { diff --git a/addons/mail/static/src/models/attachment_image/attachment_image.js b/addons/mail/static/src/models/attachment_image/attachment_image.js index 9783fa447ac..fb38c96e77f 100644 --- a/addons/mail/static/src/models/attachment_image/attachment_image.js +++ b/addons/mail/static/src/models/attachment_image/attachment_image.js @@ -10,8 +10,6 @@ registerModel({ recordMethods: { /** * Opens the attachment viewer when clicking on viewable attachment. - * - * @param {String} attachmentlistLocalId */ onClickImage() { if (!this.attachment || !this.attachment.isViewable) { diff --git a/addons/mail/static/src/utils/test_utils.js b/addons/mail/static/src/utils/test_utils.js index 1e586f98e95..f1da903ee04 100644 --- a/addons/mail/static/src/utils/test_utils.js +++ b/addons/mail/static/src/utils/test_utils.js @@ -433,7 +433,7 @@ function getCreateComposerComponent({ components, env, modelManager, widget }) { }), }); await createRootMessagingComponent({ components, env }, "Composer", { - props: { composerViewLocalId: composerView.localId, ...props }, + props: { localId: composerView.localId, ...props }, target: widget.el, }); }; @@ -502,7 +502,7 @@ function getCreateThreadViewComponent({ afterEvent, components, env, widget }) { target = widget.el; } async function func() { - return createRootMessagingComponent({ components, env }, "ThreadView", { props: { threadViewLocalId: threadView.localId, ...otherProps }, target }); + return createRootMessagingComponent({ components, env }, "ThreadView", { props: { localId: threadView.localId, ...otherProps }, target }); } if (waitUntilMessagesLoaded) { await afterNextRender(() => afterEvent({