Commit Graph

43633 Commits

Author SHA1 Message Date
Pablo Marti-Gomez 4c65f3f583 Add cache to Outcomes::LearningOutcomeGroupChildren
Updates Outcomes::LearningOutcomeGroupChildren by adding cache
at the queries for getting the total subgroups and outcomes.

closes OUT-4148
flag=improved_outcomes_management

Test plan:
- Create nested learning outcome groups
- For each nested learning outcome group create learning outcomes
> With FF improved_outcomes_management: OFF
- On Rails console: calls to Outcomes::LearningOutcomeGroupChildren
methods should return a default value
- On web: when generating actions over ContentTag, LearningOutcome
and LearningOutcomeGroup it should not lead to clear any cache
> With FF improved_outcomes_management: ON
- On Rails console: call Outcomes::LearningOutcomeGroupChildren
methods for getting total subgroups and outcomes, queries to the
DB should be made (it will need the root context)
- Call again the same methods, it should return the values from
cache
- Create a new instance of the class and call the same methods,
it should return the values from cache
- Clear the cache with `Rails.cache.clear`
- On web (or through GraphiQL) get the total subgroups and total
outcomes multiple times; it should cache the data and should not
run additional queries
- On web: clear the cache by executing the following actions:
  - Add a Learning Outcome Group
  - Adopt a Learning Outcome Group
  - Copy a Learning Outcome Group from global
  - Remove a Learning Outcome Group
  - Add an Outcome
  - Remove an Outcome
- Get the total subgroups and total outcomes, it should run new
queries
- Run the same tests for global context, it should generate and
clear the cache in the same way

Change-Id: I9b0bfc68b84b3e36869d69a926ef84d9989ea96d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257257
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2021-03-17 16:49:37 +00:00
Pablo Marti-Gomez eca632b70c Add Edit Group Modal
closes OUT-4003
flag=improved_outcomes_management

Test Plan:
- With Improved Outcomes Management flag ON
> Account level
- Access to Outcomes
- Select a group from the tree browser
- Click the kebab menu at the selected group name and
click: Edit
- The Edit Group modal should be displayed with the
data of the group
- Delete the name, an error should be
displayed with the message: "Missing required title"
- Edit the title and the description and click: Save,
the Save button should become disabled when processing
the request, then the modal should be closed, no
changes should be displayed on the group at the tree
browser, and a toast with the name of the group should
be displayed
- Reload the page, the group should display the updated
name
- Open the Edit Group modal for the same group, the
description should display the new content
- Click on Cancel and on the X (close), the modal
should be closed
- Open the Edit Group modal again, stop the Docker
container, make changes on the group information, and
click: Save, an error should be displayed with the
request that failed
> Course level: repeat the same steps

Change-Id: I0eacabf8b351ccc9ad0a90b8f6f93a1d328efa18
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258777
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Jody Sailor
2021-03-17 16:46:33 +00:00
Rob Orton 5cffab2bd1 clean up stream items more efficiently
this consolidates four after saves into one and does it more efficiently

test plan
 - existing specs should pass

fixes VICE-1218
flag=none

Change-Id: I974b38711b0146e3f916dd5f48fa52bbfe26ae41
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260579
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-17 16:38:48 +00:00
Adrian Packel 2627cb94d6 Round grade summary score stats to 2 places
fixes EVAL-1320
flag=none

Test plan:
- Have a course with at least 5 students so stats get generated
- As a teacher:
  - Create an assignment with some number of points possible
  - Give a grade to each student; make sure the lowest and highest
    scores have 2 or more decimal places
- As a student:
  - Open the grade summary page and click the icon to show statistics
    for a given assignment
  - Observe that the lowest and highest score you gave appear rounded to
    2 decimal places
- Test that scores with fewer than 2 decimal places are shown as-is
  without any extra zeroes added

