Commit Graph

43765 Commits

Author SHA1 Message Date
Eric Saupe 12dd590618 Add setting to prevent teachers from editing course availability
The setting is used in both the new UI and the old. With the React
component a new JS environment variable was required for this
specific check.

fixes LS-1959
flag=none

test plan:
- Create a course and add a teacher
- Verify the teacher can edit course availability
- As a site admin, enable the prevent teachrs from editing course
 availability flag in account settings
- As the teacher, verify you can no longer make course availability
 changes
- Enable new course availability ui
- Verify the teacher is still unable to edit course availability

Change-Id: I27a1fb77a43d7cb6ff1bea48d8b01a293c05333c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261288
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2021-03-24 17:51:06 +00:00
Andrea Cirulli 872961eb55 Revert "add the ability to load local shared library"
This reverts commit b4a90a4ffa.

Reason for revert: causing build issues

Change-Id: Icf4c6d0fe26ec073d7b7ad67d1670efdee761c16
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260738
Tested-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-03-24 16:07:08 +00:00
Andrea Cirulli b4a90a4ffa add the ability to load local shared library
move rspec and distribution into a library folder that
can be loaded as local shared lib to avoid the load code
in the jenkins files.

refs DE-555
flag = none

[canvas-builds-refspec=d4cf97caed1edf2c9c91c48460e94f99e58a4d0a]

Change-Id: Id947a389d22f04126a8654bd5e4957433cddd330
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261289
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-03-24 16:02:38 +00:00
Robin Kuss 2b5197356b spec: k5 dash planner navigation tests
Closes LS-2036

Test Plan: passes jenkins, uses nav buttons

Change-Id: Iec478dc30c6ce734d3b21d7d5afba5247834271d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261375
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
2021-03-24 15:36:01 +00:00
Jeremy Stanley 6eba4f0cc1 link cross-shard Attachment#cloned_item_id correctly
test plan:
 - specs.

I don't know of any side-effects of this bug, since the only
place I know cloned_items are still used is in blueprint
courses, which currently do not operate across root accounts.
Might as well fix the issue though, so it doesn't obstruct
consortium blueprints should we implement those

flag = none
fixes LS-1673

Change-Id: Ic19e57d3df3b1f7e9b9f6003f34c20ab440ceb29
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261462
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2021-03-24 14:47:23 +00:00
Evan Battaglia a0aae89688 MicrosoftSync: fetch AADs for users
I added two tickets for further work:
- INTEROP-6637: Supports non-email address UPNs.
- INTEROP-6640: correctly/efficiently handle multiple email addresses.
  Need to think a bit on how best to do that.
- INTEROP-6641 (and INTEROP-6608): retry & retry based on throttling

closes INTEROP-6569
flag=microsoft_group_enrollments_syncing

Test plan:
- Add some users in your test course with email addresses that
  correspond to the users we have accounts for in our microsoft tenant
  (talk to me if you are unsure of what these are)
- Run Syncer#sync for a Microsoft Group for the course
- Check that `UserMapping`s have been created corresponding to the user
  and the AAD object ids for their email addresses (look at the
  Microsoft admin console for our test tenant to get the IDs, or look up
  the IDs from the API with `graph_service.list_users`)
- Run the job again. Test both of these cases:
  - If you have extra users enrolled in the course that don't have email
    addresses or don't have users on the Microsoft side, you should see
    the job hitting the MS API again for them, but no new UserMappings
    should be created.
  - If you don't have any extra users, you should see that the the job
    doesn't the MS API.
- Clear out your UserMappings, unenroll one user (enrollment should have
  a workflow_state of 'deleted') and sync again. It should ignore the
  deleted enrollment.

Change-Id: I58575db23de7b2b56c785784efc53b8bd6b8216a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261093
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
2021-03-24 14:32:24 +00:00
Evan Battaglia 220b44cbf1 Microsoft Sync, initial syncer job
* Lays out framework for getting and caching Microsoft API tokens and
  hitting the Microsoft Graph API.
* Simple sync job which creates a group for the class if it doesn't
  exist and sets the extra LMS/SIS metadata.

