Commit Graph

41100 Commits

Author SHA1 Message Date
Jenkins 5ad11372c0 [i18n] Update package translations
Change-Id: Id0267afa5f711aa3a961defa867af7ea2b35f5ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245055
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-14 05:06:11 +00:00
Ryan Norton 25ed5d2ee1 spec: skip flaky grade calculator specs
refs EVAL-1104

Change-Id: I6ccd67b8bb23886ad76287b7de54acf315c9d494
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245049
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Ryan Norton <rnorton@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2020-08-14 01:33:28 +00:00
Alex Anderson 293554fc66 Remove sandbox from File Preview iframe
Turns out it needs same-origin, and having both
same origin and allow-scripts basically makes the
sandboxing useless against security threats.

Removing the sandboxing will fix this issue.
Something is going to have to be figured out
when it comes to security, but that will have to
wait for another day.

Test plan:
Upload a docx file to canvas
Open the file preview
It should load correctly

Closes CNVS-49923

flag=none

Change-Id: I6af088d811c5371c50fc320df86333310fe5f5e0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245045
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-14 00:43:34 +00:00
Pat Renner 466271355c soft delete outcome proficiency and proficiency ratings
closes OUT-3841
flag=none

test-plan:
- run migrations
- Ensure you can soft delete outcome proficiencies
(and their associated ratings)
- dc run --rm web script/rails c
> o = OutcomeProficiency.first (alternatively,
copy the factory code from factories/outcome_proficiency_factory
to create one for an account)
- ensure it has a workflow state (should be "active" by default)
- ensure the ratings have an "active" workflow state by default
> o.outcome_proficiency_ratings.map(&:workflow_state)
> o.destroy
- Ensure the outcome proficiency was soft deleted
(it should now have a workflow state of deleted)
- Ensure the ratings were soft deleted
> o.outcome_proficiency_ratings.map(&:workflow_state)
- Ensure calling undestroy restores both the proficiency and the ratings
> o.undestroy
> o.outcome_proficiency_ratings.map(&:workflow_state)
- Calling destroy_permanently! should hard delete
both the proficiency and all associated ratings (examine SQL output)
> o.destroy_permanently!

Change-Id: I6421fdfdd97b991e76fb08b528cddbc668495ac8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244166
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2020-08-13 23:50:03 +00:00
Caleb Guanzon f199539b08 spec: add past_announcements specs
test plan:
- specs pass

Change-Id: I779ebb741c0613c29774221f9c74dfdd32eb8736
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244913
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
2020-08-13 22:46:19 +00:00
Ryan Norton ce644cc9b8 improve postmerge build failure messaging
this just extends the messaging to be more descriptive about
the expectation when a postmerge build fails

flag = none
fixes DE-70

Change-Id: I68688320854441c88ab42053ed032653b18f6b52
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245006
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2020-08-13 22:00:15 +00:00
James Butters 13a0cfc6f8 allow plugin build to properly build with custom canvas-lms-refspec
currently if you try to schedule a custom plugin build with
non-master canvas-lms-refspec, but the auto triggered plugin build
has completed, the custom build will skip stages that were
successful in the auto build and not properly rebuild the docker
image with the plugin refspec and canvas-lms refspec. This fixes
that.

flag = none
closes: DE-162

Test Plan:
- Jenkins build passes
- Plugin build with this canvas-lms refspec doesn't skip any
  previously successful stages.

Change-Id: I129f377ae9c7650962dd223ba6544224c56fe478
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244982
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
2020-08-13 20:42:54 +00:00
Cody Cutrer 8ce6b71a3a optimize assignments_needing_grading_query
especially for courses with mostly-deleted-assignments

Change-Id: Icbb010dd0406e2206148ce08ee849babf4d7a459
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244991
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2020-08-13 20:34:53 +00:00
Jackson Howe 1b8943af0b Make updating apppointment group desc update all appts' desc
Previously, updating the description for an appointment group
would not update the description for each event, so that feature
was effectively useless.