Change-Id: I3864fe796c159cd77523c360de15495bbc85d22f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260213
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
2021-03-17 14:57:20 +00:00
Jenkins 4ff8732639 update nn translation
Change-Id: I1715d96361bc7fbf60d6ea18cbeda8b16137b696
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260873
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-17 05:55:10 +00:00
Jenkins 20b6df2418 update mi translation
Change-Id: I51677028d25c16d84b307859d00b3b7e17d606c3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260872
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-17 05:51:57 +00:00
Aaron Ogata e8b0c12ad4 better approach to allow-stages directive
refs DE-561

[canvas-builds-refspec=23aaf39eef7c6df9ba39d87a8eea4ae63b683672]

Change-Id: Ia338f72d2792b28a16119db409dbb9ad9e5db389
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260825
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-03-16 22:18:24 +00:00
Weston Dransfield 1ce0ad390b MSFT sync group create endpoint
Closes INTEROP-6561
flag=none

Test Plan:
- Identify a course with no MSFT sync group
  associated with it
- Make a request to create a MSFT sync group
  for that course
- Verify a MSFT sync group record is created
  and returned with the correct default values.
  Note the ID of the group
- Via a rails Console, update that group to
  have a workflow_state of 'errored', a
  last_error set, and a job state set
- Soft delete the group
- Attempt to create a group for the same
  course. Verify the ID of the returned group
  is the same as the group previously noted.
- Verify the returned group has a workflow state
  of "pending" and that both job_state and last_error
  have been set to nil
- Make the exact same request and verify Canvas
  responds with 409 Conflict
- Attempt to create a MSFT sync group via the
  new API as a student. Verify the request fails
  with 401
- Attept to create a MSFT sync group for a course
  that does not exist. Verify the request fails with
  404

Change-Id: Iaa8900575a189c4d5d1d25042a29a4a22ac9954a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260411
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2021-03-16 20:36:57 +00:00
Weston Dransfield ede23743d3 MSFT sync group delete endpoint
Also make MSFT sync group records
soft-deletable

Closes INTEROP-6562
flag=none

Test Plan:
- Create a MicrosoftSync::Group associated with a
  course
- Make a delete request to the new endpoint providing
  the course ID of the course associated to the group
- Verify Canvas responds with "no content"
- Verify the group associated with the course is now
  in a deleted state
- Make the group "pending" again via a Rails console
- As a user who does not have the manage users course
  permission, attempt the same delete request
- Verify Canvas responds with unauthorized
- Experiment with making the delete request for
  courses that do not exist or do not have msft
  groups. Verify Canvas responds with "not found"

Change-Id: I642f5df659abc1b045339318e2c108c4df285e93
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260310
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2021-03-16 20:23:54 +00:00
Michael Ziwisky a437e76654 Set up replica identity index for EnrollmentDatesOverride
refs FOO-1171
flag=none

[pin-commit-instructure_misc_plugin=2a355a61125e91cccf377984902b3a15921e525d]

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

Change-Id: I30820fda78adc1b2844a31be42eca88b02aefd60
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260525
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-03-16 20:19:36 +00:00
Alex Slaughter ec1e6384fa Remove ability to look user up by id - hash is now needed
Test plan:
 - Specs pass
 - Test emails
 - Test discussion boards
 - Test LTI integration urls
 - Test conversations
 - Test different hosts, 127.0.0.1, localhost, canvas.docker, etc.

flag=none

Change-Id: I827c94501c9174ff8ca44aa362c686e198a9869b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258290
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-03-16 20:16:16 +00:00
Michael Ziwisky 7ab57265c9 Set up replica identity index for UserAccountAssociation
refs FOO-1171
flag=none

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

Change-Id: I027da73a5ff87226206e3ba7b06618c0919ad8d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260531
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: Simon Williams <simon@instructure.com>
2021-03-16 20:01:43 +00:00
Michael Ziwisky 2ac314bdfa Set up replica identity index for CourseAccountAssociation
refs FOO-1171
flag=none

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

Change-Id: Ib1e7f0cd2398c56fff8ec0208ace8a69a180a393
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260522
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: Simon Williams <simon@instructure.com>
2021-03-16 20:01:35 +00:00
Michael Ziwisky ca41fd8a4f Set up replica identity index for AccessToken
refs FOO-1171
flag=none

also don't backfill nulls if the column is already non-nullable

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

