Skip to content
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

Get the images as images in the email notifications #350

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kaihendry
Copy link
Contributor

screen shot 2018-07-03 at 5 16 41 pm

@kaihendry kaihendry requested a review from nbiton July 3, 2018 09:17

function linkAttachment (message) {
const msgParts = message.split(' ')
if (msgParts.length > 1 && msgParts[0] === '[!attachment]') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use https://github.com/unee-t/frontend/blob/master/imports/util/matchers.js#L3 instead of writing this check on you own

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't actually understand your code. attachmentTextMatcher is a test to see if it's off that type? Never seen a base64 type.

And then there is still the bit where the second part if properly checked since it can be truncated and put into a template, unlike here:

https://github.com/kaihendry/frontend/blob/f66e4f42373df558aba48ae577d178d45ec470b8/imports/ui/case/case-details.jsx#L384

Copy link
Contributor

@nbiton nbiton Jul 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base64 type is for attachments while they're being uploaded...
I brought this up because you just shouldn't reinvent the matching and parsing of the attachment url IMO.
The second part? You mean checking for a file extension that matches an image?
We should have only image type attachments for now, but if you think this improves the robustness of the check, I think you should still use attachmentTextMatcher but modify it so other places in the code can benefit from it as well 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, will re-try tomorrow.

@franck-boullier
Copy link
Member

@kaihendry what's missing so we can merge this?

@kaihendry
Copy link
Contributor Author

@nbiton approval since the attachment markup is not properly defined.

@franck-boullier franck-boullier changed the title Fix https://github.com/unee-t/frontend/issues/342 Get the images as images in the email notifications Nov 2, 2018
@kaihendry
Copy link
Contributor Author

Issue is legacy support for the defns with carriage return. Will it work?

@kaihendry kaihendry self-assigned this Nov 2, 2018
@kaihendry
Copy link
Contributor Author

Struggling to test this locally, so please don't merge quite yet.

@franck-boullier
Copy link
Member

@kaihendry any idea on what's missing so we can merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants