[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:
+2
-4
@@ -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,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user