Commit Graph

98 Commits

Author SHA1 Message Date
Steven Burnett e7b4a339b3 fix error handling with notifications sqs queue
fixes CNVS-25481

Test-Plan:
- change the sqs queue in a way to cause a failure.  Notice
  message object reports as such and error is logged

Change-Id: I5ac0b9ac720b41546aa605e835b3badcfbbd17fa
Reviewed-on: https://gerrit.instructure.com/70262
Reviewed-by: Alex Boyd <aboyd@instructure.com>
Tested-by: Jenkins
Product-Review: Gentry Beckmann <gbeckmann@instructure.com>
QA-Review: Gentry Beckmann <gbeckmann@instructure.com>
2016-01-18 23:41:01 +00:00
Cody Cutrer 43c561d2d3 rip out more polymorphic shims
Change-Id: Ie93eb06d746aa2f6968b0e29e1d22dfb2242c12f
Reviewed-on: https://gerrit.instructure.com/69683
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-01-11 17:40:03 +00:00
Rob Orton 1ab5012f0b validate message data to prevent db errors
fixes CNVS-21253

test plan
 - specs should pass

Change-Id: Ie35bf34ed1f954404b86ca7048e8631b23965d67
Reviewed-on: https://gerrit.instructure.com/69156
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2015-12-18 23:48:05 +00:00
Simon Williams 922b188051 improve wording around links in plain text message templates
prefer wording like "clicking this link: %{link}" over "clicking the
link below" or "clicking the following link"

fixes CNVS-24646

test plan:
- verify that the following notifications work when delivered as plain
  text (not html) email:
    added_to_conversation
    announcement_reply
    conversation_created
    conversation_message
    group_membership_accepted
    group_membership_rejected
    new_context_group_membership
    new_context_group_membership_invitation
    new_discussion_entry
    new_student_organized_group
    peer_review_invitation
    submission_comment
    submission_comment_for_teacher
- also verify that peer_review_invivataion works when delivered as an
  sms or in a summary email (again plain text)

Change-Id: I6d36f797de3a3162fa27a4ce3f7cc423a85e3ff7
Reviewed-on: https://gerrit.instructure.com/66079
Tested-by: Jenkins
QA-Review: Adrian Russell <arussell@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Allison Weiss <allison@instructure.com>
2015-12-18 20:28:30 +00:00
Andrew Butterfield 372b823b73 Default to root account time zone if user time zone is nil
fixes CNVS-22991

Test plan:
* Follow steps to reproduce in ticket
* Ensure that when a user has a nil time zone the notification time
  defaults to the root accounts time zone

Change-Id: I6a0bf368939fbed08542045233778cb8bcdf3109
Reviewed-on: https://gerrit.instructure.com/67864
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins
QA-Review: Adrian Russell <arussell@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2015-12-02 22:09:49 +00:00
Steven Burnett 526523d32d add feature flag and config for notification service
fixes CNVS-24729

Test Plan:
- start canvas
- turn on feature flag at course level
- run `bundle exec script/delayed_job run` to start delayed jobs
- generate any notification
- notice it is processed by the service

Change-Id: I6b4258128c7ce815ec3dcd1fec5aca8771fb75ee
Reviewed-on: https://gerrit.instructure.com/67614
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Gentry Beckmann <gbeckmann@instructure.com>
Tested-by: Jenkins
Product-Review: Steven Burnett <sburnett@instructure.com>
2015-12-01 20:14:24 +00:00
Alex Boyd 17fd70a35f Try to send messages from the recipient's country
Fixes CNVS-24733

