Commit Graph

47982 Commits

Author SHA1 Message Date
Evan Battaglia bacc7131f8 MSFT sync fallback to batch if "too many users"
This was discovered in QA for a previous commit. If a course has over
100 owners, the sync fails, and then we run a partial sync, we can run
into the case where the partial sync tries to add 20 owners but many if
not all or duplicates. If there are >= 81 owners, Microsoft won't
realize this but instead say "there are too many users". Instead of
trusting this message, we should fall back to the batch API -- because
it adds each user individually, it will ignore any that are already in
the group instead of saying there isn't room.

Test plan:
- Have a Microsoft group with >= 82 owners
- From a rails console, get the graph service object and then get a list
  of 20 owners in the group.
    def all_owners_ids(gs, group_id)
      [].tap do |list|
        gs.list_group_owners(group_id) do |slice|
          list.concat slice.map{|u| u['id']}
        end
      end
    end
    group = MicrosoftSync::Group.first
    gs = group.syncer_job.steps_object.send:graph_service
    owners = all_owners_ids(gs, group.ms_group_id).take(20)
    gid = group.ms_group_id
- Remove one of the owners from the group:
    one = [owners.last]
    gs.remove_group_users_ignore_missing(gid, owners: [owners.last])
- Wait a couple seconds (API is eventually consistent) and check that
  the user is no longer in the group:
    all_owners_ids(gs, gid).include?(owners.last)
- Add the 20 owners -- 19 of which should already be in the group:
    gs.add_users_to_group_ignore_duplicates(gid, owners: owners)
- The function should return a list of the 19 duplicates. You should see
  it log that it first tried the 'patch' endpoint and fell back tothe
  'post $batch' endpoint.
- Wait a couple seconds and check that the user was added back in.
    gs.list_group_owners(gid).map{|g| g['id']}.include?(owners.last)

refs INTEROP-6805
flag=microsoft_group_enrollments_syncing

Change-Id: I4a3dd47edb62b29ba8278182b37894b28604ceda
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276318
Reviewed-by: Sean Scally <sean.scally@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2021-10-21 17:11:38 +00:00
Davis Hyer 6e7cbcd7ff don't allow concluded users reply to their own entries
fixes VICE-2162
flag=none

test plan:
  - enable the discussion redesign flag
  - enroll a student in a course with a discussion topic
  - as that student, make a parent and child post
    - the reply/quote buttons should show up correctly
  - conclude that user's enrollement
    - Enrollment.find_by(user_id: <uid>, course_id: <cid>).conclude
  - refresh the page
    - the reply/quote buttons should no longer show up

qa risk: low

Change-Id: Ib1bcde8d89be55702bbf8e8668573a69bca8d476
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276441
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-10-21 17:07:16 +00:00
Evan Battaglia 3a80c3caa6 MSFT Sync copy changes
Test plan:
- have a course with > 100 owners
- try to enable sync on it
- check copy is updated in the two places

refs INTEROP-6805
flag=microsoft_group_enrollments_syncing

Change-Id: I911c6ca6998918a3a49cbbbb2473566800ea2d60
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276483
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Sean Scally <sean.scally@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-21 16:46:41 +00:00
Cody Cutrer 349ff7fa49 RuboCop: Lint/UnusedMethodArgument spec
[skip-stages=Flakey]

all manual

Change-Id: I7703886011d35c28ba1b06414a39671eca12b501
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276448
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>
2021-10-21 16:20:05 +00:00
Jeremy Stanley a50a8bc699 republish pace plan when enrolling new students
test plan:
 - in a course with a published pace plan,
   when a new student is enrolled, a job should be enqueued
   to publish the pace plan (in five minutes, by default)
 - if more students are enrolled within this five-minute period,
   the pace plan republish job should be pushed back
   (so we don't duplicate a lot of work when enrollments are
   added in a batch)
 - pace plan update should also happen if a student enrollment's
   start_at changes
 - pace plan updates should not happen:
   - if pace plans are turned off in the course
   - if the course has no pace plan
   - if the course pace plan is unpublished
 - if a student wish a published a pace plan override has a changed
   start_at, her pace plan override should be republished
   and not the course pace plan

flag = pace_plans
closes LS-2659

Change-Id: I3e75ca7c63098dafae34a221d0958bb4576ca314
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276435
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-10-21 16:13:23 +00:00
Martin Yosifov dd5eaa1deb Fix failing test in Management/index
closes OUT-4823
flag=improved_outcomes_management

Test plan:
- all tests in index.test.js pass
- jenkins passes

Change-Id: Ia5a9a9049af885379d1ee63fb4d8bcf5a7b7630e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275988
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
Reviewed-by: Marcus Pompeu <marcus.pompeu@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
2021-10-21 16:09:05 +00:00
Jacob Burroughs e4e7aa4814 Expose vault config
Change-Id: I8f4518995f617e5baf8f878967e58ce865dce850
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276501
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-10-21 15:51:47 +00:00
Omar Gerardo Soto-Fortuño f8de1cc8a3 Hook up report flow on IsolatedParent
refs VICE-2075

flag=discussions_reporting

test plan:
  - Go to a Discussion Entry in the Isolated View.
  - Click on the kebab menu on the parent.
  - Click on Report and select a type.
  - Click on Submit.
  - Click again on the kebab menu.
  - Should say Reported instead of Report.

qa risk: low

Change-Id: I4b12dc028afb40bc495faf5a6b1936c80a2cc8ae
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276478
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>
2021-10-21 15:42:05 +00:00
Evan Battaglia 808ab82d34 MSFT sync: handle adding/removing users near limit
refs INTEROP-6805
flag=microsoft_group_enrollments_syncing

Test plan:
- have a course with one owner
- remove an owner and add a different owner. recall that enrollments
  have to be in an "active" workflow_state to count.
- run a partial sync (`group.syncer_job.run_synchronously :partial`)
- sync should fail, but it should still add the new owner. Check in the
  Microsoft admin console. Both owners will exist in the group.
- run a full sync (`group.syncer_job.run_synchronously`). Check in the
  MS admin console. The old owner should now be removed.
- Repeat but run a full sync instead of a partial sync the first time.

Change-Id: I0cce5a50a51f40ed36f5eea928638c4782b31937
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276019
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
2021-10-21 14:53:17 +00:00
Evan Battaglia 51b5ddc080 MSFT Sync: refactor http code
Also fix default special_cases ([] instead of {}) in graph_service/http.rb

The diff http.rb doesn't show nicely here, try:
  diff --ignore-space-change \
    <(git show HEAD^:lib/microsoft_sync/graph_service_http.rb) \
    <(git show HEAD:lib/microsoft_sync/graph_service/http.rb)

refs INTEROP-6805
flag=microsoft_group_enrollments_syncing

Test plan:
- run through a sync, make sure it still works

Change-Id: I12d4339c0c1a50417ed23f9476ca12b1b9f711a4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275802
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-10-21 14:53:05 +00:00
Evan Battaglia 702cf49cbd Disable course once reaches too many enrollments
closes INTEROP-6805
flag=microsoft_group_enrollments_syncing

Test plan:
- note: this is closely based on test plan for last commit
- enable sync for a course
- add 101 teachers that have users in our test tenant. I
  made a bunch of test users to use owners you can use. What I did was
  generate the list of UPNs with
  'echo evantest{001..101}deleteafternov2021@...' and add them to my
  course)
- Remember the enrollments have to be all active and the communication
  channels 'registered', so I did
  `CommunicationChannel.update_all(workflow_state: 'active')`
  followed by
  `ms_group.course.enrollments.map{|e| e.update workflow_state: 'active'}`
  which will add the users to the PartialSyncChanges table.
- run a partial sync (e.g.
  `group.syncer_job.run_synchronously :partial`)
- in the course settings check the Microsoft Sync integration, it should
  be disabled. Note that it won't show any error because errors are not
  shown when the sync is disabled, but trying to enable it will show the
  error shown when trying to enable a course with too many enrollments
  (added in a previous commit)
- in a console, check that last_error is set on the group
- remove the 'check_for_enrollment_limits' before_action hook in
  app/controllers/microsoft_sync/groups_controller.rb
- also remove the 'rescue Errors::OwnersQuotaExceeded' block on
  lib/microsoft_sync/syncer_steps.rb:263 so we can be sure we are testing
  the step_full_sync_prerequisites code path
- enable the sync again
- run a full sync
- check the course settings page again. Again the sync should be
  disabled. And last_error should should have the "too many teachers"
  error message

Change-Id: Ied4faf7f997040e224c1cbdcdb7f0c5d24c4e02e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274953
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
2021-10-21 14:52:54 +00:00
Jeff Largent 0cd984c785 Warn about unsaved changes on navigation in Pace Plans
closes LS-2721
flag = pace_plans

Test plan:
  - Enable Pace Plans feature flag and course setting
  - Go to Pace Plans in a course with at least one module item
  - Make changes to the durations or settings in the pace plan
  - Try to navigate to a different part of the course or reload the
    page
  - Expect to see a browser warning pop-up asking if you're sure you
    want to leave
  - Dismiss the browser warning
  - Make some changes and then click the "Cancel" to reset back to the
    last published state
  - Navigate or refresh the page
  - Expect to NOT see a browser warning when there are no unpublished
    changes

Change-Id: Ibcd0fe9db983e892b80ca8866675f0844ed811cd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276418
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-10-21 14:52:47 +00:00
Weston Dransfield 5e0f828c20 Add current image preview icon
refs MAT-465
flag=rce_buttons_and_icons

Test Plan:
- Navigate to an RCE instance
- Open the buttons and icons tray
  to create a new button
- Verify the color pickers work as before
- Verify the bottom of the tray has an
  empty image preview (red line through a box)
  with text reading "None Selected"

Change-Id: If45027317902b8be7e529da69c2a51596134f839
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274679
Product-Review: David Lyons <lyons@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
2021-10-21 14:37:04 +00:00
Robin Kuss 2cf11b3a54 spec: unskip missing items test for k5
Unskipped missing items test and made it a little more relevant.  Also
fixed items to say subject instead of course.

Closes LS-2754

Test Plan: passes Jenkins

Change-Id: Ib9949877007d4c9d1a2edc65fa05a4d9be7f88c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276473
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
2021-10-21 14:08:52 +00:00
Cody Cutrer d4d27313fb RuboCop: Lint/UnusedMethodArgument partial
app except for app/models, config

all manual. many cases I removed the unused argument entirely, and
updated callers to not send it

there were also a few "override this method and raise an exception so
you don't use it cause rails is changed" methods that were for old
rails versions that I just removed completely

Change-Id: I071a5a8266801427c5c7a157fefe14850495e620
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276446
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>
2021-10-21 13:39:12 +00:00
Cody Cutrer 6cb0ea010c RuboCop: Lint/UselessAssignment spec
[skip-stages=Flakey]

all manual

Change-Id: I615934f94060ed339c17d6a73599487dc577e376
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276433
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>
2021-10-21 13:38:12 +00:00
Cody Cutrer fe80e9908c RuboCop: Lint/UselessAssignment spec/apis
[skip-stages=Flakey]

all manual

Change-Id: Ib9895503e3f11a8cc385b32a27cbd472e4258c87
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276388
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>
2021-10-21 13:37:52 +00:00
Cody Cutrer a995823753 RuboCop: Lint/UselessAssignment spec/models
[skip-stages=Flakey]

all manual

Change-Id: Ib03bdf69fad2d6a9c55a92194e4d1c26fe0b80d0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276415
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>
2021-10-21 13:37:34 +00:00
Cody Cutrer cfce475310 RuboCop: Lint gems/plugins
Change-Id: I1b0fa3c70f655b738e94df56621e7c8b623f0cfd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275533
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>
2021-10-21 13:36:56 +00:00
Jenkins 387d11d7d0 [i18n] Update package translations
Change-Id: If82e98f9a4acf98ed935f4a01fc1da3072ac5dfa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276453
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-21 04:49:12 +00:00
Isaac Moore f94fe15d01 Add `locked_for_user` property to `observer_alert_json`
This change adds a new `locked_for_user` property to the Observer Alert
API to indicate whether or not a particular alert's context is "locked"
(e.g., invisible) for the calling observer. This can be set to `true` for
a number of reasons, but most commonly, the deletion of the content or
the conclusion of the course.

closes LS-2668
flag=none

test plan:
- create an observing enrollment for a student enrolled in a course
- using the API, as an observer, create an observer alert threshold for
  a high assignment grade for your student (see the bottom of the commit
  message for an example request)
- as a teacher, enter a grade for the student in the course above the
  value you set in your threshold
- call the `/api/v1/users/self/observer_alerts/<student_id>` endpoint and
  verify an alert appears, and `locked_for_user` is false
- set the course end date to the past, and restrict students from viewing
  the course after the end date
- call the API again, and verify `locked_for_user` becomes true
- revert your change to the course end date
- call the API again, and verify `locked_for_user` becomes false
- delete the assignment
- call the API again, and verify `locked_for_user` becomes true again

### Example threshold creation request:
```
curl --request POST \
  --url http://<canvas URL>/api/v1/users/self/observer_alert_thresholds \
  --header 'Authorization: Bearer <your token here>' \
  --header 'Content-Type: application/json' \
  --data '{
	"observer_alert_threshold": {
		"alert_type": "assignment_grade_high",
		"threshold": "90",
		"user_id": <your student's user id>
	}
}'
```

Change-Id: Ifc0775c70a0e0cb6bf66c5e60968013a91661eb9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276187
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: Isaac Moore <isaac.moore@instructure.com>
2021-10-20 22:54:45 +00:00
Eric Saupe c5b6a1fa4d Update PacePlanModuleItem to verify module_item assignment
fixes LS-2772
flag=pace_plans

test plan:
- Create a course with a module containing a variety of things. Make sure
some are graded assignments like a graded discussion and some are not
graded like a practice quiz or a wiki page.
- Go to the pace plans index and verify that the module items shown only
include assignments from the modules that can be graded.

Change-Id: I32d95c15489f15d68e132f7f012ba2e76d88d76a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276429
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: Eric Saupe <eric.saupe@instructure.com>
2021-10-20 22:50:58 +00:00
Weston Dransfield 03ff06699f More documentation for IDE debugging
Copying the VS Code config to these docs
exposes them to open-source users

flag=none

Test Plan:
New documentation is clear and error-free

Change-Id: Iaa35b165677bdaf1b68ad7ce137911a7c345f9ae
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276436
Reviewed-by: Jon Scheiding <jon.scheiding@instructure.com>
QA-Review: Jon Scheiding <jon.scheiding@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-20 22:08:31 +00:00
Eric Saupe 023f356e85 Remove pace plans start_date column
fixes LS-2723
flag=pace_plans

test plan:
- Creating and publishing pace plans for courses, sections, and users
should create all relevant assignment overrides with correct dates
- Pace plans frontend should continue to work as expected
- Pace plans should no longer have the start_date column but should
return a start_date for the relevant context's start_at date. For example,
if the pace plan is for the user then the start_date will be the start_at
date for the user's enrollment. Course section pace plans return the
course_section.start_at. The fallback for all start_at is the course's
start_at date.

Change-Id: Iffce86bd0eca65a4f51db5f88e2b35833b7bc1f1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276317
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: Eric Saupe <eric.saupe@instructure.com>
2021-10-20 21:57:54 +00:00
Weston Dransfield 06de77a97e Add documentation pointing to IDE debug doc
flag=none

Test Plan:
New documentation is clear and error-free

Change-Id: Ie01dd6247dedc7b72ed84214932359cc14c39f09
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276421
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jon Scheiding <jon.scheiding@instructure.com>
QA-Review: Jon Scheiding <jon.scheiding@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
2021-10-20 21:20:11 +00:00
Mauricio Ribeiro 2b4c5f2b65 fix search discussion entry bug
fixes VICE-2100
flag=react_discussions_post

test plan:
  - Create a discussion;
  - as multiple students create a number of posts
  - as a student that has not accessed the discussion
  go to the discussion;
  - in the discussion search, search for a student name or a term
 unique to a discussion post;
  - only discussion entries related to the search shold be rendered

qa risk: low

Change-Id: Ibde8fe1a03cc982953c4314b8290f8a13dc13c4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275444
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
2021-10-20 20:52:01 +00:00
Adrian Packel 67bd2c52eb Add "message observers who" flag
closes EVAL-1926
flag=none

Test plan:
- Check that the flag appears as a site-admin flag

Change-Id: I095ae73faabf37d12d2ee0e0c0efb8d2701c47e0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276414
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Eduardo Escobar <eduardo.escobar@instructure.com>
Reviewed-by: Dustin Cowles <dustin.cowles@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-10-20 20:16:05 +00:00
Jonathan Guardado 6d4e95fb64 Fix: The student picker is above the <H1> in parent mode
The H1 tags for k5dashboard and K5 Course are now aria-hidden if the
user is in observer mode, the H1 to be read by the Screen Readers is
now part of the JSX to be rendered if the observee picker will be
shown

