-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show current source document #1815
Conversation
66d16fc
to
84a90b3
Compare
@longhotsummer @goose-life We could simplify this to handle everything in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great to me as is, other than those javascript errors, which seem to be just a syntax issue?
but for context, I did see this working earlier — maybe a video would help as part of the PR? |
8ae9a08
to
ccd2751
Compare
@@ -61,11 +70,18 @@ | |||
choices = this.attachments.filter(function(att) { | |||
return self.mime_types[att.get('mime_type')]; | |||
}).map(function(att) { | |||
let url = att.get('view_url'); | |||
let default_choice; | |||
if (Object.keys(self.docx_mimetypes).includes(att.get('mime_type'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (Object.keys(self.docx_mimetypes).includes(att.get('mime_type'))) { | |
if (Object.keys(self.docx_mimetypes).includes(att.get('mime_type'))) { |
a755142
to
4680d06
Compare
'application/vnd.oasis.opendocument.text': true, | ||
'application/rtf' : true, | ||
'text/rtf': true, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@longhotsummer I'm happy to have this list here because I think the logic is more clear what we are doing. i.e we want the first document that is of these mimetypes only and nothing else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
if attachment.mime_type in DOC_MIMETYPES: | ||
return view_attachment_as_pdf(attachment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@longhotsummer Similar to the reasoning in the js, I think this logic describes our goals a bit better i.e we are interested in converting docx types only rather than putting everything through soffice.
DOC_MIMETYPES = [ | ||
"application/vnd.oasis.opendocument.text", | ||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", | ||
"application/msword", | ||
"application/rtf", | ||
"text/rtf", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@longhotsummer maybe this constant deserves a spot in docpipe itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
https://www.loom.com/share/d51ccc6882a742c5ae2bcb8f3b55334d?sid=26e9ecf0-da59-44c2-95fb-fd410f297719
Fixes #1786