strip whitespace around username on login

fixes CNVS-7857

test-plan:
 - try to log in as a user when using extra whitespace around their
   username

Change-Id: Ia230d7caf784562a881f59fed17e393d5c4b4878
Reviewed-on: https://gerrit.instructure.com/24391
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
ensure the module sequence footer is shown after publishing a page

test plan:
 * navigate to a page that is part of a module
   - the module sequence footer should slide in from the bottom
 * publish/unpublish the page
   - the module sequence footer should remain in-place (no animation)

fixes CNVS-8147

Change-Id: I140ea6086c4e67f10cd2ad221f5fd4beed656115
Reviewed-on: https://gerrit.instructure.com/24351
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
fix moving assignments when deleting a group

Moved assignments when deleted a group were being moved correctly but not
showing up in the UI without a page refresh.  This also fixes an issue where
the @model.view was not getting set correctly for assignment group list items
and assignment list items

fixes CNVS-8124

test plan:
- delete an assignment group with assignments in it
- choose the options to move them to another group
- it should work and show up in the UI without a refresh

Change-Id: I35a3ab0fde7007e75828374d8071eae6120a72f2
Reviewed-on: https://gerrit.instructure.com/24316
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
add a reserve cost to request throttling

closes CNVS-8135

This essentially adds a cost to making multiple requests in parallel, by
adding to the bucket at the beginning of each request, and then
decrementing by the same amount when the request completes.

This way we will now throttle a user who makes many parallel requests,
none of which complete.

test plan:

* The regression portion: ensure that user throttling still works as
  before outside of this new use case.
* To test this new use case, it'd be useful to have a request that takes
  a very long time to finish. You could modify a controller action like
  users#user_dashboard and add a sleep(1000) to the beginning. Then make
  enough requests in parallel, all of which will hang on the sleep, so
  that you get a 403 error. This will require quite a few rails
  processes, of course. You can help that along by increasing
  Setting.set('request_throttle.up_front_cost', '500') , then you'll
  only need two requests in parallel to hit the limit.

Change-Id: I89412b7b325eef512ba77f21373ec5d9964c86cf
Reviewed-on: https://gerrit.instructure.com/24437
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
change to new drag and drop icon

fixes CNVS-8036

test plan: no test needed?

Change-Id: I2513cb877cecd597aad2468f0ff9365c454ffed1
Reviewed-on: https://gerrit.instructure.com/24406
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
add available column to the assignment index page

fixes CNVS-7671

test plan:
  - The availability date should display in six different formats
    - Blank (when there is no availability dates)
    - "Available" (when the assignment is unlocked, and there is no lock date)
    - "Not available until <date>" (when the assignment is not unlocked yet)
    - "Available until <date>" (when the assignment is unlocked and has a lock date)
    - "Closed" (when the locked date has passed)
    - "Multiple Availability" (when there are multiple availability dates)
  - Add different variations on availability dates for assignments
  - Check that the format appears correct

Change-Id: I9bbd416b50656dd67dc4ae2d391ec5b6a6283d5c
Reviewed-on: https://gerrit.instructure.com/24455
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
user and group names ellipsis for length

fixes CNVS-8118

testing notes:
- using a user with a long name, verify
  it gets ellipsis in both "Unassigned Students"
  and when assigned in a group
- using a group with a long name, verify
  the name uses ellipsis in the group list
- "Unassigned Students" list "+" should show
  truncated group name in "Add to Group" popover

Change-Id: Ib4907fd0b9e6036d75d64f2ca210028d414baa48
Reviewed-on: https://gerrit.instructure.com/24409
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
remove AddWorkflowStateForQuizQuestions migration

This data fixup would be very expensive to run in production, as it
touches every quiz question record in the database. Besides, quiz
questions will update their workflow_state to "active" the next time
they are saved, .active? responds true for questions with nil
workflow_state, and the `active` scope on QuizQuestion already includes
quiz questions whose workflow_state is nil.

Change-Id: I72fecc53e2f46fd1c2086ec2dc13d448d74486ab
Reviewed-on: https://gerrit.instructure.com/24553
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
hide scores from students in attempts table for muted submissions

fixes CNVS-8208

test plan:
  - create a new quiz as a teacher
  - mute the quiz in gradebook
  - have a student take the quiz
  - the student score in the attempts table should say "Not yet graded"

