spec: fix self_enrollment enabling

Change-Id: I073511735ba6afb71b4bf3aef28e19e467885e51
Reviewed-on: https://gerrit.instructure.com/39876
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
add lti ContentItemSelectionResponse message type

Test Plan:
  - install a tool with the message_type 'ContentItemSelectionResponse'
  - launch the tool
  - it should have the JSON param content_items
  - content_items should have a placementOf -> id that points to a migration API endpoint
  - run the migration by POSTing to the given endpoint
  - the migration should have all course content in it
  - try a migration with one assignment, one quiz, one module, and one page
    * add quizzes[]=:id&assignments[]=:id&modules[]=:id&pages[]=:id
  - the migration should only extract the specified items

closes CNVS-14613

Change-Id: Ic43c3fb1e77c12d5f4d6712d42932e63bc36762e
Reviewed-on: https://gerrit.instructure.com/39427
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
update API doc required params - 9

- Poll choices
- Poll sessions
- Polls
- Quiz extensions
- Quiz question groups

Test plan:
- rake doc:api
- Verify the above doc pages for parameter accuracy

Refs SIS-403

Change-Id: Iefb2933061707390fa3b28428a5183ca214d5d87
Reviewed-on: https://gerrit.instructure.com/39313
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Place parameters in enrollment object in create enrollment API example requests.

Fixes CNVS-14397

Test plan:
- rake doc:api
- verify that public/doc/api/enrollments.html#method.enrollments_api.create shows the correct api parameters

Change-Id: Ie22e65c6f47f05c3e3f7bd49d89757e47f2afeb2
Reviewed-on: https://gerrit.instructure.com/38501
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Update parameters in the following API docs - 3

- Collaborations
- CommMessages
- Communication channels
- Conferences
- Content exports

Test plan:
- rake doc:api
- Verify the above doc pages for parameter accuracy

Refs SIS-403

Change-Id: I5b7c7ba70ea9ddeaed148ab8ccc24436fe307373
Reviewed-on: https://gerrit.instructure.com/38681
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
make screenreader ux in dialogs better

- removed `role="dialog"` because that puts the
  content into "application" mode, royally
  messing up navigability

- added `aria-hidden="true"` to all of the content
  outside of the dialog

- rearranged some opening/closing tags in app
  layouts so they live in the same file

closes CNVS-14476

Change-Id: I83be208a2f993caf8b436112da1b3e30e0f533fa
Reviewed-on: https://gerrit.instructure.com/39933
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
re-add reply messaging to email notifications

fixes CNVS-15068

test plan
- cause a conversation message notification email to be sent
- ensure that the text and html versions of the email include text
 saying that you can reply to the email to reply to the
 conversation message
- cause a discussion entry notification email to be sent
- ensure that the html version of the email includes text saying
 that you can reply to the email to reply to the comment (the text
 version should have the text, too, but it was there before this
 commit)

Change-Id: I79c40ecb55bd17eef96931bbb3f255768914fcc7
Reviewed-on: https://gerrit.instructure.com/39925
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
strip user input self-enrollment code

fixes CNVS-5066

when a user comes to the /registration page, they may have a
self-enrollment code (aka "Join Code" in the form) from some specific
course they're signing up for. if they enter that code with trailing (or
leading whitespace), which is particularly common when copy/pasting,
still let it work. (whitespace is never a valid part of a
self-enrollment code)

test-plan:
 - have a course with self-enrollment enabled
 - note the self-enrollment code
 - go to /register and select to register as a student
 - try to register including the course's self-enrollment code with an
   extra space character added to the end
 - registration should be successful, including creation of an
   enrollment in that course

Change-Id: I1b7c0535e437e1d5e4243d78559eaa4b6b72abdc
Reviewed-on: https://gerrit.instructure.com/39861
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
add ability to move things from one folder to another

fixes: #CNVS-14725

this commit also moves the shared functionality
of File and Folder to base class

File and Folder have similar behavior, we were branching
a lot and defining the same methods on both. this
has them both inherit from the same base class
so they can share that functionality

this commit has has a bunch of changes on stuff that
sterling is working on too. so i want to get it pushed
now so he doesn't have a bunch of merge conflicts. tests
coming in the next commit.

test plan:
in the new files interface,
* click the cog for an item
* click the move option
* a dialog asking where you want to move it to should appear
* pick something
* press "move"
* it should immediately show that it is moved
* it should still show that it is moved when you refresh