Test plan:
 - Set up config/twilio.yml
 - Ensure that your Twilio account owns phone numbers in the U.S.
   and phone numbers in at least one other country
 - Enable both the "International SMS" and "International SMS -
   Send from Recipient's Country" feature flags on the account
   you'll be working with
 - Add a phone number in the U.S. to your profile
 - Cause a notification to be sent to this phone number
 - Ensure that the text message you receive is from one of the
   U.S. phone numbers
 - Add a phone number in a country in which your Twilio account
   owns outbound phone numbers to your profile
 - Cause a notification to be sent to this phone number
 - Ensure that the text message you receive is from one of the
   phone numbers in this country
 - Add a phone number in a country in which your Twilio account
   does not own any outbound numbers
 - Cause a notification to be sent to this phone number
 - Ensure that the text message you receive is from one of the
   U.S. phone numbers
 - Disable the "International SMS - Send from Recipient's
   Country" feature flag
 - Repeat the above steps, but ensure that all text messages to
   all phone numbers are sent from a U.S. phone number

Change-Id: I65b4a7c2e201f8afc5e6068ad80a3b4f9ce8710c
Reviewed-on: https://gerrit.instructure.com/66320
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Allison Weiss <allison@instructure.com>
2015-11-13 18:16:34 +00:00
Jeremy Stanley 9aff943389 use course nicknames in notifications
test plan:
 - set up multiple users in a course
 - give some of these users different nicknames for the course
 - set up and confirm communication channels for these users
 - do things that cause notification messages to be dispatched
   to the users
 - ensure each user sees the correct course name in his/her
   notification messages

closes CNVS-24168

Change-Id: Ic49c888ae86b40ba42004e3c2dbc205e49480b79
Reviewed-on: https://gerrit.instructure.com/65544
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Allen <rallen@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-10-27 20:04:25 +00:00
Brandon Broschinsky 3822474b96 update email notification for peer review to be anonymous
*Test Plan
Create an assignment with anonymous peer reviews enabled
create two students
set one student up as a peer reviewer of other
as first student submit assignment
as student two peer review assignment
make sure peer review notifications show anonymous

Change-Id: If1a474192504a26ca09f4086514900809bdb6d81
fixes: PFS-2581
Reviewed-on: https://gerrit.instructure.com/62432
Tested-by: Jenkins
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Allison Weiss <allison@instructure.com>
2015-09-14 21:19:20 +00:00
Alex Boyd 0fc41e8d5a Send messages via Twilio
Fixes CNVS-21548, CNVS-20625, CNVS-21580

Test plan:
 - Copy config/twilio.yml.example to config/twilio.yml
 - Configure config/twilio.yml with credentials from a Twilio
   account
 - Create a user
 - Enable the international_sms feature flag for the account
   of the user you created
 - Create a communication channel from a Rails console, using
   a phone number with which you can test. Assuming
   1-801-555-0100 as the phone number, and assuming that the
   id of the user that you created is 42, you can do that with:
     User.find(42).communication_channels.create!(
       path_type: 'sms', path: '+18015550100')
 - As a site admin, confirm the user's communication channel
 - Cause a notification to be sent to the user
 - Ensure that you receive a text message
 - Multiple outbound numbers (will need a paid Twilio account
   to test):
   - Configure config/twilio.yml with credentials from a
     Twilio account that has multiple outbound phone numbers
   - Create multiple users and add new phone numbers for each
     using the above steps, and confirm them
   - Cause notifications to be generated for each user and
     ensure that they come from different phone numbers
     - You may need to test several phone numbers before a
       notification is sent from a different number
   - Cause more notifications to be sent and ensure that each
     phone number receives notifications from the same
     outbound phone number every time

Change-Id: I103c93a8096acaaabd29530b0a0b5c43bc05c26b
Reviewed-on: https://gerrit.instructure.com/59901
Tested-by: Jenkins
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2015-09-14 15:46:23 +00:00
James Williams 600165e7b2 rails4: deprecate Relation#all in favor of Relation#to_a
refs #CNVS-21596

Change-Id: I5dedaab90a2abe6bf288ff30401c9b31629b45b2
Reviewed-on: https://gerrit.instructure.com/59220
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-24 21:28:14 +00:00
Matthew Wheeler b0b783149c Change Messages table url column to text
Fixes CNVS-21253