Fixes LS-1292
flag = none

Test plan:
 - Go to calendar and create an appointment group with several
   appointments
 - Click one of the appts, then click 'Group Details'
 - Update description ('details') and location
 - Expect the description and location for each event to be
   updated
 - Set one event's description individually
 - Open group details and change just the location
 - Expect location for all events to be updated, but expect the
   event with overriden description to still exist

Change-Id: I740d435a2e27398e8d2c27443723585602a6fd9d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244754
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Anderson <raanderson@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2020-08-13 20:24:45 +00:00
Gary Mei cc2174c56a fix grade imports with spaces in grades
fixes EVAL-1035
flag=none

Test Plan
- Export the gradebook.
- In the csv, assign 1 grade to have a leading space, 1 to have a
trailing space, and 1 with neither.
- Import the gradebook.
- Verify that the changes are present without issue.

Change-Id: I62a6696bd6dbbb2b08e1ff4e3133c1b4522e2c2f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244781
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-08-13 20:09:06 +00:00
Alex Anderson 6bbb46cf95 Fix sandbox "allow-popups" errors
Test Plan:
Let's make sure existing sandbox attributes are properly removed.
Change a page to have the following content:
<iframe src="https://docs.google.com/document/d/1054I9jXtjHmSwFUuj60YsyQ-DloZpORzBffO3KDdv2k" width="100%" height="600" sandbox="allow-scripts allow-forms allow-same-origin"></iframe>
Save
Clicking the 'Request Access' link should open up a confirm modal.
Don't see the error message in the devtools console

flag=none

Fixes CNVS-49914

Change-Id: I261e428185c01f2800c7a89131da2161b00e16ae
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244965
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
2020-08-13 19:30:06 +00:00
Jacob Fugal 2b3886c5f4 extend client_credentials oauth2 grants for CD2
refs SAS-1540

* adds an audience setting to developer keys, so a key can be set to
  target external audiences with its credentials grants
* when a key with an external audience grants credentials, the token is
  signed with an asymmetric key instead of the internal symmetric key
* external audiences can retrieve the corresponding public keys from
  /login/oauth2/jwks
* credentials issued by developer keys with an account id include the
  account's guid in a custom claim

includes a refactor of key storage and rotation in consul, which had
already been done for LTI. but it wasn't really a feature of lti, just
something used by LTI, and we needed the same for key management for
this. moved it to be part of Canvas::Security

Change-Id: Ie5c0fcee6fc21687f31c109389a3bcc1ed349c5d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243606
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2020-08-13 18:52:47 +00:00
Pat Renner 6f0326392e Revert "add live events for outcome_proficiency"
This reverts commit 0f0edc8cbe.

Reason for revert: merged prematurely, depends on code in g/244166

Change-Id: I49b623197354bf5c39cb3f6829b2dea72118e890
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244037
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
2020-08-13 18:34:07 +00:00
Pat Renner 0f0edc8cbe add live events for outcome_proficiency
closes OUT-3867
flag=none

test-plan:
- ensure live events are running locally (see live_events.md)
- verify that when making changes (including soft deleting) or
 creating an outcome proficiency that live events are emitted
- verify that ratings information is included in the proficiency payload

Change-Id: I0e6603896b6a08b7a6ea1050c742e5ff3a9b3b2f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244793
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
2020-08-13 17:31:34 +00:00
August Thornton 8ff4bebce5 spec: fix flakey rspec user merge spec
fixes FOO-755
flag = none

test plan:
 - specs pass

Change-Id: I0e0bba777f78da5d80855ab8912e8c691120a7c3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244912
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2020-08-13 17:22:52 +00:00
Evan Battaglia a7dcf263bc Unfillable tables scopes
Allows us to fill tables which depend on unfillable tables.

Will have to make this more complicated if we want to support things
like ContentTag and AccessToken which will require a join. (In my
reporting scripts I have a query for AccessToken.)