Change-Id: I226d21396ab3b6b84e9cdcd62212500986efd9b2
Reviewed-on: https://gerrit.instructure.com/39943
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>
allow sharing cache_store configs between database servers

(switchman handles the details)

test plan:
 * in cache_store.yml, have something like:

oneoff:
  cache_store: redis_store

development: oneoff

 * launch rails console in development mode; Rails.cache should be a redis store

Change-Id: Ie12e655264b1f8c4a5df6ef31cf84d12cc913eb6
Reviewed-on: https://gerrit.instructure.com/39923
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
remove support for in-memory-tests

we haven't supported sqlite in forever

Change-Id: I0e76662d971b24929ca56d36e0344b3d1fa34c14
Reviewed-on: https://gerrit.instructure.com/39820
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>
clear shard and special account caches based on age

test plan:

- regression test to make sure that you can navigate to different
  domains and shards, create + process delayed jobs, and navigate to the
  default and site admin accounts

Change-Id: I0ed4bf3309e3950a046ed1cd7bc7b1fe0a806a7a
Reviewed-on: https://gerrit.instructure.com/39972
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
skip redis initialization if no servers specified

matches behavior of memcache block above

Change-Id: I0baba8d2b55c362403a9e1d3e9499c022c8b039c
Reviewed-on: https://gerrit.instructure.com/39975
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fix marginalia for postgres update/delete statements

temporarily uses our own gem again, until this gets merged upstream.

test plan: enable it in marginalia.yml , then verify that updates and
deletes get logged with the expected comment. i used the console:

Setting.create!(name: 'x', value: 'x').tap { |s| s.touch }.destroy

Change-Id: I5319551ffc4ac1444de3c78d094342cc79c6340c
Reviewed-on: https://gerrit.instructure.com/39982
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fix semantic merge conflict in cache store spec

Change-Id: Ia53c80885bf80ccbf0714b6a5412e27792e8493a
Reviewed-on: https://gerrit.instructure.com/40039
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
DA - grading rework for performance

fixes CNVS-14865

test plan:
  - with a large class
  - with DA on and off
    - check that the gradebook csv download works
      (grades can be wrong when DA is on)
    - check that gradebook2 & srgb work
    - check that student grade summary pages work

Change-Id: I7a7b4ffe302d912aa2877106295a78ab662868f1
Reviewed-on: https://gerrit.instructure.com/39470
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fix resending messaging for invitations

fixes #CNVS-5002
fixes #CNVS-14938

the route this posted to needed
to be made "optional" for the final
param (:id) to accept posts correctly.

Also the "pending" check on invites
requires the currentRole to be passed to it.

Test Plan:
 - Login as a teacher
 - Invite a new student
 - try to resend the invitation
 - you *SHOULD NOT* be told they've accepted it already
 - also sending the invite should not fail

Change-Id: I005699f70f0e6dadaa47adf797d6fa1a5002b1bd
Reviewed-on: https://gerrit.instructure.com/39753
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
hook api up for restricted access

fixes CNVS-12653

When you open the restricted access dialog, it should be synced with
the server and saving should work.

Test Plan

Given you are on the new files page
And you are a user that has permission to change restricted access
And you click a file or folders admin cog
And you select 'restricted access' for the options
Then you should see a dialog open
And there should be two options with radio buttons
And the first option should be checked by default
When you click on the 'Schedule student availability' option
Then you should see two inputs with calendars you can select
And you should be able to select dates for those inputs
And you should be able to "Update" the restricted access
And those changes should be persistant.

Change-Id: Ibe57fc49cb063cfcd3acb64f2a6d1bf8bfc49b66
Reviewed-on: https://gerrit.instructure.com/39451
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
don't bother checking redis in a health check

we automatically work around redis failures anyway

Change-Id: I13c8b689447ee1de27a768d442624d2839a52ea1
Reviewed-on: https://gerrit.instructure.com/39980
Reviewed-by: Brian Palmer <brianp@instructure.com>
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>
always show gb2 "move total column" option

fixes CNVS-15081

Test plan:
  make sure you can move your total column in gb2 whether or not your
  assignment groups are weighted.

Change-Id: I7e76f1ea95f67de326ba77fbf963017bb824a881
Reviewed-on: https://gerrit.instructure.com/39984
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>