Change-Id: I5009a2f31249643738f69a6b0d765daf89276165
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260519
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: Simon Williams <simon@instructure.com>
2021-03-16 20:00:56 +00:00
Ethan Vizitei c5988b8cc5 Initial work on getting zeitwerk loader running
refs FOO-1712
flag=none

 - drop bad directories from autoloading (jsx)
 - re-inflect some things that zeitwerk doesn't
   know by default (InstFS, etc)
 - add environment variable trigger for enabling
   zeitwerk loading
 - move samesite transition cookie to app middleware
   so we don't try to reload middleware
 - use zeitwerk.rb shim to pre-load things
   that are not correctly loaded by their own
   gems

TEST PLAN:
  1) everything continues to work fine
  2) for local development, if you use the
     CANVAS_ZEITWERK env var, you get zeitwerk
     autoloading (which is probably still broken)

Change-Id: I55a0db84034133240698bf4ff0cc8d225ec181a6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260674
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-03-16 19:55:12 +00:00
Brian Watson 0a7d652211 spec: reset selenium-axe before each suite instead of before all
flag=none

Test-plan:
- trigger axe build manually, summarized results should be more
  inclusive

Change-Id: Ic2eb48d38ddf254c83c5f47ac88d9ee79c1bd921
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260822
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
2021-03-16 19:26:59 +00:00
Kai Bjorkman 3f73f40f67 Revert "create user observer link when enrolling observer"
closes EVAL-1525
flag=none

This reverts commit 906d11bc2a.

Change-Id: I9316faf753748e6c29ae43b3afc543ec3737f011
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260797
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jody Sailor
2021-03-16 18:25:21 +00:00
Aaron Ogata 4cd931dd92 add skip-eslint flag
refs DE-565

Change-Id: Idbcc8ac2b4d780c6cf5cf26a4fcdcec85bc86eb3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260812
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-16 18:02:37 +00:00
Chawn Neal 2987f3b77b Impliment SiteAdmin notifications
fixes VICE-907
flag=none

Add logic to render Canvas Administration if
the noitification is made by site_admin else
render account.name.

TEST PLAN:
 Note there are two areas to test:
 Admin Settings and User Dashboard
 1) Using Canvas gui, use the site_admin to create
  a notification. Confirm it renders
  Canvas Administration.(It will say
  ...from Canvas Administration in notifications.)
  Then create a notification using a default account.
  Note it will render "... from Account.name".
 2) rspec <filepath> will output a verbose description.
  filepath = spec/views/accounts/settings.html.erb_spec.rb
  filepath = spec/views/users/user_dashboard.html.erb_spec.rb

Change-Id: Ic858153d545e064139edc9eddad219292d7d7a25
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260329
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-03-16 16:12:33 +00:00
Aaron Ogata f48c4fe2d3 ensure all success / failure messages use summary url
refs DE-551

Change-Id: I6e93c39275c9fd92a400ce0b0cafdbda8c6b1a57
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260782
Reviewed-by: James Butters <jbutters@instructure.com>
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-16 15:42:29 +00:00
Cody Cutrer d69aa5ab29 avoid duplicate const warning in canvas_sanitize gem
Change-Id: Ic4f8f386213e5049bd2ad94b8cb8ce5aeaeba1c3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260713
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2021-03-16 15:32:25 +00:00
Brian Watson 5268a2cbcd spec: Prune duplicate rcs specs
These specs were added in g/113835 to verify that the rcs was functional
in these usages but the rcs isn't actually being called here so these are
unnecessary duplicates

These specs were manually diffed to verify that no functionality is lost,
and rspec --dry-run was used to verify that no specs were lost

flag=none

Test-plan:
- tests pass

Change-Id: I4c89ea879305a0a5b8680a7c854560302f3d43f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260757
Reviewed-by: Robin Kuss <rkuss@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Robin Kuss <rkuss@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-16 14:56:28 +00:00
Charley Kline fe8fd81581 Fix up rubrics/Comments component for InstUI 7
Closes FOO-1572
flag = none