Test plan:
Tests pass (manual QA is N/A)

Change-Id: Iba5634b948e5857682cf574bf93160893f107461
Reviewed-on: https://gerrit.instructure.com/58351
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Matthew Wheeler <mwheeler@instructure.com>
2015-07-14 16:38:50 +00:00
James Williams ab7954f593 rails4: fix message processing
refs #CNVS-21596

Change-Id: I224152dc5bbb676474c8bbca4abb8cd5988f63c8
Reviewed-on: https://gerrit.instructure.com/57983
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-13 15:22:47 +00:00
Ethan Vizitei e85ae442d2 pick sis pseudonym reliably
closes CNVS-15282

Previously for users that have multiple pseudonyms,
the "sis_pseudonym" might be selected differently depending
on whether the pseudonyms collection was already loaded or not
because no specific order clause was given.  This patchset
makes it so that all sis pseudonym selection strategies
order the data set the same way (by "unique id") so that
you can count on getting a deterministic result.

Also, user.rb is huge, so I took the opportunity to split out a
SisPsuedonym class.  There may be room to move more
functionality into it later liked deciding what pseudonym to
fall back to in cases where the current strategy finds
nothing, but this is a good first step.  I switched all the use
cases I could find of the old interface on user.rb, but left the
method in place for now in case other plugins or extensions make use of
it.  We can wait a while and let the deprecation warnings take effect
before removing it.

TEST PLAN:
 1) download a gradebook csv export for a course
 2) make sure the SIS Login ID is the same as the secondary
   ID for each user that you see in the gradebook view itself.

Change-Id: Ib18b40acbaf3a8f4352fd6ee8e0826897e3edf49
Reviewed-on: https://gerrit.instructure.com/57001
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-06-25 22:18:14 +00:00
Strand McCutchen 19271f0521 cleanup refactor of Rubocop's Style/WhileUntilDo
fixes CNVS-20009

Prefer while/until without `do`s.

This cleanup refactor was automatically generated using
this command:

  `rubocop $(find . -name '*.rb') --only Style/WhileUntilDo --auto-correct`

These code changes were autocorrected then reviewed.

Change-Id: Ie78f62c0caea4e154339365e2ad207d77cde967c
Reviewed-on: https://gerrit.instructure.com/53001
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Strand McCutchen <smccutchen@instructure.com>
QA-Review: Strand McCutchen <smccutchen@instructure.com>
2015-04-28 18:37:29 +00:00
Ethan Vizitei 1004e66540 get sentry into canvas
closes CNVS-6016

No more error reports!  (soon)

this commit builds up sentry integration through the new
Canvas::Errors module, along with other things that need
to happen on every exception.  ErrorReports
should now get pushed towards just being used for representing
a complaint a user filed via the get help form.

I fixed about half the things that got linted as well
while I was in here, but because this touches to much
I fear divergence from tackling too many (I think we
can safely say it's "better than we found it")

I left a lot of the infrastructure for error reports in place
until other commits for plugins can be merged

TEST PLAN:
 1) setup your raven.yml config file with the dsn for our
  sentry install
 2) force an error to happen in a request response cycle.
 3) see the error in sentry
 4) force an error to happen in a job
 5) see the error in sentry
 6) statsd increments shoudl still fire
 7) for the moment, an error report should still get created.

Change-Id: I5a9dc7214598f8d5083451fd15f0423f8f939034
Reviewed-on: https://gerrit.instructure.com/51621
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-13 22:26:15 +00:00
Cody Cutrer 9834937c8c don't autorequire a bunch of gems that are rarely used
Change-Id: I09ed3686629b62849d392684d587f30cb2047013
Reviewed-on: https://gerrit.instructure.com/51853
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-04-09 18:47:50 +00:00
Joel Hough 942fec22cf better push notification endpoint handling
fixes CNVS-19286

test plan
- regression test push notifications