flag=none
refs INTEROP-6082

Test plan:
* Have some developer keys with null and non-null account_id
* Have some access tokens belonging to each
* set root_account_id on all dev keys and access tokens to null
* run DataFixup::PopulateRootAccountIdOnModels.run
* check that all developer keys with non-null account_id and all
  associated access tokens have the root_account_id
* Next, make some learning outcome groups, some with null and some with
  non-null contexts
* make some content tags with a context of each of those
* run DataFixup::PopulateRootAccountIdOnModels.run
* check that all learning outcome groups with non-null context_id and all
  associated content tags have the root_account_id

Change-Id: Ia0938ac33bf9e38e183816ad25c2da1518fe677d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244944
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-08-13 16:32:23 +00:00
Adrian Packel 0811aa28b3 Round rubric points possible to 4 places
Ensure we round the total points on rubrics to 4 places (which matches
the existing rounding on individual rubric assessments) so that we don't
end up with values like 3.9999999998 for rubrics whose individual
criteria have fractional points.

flag=none
fixes EVAL-1079

Test plan:
- Have a course with an assignment
- Create a rubric for the assignment
  - Add some individual criteria with fractional point values
    - E.g., criteria with points: 1.2, 1.2, 1.2, 0.4
  - Save the rubric and observe the total points possible
    - In the above example it should be 5, not 4.99999996 or whatever
  - Check that summed fractional values are allowed but round to a
    maximum of 4 decimal places
  - Check that the assignment's points-possible correctly copies over
    the rounded value from the rubric

Change-Id: I8c5c80526a5e3def330b3c991cef5f09daa8a482
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244657
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-08-13 15:27:07 +00:00
Alex Anderson 277ca6d3b9 Add CSS to wrap module headers
When enough content is in the module header, it pushes the
action buttons off to the side. This patchset makes it so those
headers wrap, and adds a bit of margin to the buttons so they
stay right-aligned (or left aligned in RTL languages)

Test Plan:
Create a module. Give it requirements.
Scale your browser to 320px.
The header row should wrap and the buttons
should stay right-aligned.

Fixes LS-546

flag=none

Change-Id: I646d96d59031de4398c7feef9df9bf9140b5ee1a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244791
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-08-13 15:08:31 +00:00
Jackson Howe 6dfc1fcb3e Update SR titles for rce toolbar button groups
Changes the titles to more accurately reflect the buttons' function
in each group.

flag = rce_enhancements
Fixes LS-1309

Test plan:
 - Go to RCE
 - Turn on SR
 - Tab through toolbar groups, expect to hear correct titles (shown
   in ticket)

Change-Id: Iffa97656de786e81f8179a1f7f381bb84891a77f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244771
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2020-08-13 14:36:43 +00:00
Jenkins 739a50f1f4 update tr translation
Change-Id: Ia376071e8ee8af4f759bdd3a0a6a7e79f0fb3f66
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244940
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-13 05:53:19 +00:00
Jenkins b8747e6949 [i18n] Update package translations
Change-Id: I351ffa9136611c43001036c81afd4137df28c30f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244938
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-13 04:55:09 +00:00
Michael Brewer-Davis 10a6720d2c allow admins to access grading_rubrics api
closes EVAL-1106
flag=none

Test plan:
Verify that teachers, admins, and site admins can
access "Find Rubric" details from the assignments
page
Verify that students cannot access that API

Change-Id: Idc568e0846de03a1e394f0b5c30fd4e7c1122839
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244935
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2020-08-13 03:56:17 +00:00
Brian Watson b521c1bd85 spec: un-skip specs in new_files_student_spec.rb
closes OUT-3815

flag=none

Test-plan:
 - flakey_spec_catcher passes
Change-Id: Iee1a6765235c34aa4aa8da9ba3d2487eb650c218
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244864
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
2020-08-13 02:34:50 +00:00
Rob Orton 479da9d999 sort of add muted back for graphql requests
test plan
 - use graphql for assignments
 - it should show muted
 - try to update muted
 - it should not cause an error

