[IMP] mail: convert LegacyComponent webClientViewAttachmentView

Since
https://github.com/odoo/enterprise/commit/afcdd1878a2eaf4cbca85d1169dea31a108c8c43#diff-f064a21c91b8daa5d78c44e88e2c02345ff0a7230403dd3600a65d3a6b0653d3L18
there is no listener for preview_attachment_validation.

Part of task-2783065

closes odoo/odoo#102406

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Didier (did)
2022-10-06 18:01:29 +02:00
parent 9b891b6bb2
commit f54c392111
2 changed files with 2 additions and 6 deletions
@@ -1,18 +1,16 @@
/** @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';
const { Component } = owl;
export class WebClientViewAttachmentView extends LegacyComponent {
export class WebClientViewAttachmentView extends Component {
/**
* @override
*/
setup() {
useComponentToModel({ fieldName: 'component' });
useRefToModel({ fieldName: 'iframeViewerPdfRef', refName: 'iframeViewerPdf' });
useUpdateToModel({ methodName: 'onComponentUpdate' });
}
@@ -28,7 +28,6 @@ registerModel({
if (this.iframeViewerPdfRef.el) {
hidePDFJSButtons(this.iframeViewerPdfRef.el);
}
this.component.trigger('preview_attachment_validation');
},
async setMainAttachmentFromIndex(index) {
await this.thread.setMainAttachment(this.thread.attachmentsInWebClientView[index]);
@@ -48,7 +47,6 @@ registerModel({
},
},
fields: {
component: attr(),
id: attr({
identifying: true,
}),