multi-user (endpoint stealing) test
- sign up for push notifications with one user
- ensure that they receive push notifications
- sign up for push notifications with another user
- ensure that the new user receives push notifications
- ensure that the first user no longer receives push notifications

Change-Id: I6ffacc065cb0b3c54e5224350a2e7c93c595b8df
Reviewed-on: https://gerrit.instructure.com/50622
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-03-31 21:09:06 +00:00
Joel Hough 439e119492 delete facebook integration
fixes CNVS-18978

test plan
- regression test canvas, particularly:
notifications, and their preferences
communication channels
messages
user ouath (like linkedin and google docs use)
avatars
profile page
user services (like twitter)
feature settings
context roster

Change-Id: I2d53125f76c9daf912fdeabc621c90ac1bd070df
Reviewed-on: https://gerrit.instructure.com/49267
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-03-30 20:21:58 +00:00
Joel Hough 8f3b4f8864 send push notifications to apns sandbox
fixes CNVS-18871

test plan
- send a push notification to an apns sandbox device

Change-Id: I4d4a3b9e8213e46f5eb0bfb33b575e296561af15
Reviewed-on: https://gerrit.instructure.com/49452
Reviewed-by: Miles Wright <mwright@instructure.com>
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-02-26 17:32:46 +00:00
Dave Donahue 3b6f8baffb custom e-mail logo setting
refs CAT-884

Test plan:
 1. Change the settings on a given root account to have
    a custom e-mail logo:
    a = Account.find(1)
    a.settings[:email_logo] = "http://some-cool-logo.jpg"
    a.save
 2. Trigger an e-mail alert on an event on that account
    (for instance, adding a new account admin - but it's
    worth testing several different e-mail alerts).
 3. Ensure the custom logo displays instead of the Canvas
    logo.
 4. Ensure that when a custom e-mail logo is not configured,
    the Canvas logo is rendered.

Change-Id: I37c29308dfb5404e94507c2d35872cf8609040b2
Reviewed-on: https://gerrit.instructure.com/48983
Tested-by: Jenkins
Reviewed-by: Ethan Gunderson <egunderson@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
Product-Review: Jeff Belser <jbelser@instructure.com>
Tested-by: Jeff Belser <jbelser@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
2015-02-19 21:54:22 +00:00
Cody Cutrer d6312b7e0d use url helpers in messages
fixes CNVS-11838

and then choose the host more intelligently to use one the user
can actually log in to

test plan
- have accounts on two shards, referred to as "account 1" and
 "account 2" from now on
- have account domains that are resolvable for the accounts,
 referred to as account1.canvas.dev and account2.canvas.dev from
 now on
- have account 2 trust account 1 by POSTing to
 account2.canvas.dev/api/v1/accounts/<account 2 id>/trust_links
 with a site admin's auth token and setting
 trust_link[managing_account_id] to account 1's global id.
 you can now use users from account 1 on account 2

- regression test notifications, especially considering
 notifications generated by account 2 that are sent to account 1
 users.
- account 1 users should have links that use account1.canvas.dev
 and have global ids for referenced objects that live on
 account 2's shard,
 e.g. account1.canvas.dev/courses/2~1/discussion_topics/2~30
- avatars should use the avatar owner's account domain
- account 2 users should have links that use account2.canvas.dev
 and have local ids,
 e.g. account2.canvas.dev/courses/1/discussion_topics/30
- following the links when the user receiving the notification is
 logged in should take the user to the linked object
- following the links when not logged in should take the user to
 a login page that they are able to log in to
- be sure to at least check:
 context file downloads links (e.g. discussion topic attachments)
 file downloads links (e.g. conversation message attachments)
 avatars links
 conversation notifications
 discussion notifications
 peer review notifications

Change-Id: Idebd247fee99a2b973d3fa6f4f2fca0e723d99a5
Reviewed-on: https://gerrit.instructure.com/31867
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-02-18 23:07:57 +00:00
Rob Orton b1244f27f3 change and validate length of attributes on message
test plan
 - should not get a db error when to: is longer than 255 char

