-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
incoming email parsing feature for gmail and yahoo #2933
Conversation
Generated by 🚫 Danger |
@@ -0,0 +1,5 @@ | |||
class AddColumnReplyToContentInComment < ActiveRecord::Migration[5.1] | |||
def change | |||
add_column :comments, :extra_content, :text |
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.
Could we just keep it in the regular comment body, but use a filter to remove it upon sending a notification email, and use JavaScript to hide it in the HTML views? Just wondering if we can solve this without a db change and the maintenance that may come with?
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.
I was thinking, it will become complex if we try to fit both the content into one attribute..of course we can use filter but i was thinking that both the forms will have some maintenance but i am happy doing either ways....what do you think?
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.
@jywarren any thoughts?
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.
I guess I think we might use the render
methods to offer a "full" or "trimmed" display for use in different places, and filter on display rather than filter on save. The filter could be like:
comment.filter_body(:gmail)
# vs
comment.body
maybe?
How's this coming along, Naman? Maybe we could get an early version published today? |
Yeah sure! |
Okay sure! I will implement this way!!!
…On Jun 30, 2018 1:34 AM, "Jeffrey Warren" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In db/migrate/20180627060150_add_column_reply_to_content_in_comment.rb
<#2933 (comment)>:
> @@ -0,0 +1,5 @@
+class AddColumnReplyToContentInComment < ActiveRecord::Migration[5.1]
+ def change
+ add_column :comments, :extra_content, :text
I guess I think we might use the render methods to offer a "full" or
"trimmed" display for use in different places, and filter on display rather
than filter on save. The filter could be like:
comment.filter_body(:gmail)# vs
comment.body
maybe?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2933 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ATwCYUu8FaVixQPwmh4jxeVu1OEsjzbtks5uBohjgaJpZM4U6TaS>
.
|
Hey @jywarren, is this good now? |
Hi @namangupta01 -- i think there are a few recommendations from CodeClimate that you could integrate -- not every one, but see if there are some you could resolve in code and the rest we can "accept". Exciting, thanks! |
Yeah sure! I will fix them. Btw i was asking about the current implementation. |
app/models/comment.rb
Outdated
@@ -13,6 +13,9 @@ class Comment < ApplicationRecord | |||
self.table_name = 'comments' | |||
self.primary_key = 'cid' | |||
|
|||
COMMENT_FILTER = "\n@@$$%% Trimmed Content @@$$%%\n" |
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.
Interesting and clever! What about putting it into an HTML comment as well - like <!-- $$%% TRIMMED CONTENT %%$$ -->
so that it can be parsed out with an HTML filter if need be? I dunno, just seems potentially extra helpful in the future...
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.
This way would be great. Putting this in html comment didn't come to my mind. 👍 🎉
Awesome, this looks good! Did you want to perhaps include sample reply emails from diff. services in tests, and confirm they get stripped properly? This will also have the added benefit that if email vendors change their formats, we can compare to the test examples to update the solution. Great work! Staff were VERY excited to hear about this feature -- open mouthed! 😮 |
Yes, i was already planning to do these and some more testing if we can find a way to test them in another pr. |
OK - do you want to merge this first then add tests in another PR? I think it can be very good to have tests be in the same PR so there's a relationship between the feature and the test that confirms it... what do you think? |
Even just adding some basic tests of this -- they can be expanded later! |
Yeah no problem...i will add tests in this pr for email parsing.
…On Tue, Jul 3, 2018 at 3:31 AM Jeffrey Warren ***@***.***> wrote:
Even just adding some basic tests of this -- they can be expanded later!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2933 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATwCYagMleJXXb1Dus77Ij5gkee6hxXGks5uCpgrgaJpZM4U6TaS>
.
|
oooooooooohhhhhhhh 👍 👍 👍 fantastic!! |
I think this may need to be rebased following @Souravirus upgrade to Rails 5.2 -- @Souravirus what do you think? |
@jywarren All test are failing on local. I am using |
Got it...never mind |
@jywarren I have added the test... can you please have a look so that i can finalize it? |
@jywarren Is it good now? |
Also added readme for google and yahoo parsing. |
Awesome. Fantastic work!!! |
And congrats on this -- very well implemented! Let's keep an eye out as it goes live since it's rather complex, and we can patch anything that comes up. Thanks! |
Yeah sure and we will also expand this feature for all email services. |
* Added reply to content field in comment table * Added incoming email parsing feature for gmail and yahooo * Added incoming email parsing feature for gmail and yahooo * Minor changes * Removed column * Added filter in comment * Added mail filter in mails * Minor changes * Fixes codeclimate issues * Modified COMMENT_FILTER * Added test for parsing gmail and yahoo * Added detail readme for yahoo and gmail parsing
* Added remaining unit tests for publiclab#2933 * Minor change * Indentation changed * Added tests and moved emails to fixtures * Added tests and moved emails to fixtures
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
fixes #0000
-style reference to original issue #@publiclab/reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.
Thanks!