Outdated version of <Select> could be replaced, luckily enough
because this usage of it is so straightforward, with the new
<SimpleSelect> so this is now ready for InstUI 7. Also removed
sinon from the test file because it isn't needed... jest.fn
works just fine.

Test plan:
* Have a course
* Have an assignment in that course with a rubric
* Have a student take the assignment
* As teacher, go into speedgrader for that assignment and
  open the rubric
* Type in some comment into the rubric and give the student
  some points or whatever. BE SURE to click on "save this
  comment for reuse" before submitting
* Have another student take the assignment
* As teacher, go back into speedgrader for the assignment
  and this second student, and open the rubric
* The "Save Comments" select box should be there and work
  exactly the same as it did before this commit

Change-Id: I140e48a23a19f811f59cdaa2cd777faaaeba052f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260755
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2021-03-16 14:30:32 +00:00
Ed Schiebel 2e78b3f846 Omit download button for external links
closes LS-2032
flag=rce_better_file_downloading

test plan:
  - with the rce better file downloading flag on
  - in the rce, add an external link
  - in the rce, add another external link, edit the HTML and add
    class="instructure_file_link" to the <a> element
  - in the rce, add a file link
  - in the rce, add a youtube link using the external link dialog
  - save
  > expect only the file link to get a download button
  > expect the youtube link not to get a preview thing

Change-Id: Ifab8f8957ca1c7b1fcc9a84b81254dc73fbbcd22
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260719
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: Ed Schiebel <eschiebel@instructure.com>
2021-03-16 14:13:07 +00:00
Ed Schiebel 14ab73d240 Default rce file links to preview-in-overlay
closes LS-2033
flag=rce_better_file_previewing

test plan:
  - in the rce add a course file link
  - add a file link from All Files
  - add another file link
  - put the cursor in each link and click on "Link Options"
  > expect the link options tray to open with "Preview in Overlay" checked
  - for the 3rd file, change to preview inline
  - save
  > expect first 2 files to open in an overlay when clicked
  > expect the 3rd file to open inline

Change-Id: Ifa0a462f752ac3d1afc89002c5db421f1720229d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260743
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: Ed Schiebel <eschiebel@instructure.com>
2021-03-16 14:05:46 +00:00
Jenkins ef4181a63a update nb translation
Change-Id: I451905c286a6f78de45f786505ebbf24f4aba3e1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260760
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-16 05:46:29 +00:00
Brian Watson 760bf0ff15 spec: Remove redundant outcomes rcs specs
These specs were added in g/113835 to verify that the rcs was functional
in these usages but the rcs isn't actually being called here so these are
unnecessary duplicates

flat=none

Test-plan:
- diff spec/selenium/outcomes/rcs/<spec> spec/selenium/outcomes/<spec>
- verify that differences are negligible
- stub_rcs_config is defined in rcs specs but not actually called

Change-Id: I54b8858d4adcd5fb52912814e1e0fbe2806b4a7b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260714
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
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-16 02:53:52 +00:00
Rob Orton bd3d26138d use method to determine if the box is checked
this allows nil to return true

test plan
 - enable show_push_notification_account_setting feature
 - go to account setting on a root_account
 - it should be checked
 - disable it should be unchecked

flag=show_push_notification_account_setting
refs SAS-1852

Change-Id: I4c7f370de9dc468683114f2ee0bd7cf998577581
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260748
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Reviewed-by: Michael Jasper <mjasper@instructure.com>
2021-03-15 23:42:39 +00:00
Jeremy Stanley 31a0b60b67 delay course progress live event dispatch
the ContextModuleProgression may be saved more than once while
requirements are evaluated, and these saves may generate spurious
course completion live events based on incomplete data. evaluating
an item requirement may also trigger delayed re-evaluation of other
requirements.

give these changes time to settle before sending any course progress
live events. queue a singleton job to do so, so multiple changes
in close succession do not result in multiple live events. the
delay is configurable as the "course_progress_live_event_delay_seconds"
Setting (default 120, two minutes).

test plan:
 - enable live events in a production-like environment
 - have a set of modules with requirements
 - as a student, complete some of them in rapid succession
 - wait two minutes, and a course progress live event should be
   created and up-to-date when received (counting the right
   number of completed requirements)
 - as the student, finish the requirements
 - two minutes later, a course completion live event should be
   received

