Commit c65af9a4 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #18927 TIME 1:30 send signed attachment after draft + show infos

parent 96195e97
......@@ -157,6 +157,17 @@ export class MailEditorComponent implements OnInit, OnDestroy {
this.setDefaultInfoFromResource();
}
for (let i = 0; i < this.emailAttachTool.attachments.list.length; i ++) {
await this.getSignedAttachment(this.emailAttachTool.attachments.list[i].id)
}
this.emailAttach.attachments.forEach((element: any, index: number) => {
const attach: any = this.emailAttachTool.attachments.list.find((item: any) => item.id === element.id || item.signedResponse === element.id);
this.emailAttach.attachments[index].format = attach.format;
this.emailAttach.attachments[index].size = attach.size;
});
this.initEmailModelsList();
}
......@@ -311,22 +322,6 @@ export class MailEditorComponent implements OnInit, OnDestroy {
});
await this.getAttachElements(false);
const attachIds: number[] = this.emailAttachTool.attachments.list.map((item: any) => item.id);
this.emailAttach.attachments.forEach(async (element: any, index: number) => {
await this.getSignedAttachment(element.id);
if (attachIds.indexOf(element.id) > -1) {
const attachment: any = this.emailAttachTool.attachments.list.find((item: any) => item.id === element.id);
this.emailAttach.attachments[index] = {
id: attachment.id,
format: attachment.format,
label: attachment.label,
original: attachment.original,
size: attachment.size,
signedResponse: this.signedAttachId
}
}
});
resolve(true);
}),
catchError((err) => {
......@@ -469,7 +464,7 @@ export class MailEditorComponent implements OnInit, OnDestroy {
if (type === 'document') {
return this.emailAttach.document.isLinked;
} else {
return this.emailAttach[type].filter((attach: any) => attach.id === item.id).length > 0;
return this.emailAttach[type].filter((attach: any) => attach.id === item.id || item.signedResponse === attach.id).length > 0;
}
}
......@@ -1064,6 +1059,11 @@ export class MailEditorComponent implements OnInit, OnDestroy {
tap((data: any) => {
if (!this.functions.empty(data.signedResponse)) {
this.signedAttachId = data.signedResponse;
this.emailAttachTool.attachments.list.find((item: any) => item.id === id).signedResponse = data.signedResponse;
const attach: any = this.emailAttach.attachments.find((item: any) => item.id === id)
if (attach !== undefined) {
this.emailAttach.attachments.find((item: any) => item.id === id).signedResponse = data.signedResponse;
}
} else {
this.signedAttachId = null;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment