password change failure in IE8, fixes #11089

Change-Id: Id18c7cc00ffc5a010dfeda912c0fe9a29afba5b6
Reviewed-on: https://gerrit.instructure.com/15082
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Cam Theriault <cam@instructure.com>
refs #11686 lets android users use mobile login

user_agent was only being checked for iPhone or
iPod signatures, just added android to the regex.

Also cleaned up the specs around this issue since
there was a bit of duplication amongst them.

Change-Id: Id58c95c8bdc70a24faff79fd727684733605f59b
Reviewed-on: https://gerrit.instructure.com/15159
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
1.9: fix more errors in full spec runs

* sort the plugin assets found so that the output is deterministic
* spec: pass a single element not an array for course_section_id
* spec: don't actually try to hit facebook's servers
* spec: fix some subsecond precision issues in the assignment overrides
  specs -- you can't shave off usecs that way, floating point precision
  will bite you

Change-Id: I3b54eadf4ebde3474c665263db425666fd3759e7
Reviewed-on: https://gerrit.instructure.com/15180
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
update "find outcome" interface across canvas.

fixes #11556

when searching for an outcome on question bank,
rubric, quiz, assignment, and discussion pages,
use the new outcome interface.

this commit also adds the following features to the
find outcome dialog:
  * option to turn off import of account groups;
  * option to add a "set mastery at" input to the
    outcome detail pane;
  * option to add a "use for scoring" checkbox to
    outcome detail pane.

test plan:
  * attempt to add/align/whatever an outcome on the
    quiz, question bank, assignment, rubic, and discussion
    pages; verify that:
    - new outcome find dialog is used;
    - when an outcome is selected, a mastery level text box
      or "use for scoring" checkbox is displayed as
      appropriate;
    - only outcomes in the current context are displayed;
    - on import, the outcome displays;
    - outcome groups cannot be imported;
    - there are no regressions.

Change-Id: I2439a4287738385e31cdaff18879d4692a4b7cec
Reviewed-on: https://gerrit.instructure.com/15083
Reviewed-by: Mark Ericksen <marke@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Marc LeGendre <marc@instructure.com>
import relevant unminifed date.js source

from https://github.com/datejs/Datejs as of commit 7bdddb5

Change-Id: I74013928f86f5436a0e38f4b51dc724ae01aaf89
Reviewed-on: https://gerrit.instructure.com/15039
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
apply 2e70fc8 to date.js sources

2e70fc8 is the only change we've made to date.js other than the
(currently) reverted 37c15d2.

Change-Id: Ie9caf77522146afd17c67af306df1c6eba1c46d1
Reviewed-on: https://gerrit.instructure.com/15040
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
use imported date.js files for new vendor/date.js

the order in which the files do their thing is important, so chain them
via require.js dependencies. now requiring vendor/date-js/parser.js is
the same as loading all four original files in the order en-US -> core
-> sugarpak -> parser (which is the order they appear in the minified
version), so replace the minified version with just such a require.

Change-Id: I55feb462ef2c188a14a4812ddca4f703bcf7d671
Reviewed-on: https://gerrit.instructure.com/15041
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
properly handle time manipulations around DST-end

a265b7b reverted 37c15d2, which was the original version of this change.
This "reverts" a265b7b by restoring that functionality, but with
additional considerations.

First, the change is applied to readable date.js source, instead of the
minified version we had been using.

Second, this adds to the original commit to fix the set method on Date
objects to play nicely with the fixed addMilliseconds method.

In the vast majority of the year where both the old and the new
addMilliseconds behave identically, set worked fine. but on DST
boundaries where addMilliseconds was now fixed, it became incorrect for
set to use addMilliseconds/addSeconds/addMinutes/addHours instead of
using setMilliseconds/setSeconds/setMinutes/setHours.

In particular, when set tried to use addHours with a DST day as the
target, it would move e.g. 10 hours from midnight to either 9am or 11am
(depending on which DST boundary), rather than to 10am (which was either
9 or 11 hours away from midnight, depending on boundary).

This was particularly egregious since Date.parse ends up using today's
date as the base and then calling set on it. So all Date.parse calls --
that occurred on a DST-boundary day -- were broken.

fixes #11642

Change-Id: Ibc15796c699d1c3a1dea935f4ff68203270df484
Reviewed-on: https://gerrit.instructure.com/15025
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
don't localize SpeedGrader™

that little ™ break RubyParser under ruby 1.9 (the i18n:check rake task
uses RubyParser). but putting the &trade; in the translation string like
we had means it gets html escaped.

since this is a trademark, just skip localizing it, rather than doing
silliness like putting a placeholder for the trademark symbol into the
english string.

test-plan:
 - rake i18n:check passes under ruby 1.9
 - you don't see '&trade;' spelled out in the browser

Change-Id: Ie2a7705c89f05eae37230e9229c0b12e511e7177
Reviewed-on: https://gerrit.instructure.com/15186
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
add varied due date functionality to the main assignments page

test plan:
  REFERENCE:
    * "Main Assignments Page": "localhost:3000/assignments", or click on
    "Assignments" in the menu bar near the top of the page.
    * "Right Side Bar": Go to the Main Assignments Page, it's on your
    right.
    * "Course Assignments Page": Hover over "Courses" in the menu bar
    * near the top of the page, click on the course you set up. Once
    that page loads, click on "Assignments" tab on the left hand side.
  STEPS:
    * https://gist.github.com/f12b3694016f3dcc979e

Change-Id: I9a5884ec1057f196ba5b731a2978c874141bec5b
Reviewed-on: https://gerrit.instructure.com/15006
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
moved discussion topic files to conventional dirs

Change-Id: Ie3c4e51c551595b9b880e827386cd90f86aad08e
Reviewed-on: https://gerrit.instructure.com/13856
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
paginated discussions with search

* pagination
  * don't show too many root entries (page links to see more)
  * don't show too many child entries ("show more" links)
  * don't show too many descendent entries ("show more" links)
* search
  * simple search on user name and content
  * button to see only unread entries
  * clicking an entry to shows it in context of the whole discussion

test plan:
1. create a side-comment discussion with lots of entries
   1. ensure root entries are paginated
   2. ensure only a few side entry comments are shown (link to see more)
2. create a threaded discussion with lots of entries
   1. ensure root entries are paginated
   2. ensure only a few child entries are shown (link to see more)
   3. ensure ancestors are only shown a few levels deep (link to see more)
3. search a discussion
   1. ensure all search terms match (regardless of order)
   2. ensure unread filter works in conjunction with search terms
   3. click a result to see it in context

Change-Id: Ic886474181ee74dc8364fef34ff0a099654b2779
Reviewed-on: https://gerrit.instructure.com/14887
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
new dashboard design

the new dashboard design categorizes recent activity into buckets that can be
expanded/collapsed, and inidividual messages can be dismissed.  the categories
are announcements, conversations, discussions and assignments.  this redesign
applies to the homepage dashboard, the group home page, and the course homepage
when "recent activity dashboard" is selected as the course home page type.o

the motiviation is that the dashboard should capture and present in one place
important information happening in all the user's courses or groups, and allow
for jumping into this information to see more details:

- announcements/discussions should show on the dashboard when they are created,
  or when there are root replies to recent announcements
- conversations should show on the dashboard when there is new activity
- assignments should show on the dashboard when they are created, or when
  changes are made at least a couple hours after being created

the presence of a dashboard item means there is activity for that item that may
be of interest to the user.  additionally, the dashboard items will show
read/unread state (excluding assignments) for items which the user has not yet
viewed.

additionally, global messages such as course inivitations, account level
announcements, and new user messages have been restyled, but will keep their
place above the recent activity widget on the dashboard.

test plan:
- visit many exising user's dashboards and make sure they are functional in the
  new style.
- visit canvas as a brand new user (no enrollments), a new user enrolled in
  a new course and make sure the dashboard is restyled and the messaging makes
  sense.