alternatively you could modify the Setting and customize the
expected delay

closes LS-1967

Change-Id: I5c5ab01e75c48cc9916d9299ee1be55d360d1ee7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260416
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2021-03-15 23:14:08 +00:00
Aaron Ogata 8b21e0daeb only run yarn linter if relevant files have changed
refs DE-562

Change-Id: I5a1f783666eea4f74c4c8883622b3c29edb94111
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260574
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-03-15 22:21:32 +00:00
Charley Kline 2fde47d3cb Add course template permissions
Closes FOO-1684
flag = course_templates

Creates the permissions for controlling access to the new
course template feature.

Test plan:
* With the :course_templates FF on
* Visit the Permissions page, Account Roles tab
* The Courses - Course Templates permission group should
  be there, with the three granulars beneath it

Change-Id: I90f865d0895d463562b2f6c5fe543305e1411ef7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260697
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-15 21:13:51 +00:00
Cody Cutrer e1b5645a21 course templates is a root account feature flag
not site admin only

Change-Id: I4eadefaab99cabd46f67c7f579ce20f861532ef7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260651
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-15 20:54:26 +00:00
Jackson Howe a768b9adee Add endpoint to query visible course nav tools
This adds an endpoint that we'll use later to query which LTI tools to
show on the K5 dashboard. We want to get tools that:
 - have course_navigation placement
 - are not hidden by the teacher in navigation settings
 - have visibility settings applicable to user
The LTI tools that show up in the course navigation list satisfy all of
these requirements, so we can simply take the list of items in
course_nav (which is heavily cached), and filter for external tools.

refs LS-1770
flag=none

Test plan:
 - Hit /api/v1/courses/{id}/external_tools/visible_course_nav_tools
 - Expect to see a list of tools that meet the above requirements for
   each user doing the api call (essentially, every tool listed in
   course nav should be present in the JSON)

Change-Id: I436535e1f377b8b73c548e09acfe4c9324575910
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260383
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2021-03-15 20:27:06 +00:00
Rob Orton a811654948 update sis documentation don't recommend bad stuff
test plan
 - rake doc:api should work

fixes VICE-1219
flag = none

Change-Id: I701f2abb662857bb4ce6da1849e2dac52327d146
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260580
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2021-03-15 20:09:16 +00:00
Ed Schiebel df4ead0aad Fix link preview for old RCE content
closes LS-2020
flag=none

test plan:
  - in the RCE, add a file link and enable auto-open of the inline preview
  - edit the HTML and remove the instructure_file_link class name from
    the link
  - save
  > expect the link's preview to auto-open
  > expect this to  work with the rce_better_file_previewing and
    _downloading flags on or off

Change-Id: I2c17561cd0f6d6ec534031187624f8fc6feed598
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260632
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-03-15 19:58:34 +00:00
Aaron Ogata 709eb4f968 add color output to packages/ test runners
Change-Id: I63b2af8f276e59ea295828c2d4a7de288ea013c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260571
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-15 19:33:31 +00:00
Aaron Ogata d7e131b296 mirror busybox to starlord
refs DE-563

Change-Id: Ia48d1c078159aa3c0e3860cbb33ca34afcee8483
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260658
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-15 18:26:04 +00:00
Nate Armstrong 040a5c2b08 Move New Course Availability UI to RootAccount
refs LS-2018
flag=new_course_availability_ui

test plan: none

Change-Id: I9dc316afca32bba196ad5acac5711751691e1552
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260598
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-15 17:39:56 +00:00
Jeff Largent 141c0c5b9b Upgrade InstUI to latest minor / patch versions
This change aims to fix tree-shaking issues introduced in InstUI 7 by
the addition of `"type": "module"` to the packages' package.json
files. It updates the following major versions to their latest minor /
patch versions:

* 7 -> 7.4.4
* 6 -> 6.27.0

It also updates @instructure/ui-icons from v6 to v7, since nothing has
changed between those versions except the addition of new icons and a
slight tweak to the "add" and "x" icons to make them more closely
match product designs.

