allow downloading everything in a folder as a zip

closes: CNVS-14728
closes: CNVS-12658
refs: DES-213

test plan:
* in new files interface:
* click the "cloud download" button on an item
  (it's next to the publish and cog buttons)
* if it is a file, it should download immediately
* if it is a folder, it should show a progress
  indicator while it is preparing the download
  (delayed jobs need to be running)
* when the progress reaches 100%, the browser should
  download it just like any other file.

Change-Id: Icc4712b5b421e26343bcfbc6458459cfeedf471e
Reviewed-on: https://gerrit.instructure.com/40137
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
fix a bugs in new files

fixes CNVS-15182

The restricted access dialog window wasn't closing after making its
requests. Also, restricted access wasn't seting the 'locked' params
which was needed in order to ensure restricted access/hidden states
were properly set.

Test Plan
As a user that can access new files
Go to the new files page
When you click on the admin gear
And open the restricted access menu
And click update
Then the dialog should load
And then it should close

As a user that can access new files
Given you have an unpublished file or folder
Go to the new files page
When you click on the admin gear on an unpublished file or folder
And open the restricted access menu
And click update
Then the dialog should load
And then it should close
And the file or folders published icon should have correctly changed

Change-Id: I6921bc812ba7be7b79fa90c82971b4c7ebc24d3c
Reviewed-on: https://gerrit.instructure.com/40266
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Sterling Cobb <sterling@instructure.com>
fix issue editing questions in question banks

fixes CNVS-11006

test plan:
  - as a teacher
    - create a question bank with more than 50 questions
    - edit a question
    - it should successfully edit the question without adding a new question
      to the bank
  - do a regression test around creating and editing questions both in and
    outside of question banks

Change-Id: Iba765cf3b5c5b2687a012e44592e47d8e3ec6716
Reviewed-on: https://gerrit.instructure.com/40260
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
add multi-select to files

closes: CNVS-12656
closes: CNVS-12724, CNVS-11664

this adds both the ability to multi-select
items (CNVS-12656), and the actions
(like move, delete, download as a zip: CNVS-12724)

test plan:
in new files, click around on the folders/files
in the list.  if you click anywhere other than
a link, button, or input it should toggle whether
that thing is selected (things that are selected
get a blue background). you should be able to
control/shift click, press control+a, control+shift+a
it should work just the mac finder's multi-select

using a screenreader, you should be able to use
the <input type="checkbox"> to toggle selected

be thorough, it should handle all the edge cases ;)

* now that you have some things selected:
* there should be some buttons that appear on the top of the page
* try each:
* download as zip
* move
* delete
* they should all work

Change-Id: I51c2df7d8437d918c2875c293f38e3c60b0122c6
Reviewed-on: https://gerrit.instructure.com/40203
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
reduce size of all_site_admin_account_users cache key

store the bare minimum of ruby objects, instead of the full AR objects

on a large site admin test object, this cache went from ~64K to ~9K

Change-Id: I102127f9344dc801be9875b7e26092857061c1f4
Reviewed-on: https://gerrit.instructure.com/40182
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
fix new files in Safari

fixes: CNVS-15200

freaking Safari doesn't implement the URLUtils
interface so we can't use `new URL`
see: https://developer.mozilla.org/en-US/docs/Web/API/URL

test plan:
* open new files in safari
  (and FF, IE, & chrome to be thorough)
* it should load.

Change-Id: Ieb219bd019e029020a572580987c98d2c93c1014
Reviewed-on: https://gerrit.instructure.com/40319
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
display upload progress for new file uploads

closes CNVS-15120

test plan:
  - enable new files
  - upload a file
    - ui should display upload progress
    - screen reader should announce upload progress

Change-Id: I01d644cfbe528dfcfa2e2161a87aefd3e8d9903c
Reviewed-on: https://gerrit.instructure.com/40148
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
QA-Review: Jason Madsen <jmadsen@instructure.com>
Updated tr translation

Change-Id: I83b93ef3c75fe70af526a022922931766891296c
Updated fa-IR translation

Change-Id: Ie05337c4530703b32eb34ec1790780068b7d91b5
don't set badge counts and crumbs in get_context on api requests