- make an account level announcement and make sure it shows up on user's
  dashboards.
- create all different types of conversations: single, group, bulk private,
  from submission comment, add user to convo, etc. and make sure the
  appropriate dashboard items appear and make sense
- create discussions and announcements, reply to them at the root level and at
  the sub entry level (sub entries will not make new dashboard items), test
  from both a read and unread user's perspective, making sure dashboard items are
  correct. (note that read/unread state will not be correct for existing items
  before this code is applied, but should be correct for future items moving
  forward)
- dismiss dashboard items and account announcements, make sure they stay
  dismissed.
- test creating assignments, waiting > 2 hours, and updating due dates or other
  assignment details. make sure items appear. note that unread state will not
  exist for assignment notifications.

closes #10783
refs #11038
refs #11039

Change-Id: I276a8cb1fae4c8a46425d0a368455e15a0c470c5
Reviewed-on: https://gerrit.instructure.com/14540
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
hide conversation stream items where user is last author, fixes #11407

test plan:
1. log in as User A
2. send a message to User B
3. log in as User B
4. the conversation should show on the dashboard
5. reply to the conversation
6. the conversation should no longer show on the dashboard

Change-Id: I0da7cfd004deff2ae04e9d187f6171ed1b4b28b0
Reviewed-on: https://gerrit.instructure.com/15033
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
dashboard caching of recent_stream_items, closes #11396

Change-Id: Ib84785c76addc15734162560e6a9de352aa7618f
Reviewed-on: https://gerrit.instructure.com/14998
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
1.9 spec: add encoding magic comment to file containing utf-8

Change-Id: Ifbf3f3de8999759af47995e54551fff8e3e5d039
Reviewed-on: https://gerrit.instructure.com/15242
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
generate safe file urls relative to the shard of the files domain

allows it to be a different shard than where the file is. I had
to remove type casting from dynamic finders that don't know how
to deal with non-integral global ids.

also cache s3 urls on the same shard as the attachment

test plan:
 * have multiple shards and S3 storage
 * have a single safe files domain
 * you should be able to upload and download files in all shards
 * verify that it's going against the files domain, not the normal
   domain

Change-Id: I2b498fc1df20d5b43bf20f702580451621eeaf6a
Reviewed-on: https://gerrit.instructure.com/15158
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
show temporary invitations from all shards

test plan:
 * turn on cross-shard invitations in the console
   (Setting.set('cross_shard_invitations', '1'))
 * create a user with an email address in a shard (NOT
   a site admin)
 * in an unrelated shard with open registration on,
   as an admin invite that e-mail address to a course
 * log in as the original user on the first shard; the invitation
   should show up on your dashboard
 * accepting/rejecting that invitation is *not* yet supported

Change-Id: I3b0c9657fe0dd37a737af9f4253ea8ef8b2f2b91
Reviewed-on: https://gerrit.instructure.com/14903
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
make CommunicationChannelsController#confirm sharding-aware

 * Add CommunicationChannel#merge_candidates and use that in
   CommunicationChannelsController#confirm, UsersController#create,
   and profile settings view
 * change a few pseudonym accesses to be based off the account, not
   the user
 * search all_pseudonyms in a few places
 * shorten @communication_channel.confirmation_code to @nonce in
   several places

test plan:
 * create a normal user in shard 1. invite the same e-mail address to
   a course in shard 2. accept the invitation as you're existing user
   (you should have to log in)
 * invite a different e-mail address to a course in shard 2. accept
   the invitation while logged in as the user from the previous step

Change-Id: I9e7a4adb0b816650f444210c7a110b08858ec037
Reviewed-on: https://gerrit.instructure.com/15121
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
don't use "" for from_name when turning off custom from

fixes #11715

Change-Id: Ica0be72877b97a03eeee2fc23409bf3c988072e9
Reviewed-on: https://gerrit.instructure.com/15213
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Marc LeGendre <marc@instructure.com>