fixes LS-2728
flag = k5_parent_support

Test plan:
1- Go to the k5 dashboard as an observer with some linked students
2- Using VoiceOver navigate to the H1 using Control+Option+Cmd+H,
and expect the focused element be above the student picker
3- As observer, open a course with several linked students enrolled
in that course and repeat step 2

Change-Id: I233c3732246b41b90d59c9ab9ee1490e0bf1b64a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276204
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: Jonathan Guardado <jonathan.guardado@instructure.com>
2021-10-20 19:54:41 +00:00
Jackson Howe e6056c77f4 Create observer_picker flag
to use when porting the k5 observer picker into classic canvas.

closes LS-2647
flag = observer_picker

Change-Id: I2db666fe54d31e9493e97d7e31f69a1df7165fbb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276321
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2021-10-20 19:15:20 +00:00
Syed Hussain c2e04b732d Open rubric by default in A2 view
closes EVAL-2043
flag=assignments_2_student

Test plan:
With the FF ON:
1. As a teacher, create an assignment with a rubric
2. As a student:
- go to the assignment and see that the rubric is open by default
- submit an attempt
- start a new attempt and see that the rubric is open by default
3. As a teacher, grade an attempt
4. As a student, go to the attempt and see the rubric is open by
default with the assessments

Change-Id: I48d06e5e711392133e376369987d0bc8ea75cb44
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276163
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-10-20 18:13:18 +00:00
Ethan Vizitei c7b7f8d0dd bump inst-jobs
refs FOO-2512
flag=none

TEST PLAN:
  1) specs pass
  2) get system into a state with one
     orphaned job that cannot be rescheduled
  3) the pool does NOT enter an unresponsive state as it tries to
     abort that job over and over

Change-Id: I22d1c3600e3a6471bd6c9a265d90b91616ac52c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276384
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-10-20 17:52:08 +00:00
Omar Gerardo Soto-Fortuño 7bb77c64b3 Hook up report flow on DiscussionThreadContainer
refs VICE-2075

flag=discussions_reporting

test plan:
  - Go to a Discussion Entry in the main topic page.
  - Click on the kebab menu.
  - Click on Report and select a type.
  - Click on Submit.
  - Click again on the kebab menu.
  - Should say Reported instead of Report.

qa risk: low

Change-Id: I2aae2f9ba45e7f084674c70eed8d5b91117cb77e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276164
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>
2021-10-20 17:36:16 +00:00
Robin Kuss 68b422b157 spec: skip date not registering
Refs LS-2782

Test Plan:  passes jenkins

Change-Id: I1c851e9c2f78a117a7fb1a4e8e55fb6412d9236c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276379
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
2021-10-20 16:32:40 +00:00
Davis Hyer 12e0bfb5e7 switch inbox menu icon to kebab
refs VICE-2139
flag=react_inbox

test plan:
  - yarn storybook
  - MessageDetailHeader
    - dropdown menu trigger should be a kebab

qa risk: low

Change-Id: I3be96e397bb64ca2303d0f762325bb939b084230
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276309
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>
2021-10-20 14:47:11 +00:00
Brian Dunn 6af9b47c39 add integration_id to GraphQL user type
Introduces the integration_id value for users into the GraphQL user
type, serving it through user connections similarly to sis_id. This
value is used by some schools to connect with 3rd party tools, so this
addition will ensure full compatibility for tools looking to upgrade
from the REST API to the GraphQL API.