Change-Id: I55c697b3a0848cf700ecb4a19ef7447a643e0a64
Reviewed-on: https://gerrit.instructure.com/48157
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2015-02-18 19:39:15 +00:00
Joel Hough 28d82fa793 push notifications
fixes CNVS-7398

test plan
- using canvas mobile app with push notification support, enable
 push notifications
- cause a notification to be sent from the canvas web ui
- ensure that the canvas app gets a notification

Change-Id: Idb320520a23ba6c5c2649253da557160be54084a
Reviewed-on: https://gerrit.instructure.com/42892
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-01-15 22:19:24 +00:00
Joel Hough 82d0751897 yo integration
Fixes CNVS-16494

test plan
- configure yo plugin with an api token
- configure a user's yo service with their yo username
 (you'll need to install the yo app and register a user)
- set yo notification preferences to asap
- cause a notification to be sent
- ensure canvas yo's you
- ensure the yo link links back to canvas

Change-Id: I36ed467ed19842c2e92285ae20a3553272698f22
Reviewed-on: https://gerrit.instructure.com/42896
Product-Review: Joel Hough <joel@instructure.com>
QA-Review: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
2014-11-03 22:53:39 +00:00
Cody Cutrer 95ecf20e73 use Rails' base_class
and remove base_ar_class, that does the same thing

Change-Id: Id76a2dcc375cfea397ff4b4853f50d660b6b044c
Reviewed-on: https://gerrit.instructure.com/41783
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-30 21:14:22 +00:00
Cody Cutrer 102fdfc849 no more dynamic finders (models)
refs CNVS-15126

Change-Id: I2996e0e262c41274c34d0ea3bfde757074416b8c
Reviewed-on: https://gerrit.instructure.com/40973
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-24 20:51:48 +00:00
Joel Hough c14f18cb85 account setting for author email in notifications
fixes CNVS-15348

test plan
- send a conversation message
- ensure that the notification does not include the author's email
 address
- in the account's settings page, check "Show the email address of
 sender for user interaction Notifications"
- send another conversation message
- ensure that the notification includes the author's email address

Change-Id: I2816d82fb2f6413d1c2c972296a758b571fb03de
Reviewed-on: https://gerrit.instructure.com/40766
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Janelle Seegmiller <jseegmiller@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2014-09-10 19:57:52 +00:00
Cody Cutrer 5f4dcccff4 avoid extraneous queries to Notification
just use the cached .all, even for associations

test plan:
 * go to the notification preferences page as a user
 * in console
   * np = NotificationPolicy.first; np.notification
   * the first time, it should query notification_policy,
     and *all* notifications
   * do it again, and this time it should not query
     notifications, but should still return an object

Change-Id: I3b83ec9ce6f6f6b4d542e83d2b8653b4e221afd4
Reviewed-on: https://gerrit.instructure.com/40460
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-09-09 21:54:16 +00:00
James Williams 81558f728c remove rails 2 support
closes #CNVS-14261

Change-Id: I1b0e8a4438ab659ecd1ac8462bc3559d810989b3
Reviewed-on: https://gerrit.instructure.com/38744
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-08-06 18:16:19 +00:00
Joel Hough 0c80487238 use absolute url for avatar in notifications
fixes CNVS-14251

test plan
- cause a notification with an avatar to be sent (discussion,
 conversation, or submission comment)
- ensure that the avatar image src attribute is an absolute url

Change-Id: I6992de1f4b83ecfdf838725a42e09feb1ca5e1c9
Reviewed-on: https://gerrit.instructure.com/37729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2014-07-18 14:18:25 +00:00
Cody Cutrer 1277aaae90 stabby lambda scopes for rails4
Change-Id: I34f2527471cdb4d8cab5cde426ba959baa26189e
Reviewed-on: https://gerrit.instructure.com/37151
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-07-04 02:11:56 +00:00
Cody Cutrer f3e3920a0c fix message delivery in ruby 2
Change-Id: I9f087757431d69e9d0fb1c1890f05c89c141fb7a
Reviewed-on: https://gerrit.instructure.com/36845
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-25 16:32:29 +00:00
Ethan Vizitei 39a35ab09e Use source user as "FROM" for emails
This gives certain user-triggered events
a "look" as though they came directly from
that user (the FROM and REPLY-TO headers
have the name of the source user).

This also introduces "letter_opener" into the
dev environment.  If you use "letter_opener"
as your send method for dev emails, it will
open all emails in a browser tab. Very useful.

closes: CNVS-11837

TEST PLAN:

Validate each of the following notifications
looks like it's "from" the source user:

- Submitting an assignment
- Resubmitting an assignment
- Posting to a discussion
- sending a conversation message
- posting a comment on a submission

Change-Id: I0e04aa9aa5bf31a590e69507e04b86b637247acf
Conflicts:
	app/models/message.rb
Reviewed-on: https://gerrit.instructure.com/35362
Reviewed-by: Drew Bowman <dbowman@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Drew Bowman <dbowman@instructure.com>
2014-05-31 01:02:14 +00:00
Jayce Higgins d5af57e0bc Better formatting for emails and add avatar for conversations
Fixes: CNVS-12970

We needed an avatar and signature for notifications
sent out via conversations. Also reformatted all the
notifications to take on a cleaner and more easy to
read format.

The majority of testing can be done on the conversation
notifications. I was using letter opener to do this.
I have included letter opener and the relevant setup
stuff in this commit so that it can be tested.

Test-Plan:
-Make sure that your organization has allowed avatars
-Give a student or a teacher an avatar
-Send a conversation message to another user from
  the user that has an avatar
-If you have letter_opener installed, the email
  should be intercepted and you'll see its formatting.
  Otherwise, use whatever method you'd like to view
  the email.
-Verify that everything looks alright and we have
  an avatar and good formatting.

-STEP 2-
-Disable avatars
-Send another email and verify that the avatar isn't
  showing up

Change-Id: I876dc119c5daefa10811c75c08b315722a50f63d
Reviewed-on: https://gerrit.instructure.com/35144
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Drew Bowman <dbowman@instructure.com>
2014-05-30 23:24:03 +00:00
Anthus Williams c247a3758d remove some of the less useful associations from export
delayed_messages, exports, imports, migrations,
stream_items, etc.

Change-Id: I6eb63457ad496d7aaf56fc9ec8a9602a5679fdd7
Reviewed-on: https://gerrit.instructure.com/35215
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-05-27 15:44:00 +00:00
James Williams 7f6fbcbf62 don't escape message subjects
test plan:
* create an asset (such as an assignment) that includes
characters such as quotes, ampersands and brackets.
(e.g. "<stuff> &that's html escaped")
* create a notification for the asset (such as an
"Assignment Created" message)
* confirm that the message subject is not escaped
(e.g. "&lt;stuff&gt; &amp;that&#x27;s html escaped")

fixes #CNVS-11652

Change-Id: I23a4529b7e582a8a5f725f965d96c79748e762b7
Reviewed-on: https://gerrit.instructure.com/34796
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-19 16:51:49 +00:00
Anthus Williams 828981e72c define exportable attributes/associations on models
instead of passing an :exportable option to
ActiveRecord::Associations, simply define a constant
on the class containing exportable associations and
attributes. This is due to :exportable breaking
ActiveRecord, and we can't simply monkey-patch in
config/initializers because models are included in
migrations before the initializers are run

Change-Id: I11f1a6b4570c397d8e01010c517bc6efdac7afca
Reviewed-on: https://gerrit.instructure.com/33235
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-05-06 23:54:24 +00:00
Joseph Rodriguez 2d9cfc5ac4 moved Facebook code into gem
fixes: CNVS-12120

test plan:
- regression test facebook functionality

Change-Id: I041e726ee12f9eca8fc27ccdd049422073d1af15
Reviewed-on: https://gerrit.instructure.com/33595
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 22:32:15 +00:00
Joseph Rodriguez 02761bce6f pull canvas specific code out of Facebook class
fixes: CNVS-12520

test plan:
- regression test facebook functionality

Change-Id: I0016edccd3186e7d55146bf216ec2b07a369c801
Reviewed-on: https://gerrit.instructure.com/33531
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 22:32:07 +00:00
Raphael Weiner a13f85e0ed move twitter to gem
fixes: CNVS-12492

test-plan:
* Test that all things Twitter related still work

Change-Id: Ib656c5bfcb2dc8490a6fa6f214b0f6dce25ad181
Reviewed-on: https://gerrit.instructure.com/33193
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:27 +00:00
Nathan Mills 8eeb4f5bf0 refactor twitter to not be a mixin
fixes: CNVS-12118

test-plan:
*twitter integration should work

Change-Id: I44a9011eb451aaa8eb196264bb4b65d1635da083
Reviewed-on: https://gerrit.instructure.com/33065
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:17 +00:00
Braden Anderson 34c2f55089 rails3: fix message email html
fixes CNVS-12213

test plan:
  * launch Rails 3
  * trigger a notification email
  * view it in /messages
  * verify that it looks the same as Rails 2 emails

Change-Id: I86526453c92e489f5f18002c3fe4adb55ddacf56
Reviewed-on: https://gerrit.instructure.com/32888
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-04-04 22:25:48 +00:00
Nick Cloward 4748aba483 extract canvas sort gem
fixes: CNVS-11890

Test Plan:

Canvas Should not be broken, test requests that use the SortLast and SortFirst
class.  One is account settings.  Make sure its sorted correctly.  Another is
submissions_controller show method and make sure the visible rubric assesments
are sorted correctly.

Change-Id: I75a61475a928e069d6566fcc51305a6c442ec5a0
Reviewed-on: https://gerrit.instructure.com/32014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-04 14:53:09 +00:00
Joshua Simpson ae814421e0 namespace all of quiz into quizzes module
This commit namespaces the rest of quiz related code into a Quizzes
namespace: controllers, views, models, and classes that previously lived
under lib/ that are Quiz-related.

Test plan:

Full regression test on all quiz related items

refs CNVS-10457

Change-Id: If54b61213945056539e03271a936d233abb66188
Reviewed-on: https://gerrit.instructure.com/29351
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-02-18 22:17:13 +00:00
Cameron Matheson 67647ce982 rails3: second attempt at fixing erubis
Change-Id: I3bba2799e20fdd52efe6a16b1276d5cfac74419f
Reviewed-on: https://gerrit.instructure.com/30013
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2014-02-13 19:12:41 +00:00
Raphael Weiner 6ae716da73 extracted html text helper methods into gem
test plan:
  * run specs

Change-Id: I8bd463396aee14853bdcf552eef144a509ffb62a
Reviewed-on: https://gerrit.instructure.com/29613
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-07 20:11:19 +00:00
Cody Cutrer e87f947d21 rename Mailer#message
in Rails 3, there's another method with the same name

also fix some specs that check the underlying delivery method

Change-Id: I1e318a280420ea5872b7e4dca097a2b68a0a69e7
Reviewed-on: https://gerrit.instructure.com/28742
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-01-21 20:15:28 +00:00
James Williams b9eddb6b24 use self.user instead of @user in message for rails 3 compatibility
Change-Id: Iac4e81744bb89a73c6a0dc8414d503f59e54df2a
Reviewed-on: https://gerrit.instructure.com/28425
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-01-14 13:24:57 +00:00
James Williams 51b12ec859 fix Message#define_content template helper for rails 3
Change-Id: Ib51c6521f918d216612df74cf7e156dd95a74f2a
Reviewed-on: https://gerrit.instructure.com/28427
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-01-14 13:12:49 +00:00