Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
MaarchCourrier
Commits
28dd22b3
Commit
28dd22b3
authored
Dec 07, 2021
by
Hamza HRAMCHI
Browse files
FIX #18927 TIME 0:15 send resource with signed attachment if exists
parent
4a57db1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/frontend/plugins/mail-editor/mail-editor.component.ts
View file @
28dd22b3
...
...
@@ -104,6 +104,8 @@ export class MailEditorComponent implements OnInit, OnDestroy {
summarySheetUnits
:
any
=
[];
signedAttachId
:
number
=
null
;
constructor
(
public
http
:
HttpClient
,
public
translate
:
TranslateService
,
...
...
@@ -988,9 +990,14 @@ export class MailEditorComponent implements OnInit, OnDestroy {
};
}
openEmailAttach
(
type
:
string
,
attach
:
any
):
void
{
async
openEmailAttach
(
type
:
string
,
attach
:
any
):
Promise
<
void
>
{
this
.
signedAttachId
=
null
;
if
(
type
===
'
attachments
'
)
{
this
.
http
.
get
(
`../rest/attachments/
${
attach
.
id
}
/content?mode=base64`
).
pipe
(
if
(
attach
.
status
===
'
SIGN
'
)
{
this
.
signedAttachId
=
attach
.
id
;
await
this
.
getSignedAttachment
(
this
.
signedAttachId
);
}
this
.
http
.
get
(
`../rest/attachments/
${
this
.
signedAttachId
!==
null
?
this
.
signedAttachId
:
attach
.
id
}
/content?mode=base64`
).
pipe
(
tap
((
data
:
any
)
=>
{
this
.
dialog
.
open
(
DocumentViewerModalComponent
,
{
autoFocus
:
false
,
panelClass
:
'
maarch-full-height-modal
'
,
data
:
{
title
:
`
${
attach
.
label
}
`
,
base64
:
data
.
encodedDocument
,
filename
:
data
.
filename
}
});
}),
...
...
@@ -1030,4 +1037,20 @@ export class MailEditorComponent implements OnInit, OnDestroy {
return
'
%
'
+
(
'
00
'
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
);
}).
join
(
''
));
}
getSignedAttachment
(
id
:
number
)
{
this
.
signedAttachId
=
null
;
return
new
Promise
((
resolve
)
=>
{
this
.
http
.
get
(
`../rest/attachments/
${
id
}
`
).
pipe
(
tap
((
data
:
any
)
=>
{
this
.
signedAttachId
=
id
+
data
.
relation
;
resolve
(
true
);
}),
catchError
((
err
:
any
)
=>
{
this
.
notify
.
handleSoftErrors
(
err
);
return
of
(
false
);
})
).
subscribe
();
})
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment