[IMP] mail: uniformize components localId prop

task-2732017

closes odoo/odoo#82699

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Sébastien Theys
2022-01-13 13:40:42 +00:00
parent 45cc8fa5a1
commit b532db523d
77 changed files with 147 additions and 293 deletions
@@ -6,7 +6,7 @@
<t t-if="categoryLivechat and categoryLivechat.categoryItems.length">
<DiscussSidebarCategory
className="'o_DiscussSidebar_category o_DiscussSidebar_categoryLivechat'"
categoryLocalId="categoryLivechat.localId"
localId="categoryLivechat.localId"
/>
</t>
</xpath>
@@ -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() });
}
@@ -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() });
}
@@ -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]();
}
@@ -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',
});
@@ -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',
});
@@ -34,7 +34,7 @@
<t t-if="activityBoxView.isActivityListVisible">
<div class="o_ActivityBox_activityList">
<t t-foreach="activityBoxView.activityViews" t-as="activityView" t-key="activityView.localId">
<Activity className="'o_ActivityBox_activity'" activityViewLocalId="activityView.localId"/>
<Activity className="'o_ActivityBox_activity'" localId="activityView.localId"/>
</t>
</div>
</t>
@@ -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',
});
@@ -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',
});
@@ -21,7 +21,7 @@
<t t-if="attachmentBoxView.chatter.attachmentList">
<AttachmentList
className="'o_attachmentBox_attachmentList'"
attachmentListLocalId="attachmentBoxView.chatter.attachmentList.localId"
localId="attachmentBoxView.chatter.attachmentList.localId"
onAttachmentRemoved="attachmentBoxView.onAttachmentRemoved"
/>
</t>
@@ -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", {
@@ -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,
@@ -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,
})
});
}
}
@@ -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,
@@ -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,
@@ -6,12 +6,12 @@
<t t-if="attachmentList">
<div class="o_AttachmentList_partialList o_AttachmentList_partialListImages">
<t t-foreach="attachmentList.attachmentImages" t-as="attachmentImage" t-key="attachmentImage.localId">
<AttachmentImage className="'o_AttachmentList_attachment'" attachmentImageLocalId="attachmentImage.localId" onAttachmentRemoved="props.onAttachmentRemoved"/>
<AttachmentImage className="'o_AttachmentList_attachment'" localId="attachmentImage.localId" onAttachmentRemoved="props.onAttachmentRemoved"/>
</t>
</div>
<div class="o_AttachmentList_partialList o_AttachmentList_partialListNonImages">
<t t-foreach="attachmentList.attachmentCards" t-as="attachmentCard" t-key="attachmentCard.localId">
<AttachmentCard className="'o_AttachmentList_attachment'" attachmentCardLocalId="attachmentCard.localId" onAttachmentRemoved="props.onAttachmentRemoved"/>
<AttachmentCard className="'o_AttachmentList_attachment'" localId="attachmentCard.localId" onAttachmentRemoved="props.onAttachmentRemoved"/>
</t>
</div>
</t>
@@ -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',
});
@@ -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',
});
@@ -16,9 +16,7 @@ export class ChannelMemberList extends Component {
}
Object.assign(ChannelMemberList, {
props: {
channelLocalId: String,
},
props: { channelLocalId: String },
template: 'mail.ChannelMemberList',
});
@@ -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,
@@ -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"
/>
@@ -10,7 +10,7 @@
</t>
<t t-foreach="messaging.chatWindowManager.allOrderedVisible" t-as="chatWindow" t-key="chatWindow.localId">
<ChatWindow
chatWindowLocalId="chatWindow.localId"
localId="chatWindow.localId"
hasCloseAsBackButton="messaging.device.isMobile"
isExpandable="!messaging.device.isMobile and !!chatWindow.thread"
isFullscreen="messaging.device.isMobile"
@@ -16,8 +16,8 @@ export class Chatter extends Component {
setup() {
super.setup();
useUpdate({ func: () => 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',
});
@@ -13,7 +13,7 @@
<Composer
className="'o_Chatter_composer'"
classNameObj="{ 'o-bordered': chatter.hasExternalBorder }"
composerViewLocalId="chatter.composerView.localId"
localId="chatter.composerView.localId"
hasFollowers="true"
hasMentionSuggestionsBelowPosition="true"
isCompact="false"
@@ -25,13 +25,13 @@
<t t-if="chatter.attachmentBoxView">
<AttachmentBox
className="'o_Chatter_attachmentBox'"
attachmentBoxViewLocalId="chatter.attachmentBoxView.localId"
localId="chatter.attachmentBoxView.localId"
/>
</t>
<t t-if="chatter.activityBoxView">
<ActivityBox
className="'o_Chatter_activityBox'"
activityBoxViewLocalId="chatter.activityBoxView.localId"
localId="chatter.activityBoxView.localId"
/>
</t>
<t t-if="chatter.threadView">
@@ -39,7 +39,7 @@
className="'o_Chatter_thread'"
getScrollableElement="getScrollableElement"
hasScrollAdjust="chatter.hasMessageListScrollAdjust"
threadViewLocalId="chatter.threadView.localId"
localId="chatter.threadView.localId"
t-ref="thread"
/>
</t>
@@ -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,
@@ -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,
@@ -4,7 +4,7 @@
<t t-name="mail.ChatterContainer" owl="1">
<div class="o_ChatterContainer" t-attf-class="{{ className }}" data-command-category="mail" t-ref="root">
<t t-if="chatter">
<Chatter chatterLocalId="chatter.localId"/>
<Chatter localId="chatter.localId"/>
</t>
<t t-else="">
<div class="o_ChatterContainer_noChatter"><i class="o_ChatterContainer_noChatterIcon fa fa-circle-o-notch fa-spin"/>Please wait...</div>
@@ -16,9 +16,7 @@ export class ChatterTopbar extends Component {
}
Object.assign(ChatterTopbar, {
props: {
chatterLocalId: String,
},
props: { chatterLocalId: String },
template: 'mail.ChatterTopbar',
});
@@ -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,
@@ -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 @@
>
<i class="fa fa-smile-o"/>
</button>
<PopoverView t-if="composerView.emojisPopoverView" popoverViewLocalId="composerView.emojisPopoverView.localId"/>
<PopoverView t-if="composerView.emojisPopoverView" localId="composerView.emojisPopoverView.localId"/>
<button class="o_Composer_button o_Composer_buttonAttachment o_Composer_toolButton btn btn-light fa fa-paperclip" t-att-class="{ 'o-mobile': messaging.device.isMobile }" title="Add attachment" type="button" t-on-click="_onClickAddAttachment"/>
</div>
<t t-if="props.isExpandable">
@@ -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"
/>
<t t-if="!props.isCompact">
<t t-call="mail.Composer.actionButtons"/>
@@ -49,9 +49,7 @@ export class ComposerSuggestedRecipientList extends Component {
}
Object.assign(ComposerSuggestedRecipientList, {
props: {
threadLocalId: String,
},
props: { threadLocalId: String },
template: 'mail.ComposerSuggestedRecipientList',
});
@@ -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: {
@@ -6,7 +6,7 @@
<t t-if="composerView">
<t t-if="composerView.hasSuggestions">
<ComposerSuggestionList
composerViewLocalId="props.composerViewLocalId"
composerViewLocalId="composerView.localId"
isBelow="props.hasMentionSuggestionsBelowPosition"
/>
</t>
@@ -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',
});
@@ -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',
});
@@ -7,7 +7,7 @@
<t t-foreach="messaging.dialogManager.dialogs" t-as="dialog" t-key="dialog.localId">
<Dialog
className="'o_DialogManager_dialog'"
dialogLocalId="dialog.localId"
localId="dialog.localId"
/>
</t>
</t>
@@ -52,7 +52,7 @@
hasComposerDiscardButton="discuss.thread === messaging.inbox"
hasComposerThreadName="discuss.thread === messaging.inbox"
hasComposerThreadTyping="true"
threadViewLocalId="discuss.threadView.localId"
localId="discuss.threadView.localId"
/>
</t>
<t t-if="!discuss.thread and (!messaging.device.isMobile or discuss.activeMobileNavbarTabId === 'mailbox')">
@@ -78,7 +78,7 @@
<t t-if="discuss.mobileMessagingNavbarView">
<MobileMessagingNavbar
className="'o_Discuss_mobileNavbar'"
mobileMessagingNavbarViewLocalId="discuss.mobileMessagingNavbarView.localId"
localId="discuss.mobileMessagingNavbarView.localId"
/>
</t>
</t>
@@ -5,7 +5,7 @@
<t t-if="discussPublicView">
<ThreadView t-if="discussPublicView.threadView"
hasComposerThreadTyping="true"
threadViewLocalId="discussPublicView.threadView.localId"
localId="discussPublicView.threadView.localId"
/>
<WelcomeView t-if="discussPublicView.welcomeView"
localId="discussPublicView.welcomeView.localId"
@@ -64,9 +64,7 @@ export class DiscussSidebar extends Component {
}
Object.assign(DiscussSidebar, {
props: {
localId: String
},
props: { localId: String },
template: 'mail.DiscussSidebar',
});
@@ -20,12 +20,12 @@
</t>
<DiscussSidebarCategory
className="'o_DiscussSidebar_category o_DiscussSidebar_categoryChannel'"
categoryLocalId="discuss.categoryChannel.localId"
localId="discuss.categoryChannel.localId"
/>
<t name="beforeCategoryChat"/>
<DiscussSidebarCategory
className="'o_DiscussSidebar_category o_DiscussSidebar_categoryChat'"
categoryLocalId="discuss.categoryChat.localId"
localId="discuss.categoryChat.localId"
/>
</div>
</t>
@@ -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',
});
@@ -42,14 +42,14 @@
<t t-foreach="category.filteredCategoryItems" t-as="item" t-key="item.localId">
<DiscussSidebarCategoryItem
className="'o_DiscussSidebarCategory_item'"
categoryItemLocalId="item.localId"
localId="item.localId"
/>
</t>
</t>
<t t-if="!category.isOpen and category.activeItem">
<DiscussSidebarCategoryItem
className="'o_DiscussSidebarCategory_item'"
categoryItemLocalId="category.activeItem.localId"
localId="category.activeItem.localId"
/>
</t>
</div>
@@ -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',
});
@@ -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',
});
@@ -53,9 +53,7 @@ export class EmojiList extends Component {
}
Object.assign(EmojiList, {
props: {
localId: String,
},
props: { localId: String },
template: 'mail.EmojiList',
});
@@ -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);
}
@@ -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',
});
@@ -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' });
}
/**
@@ -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
@@ -22,7 +22,7 @@
<t t-if="messageView" name="rootCondition">
<MessageInReplyToView t-if="messageView.messageInReplyToView" messageInReplyToViewLocalId="messageView.messageInReplyToView.localId"/>
<div t-if="isActive and messageView.messageActionList" class="o_Message_actionListContainer pl-5 pr-3" t-att-class="{ 'o-squashed': messageView.isSquashed }">
<MessageActionList messageActionListLocalId="messageView.messageActionList.localId"/>
<MessageActionList localId="messageView.messageActionList.localId"/>
</div>
<div class="d-flex flex-shrink-0">
<div class="o_Message_highlightIndicator" t-att-class="{ 'o-active': messageView.message.isHighlighted or messageView.isHighlighted }"/>
@@ -131,7 +131,7 @@
<t t-if="messageView.composerViewInEditing">
<Composer
className="'o_Message_composer mb-1'"
composerViewLocalId="messageView.composerViewInEditing.localId"
localId="messageView.composerViewInEditing.localId"
hasCurrentPartnerAvatar="false"
hasDiscardButton="false"
hasMentionSuggestionsBelowPosition="false"
@@ -161,10 +161,10 @@
</ul>
</t>
</div>
<AttachmentList t-if="messageView.attachmentList" attachmentListLocalId="messageView.attachmentList.localId"/>
<AttachmentList t-if="messageView.attachmentList" localId="messageView.attachmentList.localId"/>
<div t-if="messageView.message.messageReactionGroups.length > 0" class="d-flex flex-wrap ml-2">
<t t-foreach="messageView.message.messageReactionGroups" t-as="messageReactionGroup" t-key="messageReactionGroup.localId">
<MessageReactionGroup className="'mr-1 mb-1'" messageReactionGroupLocalId="messageReactionGroup.localId"/>
<MessageReactionGroup className="'mr-1 mb-1'" localId="messageReactionGroup.localId"/>
</t>
</div>
</div>
@@ -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",
});
@@ -4,7 +4,7 @@
<div class="o_MessageActionList d-flex" t-attf-class="{{ className }}" t-on-click="messageActionList and messageActionList.onClick" t-ref="root">
<t t-if="messageActionList">
<i t-if="messageActionList.message.hasReactionIcon" class="o_MessageActionList_action o_MessageActionList_actionReaction p-2 fa fa-lg fa-smile-o" t-att-title="ADD_A_REACTION" t-on-click="messageActionList.onClickActionReaction" t-ref="actionReaction"/>
<PopoverView t-if="messageActionList.reactionPopoverView" popoverViewLocalId="messageActionList.reactionPopoverView.localId"/>
<PopoverView t-if="messageActionList.reactionPopoverView" localId="messageActionList.reactionPopoverView.localId"/>
<span t-if="messageActionList.message.canStarBeToggled" class="o_MessageActionList_action o_MessageActionList_actionStar p-2" t-att-class="{
'o_MessageActionList_actionStar_active': messageActionList.message.isStarred,
'fa fa-lg fa-star': messageActionList.message.isStarred,
@@ -14,7 +14,7 @@
<span t-if="messageActionList.hasMarkAsReadIcon" class="o_MessageActionList_action o_MessageActionList_actionMarkRead p-2 fa fa-lg fa-check" title="Mark as Read" t-on-click="messageActionList.onClickMarkAsRead"/>
<span t-if="messageActionList.message.canBeDeleted" class="o_MessageActionList_action o_MessageActionList_actionEdit p-2 fa fa-lg fa-pencil" title="Edit" t-on-click="messageActionList.onClickEdit"/>
<span t-if="messageActionList.message.canBeDeleted" class="o_MessageActionList_action o_MessageActionList_actionDelete p-2 fa fa-lg fa-trash" title="Delete" t-on-click="messageActionList.onClickDelete"/>
<DeleteMessageConfirmDialog t-if="messageActionList.showDeleteConfirm" messageActionListLocalId="messageActionList.localId"/>
<DeleteMessageConfirmDialog t-if="messageActionList.showDeleteConfirm" localId="messageActionList.localId"/>
</t>
</div>
</t>
@@ -6,10 +6,6 @@ const { Component } = owl;
export class MessageAuthorPrefix extends Component {
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
/**
* @returns {Message}
*/
@@ -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',
});
@@ -55,7 +55,7 @@
<t t-if="messagingMenu.mobileMessagingNavbarView">
<MobileMessagingNavbar
className="'o_MessagingMenu_mobileNavbar'"
mobileMessagingNavbarViewLocalId="messagingMenu.mobileMessagingNavbarView.localId"
localId="messagingMenu.mobileMessagingNavbarView.localId"
/>
</t>
</t>
@@ -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',
});
@@ -73,9 +73,7 @@ export class NotificationGroup extends Component {
}
Object.assign(NotificationGroup, {
props: {
localId: String,
},
props: { localId: String },
template: 'mail.NotificationGroup',
});
@@ -16,9 +16,7 @@ export class NotificationPopover extends Component {
}
Object.assign(NotificationPopover, {
props: {
messageViewLocalId: String,
},
props: { messageViewLocalId: String },
template: 'mail.NotificationPopover',
});
@@ -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',
});
@@ -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',
});
@@ -129,9 +129,7 @@ export class RtcCallViewer extends Component {
Object.assign(RtcCallViewer, {
components,
props: {
localId: String,
},
props: { localId: String },
template: 'mail.RtcCallViewer',
});
@@ -13,7 +13,7 @@
<t t-if="rtcCallViewer.layout !== 'tiled'">
<div class="o_RtcCallViewer_mainParticipantContainer justify-content-center mw-100 mh-100">
<t t-if="rtcCallViewer.mainParticipantCard">
<RtcCallParticipantCard className="'o_RtcCallViewer_participantCard w-100'" callParticipantCardLocalId="rtcCallViewer.mainParticipantCard.localId"/>
<RtcCallParticipantCard className="'o_RtcCallViewer_participantCard w-100'" localId="rtcCallViewer.mainParticipantCard.localId"/>
</t>
</div>
</t>
@@ -32,7 +32,7 @@
<!-- maybe filter focused partner out? -->
<RtcCallParticipantCard
className="'o_RtcCallViewer_participantCard o_RtcCallViewer_gridTile'"
callParticipantCardLocalId="participantCard.localId"
localId="participantCard.localId"
/>
</t>
</t>
@@ -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',
});
@@ -55,9 +55,7 @@ export class RtcInvitationCard extends Component {
}
Object.assign(RtcInvitationCard, {
props: {
threadLocalId: String,
},
props: { threadLocalId: String },
template: 'mail.RtcInvitationCard',
});
@@ -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',
});
@@ -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',
});
@@ -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',
});
@@ -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',
});
@@ -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',
});
@@ -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',
});
@@ -42,7 +42,7 @@
<t t-if="threadView.composerView">
<Composer
className="'o_ThreadView_composer'"
composerViewLocalId="threadView.composerView.localId"
localId="threadView.composerView.localId"
hasCurrentPartnerAvatar="props.hasComposerCurrentPartnerAvatar"
hasDiscardButton="props.hasComposerDiscardButton"
hasSendButton="props.hasComposerSendButton"
@@ -13,11 +13,11 @@ export class ThreadViewTopbar extends Component {
*/
setup() {
super.setup();
useRefToModel({ fieldName: 'guestNameInputRef', modelName: 'ThreadViewTopbar', propNameAsRecordLocalId: 'localId', refName: 'guestNameInput' });
useRefToModel({ fieldName: 'inviteButtonRef', modelName: 'ThreadViewTopbar', propNameAsRecordLocalId: 'localId', refName: 'inviteButton' });
useRefToModel({ fieldName: 'threadNameInputRef', modelName: 'ThreadViewTopbar', propNameAsRecordLocalId: 'localId', refName: 'threadNameInput' });
useRefToModel({ fieldName: 'threadDescriptionInputRef', modelName: 'ThreadViewTopbar', propNameAsRecordLocalId: 'localId', refName: 'threadDescriptionInput' });
useUpdateToModel({ methodName: 'onComponentUpdate', modelName: 'ThreadViewTopbar', propNameAsRecordLocalId: 'localId' });
useRefToModel({ fieldName: 'guestNameInputRef', modelName: 'ThreadViewTopbar', refName: 'guestNameInput' });
useRefToModel({ fieldName: 'inviteButtonRef', modelName: 'ThreadViewTopbar', refName: 'inviteButton' });
useRefToModel({ fieldName: 'threadNameInputRef', modelName: 'ThreadViewTopbar', refName: 'threadNameInput' });
useRefToModel({ fieldName: 'threadDescriptionInputRef', modelName: 'ThreadViewTopbar', refName: 'threadDescriptionInput' });
useUpdateToModel({ methodName: 'onComponentUpdate', modelName: 'ThreadViewTopbar' });
}
//--------------------------------------------------------------------------
@@ -62,9 +62,7 @@ export class ThreadViewTopbar extends Component {
}
Object.assign(ThreadViewTopbar, {
props: {
localId: String,
},
props: { localId: String },
template: 'mail.ThreadViewTopbar',
});
@@ -62,7 +62,7 @@
<i class="fa fa-lg fa-user-plus"/>
</button>
<t t-if="threadViewTopbar.invitePopoverView">
<PopoverView className="'o_ThreadViewTopbar_invitePopoverView'" popoverViewLocalId="threadViewTopbar.invitePopoverView.localId"/>
<PopoverView className="'o_ThreadViewTopbar_invitePopoverView'" localId="threadViewTopbar.invitePopoverView.localId"/>
</t>
</t>
<!-- FIXME: guests should be able to see members but there currently is no route for it, so hide it for now -->
@@ -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' });
}
/**
@@ -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) {
@@ -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) {
+2 -2
View File
@@ -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({