refs MBL-14634

Change-Id: I875d99bdd29792755641b0a9485ed2dd35013801
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244928
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Nate Armstrong <narmstrong@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
2020-08-13 01:01:47 +00:00
Michael Brewer-Davis 1c794a6483 switch rubrics queries to use outcome proficiency type
refs OUT-3766
flag=none

Test plan:
qa-cr

Change-Id: I320ee289984a4ca4e17cabc61f0d3e25a749053e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243854
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2020-08-12 23:35:10 +00:00
Rob Orton fd2d5323b5 use consistant methods for skipping messages
Change-Id: If82aee2f4c78cafc02d72bd3a8ca0eded4f9afe1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244777
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
2020-08-12 21:22:20 +00:00
James Williams 61196bea80 run content migration attachment creation through instfs
test plan:
* have instfs enabled
* import a zip file into a course
* the attachments should have instfs_uuids

closes #LS-1285

Change-Id: I42e877e25dfcbd855bfc9e56b59cf969ea7d6ce0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244749
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-08-12 20:49:52 +00:00
James Butters e59ab3875e remove print-env-excluding-secrets
only the Jenkinsfile.test-subbuild is using print-env-excluding-secrets
rather than the canvas-builds-library cleanAndSetup, change to use
canvas-builds-library and remove print-env-excluding-secrets

flag = none

Change-Id: I6109ab4d981d52286c85f1a2c887332bcb5efb17
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244822
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-08-12 20:49:03 +00:00
Erin Hallmark 9be2ff569e Update community urls to reflect platform move
The Canvas Community moved to a new platform and links were affected.
Updated links in the UI to reflect new URLs so customers have them
instead of having to rely on redirects.

CLOSES: FOO-852
flag=none

Test plan:
- jenkins passes
- links work

Change-Id: I4bad04dbd550d24c48a4aac54fb3c5a547947e7d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244878
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Erin Hallmark <erin@instructure.com>
2020-08-12 20:17:02 +00:00
Jared Crystal a19863457a make assignments index modals responsive to 320px
fixes DEMO-13
flag = responsive_awareness

test plan:
 - the following modals are all responsive at 320px and
   are unchanged for the desktop view:
    - add Assignment group (+ Group)
    - edit Assignment Groups Weight (root kebab)
    - add assignment to assignment group (+ on group)
    - edit assignment group (group kebab)
    - edit individual assignment (assignment kebab)

Change-Id: Idaf097435916da9035672a89bf65ddef83cc4bb2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244474
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Matthew Goodwin <mattg@instructure.com>
2020-08-12 19:39:32 +00:00
Xander Moffatt b2a7cd9e9c accept explicit client id when retrieving tool
* this will assist in finding the MS Teams tool in non-iad regions,
during a full window launch in Safari

refs INTEROP-5960
flag=none

test plan
* create two context external tools that:
  * are on different shards
  * have different domains
  * are linked to the same developer key
* retrieve a tool using the external tools API:
  * using an API access token and header `Authorization: Bearer <token>`
  * GET `<canvas>/api/v1/courses/:id/external_tools`
* try to retrieve tool B from tool B's shard, using tool A's url
  * using the above API request,
  * add this query parameter: `?url=<encoded url of tool A>`
  * this should not find a tool and return nil, since the tools have
    different urls
* try again
  * using the above API request and query parameter,
  * add this query parameter: `&client_id=<developer key id>`
  * this should succeed and retrieve tool B

Change-Id: Ife6912c01c16bb3209c9d3e39c92468b4f2e9ce8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244148
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Michael Guymon <mguymon@instructure.com>
2020-08-12 18:10:20 +00:00
Jeremy Stanley 8cbd957eb1 fix ContentTag#direct_shareable? for nil content_id
in practice I can't find any module tags fitting this description
but just in case that happens

test plan: specs

