Updated Gradebook to CSV export to include all section names
Add full & sortable name fields to SIS User Import

Both fields are optional. If absent, the user's name and sortable_name
will be set in the same manner as before.

The full_name field takes precedence over first_name and last_name. The
sortable_name field takes precedence over the inferred value.
fix alerts.js error with non-existent roles

test plan:
* create a custom account role
* enable alerts for the account
* create an alert referencing the custom role
* delete the custom role
* visit the accounts settings page using optimized js
e.g. "accounts/:id/settings?optimized_js=1"
* settings should still load

fixes #CNVS-12655

Change-Id: I0b9d86e8d331189836e5def4407fb155003cf8d7
Reviewed-on: https://gerrit.instructure.com/33961
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
allow subaccount admins to move courses to other accounts

test plan:
* create a subaccount (the "parent" subaccount)
* create more children subaccounts within that parent subaccount
* create an account admin user for the parent subaccount
* create a course beloning to one of the children subaccounts

* as the account admin user, confirm that you can visit
 the course settings page and use the drop-down box to
 change the courses' account to any child account that
 belongs to the parent subaccount
* also confirm that the drop-down box does not show accounts
 outside the parent subaccount (even if they're on the same root
 account)

fixes #CNVS-10501

Change-Id: I1d7cae8a19b926cabb3473ba950d29ab08ad25ce
Reviewed-on: https://gerrit.instructure.com/34009
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
package.json should include compute-cluster in dependencies

Include compute-cluster in "dependencies" so `npm install --production`
works for building assets.

Test plan:
  - run rm -rf node_modules && npm install --production
  - run bundle exec rake canvas:compile_assets

Change-Id: Ie5b1d387608f24b59a736dbeb974cb1ec710cfbd
Reviewed-on: https://gerrit.instructure.com/34302
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
redirect from ember quiz stats when no permission

also better organize testing of permission redirection into a module

closes CNVS-12829

test plan:
  - enable fabulous quizzes
  - as an instructor
    - visit a quiz show page
      - verify that user can navigate through Overview, Moderate,
        Statistics tabs
  - as a student
    - visist a quiz show page
      - verify that users gets redirected to the Overview when navigating to Moderate or
        Statistics Tab
      - verify that redirect happens if user enters the correct url for
        moderate or statistics as well.

Change-Id: Ib87c42c53d9e53f224914cdab34d1781592a8512
Reviewed-on: https://gerrit.instructure.com/34256
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
fix users admin merge autocomplete box

test plan:
* as an account admin, visit /users/:id/admin_merge
* the "Find a User" autocomplete box should work
 (note: the minimum search length is 4 characters)

fixes #CNVS-11476

Change-Id: I74095750a23085d63b814d80e40dacc62133ff7c
Reviewed-on: https://gerrit.instructure.com/34224
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
download formatted files from google doc when available

google docs allows you to specify the format in additional
parameters in the download url, so we can download .doc or
and .xlsx files instead of always plain 'text/html' content

test plan:
* enable the google docs and crocodoc plugins
* create a course with a file upload assignment
* as a student in the course, enable google docs
 integration in user settings
* submit a file to the assignment through the google
 docs tab
* the submitted file should open up in crocodoc

fixes #CNVS-1503

Change-Id: I00ad9ac25a0dd6c46e5b56d2e566ab88b6550054
Reviewed-on: https://gerrit.instructure.com/33994
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
cache 'everyone' search result in new conversations

fixes CNVS-12865

test plan
- as a teacher in new conversations, compose a new message
- select 'all in course' from the people picker drop down
- ensure that 'all in course' can be selected
- ensure that the message can be sent and is delivered to all
 users in the course

Change-Id: I6f2e0ad30ca2a09e52b4b5b764f3c21ecc0628f0
Reviewed-on: https://gerrit.instructure.com/34291
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
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>
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>
fixed code indentation

