diff --git a/addons/mail/__manifest__.py b/addons/mail/__manifest__.py index 838d99efc98..c65d02a5f0f 100644 --- a/addons/mail/__manifest__.py +++ b/addons/mail/__manifest__.py @@ -77,6 +77,9 @@ 'web/static/src/webclient/webclient.scss', 'web/static/src/webclient/webclient_extra.scss', 'web/static/src/core/utils/*.scss', + # depends on BS variables, can't be loaded in assets_primary or assets_secondary + 'mail/static/src/scss/variables/derived_variables.scss', + 'mail/static/src/scss/composer.scss', # Dependency of notification_group, notification_request, thread_needaction_preview and thread_preview 'mail/static/src/components/notification_list/notification_list_item.scss', 'mail/static/src/component_hooks/*.js', @@ -162,7 +165,6 @@ 'web.assets_qweb': [ 'mail/static/src/xml/*.xml', 'mail/static/src/components/*/*.xml', - 'mail/static/src/widgets/*/*.xml', ], }, 'license': 'LGPL-3', diff --git a/addons/mail/static/src/components/chatter/chatter.js b/addons/mail/static/src/components/chatter/chatter.js index ab6dc10fc54..c2bf0669c81 100644 --- a/addons/mail/static/src/components/chatter/chatter.js +++ b/addons/mail/static/src/components/chatter/chatter.js @@ -2,7 +2,6 @@ import { useComponentToModel } from '@mail/component_hooks/use_component_to_model'; import { useRefToModel } from '@mail/component_hooks/use_ref_to_model'; -import { useUpdate } from '@mail/component_hooks/use_update'; import { registerMessagingComponent } from '@mail/utils/messaging_component'; import { LegacyComponent } from '@web/legacy/legacy_component'; @@ -13,15 +12,10 @@ export class Chatter extends LegacyComponent { */ setup() { super.setup(); - useUpdate({ func: () => this._update() }); useComponentToModel({ fieldName: 'component' }); useRefToModel({ fieldName: 'scrollPanelRef', refName: 'scrollPanel' }); } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - /** * @returns {Chatter} */ @@ -29,26 +23,6 @@ export class Chatter extends LegacyComponent { return this.props.record; } - //-------------------------------------------------------------------------- - // Private - //-------------------------------------------------------------------------- - - /** - * @private - */ - _notifyRendered() { - this.trigger('o-chatter-rendered'); - } - - /** - * @private - */ - _update() { - if (this.chatter.thread) { - this._notifyRendered(); - } - } - } Object.assign(Chatter, { diff --git a/addons/mail/static/src/components/web_client_view_attachment_view/web_client_view_attachment_view.js b/addons/mail/static/src/components/web_client_view_attachment_view/web_client_view_attachment_view.js new file mode 100644 index 00000000000..4603b44602d --- /dev/null +++ b/addons/mail/static/src/components/web_client_view_attachment_view/web_client_view_attachment_view.js @@ -0,0 +1,32 @@ +/** @odoo-module **/ + +import { useComponentToModel } from '@mail/component_hooks/use_component_to_model'; +import { useRefToModel } from '@mail/component_hooks/use_ref_to_model'; +import { useUpdateToModel } from '@mail/component_hooks/use_update_to_model'; +import { registerMessagingComponent } from '@mail/utils/messaging_component'; + +import { LegacyComponent } from '@web/legacy/legacy_component'; + +export class WebClientViewAttachmentView extends LegacyComponent { + /** + * @override + */ + setup() { + useComponentToModel({ fieldName: 'component' }); + useRefToModel({ fieldName: 'iframeViewerPdfRef', refName: 'iframeViewerPdf' }); + useUpdateToModel({ methodName: 'onComponentUpdate' }); + } + /** + * @returns {WebClientViewAttachmentView} + */ + get webClientViewAttachmentView() { + return this.props.record; + } +} + +Object.assign(WebClientViewAttachmentView, { + props: { record: Object }, + template: 'mail.WebClientViewAttachmentView', +}); + +registerMessagingComponent(WebClientViewAttachmentView); diff --git a/addons/mail/static/src/widgets/attachment_viewer/attachment_viewer.scss b/addons/mail/static/src/components/web_client_view_attachment_view/web_client_view_attachment_view.scss similarity index 100% rename from addons/mail/static/src/widgets/attachment_viewer/attachment_viewer.scss rename to addons/mail/static/src/components/web_client_view_attachment_view/web_client_view_attachment_view.scss diff --git a/addons/mail/static/src/components/web_client_view_attachment_view/web_client_view_attachment_view.xml b/addons/mail/static/src/components/web_client_view_attachment_view/web_client_view_attachment_view.xml new file mode 100644 index 00000000000..ec45d724369 --- /dev/null +++ b/addons/mail/static/src/components/web_client_view_attachment_view/web_client_view_attachment_view.xml @@ -0,0 +1,24 @@ + + + + + + +

+
+
+ +
+