The permissions for this data point mirror the SIS data ("Only included
if the user has permission to view SIS information."), so it is only
displayed for users that have SIS data permissions, just like with the
REST API.

Fixes #1918
flag=none

Test Plan:

- Configure an integration_id value for one or more users.
- Run a GraphQL query (either through cURL, Postman, or GraphiQL) that
  includes user nodes, with each of the following setups:
  - Admin with SIS permissions
  - Admin without SIS permissions
  - Instructor with SIS permissions
  - Instructor without SIS permissions
- Observe that the correct integration_id appears when running the query
  as a user with SIS permissions, and null when run as a user without
  permissions.

Example query:

```
query LastActivityQuery {
  course(sisId: "UNIV-FRSH101-600-202102") {
    sisId,
    enrollmentsConnection {
      nodes {
        user {
          sisId,
          integrationId
        },
        lastActivityAt,
        updatedAt
      }
    }
  }
}
```

Change-Id: Ifce26e7105cb0b7461da7d4013c91242cd76188e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271111
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-10-20 03:15:14 +00:00
Cody Cutrer 44424c3619 update pygments.rb
so that it defaults to python3

Change-Id: I6de13d3937cb671dac0cd10e9c96dbc82e9bd96c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276320
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-20 01:18:12 +00:00
Martin Yosifov 64b803665b Fix focus issue in CreateNewGroup Create/Cancel button
closes OUT-4750
flag=improved_outcomes_management

Test plan:
- Enable Improved Outcomes Management FF
- Go to Account > Outcomes
- Click on Create New Group link in TreeBrowser
- Verify that the background color and hover color of the
expanded Create New Group are white
- Turn on high contrast mode, retest and verify that
results are the same

Change-Id: Ie7b2d81a6c79f74e9fa47ba167e47e9a38839bdc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276178
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-10-20 00:56:42 +00:00
Jackson Howe 5c58ad2ceb Fix LS AccessViolationError - notification preferences
Move course notification preference code into shared package so that
it can be used by both the account_notification_settings and
course_notification_settings features.

refs LS-2763
flag = none

Test plan:
 - Open /profile/communication and expect to be able to change
   preferences for account and courses
 - Open /courses/<id>?view=notifications and expect to be able to
   change course notification preferences

Change-Id: I092e1dabac092b3768a97cf7bf527ebe0a79e670
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276254
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: Nate Armstrong <narmstrong@instructure.com>
2021-10-19 23:04:45 +00:00
Cody Cutrer 759268f7dd fix bin/rubocop to work when pwd != rails root
Change-Id: Ib8aabe6948800e0ab143b448e4814c916029668b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276296
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-19 22:40:09 +00:00
Jackson Howe dcd871fbce Filter missing submissions by observed student
Also make the planner overrides checkbox read-only for observers.

closes LS-2722
flag = k5_parent_support

Test plan:
 - Open up the schedule tab on k5 dashboard as an observer with
   several linked students
 - Switch between students, expect to see one network request each
   time for missing_submissions and expect the observed student's
   missing assignments to appear
 - As an obsever, expect to see the overrides checkbox reflect the
   student's state, but read-only
 - Expect the planner to still work for k5 and classic students

Change-Id: Ife22e5361c6c5516506db5c908c05fff0f65bfab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276061
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-10-19 21:46:44 +00:00
Eric Saupe 6984011a42 Fix course pace plans changing non-course overrides
fixes LS-2764
flag=pace_plans

test plan:
- Create a pace plan for a course with module items and a student
enrolled
- Publish the course pace plan
- Verify the overrides have the expected dates
- Create a pace plan for the user with a different start date than the
course pace plan
- Publish the student pace plan
- Verify the overrides have changed for the student to the expected dates
- Republish the course pace plan
- Verify the overrides for the student pace plan have not changed

Change-Id: I16c8c04bb72aaccab14f296013eda475e8c2c6e4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276167
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: Eric Saupe <eric.saupe@instructure.com>
2021-10-19 21:13:34 +00:00
Ed Schiebel cee23965e2 DatetimeField changing date loses time when fields are separate
There's a good chance that parsing the user's typing in the
date or time fields may result in incorrect results, but
it's always been that way and way beyond the scope of this
ticket.

closes LS-2740
flag=none

test plan:
  - go to /calendar and create an event
  - edit the event and save, expect the event to have the
    correct start and end times you assigned
    - change which calendar
    - change a start or end time
    - change the date using the picker
    - change the date by typing in the text box

  This doesn't really belong in this commit, but it's
  bugged me forever that when the help text appears
  below the time box, alignment gets all wonky.
  - edit the event and put cursor into the start time box
  > when the text below the box shows the parsed time,
    the time boxes stay in aligned

  - edit an assignment
  - edit the due date as many different ways you can think of
  > expect it to save the correct date and time

Change-Id: Ia86ae6feac1f1e93f1ab9b99213f6018ca672ab8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276168
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-10-19 21:12:36 +00:00
Drake Harper e1c844612b Add studentReporting to discussion query
closes VICE-2174
flag=discussions_reporting

Test Plan:
 - turn discussion reporting ff on
 - open network inspector in dev tools
 - go to a discussion page
 - open graphql discussion response
 - shouls see studentReporting > permissions > discussionTopic

Change-Id: I9c4b185da1da918ec08b7b91e2bd53a1eae748e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276287
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-19 20:39:34 +00:00
Cody Cutrer 0b87e99d23 require ruby 2.7
since we've started taking advantage of some ruby 2.7 only features,
in particular filter_map

Change-Id: Ie5f0e4f94018080c5c8cd2effff1eb0f234ea955
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276268
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-19 20:28:46 +00:00
Cody Cutrer 88649d5d93 rubocop: disable Rails/HelperInstanceVariable
Change-Id: I350cee57432366b347ef823e3aafc5680b30e71c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275604
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-10-19 20:28:29 +00:00
Omar Gerardo Soto-Fortuño 99427348d7 Add loading indicator to ReportReply
refs VICE-2075

flag=discussions_reporting

test plan:
  - Go to Storybook.
  - Go to Examples -> Discussion Posts -> Components
      -> ReportReply -> Loading.
  - Should show the loading indicator and buttons
      be disabled.

qa risk: low

Change-Id: I89545d4365eac47b9331dddc69143a85bdba7533
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276276
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-19 20:22:20 +00:00
Drake Harper 38cc6c7f45 Add studentReporting to DiscussionTopicPermissionsType
refs VICE-2174
flag=discussions_reporting

Test Plan:
 - turn discussion reporting ff on
 - go to http://localhost:3000/graphiql
 - run a query similar to the example below
 > should see studentReporting as true
 - go to the discussions landing page in the course
    you queried against
 - click the settings cog in the top right
 - change student reporting to be false (unchecked)
 - run the query again
 - studentReporting should be false

Example Query: (remember to update the _id for the discussion)
query MyQuery {
  __typename
  legacyNode(_id: "23", type: Discussion) {
    ... on Discussion {
      id
      _id
      title
      permissions {
        studentReporting
      }
    }
  }
}

Change-Id: Ibbbae7e546efdcbc52901a38bcf1e606f3881055
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276278
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-19 19:51:26 +00:00
Ethan Vizitei 75a442a563 keep db connections in MB producer thread clean
closes FOO-2500
flag=none

TEST PLAN:
  1) re-enable MB pulsar writes in high traffic environment
  2) connection leasing errors do not return

