force gradebook transition

this commit forces on the new, accessible, individual gradebook view and forces
of the old GB1

closes CNVS-12327

test plan:
- make sure that individual gradebook view is on and GB1 is off and that you
  can't change it from the UI as a teacher or site admin
- now run the following (to simulate not already having the flag set to on):

  FeatureFlag.where(feature: "screenreader_gradebook").destroy_all

- check again to make sure it is on and can't be turned off

Change-Id: I23cb476d051b4e7697de47432dbe4a408b9800ef
Reviewed-on: https://gerrit.instructure.com/35464
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fix viewing test student grades by teacher

fixes CNVS-12584

test plan:
- as a teacher, enter student view and then exit (to create the test
  student)
- go to gradebook and give them a grade on an assignment
- click on their name to see their individual grades page
- it should load
- when you click on the 'score details' you should get a message the
  grade stats are not available for the test student.

Change-Id: I39a3d24d606569372515ec903fedbdce1e3e7558
Reviewed-on: https://gerrit.instructure.com/35474
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
spec: close open dialogs before starting LTI dialog spec

Change-Id: I97385ab3c1ff337a6c289dfe50b2ba8bcbea2001
Reviewed-on: https://gerrit.instructure.com/35630
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
messageable user: exclude bookmark from serialization

fixes CNVS-13309

test plan:
  * open user settings page with in an environment with
      pg-collkey enabled
  * verify that the page loads

Change-Id: Ic3a8b969df6a8a6c6c0b5e3c0a2d740eb324c025
Reviewed-on: https://gerrit.instructure.com/35615
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
create public courses report

closes CNVS-13328

test plan
 - set a course to public
 - run report, it should include the public courses

Change-Id: Ia3ef9ed62604039998bd90ef06337157dc0c5acb
Reviewed-on: https://gerrit.instructure.com/35557
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
spec: fix conversations_new_spec for g/35091

Change-Id: I4c069758c855135082013e4c1a83ef1d97aca40f
Reviewed-on: https://gerrit.instructure.com/35657
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
conversations: mark as read when replying by email

fixes CNVS-13245

test plan:
  * set up reply by email
  * start a conversation with a user receiving conversation emails
  * reply by email as the recipient
  * open conversations as the recipient
  * verify that the conversation is marked as read

Change-Id: Ic52639abea1cc8d9e0214453e9a1dc1c1b4c6906
Reviewed-on: https://gerrit.instructure.com/35319
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
add has_submitted to poll_session

fixes CNVS-13312
This commit adds a 'has_submitted' key to poll_session json.
The 'has_submitted' key lets the user requesting the poll_session know
whether or not they've submitted a submission to the requested
poll_session.

Test plan
- Create a poll and poll session
- Make an API call to poll_session#show as a student
  - 'has_submitted' should be false
- Make a submission to the poll session as a student
- Make an API call to poll_session#show as the same student
  - 'has_submitted' should be true

Change-Id: I189b1fca4c467019b51123e929c4f45e5cf2d227
Reviewed-on: https://gerrit.instructure.com/35571
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
expose files/:id/public_url in API and use it

fixes CNVS-13156

when requesting the public_url for an attachment for use in preview, do
so through an official API endpoint so that it doesn't get redirected to
a different domain if the file was originally from a root account with a
different domain. this redirect would cause problems due to cross-origin
resource sharing since the request is XHR.

document the now-official endpoint while we're at it.

test-plan:
 - have two root accounts, A and B, with different domains
 - create a course in root account A
 - upload a pdf to that course's files
 - go to the course settings and move the course to root account B
 - visit the course's files page using root account B's domain
 - click the pdf in the left file listing pane, so it attempts to
   preview in the right pane
 - should not get an XHR error about a cross-domain request

Change-Id: Ie126dbea558b9d329bee8e86389f9340515a2394
Reviewed-on: https://gerrit.instructure.com/35493
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>
remove "Allowed" state for RootAccount features on root accounts

the "Allowed" state means a feature is off in an account, but
sub-accounts or courses below it are allowed to enable it.

the 'allowed' state does not, however, make a lot of sense for
features that apply to RootAccount. since the feature cannot
be controlled in sub-accounts or courses, the 'allowed' state
is equivalent to 'off' here.

so to make this less confusing, remove the "allowed" state
for RootAccount features.

(specifically, lock the transition in the API, and make the
UI hide buttons for locked transitions that don't have
messages to display when the user tries to perform them)