NOTE: I discovered the MS API is eventually consistent -- it does not
immediately create a group when we hit the POST /education/classes
endpoint. In a future commit (I added a new ticket) we can work replace
the "sleep" with polling with sleeping or launching a new delayed job.

closes INTEROP-6567
flag=microsoft_group_enrollments_syncing

Test plan:
* Get creds from me and put in dynamic_settings.yml
* Try getting a token and observe it is cached (only the first time you
  run will you see "get service:timeouts:microsoft_sync_login:error_count"
  and "set microsoft_sync_login/<OURTESTTENANT>" calls to the redis cache):
    MicrosoftSync::LoginService.token(<OURTESTTENANT>)
* Put our test tenant (you can get that from me) into your root
  account's settings[:microsoft_sync_tenant]
* Create a course with a name and description that clearly label it
  as your test course for the Microsoft sync project
* From a rails console run:
    c = Course.find(...) # your new test course
    g = MicrosoftSync::Group.create(course: c)
    syncer = MicrosoftSync::Syncer.new(g)
    syncer.sync
* Run the syncer again and observe (from the MicrosoftSync::GraphClient:
  log lines) that we do not create or delete anything.
* Check that the group looks OK on the Microsoft side:
    g = MicrosoftSync::Group.last
    syncer = MicrosoftSync::Syncer.new(MicrosoftSync::Group.last)
    cgs = syncer.canvas_graph_service
    gs = cgs.graph_service
    gs.get_group(g.ms_group_id)
* Check that the extra properties on the group have been set:
    gs.get_group(g.ms_group_id, select:
      %w[microsoft_EducationClassLmsExt microsoft_EducationClassSisExt])
* Update the group's ms_group_id to nil in the database:
    g.update! ms_group_id: nil
  Then rename the course to something similar but slightly different and
  re-rerun the sync job (you may have to run syncer.course.reload and/or
  syncer.group.reload to make the syncer get new values). Then repeat
  the last two steps. In the first of those two steps, the group name,
  but in the second step, the data in microsoft_EducationClassLmsExt
  should be updated. This is because the syncer assumes if a group has
  been created it was created correctly, but it doesn't assume the extra
  metadata was ever set to it re-sets it. Also check that ms_group_id
  has been re-filled in on the group record.
* Change your creds to something invalid and clear the rails cache.
  Run the sync. It should raise an error. Then check that the Group
  record has been updated with workflow_state=errored and
  last_error="Invalid Status Code: Login service returned 401 for tenant
  <OURTENANT>". This is what will be shown to the user (teacher).
* If you need/want to look at the Microsoft admin web console, you can
  get those creds from me. From there you can delete your group, if
  needed. You can also delete your group by using:
    gs.request(:delete, "groups/#{ms_group_id}")

Change-Id: I077497c1c412095420079ea80d461bd172425bca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260232
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2021-03-24 14:30:20 +00:00
Jenkins 3d66f9df05 update nn translation
Change-Id: Iad6a6235a70c4958c35d5eee993a1c9d482f7d3d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261440
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-24 06:00:23 +00:00
Ahmad Amireh a93ffddd20 specify stylesheet for Handlebars in JSON files
fixes FOO-1616
flag  = none

this is so that the stylesheets for the templates can survive the
rename; the reference to the brandable css bundle is specified in the
same .json file we specify the i18n scope in

test plan:: go to an assignment page, edit it, and verify the "Assign
to" widget looks OK

Change-Id: I44e2851d24c04645ee6c927cf9c5459d6da3e8a8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260355
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
2021-03-23 21:57:32 +00:00
Cody Cutrer 60c2b652fe prevent deletion of template courses
closes FOO-1687

test plan:
 * designate a course a template (in console)
 * the Delete this Course button should be gone from the course settings sidebar
 * trying to delete via API should fail

Change-Id: I64621a1cab664bf29bae35a443d168bf51345e05
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260510
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
2021-03-23 20:12:49 +00:00
Davis Hyer 965b3481fe update i18n namespacing for discussions
fixes VICE-1234
flag=none