Change-Id: I63bbfc370777c542d7d74441991fbafc188146b1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276255
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-19 19:48:45 +00:00
Brian Dunn 39e22af950 add updatedSince filter for submissionsConnection
Introduces a filter for submissionsConnection that will filter results
based on the submissions table's updated_at column. This mirrors the
functionality of submittedSince and gradedSince, but serves to find
results where the assignment grade has been changed or the submission
was changed (e.g. resubmitted).

closes #1934
flag = none

Test Plan:
- Use a collection of assignment submissions with previous timestamps
  for gradedAt, submittedAt, updatedAt
- Update one submission by grading it
- Update a different submission by re-submitting it
- Run a GraphQL query (either through cURL, Postman, or GraphiQL) to
  verify that both edited items are included in the results, and nothing
  else. Example query:

```
query AssignmentGradesQuery {
  course(sisId: "UNIV-FRSH101-600-202103") {
    sisId
    submissionsConnection(filter: {updatedSince: "2021-08-09T10:47:58-07:00"}) {
      nodes {
        assignment {
          _id
        }
        grade
        user {
          sisId
        }
        updatedAt
        submittedAt
        gradedAt
        enteredScore
      }
    }
  }
}
```

Change-Id: I0917daa80b3ab7d8ba7744960f951948e655dfbe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276246
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-10-19 19:44:24 +00:00
Jackson Howe 60f3a182fe Tweak zoom/webex regex to allow '-' in url
fixes LS-2752
flag = none

Test plan:
 - Add a link like https://instr-ucture.zoom.us/j/9585021282 (with a
   hyphen) to a k5 subject calendar event location or description
 - Visit the planner
 - Expect to see a join button

Change-Id: Iac43b8bc15eada834bdc71054e3f239d253e4aee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276272
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2021-10-19 19:43:13 +00:00