It also updates @babel/core, @babel/runtime, and
@babel/runtime-corejs3 to latest (7.13.10) to fix this babel issue:
https://github.com/babel/babel/issues/12854.

The dependency changes also shuffled around the webpack build a bit--
the assignment_edit bundle is now (slightly) over the max asset size
limit, while quizzes_bundle and screenreader_gradebook are not any
more.

fixes LS-2016
flag = none

Test plan:
  - Ensure everything in canvas still works and looks the same

Change-Id: I262012c9b752cec617f425c57e8c276bc7870b21
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260391
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>
2021-03-15 17:39:32 +00:00
Gary Mei ef67a32f3c spec: fix incorrect specs in EditViewSpec
flag=none

Test Plan
- Specs pass.

Change-Id: Ia85973c821d55f2648a138718820af43644978bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260645
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-03-15 17:30:43 +00:00
Wagner Gonçalves fabc4c3053 enable to submit homework assignment zip files from windows
closes INTEROP-6605
flag=none

When a user was submitting a zip file with `application/x-zip-compressed`
extension, we weren't accepting and returning `unable to find extension`
error.

So, we're changing the `canvas_mimetype_fo` gem to work with multiple
mime_type for the same extension like zip: application/zip,
application/zip-compressed, and application/x-zip-compressed.

And changing the `infer_file_extension` method to try to find the
extension from the filename when we don't know the content_type given.

test-plan:

test-plan
* Have a Course recorded;
* Have a Student enrolled in this Course;
* Have an Assignment recorded to this Course;
* In the course settings, you have to allow the assignment enhancements
  feature;
* Logged as a student, you should be able to submit the homework by
  uploading a zip file with different mime types like `application/zip`
  and `application/x-zip-compressed`;
* Accessing rails console, you should be able to validate if the
  Attachment.content_type corresponds to the file you submitted;
* To upload a zip file with `application/x-zip-compressed` mime type I
  used parallels to have a Windows running in Mac;
* You should be able to submit the homework after disabling the
  assignment enhancements feature;

Change-Id: If3a0dd3da67072c6292e65c551d83be9e235e7f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260472
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2021-03-15 17:19:41 +00:00
Mysti Lilla 4b2a300e87 Don't cache due dates on non-save
refs INTEROP-6554
flag=none

Test plan
- Have an assignment in a course
- Ensure due date cacher jobs
  have already run
- Do a put to the assignment from
  the API that changes nothing
- Ensure due date cacher doesn't
  run anyway

Change-Id: Ie3e39ef546c0fb9f0db52e10cdb7ead46b36c023
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260594
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
2021-03-15 16:56:11 +00:00
Eric Saupe ecba4cd360 Limit rendering To Do tab to supported contexts
PlannerNotes can be added to a student or to a course within
the context of a student. Groups are not supported but were
rendering the To Do tab and the form with the group if that
was all that was selected. This changes the logic for rendering
the To Do tab and the select options to the same and removes
groups from being included at any point.

fixes LS-1855
flag=none

test plan:
 - Create and publish a course
 - Enroll a student into the course
 - Create a group in the course and add the student to the group
 - As the student, go to your calendar and only have the group selected
 - In the calendar, select a day and verify the "My To Do" tab is not
  rendered
 - Select all the available calendars
 - Select a day and verify the "My To Do" tab is rendered
 - Click on the "My To Do" tab
 - Verify no student groups are available in the Calendar select

Change-Id: I6412a856bacd3cb4dfb75dc951a23900fb66ad15
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260261
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2021-03-15 15:45:10 +00:00
Weston Dransfield 67cbc6c448 Add collaboration DL extension with support for1.3 IDs
Closes INTEROP-6601
flag=none

Test Plan:
1. Install the 1.3 example tool in a course
   with the collaborations placement configured
2. Launch the tool from the collaborations
   placement and return an LTI Resource Link.
   In the test tool UI, also specify a combination
   of user `lti_ids` and group `lti_context_ids`
   from the course
3. Verify a collaboration is created in Canvas that,
   when clicked on, launches the tool.