refs LS-1254

Change-Id: Iadaa9915bce20b96fb4b195df99f97fe7dd09d56
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244821
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-08-12 17:22:29 +00:00
Mysti Lilla ca90cee58a Fill AssignmentOverride and AOStudent with quiz as context
closes INTEROP-6073
flag=none

Test plan
- Have an adhoc override on a non-assignment quiz
- (Also an assignment quiz, but I'm pretty sure those
  are linked to the assignment, but check)
- Remove the root account ids for both
- Run DataFixup::PopulateRootAccountIdOnModels.run
  and ensure both get their root account ids filled

Change-Id: I5effe4850c8213ffa3f658691f8a1091673d6434
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244823
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-08-12 16:20:18 +00:00
Caleb Guanzon ebcb12c309 spec: finish new /profile/communication tests
test plan:
- passes jenkins

Change-Id: If2ad2de7068593bc814b1e960492d3873dbed071
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244522
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
2020-08-12 16:04:35 +00:00
Drake Harper c337ad8a96 Fix not sending notification when adding an admin
Test Plan:
-navigate to /accounts/<user id with admin access>/settings
-add an admin by email
-navigate to /users/<new user id>/messages
-verify there is an message for

flag=none
fixes VICE-573

Change-Id: I5f3f5b4bae657a5449836cddc525310bef3e8682
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244801
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2020-08-12 15:59:11 +00:00
Cody Cutrer 789908d057 fix RoleOverride datafixup for no root_account_id column
fixes gh-1665

test plan:
 * have a database from a relatively old version of canvas (circa 2019-09-11)
 * run predeploy migrations only, from master
 * it shouldn not error about root_account_id

Change-Id: Iaca0d7b31470d3c693b9600a6988a442ceb735b7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241985
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-08-12 15:51:00 +00:00
Alex Anderson 489572e455 Revert the Lato Extended font change
The original patchset made it so italic fonts weren't
working correctly. This reverts that change so we
don't introduce a regression.

Test Plan:
Within a Canvas course, create a page.
Enter text, highlight the text and select the italics icon to italicize the text. Notice that the text is italicized.
Save the page. The text should be italicized.

Fixes LS-1313

Change-Id: Id6a58979499a45f62abfc5f5ee911d335c32067c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244835
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Alex Anderson <raanderson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-12 15:28:48 +00:00
Evan Battaglia efe298c1c8 Clear old (always global) user root account ids
Must be merged and deployed with the "Make Users root_account_ids
relative to user shard" (g/244742) commit.
The migration here is named to run before
20200806175207_populate_root_account_id_on_models
kicks off the users backfill.

flag=none
refs INTEROP-6063

Test plan:
- make sure you have some users with root account ids with all global
  ids (ids are still global when on same shard as user)
- run migrations
- make sure those root account ids are cleared (if you are running jobs
  you will also start backfills so you may notice users filling up again
  but they will have local root account IDs for root accounts on the same
  shard as the user)

Change-Id: I047afe45989f2e86ca711e24683beca4557ce1c6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244804
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-08-12 15:22:31 +00:00
Jackson Howe 2e0b040f87 Improve manageable_courses API for direct share
Matches query against course name, code, id, and SIS ID, instead
of just course name.

Doesn't show courses that are soft or hard concluded if the flag
is supplied to the API - this flag was present before, but did
not work properly.

Returns a bit more data from the API - like course code and IDs,
so UI can differentiate between courses with same name.

Decreases required number of characters when searching for a course
in direct share - this way, people can search by ID if the ID is
small.

Removes server-side caching of search results - the caching was
causing weirdness when adding/removing courses.

Fixes LS-514
flag = none