test plan:
  - n/a

qa risk: low

Change-Id: Ied91a391acb595dc803e7a1710ef1edfa0c5cd50
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261325
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chawn Neal <chawn.neal@instructure.com>
QA-Review: Chawn Neal <chawn.neal@instructure.com>
Product-Review: Chawn Neal <chawn.neal@instructure.com>
2021-03-23 19:56:30 +00:00
Aaron Ogata 16dddb5a81 move JS jobs to root level
refs DE-338

[canvas-builds-refspec=67ccb03c4f435ee6421ee91a003fec1430a27d74]

Change-Id: I674c8f16c5dd848b4e165b21b910848108e4f2f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261313
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-03-23 17:49:58 +00:00
Michael Brewer-Davis 2297b2e346 delete outcome results when rubric replaced
closes OUT-4247
flag=none

Test plan:
- create new outcome
- create two rubrics which include a single outcome criterion using the new outcome
- create an assignment
- attach one of the rubrics to the assignment
- assess a student using the rubric
- attach the other rubric to the assignment, replacing the first one
- view the /api/v1/courses/xxx/outcome_results endpoint

Change-Id: I94049974b68fe804bd9f61e214ffea57ac2f3510
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260698
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
2021-03-23 17:17:00 +00:00
Michael Brewer-Davis a9ff89f509 make LearningOutcomeResult soft-deleteable
refs OUT-4247

Test plan:
- ensure results from aligned rubrics and from quizzes
  are visible in the learning mastery gradebook

Change-Id: Ie9731f2c702f91b3da2ce4d8ae43f7045ee5509e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260613
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
2021-03-23 17:16:41 +00:00
Charley Kline 482294a632 Disable tests related to v7 <Select> in assignments_2/teacher
Closes FOO-1577
flag = none

Since assignments_2 teacher page is currently unused, just
update the import source for the <Select> component to InstUI 7.
Select works entirely differently in InstUI 7 so this is almost
certainly going to completely break a lot of functionality, but
for now just skip the failing tests rather than update all the
code to deal with the new <Select> usage.

Also put in some comments warning whoever picks that code up
next that there is work to be done on date and time pickers.

Test plan:
* build passes
* No more imports from "@instructure/ui-forms"  in assignments_2

Change-Id: I0ad71714ea0728071738043b585582758d04cbf6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261312
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2021-03-23 16:56:03 +00:00
Charley Kline b8d1380375 Short-circuit old <DateTimeInput> in assignments_2/teacher
Closes FOO-1716
flag = none

Since assignments_2 teacher page is currently unused, just
short out the calls to the deprecated InstUI <DateTimeInput>
component rather than fix them right now.

Also skipped some tests that would fail without that component.

And put in some comments warning whoever picks that code up
next that there is work to be done on date and time pickers.

Test plan:
* build passes
* No more DateTimeInput in assignments_2

Change-Id: I37262cd41d656873e6ca401ee520db0db80d0a37
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261286
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2021-03-23 16:55:53 +00:00
Michael Ziwisky a39a2e99cc Set up replica identity index for User
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: Ib309f1249a84d44492af8298d44fee3efa40992c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260534
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-03-23 16:27:45 +00:00
Ryan Shaw 485acb0a05 remove “while(1);” json protection
Closes: COREFE-212