test plan:
 - set the Use New Styles feature to "Allowed" in Site Admin
   account settings
 - in a root account settings page, ensure the 'Allowed'
   option is not selectable for this feature
 - ensure that the API reports the new_styles feature is "off"
   and its "allowed" transition is locked
   i.e., GET /api/v1/accounts/1/features/flags/new_styles
   includes state: 'off' and transitions: {allowed: {locked: true}}
 - ensure the API refuses to set the new_styles feature to "allowed"
   in the root account
   i.e., PUT /api/v1/accounts/1/features/flags/new_styles?state=allowed
   should return a 403 error and not change the state
 - regression test: in a sub-account, ensure the 'Use New Styles'
   feature does not appear
 - regression test: verify that when a (non-site-admin)
   root account admin attempts to disable Draft State in
   an account, the Off button is still there, and a message appears
   when you click it, and the feature remains enabled

fixes CNVS-13220

Change-Id: I4d41076c10696b02d0c482a778d2555714487f17
Reviewed-on: https://gerrit.instructure.com/35473
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
do OTP remember me cookie per IP

test plan:
 * configure MFA for a user
 * log in to canvas, and remember me on the MFA verification page
 * log out and log back in; you should not need to enter your MFA
 * log out, and switch internet connections to a different public
   IP (using tethering would be great for this)
 * log in, and you should have to enter your MFA
 * log out and log back in; you should not need to enter your MFA
 * log out and switch back to your original internet connection
 * log in, and you should not have to enter your MFA

Change-Id: Id682ecdabcae8c520ff43f6c90387f78382f5755
Reviewed-on: https://gerrit.instructure.com/25889
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>
add more indexes to support foreign keys

Change-Id: I4011daaf5b12ef47ed01d502eef401dabff7f927
Reviewed-on: https://gerrit.instructure.com/35297
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>
scope poll_sessions closed/opened endpoints to sections

fixes CNVS-13346
This fixes a problem where the poll_session closed and opened endpoints
allow a student to see poll_sessions that do belong to course_sections
they're not enrolled in.

Test plan
- Create a poll
- Create poll sessions with differing course and course sections
- As a student, you should visit the poll_session closed/opened
  endpoints
- You should only see poll sessions for courses AND course sections that
  the student is enrolled in.

Change-Id: I5cfd75dab1dfe0e1ec1c81ac84814bfd2622ef9d
Reviewed-on: https://gerrit.instructure.com/35666
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
improve student group signup experience

fixes CNVS-11832
fixes CNVS-11836
fixes CNVS-13327

test plan

  - enable feature student_groups_next for course
  - regression test groups page student view

  - regression test instructor groups page

  - as an instructor have multiple groups in a group set
  - visit one of the groups
  - the instructor can switch between the groups in the group set

  - as a student you should be able to create a group

Change-Id: Iacf1eaf4467b57f307d45245b53dfc93f14154ff
Reviewed-on: https://gerrit.instructure.com/34454
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Drew Bowman <dbowman@instructure.com>
translate student report headers

refs CNVS-3134

test plan
 - student report examples and report headers
   should be translated

Change-Id: Icc7b20d5120d759eff5707480ba87dabafcc85c9
Reviewed-on: https://gerrit.instructure.com/34591
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
translate provisioning report headers

refs CNVS-3134

test plan
 - provisioning report headers should be translated

Change-Id: I457989c7d82dac29cfd565e897ce8b8b8190de61
Reviewed-on: https://gerrit.instructure.com/34590
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
translate outcome report headers

refs CNVS-3134

test plan
 - outcome report examples and report headers
   should be translated

Change-Id: I4a9fd3e8b47b2e3b095b9c6160123e088508832c
Reviewed-on: https://gerrit.instructure.com/34581
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
translate grade report headers

refs CNVS-3134

test plan
 - grade report examples and report headers
   should be translated

Change-Id: Ib0ad3f67e990d70372882fa4315245c80500e73a
Reviewed-on: https://gerrit.instructure.com/34579
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
translate course report headers

refs CNVS-3134

test plan
 - course report examples and report headers
   should be translated

Change-Id: I1ed6e93886c281c0f8635aca63171af8966bc58c
Reviewed-on: https://gerrit.instructure.com/34577
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
bump switchman version

Change-Id: I917579dfaf73f869b032aa9a5377129726095931
Reviewed-on: https://gerrit.instructure.com/35653
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>