Test plan:
 - Enable direct share on the account
 - Go to some assignment, click 'copy to'
 - Search for courses (at least 2 chars req'd to search)
 - Expect that concluded courses (either marked as concluded with
   the button or whose end date have passed) don't appear in
   results
 - Expect that you can search by course name, code, id, or SIS id
 - Open /users/self/manageable_courses?term=whatever&include=concluded
 - Expect including include=concluded in the API should show concluded
   courses while leaving it out should not
 - Repeat for both account admins and teachers

Change-Id: Ie0c268fa47f5bb4bca61b048181b43bdea68f66a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244235
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2020-08-12 14:23:38 +00:00
Jenkins 3b35dff7fc [i18n] Update package translations
Change-Id: I9776daf7c5cd53913adc0cdb39739d16ca15ec45
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244826
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-12 04:47:21 +00:00
Evan Battaglia 8502957025 backfill CommunicationChannel root_account_ids
Note: we'll want to wait until the user update job uses relative
root_account_ids before merging this

flag=none
refs INTEROP-6038

Test plan:
- On two different shards, have a user which is enrolled in courses on
  both shards, and a user that is enrolled in courses only on its shard.
  For a better test make the two courses have different local account
  ids. (To enroll a user: course.enroll_user(u, 'StudentEnrollment',
  workflow_state: 'active'))
- The fixup for CommunicationChannel won't run until all users on
  both shards have root_account_ids, so on each shard, run
  DataFixup::PopulateRootAccountIdOnModels.run to set the root_account_ids
  on all main users objects and then fill the users with id >
  10000000000000 (shadow users) with some bogus root_account_ids (this
  will be updated when the CommunicationChannel backfill runs
  User#update_root_account_ids)
- On shard 2, create a communication channel for each user on
  shard 2, including the shard 1 shadow user that is on shard2.
- CommunicationChannel.update_all(root_account_id: nil)
- On shard 2, run DataFixup::PopulateRootAccountIdOnModels.run
- Look at the communication channels and make sure each one has the root
  account ids of the user, relative to shard 2.

Change-Id: I811714fe6e4331e51cca2e14417bbe330b6175a4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244186
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-08-11 22:57:56 +00:00
Evan Battaglia 35d2f31581 Make Users root_account_ids relative to user shard
This makes it consistent with the backfill. It may also make shard moves
easier.

This needs to be merged before the CommunicationChannel backfill is
merged.

Note that a future task will be to fix up the global root account ids
already set on users updated before this fix.

refs INTEROP-6061
flag=none

Test Plan:
This test plan assumes you have MRA and at least
two shards set up.

1. Create a user and associate them with the root account in Shard 1.
   One way to do this is by finding a course on shard 1 and running:
   course.enroll_user(u, 'StdentEnrollment', enrollment_state: :active)
2. Run jobs
3. Verify root_account_ids on the user is now an array of size 1
   containing the local ID of the Shard 1 root account
4. Associate a user with a root account on shard 1 and a root account of
   shard 2
5. Run jobs
6. Verify root_account_ids on the user is now an array of size 2
   containing the local ID of the Shard 1 account and the global ID of
   the Shard 2 root account

Change-Id: Ic21613d08185187bbc23ea1bee74fc6bfd6999db
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244742
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-08-11 22:30:15 +00:00
Aaron Ogata 217b1f35de skip uglify js / source maps on pre-merge builds v2
refs DE-161

Test Plan:
1. Ensure that JS sourcemaps are skipped on pre-merge
1. Ensure that JS sourcemaps are run on post-merge
3. Ensure that Linters catch bundle size increase limits on pre-merge

Change-Id: I59607d902b191169a0415fc7673cb3a3a06dba68
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243619
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
2020-08-11 21:05:54 +00:00
Jared Amen 4f3e41a233 Course media option now shows all course media
Test Plan:
  * Run script/delayed_job
  * Ensure RCE Enhancements are turned on
  * Add media to course files
  * Navigate to content that utilizes RCE enhancements,
    such as a page
  * Click the record/upload media button in the toolbar
  * Click 'Course Media'
  * The uploaded course media file should be there

fixes LS-981
flag = rce_enhancements

Change-Id: Id967808b192e77eb22e5610c32b0f2a57f186021
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244213
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2020-08-11 20:39:56 +00:00
Aaron Ogata 38182bb44d cache yarn install for client_apps
refs DE-183

[change-merged]
[build-registry-path=jenkins/canvas-lms-de-183-pt-3]

Change-Id: I1f3523790f058593ed16c22e5b5c81f82e223ea8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244661
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-11 20:39:24 +00:00
Ed Schiebel e29c95b1fc Make fullscreen videos fill the screen
I broke fullscreen sizing with LA-729,
commit c603d6e9f2
This fixes that.

This change is built on top of the LS-1191, g/242726 changes

closes LS-1308
flag=none

test plan:
  - in the rce, create a link to a video (select text then pick a video
    from the tray and save
    You should do this for a landscape video and a portrait video.
  - click the link
  > expect a new browser tab to open with the video
  - click the fullscreen button
  > expect the video to fill the screen, letterboxed if necessary
  - click the fullscreen button on the embedded video
  > expect the video to fill the screen, letterboxed if necessary

Change-Id: Ifb791c91c3d76b2285e2797aceb6c37c5d943605
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244745
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2020-08-11 20:38:46 +00:00
Jeremy Stanley 3e718cb479 direct share for modules and module items
test plan:
 - enable Direct Share feature
 - ensure Canvas jobs are running
 - on the modules page, select the kebab menu next to a module
   and choose "Copy To...", and ensure the module can be
   copied to another course
 - on the modules page, select the module kebab menu and
   choose "Send To...", and ensure the module can be sent
   to another teacher in the account
   - As that teacher, ensure the module can be imported
     into a course
 - on the modules page, select the kebab menu next to module
   items of all shareable types (assignments, discussions,
   pages, quizzes) and ensure "Copy To" and "Send To" work'
   (and module items other than these types do not have the
   options available)
 - repeat the previous step using newly added objects
   (that were added to the module after the page load,
   without reloading the page) and ensure "Copy To" and
   "Send To" appear and work for the four types given,
   and do not appear for all other types
 - with the direct_share feature turned off, "Copy To"
   and "Send To" do not appear in the menu for existing
   or newly created items

flag = direct_share

closes LS-1254

Change-Id: If44f9e3a7b364828caa71bb49b9e9ec37433f70f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244185
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-08-11 20:15:48 +00:00
Cody Cutrer fff4bc7f08 send users from trusts to the account they signed in with sometimes
if they have no reason to be at the account the signed in at. but only
if they weren't going to a deep link

test plan:
 * have two accounts that trust each other, and use Canvas auth
 * create a user in account 2, completely unassociated with account 1
 * go to account 1, and sign in with that user's credentials
 * you should end up at the dashboard for account 2

Change-Id: Ida64b77a58bd3494916e8d31d066c031ea640735
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243508
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2020-08-11 19:23:31 +00:00
Cody Cutrer e9cf9a4945 search trusted accounts for forgotten passwords as well
test plan:
 * have two accounts that trust each other, using Canvas auth
 * create a user in account 2
 * go to account 1's login page, and try to reset the password
   for that user
 * you should get an email, and it should point to account 2

Change-Id: I9eaed4c2d6204987af82392222506c29df82fc64
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243511
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2020-08-11 19:22:02 +00:00
Han Yan 887fd00245 set root_account_id for imported bank and quiz questions
flag=none

closes QUIZ-7768

test plan:
- create question bank and a question in the bank
- go to a course and create a Classic Quiz
- click on Find Questions and add a question to the new quiz
- export course content
- choose to export Quiz only
- go to a new course settings and chose to import quiz content
- in rails console, verify the newly imported AssessmentQuestion
  and Quizzes::QuizQuestion have correct root_account_id

Change-Id: I4298cb5f79caada562afb556f4097c432f6ecd9d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244750
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Bryan Petty <bpetty@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Han Yan <hyan@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-08-11 18:52:21 +00:00