Change-Id: I0ca8a9813ada2d4965577778cff822396764cf5d
Reviewed-on: https://gerrit.instructure.com/40356
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
add specs for variable substitutions

Test Plan:
 - specs should pass

Change-Id: I4267d457f2f58c9913e36ff9f59cf8e9dbc96db6
Reviewed-on: https://gerrit.instructure.com/40315
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
add job source to the "Processing" log line json

test plan: run jobs, the "Processing" log line when the job starts
should include the source field among the other json fields. This source
field has the marginalia information about the web request or other job
that created this job.

Change-Id: If58da146b241b12093fd31822b93924481434143
Reviewed-on: https://gerrit.instructure.com/40352
Reviewed-by: Hubert depesz Lubaczewski <hlubaczewski@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
allow lti content to enter full screen mode

Test Plan
- lti content should be able to enter full screen mode

fixes PLAT-614

Change-Id: Icffa991ca618cc6aeab2ac5ba0743746ab8bac41
Reviewed-on: https://gerrit.instructure.com/40320
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
use github helper for dress_code gem in gemfile

Change-Id: I36af600183c33c47aac4547651db49362c52a91d
Reviewed-on: https://gerrit.instructure.com/40183
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Colleen Palmer <colleen@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
remove ActionDispatch::RequestId middleware

Our custom RequestContextGenerator middleware also sets a request id
header, which is heavily used throughout our infrastructure, so there's
no point in setting a second, unused request id header.

test plan: inspect response headers, there should be an
X-Request-Context-Id header but no X-Request-Id header.

Change-Id: If6964a6aaf20968299cb9e3762343be92822efa2
Reviewed-on: https://gerrit.instructure.com/40355
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
Removes the selected item from modules and module item move dialogs

fixes CNVS-15186

Test Plan:
  - Go to the modules page (/courses/##/modules)
  - Use the Move To... option in the settings cog menu to move
    a module.
  - In the dialog the module you selected to do this with should not
    be an option.
  - Repeat the same with a module item.
  - If you attempt to move the item within the save module, the item
    should not be displayed as an option.

Change-Id: If2649406570ae11fba0bca5b4910ed8fbcc6d84b
Reviewed-on: https://gerrit.instructure.com/40362
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
Adds a role to sidebar buttons on account settings

fixes CNVS-13905

Test Plan:
  - Using NVDA in Firefox go to the account settings page
    (/accounts/##/settings)
  - Using the "B" key the "Add a New Course" and "Add a New
    User" buttons should be recognized.
  - Using the "F" key the same should occur

Change-Id: Ief88cec1f0c12a48ba55ac50614ca83877358a20
Reviewed-on: https://gerrit.instructure.com/40369
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
fix 'Become' link for admins on profile page

test-plan:
 - have profiles enabled on the account
 - log in as an admin
 - flag some other target user was "public"
 - try and view that user's profile
 - should not get a 404

Change-Id: Ibcae7f577b5824d42996c830030d5dd87094685f
Reviewed-on: https://gerrit.instructure.com/40250
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
locale query params for session_locale

fixes CAT-330

NOTE: *the locale for a page is inferred in a weighted order.
       session_locale is checked just before a provided context's
       account locale preference and just after the user's

Test Plan
  1. Fire up canvas with full i18n support configured
     (i.e. $ RAILS_LOAD_ALL_LOCALES=true rails server)
  2. Navigate to a page that supports localization while logged out
     such as the login screen
  3. Append the following query params to the URL in the browser
     '?session_locale=zh'
  4. Navigate to that URL and ensure the page is localized in the provided
     locale

Change-Id: I9e94d6ecfd41e77683940272aa0988c67064b602
Reviewed-on: https://gerrit.instructure.com/39844
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Gunderson <egunderson@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
fix canvas_update script sass compilation

We compile sass using npm run compile-sass now, but the
script was still referencing the old (now deprecated) rake
task, which was causing updates to fail.

Change-Id: Idbedcf61ccccbdb0f1deb5907afb25d5d6650000
Reviewed-on: https://gerrit.instructure.com/40392
Reviewed-by: Nick Houle <nhoule@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Dave Donahue <ddonahue@instructure.com>
QA-Review: Dave Donahue <ddonahue@instructure.com>