The attack vector this was trying to fix has been fixed in all browsers
since 2011 (https://security.stackexchange.com/questions/155518/)
and so is not a problem in any of the browsers we support

See this answer for more details of what the attack was and how
it is no longer a problem: https://stackoverflow.com/a/2669766/7159335

This will make it a lot easier for all of our api request so we don’t
Have to worry about that anymore

Test plan:
* in a browser where you are logged into canvas
* go to /api/v1/users/self
* it should not have a “while(1);” in front of the json

Change-Id: I3750672c41791040f7fb09b2e35bad7966060101
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/205090
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-23 16:21:44 +00:00
Rob Orton 9d2604c4e5 leave root_account out of the find and create
there is an index on the user_id and context_id, we want to find from
the keys of the index and let root_account get populated from favorite
context

test plan
 - specs should pass

fixes VICE-1236
flag=none

Change-Id: I70f2ceaa941d38cd7a7de054b0888044d3325a25
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261298
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2021-03-23 16:18:10 +00:00
Davis Hyer 9bf4473a71 update designs of TheradingToolbar
fixes VICE-1235
flag=none

InstUI had a few hidden gems, this switches us to use them

test plan:
  - open storybook
  - components should more closely match the original updated
    designs

qa risk: low

Change-Id: Ibd68ec64a764d4c93132d934e4eb94ca0d4f7c26
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261328
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chawn Neal <chawn.neal@instructure.com>
QA-Review: Chawn Neal <chawn.neal@instructure.com>
Product-Review: Chawn Neal <chawn.neal@instructure.com>
2021-03-23 16:15:18 +00:00
Nate Armstrong 62e0c3f8f8 Fix modules items api for public_to_auth_users
closes LS-2015
flag=none

test plan: automated

Change-Id: If26b259acf319923060936bd84dfd44c26ce4ecc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261334
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
2021-03-23 15:24:02 +00:00
Jackson Howe b497441e99 Add apps to k5 resources page
This change adds apps to the resources page with
canvas_for_elementary enabled. Shows all the non-hidden course_nav
apps for each of the user's non-homeroom courses. Apps installed in
multiple courses only show up once, but a modal is presented to choose
launch context.

Also adds error handling and loading incdicators for apps and staff
info on the resources page.

flag=canvas_for_elementary
closes LS-1770

Test plan:
 - Enroll a user in at least one homeroom and one non-homeroom course in
   a k5 subaccount
 - Go to the Resources tab on the dashboard
 - Expect to see a loading indicator while loading
 - After loading, expect to see student applications section with app
   buttons listed for each app installed in non-homeroom courses
 - Click on an app
 - If the app is installed in more than one course, expect to see a
   modal, else, the click will immediately launch the tool in the
   associated course
 - Simulate a browser connection failure when the apps are loading,
   expect to
   see an error message appear
 - Remove all apps, expect to not see the apps section at all

Change-Id: Ie98df547e37342f3b42da69e94923e4f2da6b5d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260692
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-03-23 15:15:18 +00:00
Aaron Ogata e497e9e605 move depends-on logic to extendedStage
refs DE-338

[canvas-builds-refspec=e5c05f880520aceaa5743a4f220d4f8438fdfbd4]

Change-Id: I6404f5f061573404e4c47dc0e0f9adc2b76a4e4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261363
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-03-23 14:46:35 +00:00
Adrian Packel 618b2393b3 Prevent concluded students from submitting
Do not allow concluded students to submit in the enhanced student view;
also prevent them from redoing an attempt or starting a new one, and add
a notice saying that their enrollment has been concluded.

fixes EVAL-1413
flag=assignments_2_student

Test plan:
- Have a course with assignment enhancements enabled and a student
- Conclude the student's enrollment
- As the concluded student, check that the following hold:
  - If you already submitted, the "New Attempt" button should not appear
    in the header
  - If you have a submission in progress, the "Submit" button should not
    appear
    - (note that you can currently modify your draft; this will be fixed
      eventually but isn't a concern for this ticket)
  - If you have not yet submitted anything, the option to choose a
    submission type should not be shown
  - At the bottom of the page, you should see some text informing you
    that you can't submit because your enrollment has been concluded
- As a student who is not concluded, check that you have the ability to
  submit/redo/begin a submission as usual

Change-Id: I294e5181e106e4bbaf893fc271335d37475a30b2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260690
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jody Sailor
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
2021-03-23 14:11:15 +00:00
Jenkins daca2fe134 update pt translation
Change-Id: Ic097199b14e1525f09edc281a37f79c2eb07ccc4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261346
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-23 05:49:07 +00:00
Jenkins 77186429a0 update mi translation
Change-Id: Iee6b0f04941c65c761a784eeef5766e3e15b30e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261345
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-23 05:47:43 +00:00
Aaron Ogata adf58468d1 use extendedStage for Builder wrapper
refs DE-338

[canvas-builds-refspec=e12b0f989dc38492981a9f286e079afc70e24cd5]

Change-Id: I1fd2647d5ef6e9cc4714daac0433c29b1939e156
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261323
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-03-22 23:09:40 +00:00
Jonathan Guardado e82364a79c RCE course links option embeds files with image content-type
When adding a link to the RCE the validations to check the file
content were changed; instead of using isAudioOrVideo, isImage or
isVideo now the fileEmbed method of the mimeClass will be used to
make sure the browser supports the file

fixes LS-1933
flag=none

Test Plan:

Scenario 1:

1- Upload a file to a course with image/ content type not supported
 by the browser (e.g. dxf file)
2- Create or edit a page to see the RCE
3- Type some text and highlight it.
4- Use the arrow next to the links button to choose "Course links"
and then choose files in the right.
5- Click the file you uploaded in step 1 and notice it does not try
to embed the image; instead it creates a link of the text to that
file

Scenario 2:

1- Upload a file to a course with image/ content type supported
by the browser (e.g. png file)
2- Repeat steps 2,3 and 4 of the Scenario 1
3- Click the file you uploaded in step 1 and notice it image is
rendered without problems

Change-Id: I389dd25393e7e36556301d5e4216b699f71da76f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260702
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
2021-03-22 23:04:22 +00:00
Brian Watson 4551fb00b8 spec: tweak axe-selenium a11y rules
flag=none

Test-plan:
- Verify output is less noisy with a11y team

Change-Id: I432121254c29822ce310d9fbcf5d0f1bc8576873
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261120
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-22 22:48:33 +00:00
Jeff Largent 49ff388a2d Fixes broken K-5 mode schedule tab test
flag = none

Test plan: tests pass again

Change-Id: I99e8baccf116add29295d5580b8ec61d61053439
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261329
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Jeff Largent <jeff.largent@instructure.com>
Tested-by: Jeff Largent <jeff.largent@instructure.com>
2021-03-22 22:13:37 +00:00
Jeff Largent b2b23f65e1 Add missing assignments component to K-5 schedule tab
This change adds a new component that appears under the "Today" item
in the K-5 Dashboard Schedule tab when there are missing submissions
for assignments in the past. It initially displays as a collapsed list
calling out the number of missing assignments, and displays all
missing assignments as Planner items when expanded.

closes LS-1761
flag = canvas_for_elementary

Test plan:
  - Create a text submission assignment, an assigned quiz, and an
    assigned discussion in a new or existing course with due dates in
    the past
  - Log in as a student enrolled in the course who hasn't submitted
    any submissions for those assignments
  - Go to the Schedule tab of the K-5 planner as that student
  - Expect to see a link by Today with the text "Show 3 missing items"
    and a warning icon next to it
  - Click with link / button to expand it
  - Expect to see 3 items in the list linking to the assignments, with
    the appropriate icon based on whether the assignment is a quiz,
    discussion, or something else
  - Expect the items to have a warning icon instead of a checkbox
  - Expect the items to show the name of the course in the course's
    color below the assignment name

  - Enter a submission for one of the assignments
  - Back on the Schedule tab, expect the link to say "Show 2 missing
    items"

  - Enter submissions for all missing assignments (or become a user
    with no missing assignments)
  - On the Schedule tab, expect the link to not appear

Change-Id: I27f2e45fa03d31e2d48e5e907e202d0bee96c90d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260559
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-03-22 21:23:22 +00:00
Aaron Ogata 592541ad51 abstract stage status waiting
refs DE-338

[canvas-builds-refspec=542db943be830158dca3340d1f0c10605eeb67ea]

Change-Id: Ia1b35aeeade04e942efd0d29c0e5ccd4b38b17d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261304
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-03-22 20:49:17 +00:00
Wagner Gonçalves 67dc66446a avoid 500 error on grade passback
When a XML with an invalid encoding is sent to the `grade_passback`
endpoint, it's checked by `check_outcome` method, which was raising a
500 error when converting the xml to a string.

We're changing the `check_outcome` method, to catch that error, and
return a success response with description error message in the
imsx_description property.

closes INTEROP-6515
flag=none

test-plan:
- spec's should pass;
- Have installed https://github.com/instructure/lti_example LTI Outcome
  Service Example;
- Have an assignment with external tool submission using the LTI Outcome
  Service Example;
- As a student, you should be able to grade passback using the tool;
- You have to change the tool to send a xml with invalid encoding like:
  %{<?xml version="1.0" encoding="utf8"?><imsx_POXEnvelopeRequest \
  xmlns = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0"> \
  </imsx_POXEnvelopeRequest>}
- You should be able to submit the grade passback and receive a XML with
  imsx_codeMajor=unsupported and imsx_description contains the text
  `Invalid XML: unknown encoding name - utf8`;

Change-Id: I6febbc55a5979a9a21f8b72f464d09d4f57a726e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261045
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
2021-03-22 20:32:49 +00:00
Aaron Ogata 0b18290357 improve single block syntax for easier modification
refs DE-338

Change-Id: Ie3812fa6c430495b17459662490d18064f97dedd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261294
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-22 18:22:49 +00:00
Aaron Ogata 4db066e5e4 rename timedStage => extendedStage
refs DE-338

[canvas-builds-refspec=c9a2defcf07854831310c015926d53a8894a31dc]

Change-Id: Ia6567b31d3b0e5b2579c7718f01fb010e15153da
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261285
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-03-22 18:03:07 +00:00
Chawn Neal e47b3684ab update discussion type attributes
fixes VICE-1194
flag=none

test plan:
  - Go to graphql. go to legacy node> Discussion
   there you should see new attributes.
  - rspec will specfically list the added
   attributes

qa risk: low

Change-Id: I3e7cac9c82ff3888e8598f5b5a45fb35e8579c5d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261122
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2021-03-22 17:52:57 +00:00
James Butters 7a995262c9 refactor check_dependencies
refactor check_dependencies and add print_missing_dependencies
to work with both mac and linux.

closes: DE-577
flag = none

Test Plan:
-run docker_dev_setup on mac with missing depenedencies or
 docker-compose version older than 1.20.0
  -script dies with message about missing dependencies
-run docker_dev_setup on linux with missing dependencies or
 docker-compose verions older than 1.20.0
  -script dies with message about missing dependencies
-run docker_dev_setup on linux without dory
  -prompoted to skip dory, if 'y' script continues and does
   not try to start dory. If 'n' script dies with message to
   install dory then rerun.

Change-Id: I07f191cdfacbcd2124d8be69541999f57f1ff777
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261155
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-22 17:50:54 +00:00
Jeffrey Johnson 57359419be Initial creation of Discussion Post Toolbar fixes VICE-937
Test Plan
1. Pull down commit
2. Run storybook `yarn storybook`
3. Test the Discussion Post Toolbar in storybook

Expect: Design Criteria is met and all callbacks are working
Change-Id: I687fa92e1d0b981022c1e429621642e5bb96698b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261133
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2021-03-22 17:30:21 +00:00
Service Cloud Jenkins 5b440d7e63 Update parallel_runtime_rspec.log from build 178
Change-Id: I081ce48ca7da7f239fa6c771eae9a74525cbd289
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261245
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: James Butters <jbutters@instructure.com>
2021-03-22 16:38:31 +00:00
Evan Battaglia 046a0ccb13 Add ms_group_id to microsoft_sync_groups
It turns out creating a Microsoft group for a course is a two-step
process; the easiest way to determine if both steps have run is to save
Microsoft's ID for the group one the model, and only save it once we
have run both steps.

flag=none
refs INTEROP-6567

Test plan:
- run migration up, observe new field in DB
- run migration down, observe field is gone

Change-Id: I46be7cce6555cdc8a91770fc13cd94ea9dec23b9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260506
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
2021-03-22 16:30:58 +00:00
Evan Battaglia f32bf09676 MicrosoftGroup::UserMapping
closes INTEROP-6597
flag=none

Test plan:
- rake db:migrate
- try creating a MicrosoftGroup::UserMapping model. make sure Rails
  requires it to have both a root account and a user id (failing
  validation otherwise). Make sure Rails also fails validation if you
  try to create two records with the same user id and root account id.
- describe table (\d+ microsoft_groups_user_mappings) and check that
  root account id is non-nullable, the indexes look good,
  replica identity is on [root_account_id, id]
- Rollback migration (rake db:migrate:down VERSION=20210308210138) and
  check that table is gone

Change-Id: I2430eec8843494409e0026fbe761cc7945abf568
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260311
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2021-03-22 16:30:48 +00:00
Wagner Gonçalves 562fa66294 fix infer file extension from attachment module
The `infer_file_extension` first should try to infer the extension from
name, filename, or url parameters, because, there's more than one mime
type to the same extension, like text/plain: dat, txt, hh, hlp.
In case the extension wasn't find, we will try to find using the
content_type parameter.

closes INTEROP-6616
flag=none

test-plan:
1. Have a Course recorded;
2. Have a Student enrolled in this Course;
3. Have an Assignment recorded to this Course with some restrict upload
   file types;
4. Enable the assignment enhancements feature in the course settings;
5. Logged as a student, you should be able to upload files with
   diferrent extensions (according to extensions restricted in step 3)
   without receiving the console error `filetype not allowed`;
6. You should be able to receive the console error `filetype not allowed`
   when trying to upload a file with a extension that wasn't in the
   restricted list;
7. Accessing the submission details, you should be able to validate if
   the attachment corresponds to the file you submitted;
8. Accessing the speed grader as a Teacher, you should be able to preview
   or download the file submitted;
9. You should be able to you should be able to upload files after
   disabling the assignment enhancements feature and execute steps 5
   until 8;

Change-Id: Ie54b16fb3b6906554a2e1aad6010ad54d86a60f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260893
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
2021-03-22 16:27:05 +00:00
Aaron Ogata a61650192c wrap all stages in builder parent stage
refs DE-338

Change-Id: I1cc1eceacc310f8a221b0747f996cf1d9d44aac5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261273
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-03-22 15:45:56 +00:00
James Butters 6e11d6868c move functions to common.sh
move shared functions to common.sh. Move common.sh to
script/common/utils/common.sh

closes: DE-571
flag = none

Test Plan:
-running docker_dev_setup succeeds
-running docker_dev_update succeeds
-running rebase_canvas_and_plugins succeeds

Change-Id: I4d74369f9c88854d1bb4ac0b3b990f5045f24506
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261153
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-03-22 15:27:48 +00:00
James Butters 41849fec6c fix canvas_update for non-dockerized
flag = none

Test Plan:
- running docker_dev_update succeeds
- running canvas_update on non-docker succeeds


Change-Id: I2b20ae04315b4bfbd7a90f5a9331f0354065d239
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261263
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-22 14:43:10 +00:00
Weston Dransfield fc879f9b58 Add LTI launch index to LTI manual docs
flag=none

Test Plan:
Verify new documentation's links work correctly.
Verify the documentation is free of grammatical errors.

Change-Id: I54ab36dbe846353cee848f9e31c32bf647fb575c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261062
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2021-03-22 14:32:24 +00:00
Jenkins be3a08caee update tr translation
Change-Id: I2966e7a698a27e4c23469f76618c3f8f777cf0f5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261242
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-20 05:55:34 +00:00
Jenkins 5ad86714af update hy translation
Change-Id: I619f8d1e2f60bdd4652002b7ece70eb1563dc8c6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261241
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-20 05:54:43 +00:00
Jenkins f7c85c6164 update fa translation
Change-Id: I04e97b23a757d6e61e831c1e99a6b899fa1df93f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261240
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-20 05:53:51 +00:00
Jenkins 54790797ef update el translation
Change-Id: I139787aeaa84e783dc404b079d2d8d64ca35e92a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261239
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-20 05:53:26 +00:00