Change-Id: Ief963ee17fdf42117ebd0a47bf206493e82dcab1
Reviewed-on: https://gerrit.instructure.com/24540
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
add reply/reply all options to old conversations

fixes CNVS-8112

when replying to a conversation message created in the
new conversations ui, the old conversations ui should
display reply/reply all buttons instead of a single
send button.

the reply button should send a message to only the thread's
original author, while the reply-all button should reply to
every person in the conversation.

test plan:
  * as a user with the new conversation ui enabled, send a
    message to at least two users who are still using the
    old conversations ui;
  * as one of the users with old conversations enabled,
    view your conversations and verify that you see a new
    group message from the first user;
  * verify that when you view the message you have the
    option to reply or to reply all;
  * send a reply message;
  * verify that as another user in the group conversation
    you cannot see the reply message;
  * verify that the original thread author can view the
    reply message;
  * as the user who sent the reply message, send a reply
    all message;
  * verify that all users in the conversation can view the
    reply all message.

Change-Id: I6c9540817c8ad0096242db44a717545c53880437
Reviewed-on: https://gerrit.instructure.com/24430
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Tested-by: Zach Pendleton <zachp@instructure.com>
update API documentation on usage of SIS IDs

refs CNVS-7814

Change-Id: I492b6b0f3bce2f328a85c642394b5aa2fe1ad0f8
Reviewed-on: https://gerrit.instructure.com/24519
Reviewed-by: Rob Orton <rob@instructure.com>
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>
ensure redis gems are loaded before calling LeakyBucket.lua

Change-Id: Ib9696b6a9ec8bfbd75c9fa49741cf42810f27561
Reviewed-on: https://gerrit.instructure.com/24559
Product-Review: Dave Jungst <dave@instructure.com>
QA-Review: Dave Jungst <dave@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
use better indexes on external feed entries

 * asset_id and asset_type aren't used for queries
 * we often look up by both uuid and url, so add an index on url, and
   split the index on (external_feed_id, uuid) into two

Change-Id: I654e7521d3246fc86a74babf8f190c86a7b6c005
Reviewed-on: https://gerrit.instructure.com/24403
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>
add collapsible item groups to styleguide

refs PS-574

test plan

*verify styles work across supported browsers

Change-Id: I14d822efa103b1ecde377a6a6df54c8303d2e8a7
Reviewed-on: https://gerrit.instructure.com/24315
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
remove empty space after hiding speedgrader w/unpublish

fixes CNVS-7931

test plan:
 - as a teacher:
 - go to the assignments show page for a published assignment
 - verify that SpeedGrader link is in the right place
 - click unpublish
 - verify that the SG link has moved and there is no empty space
 - click publish and verify that the SG link comes back in the right spot
 - go to show page for unpublished assignment
 - verify no SG link or empty box appears

Change-Id: I0f55049cafb49cc1a88acda0a47f73b5ee649f49
Reviewed-on: https://gerrit.instructure.com/24538
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
gemfile fixed to handle ruby2.0 for test

Change-Id: I4ebbaec7107859a882d8f64e1b4c4521c5b4e6ef
Reviewed-on: https://gerrit.instructure.com/24551
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
fix typo in DiscussionTopic::user_can_see_posts?

fixes CNVS-5460

test plan
- create a graded group discussion that requires posting before
 seeing replies
- make some replies to the group discussion
- as a student in the group who has not made any replies, ensure
 that no replies are visible
- as the student, make a reply
- ensure that the replies are now visibile

Change-Id: Ic3e87af0022267bd1b632c5258b92be001e3909d
Reviewed-on: https://gerrit.instructure.com/24542
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
search box on assignments index page

fixes CNVS-7191

test plan:
 - type a search term into the search box
 - assignment groups without a matching assignment should disappear
 - assignments that do not match should disappear
 - assignment groups that were collapsed should
     expand if there are matching assignments and then
     collapse when the search box is empty

Change-Id: Ibecfd35bc74403dd97bee928eb3be427f6cc554a
Reviewed-on: https://gerrit.instructure.com/24120
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
do some data fixups before applying constraints

refs CNVS-6202, CNVS-7414

Change-Id: I59859896b15f879d25c19a6c4626be5851cc0604
Reviewed-on: https://gerrit.instructure.com/24527
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>
fix problem with sanitizing nested hash conditions

Change-Id: Icca6c874390dfe8975a7d3871789a3d33d24476e
Reviewed-on: https://gerrit.instructure.com/24494
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>