4. Verify the collaboration is only available to
   users who were explicitly specified or part of
   a group from step 2

Change-Id: Icdd4a1363940a27397b93b9405d2b8878eb784c0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260573
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2021-03-15 15:36:02 +00:00
Robin Kuss 609ecaaa67 spec: add k5 dashboard teacher grade tab
Closes LS-2010

Test Plan: passes jenkins and tests grades tab

Change-Id: I4a64101f57dd29f9982a37402e3efe0e448d5de2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260556
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: Robin Kuss <rkuss@instructure.com>
2021-03-15 15:20:54 +00:00
Aaron Ogata 8ba5a59acf allow ENABLE_AXE_SELENIUM to be used as env var
refs DE-560

[skip-rebase]

Change-Id: Ida5d5433d477ab092468a81cbaf0cbb419cfd0a0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260547
Reviewed-by: James Butters <jbutters@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-15 15:11:09 +00:00
Adrian Packel 24b7244c11 Show similarity pledge in enhanced view
closes EVAL-1379
flag=assignments_2_student

Test plan:
- Have a course with the assignment enhancements student view enabled
- On the account settings page:
  - Enable Turnitin under "Features"
  - Enter some pledge text in the relevant field under "Similarity
    Detection Platform"
  - Enter some text for "Submission Comments" under "Turnitin Settings"
- Create an assignment with online submissions
  - Enable Turnitin for the assignment
- Open the assignment view page as a student and save a draft, or
  otherwise cause the "Submit" button to appear
  - You should see a checkbox with the pledge text you specified (and
    the comments you specified listed above it)
  - The "Submit" button should be disabled until you check the checkbox
- Try checking the same thing for a Vericite-enabled assignment if you
  have the fortitude
- Check that an assignment without Turnitin or Vericite does not show
  the checkbox/pledge/comments

Change-Id: I9ad0d5a4622b1c0f027723891e420c7c8987fee9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258771
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jody Sailor
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
2021-03-15 15:05:42 +00:00
juanpablo.montoya 2b25f188ff Sync changes to already-published quizzes
When a quiz in an associated course was published, new changes from a blueprint course quiz were not updated in quiz_data.
This fix generates data for new changes to be imported in the associated course

Fixes LS-1931
flag=none

Test plan
- Create a course and make it available as a blueprint course
- Create a new course and associate it to the blueprint course
- Create a quiz in the blueprint course but don't publish it
- Sync the changes
- Go to the associated course and publish the quiz
- Go again to the blueprint course quiz and add new questions or modify the content
- Sync changes
- Students at the associated course should be able to see new changes

Change-Id: I73914dd54f766eefe1fc9baa7779eddcd2052d58
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260495
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: JuanPablo Montoya <juanpablo.montoya@instructure.com>
2021-03-15 14:43:41 +00:00
Rob Orton f49a66f26b spec: reload user before checking for past_lti_ids
Change-Id: I8291f48ea86f68243acc31c0c44aa271851442d0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260605
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-03-13 03:49:47 +00:00
Nate Armstrong 7fc5013bd6 Handle rounding errors for min_score requirements
refs LS-1916
flag=none

Uses BigDecimal when comparing scores for min_score completion
requirements.

test plan: automated :)

The best way to test this locally is to:
- Create a course with a student
- Create a module and add an assignment to that module
- Make the assignment worth 10 points
- Add a module completion requirement for the assignment to
  score at least 1
- Publish the module and the assignment
- In the UI, give the student a grade of 0 for the assignment
- As the student, see that the item is incomplete
- From the rails console, find the submission and give it
  a score of 0.3 + 0.3 + 0.3 + 0.1

```
submission = Submission.last
submission.score = 0.3 + 0.3 + 0.3 + 0.1 # 0.9999999999
submission.save
```

- As the student, refresh the modules page
- See that the module item is marked as complete
- View the module item in the api and verify it is marked as complete
  there too `/api/v1/modules/:module_id`

Change-Id: I428fef5eb73e07ed64b5e43509159b9317d4645d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260593
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
2021-03-12 23:44:26 +00:00