fixes: CNVS-12683

test plan:
- code formatting only, no qa needed

Change-Id: I9e52687c886c6ca3ff2e1f92ae3c9f0733375dd1
Reviewed-on: https://gerrit.instructure.com/33869
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>
fix LOLCALIZE, closes CNVS-12847

test plan:
1. run canvas w/ LOLCALIZE, e.g. LOLCALIZE=1 script/server
2. behold the lulz
3. behold the lack of javascript errors

Change-Id: Ib46d5fc267cf743b4a9ac367d75be8a3b4b1702d
Reviewed-on: https://gerrit.instructure.com/34275
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
add basic polling api

refs CNVS-12469
closes CNVS-12471,CNVS-12472,CNVS-12473
This commit adds basic CRUD API operations for polling.

Test plan
- Check the create/show/update/deletion API endpoints for both polls
and poll_choices

- Check access controls (students shouldn't be allowed to
  create/delete/update polls or poll choices, nor see the 'is_correct'
  attribute on poll_choices)

Change-Id: I05504bac9cce30382311b3beb6df826e6a30b77f
Reviewed-on: https://gerrit.instructure.com/33956
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
i18n for will_paginate helper

fixes CNVS-11947

the will_paginate actionview helper in will_paginate 3+ uses direct
calls to the I18n.translate method. they didn't match the current
signature (english default as second argument) for our customized
I18n.translate flow. so we adjust our version to allow the (key,
options) call signature as well as (key, default, options). the default
can be specified in the options with the :default key if it's not
hard-coded into the config/locales/en.yml file.

however, will_paginate is bad at actually passing the default to
I18n.translate anyways. fortunately, it provides an en.yml for its
translations, so we just need to make sure to not automatically
view-scope its translate calls.

test-plan:
 - running rails3, having more than one page's worth of error reports,
   load /error_reports; pagination should not show code or I18n errors

Change-Id: Ib98c566f0823e016f823dbec550260eff18abf98
Reviewed-on: https://gerrit.instructure.com/33707
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
admin tools audit logging fragile specs

fixes: CNVS-12870

Adds timecop around the creation of the audit log records.  This will simulate
the data more accuratly and allow the sorting to be correct in the selenium
specs.

Test Plan: Automated tests should pass.

Change-Id: I160cf84570050b1dc713dac921dc44a2eeb40409
Reviewed-on: https://gerrit.instructure.com/34307
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
add integration_id for section and course post to SIS APP

fixes SIS-237

TestPlan:
 - verify course has sections && Post Grades to SIS is enabled
 - verify course has integration_id
 - verify section has integration_id
 - go to Gradebook as Teacher in course
 - select All Sections in the SectionButton
 - Click Post Grades
 - ignore all errors
 - click post grades button
 - in javascript console, the url should contain:
   - if selected 'All Sections' - /grades/course/:integration_id
   - if one section selected - /grades/section/:integration_id

Change-Id: I9ffea143784ba8bd62889d8bd9e89b16ff8dc703
Reviewed-on: https://gerrit.instructure.com/33946
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
check db privs when deciding how to find_in_batches

previously we relied on the symbol stored in
Shackles.environment; if the environment was :slave
we would use a cursor, otherwise a temporary table.
The problem is there could be multiple slaves (or
connections in general for which the database user
doesn't have the rights to create a temporary table).

This commit has AR ask the database if we have permission
to create temp tables and make the decision based
on that information.

Change-Id: I94e4929874c42f200cf544b71f435be211bfe33b
Reviewed-on: https://gerrit.instructure.com/34263
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
bump ruby-saml-mod version

fixes CNVS-12871

test plan:

* regression test on saml logins
* the saml login redirect should not contain newlines encoded in the
  base64 (%0A characters)

Change-Id: I28470ce165ec1f8a90cfb22983d49d017bb72b80
Reviewed-on: https://gerrit.instructure.com/34311
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
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>