Commit Graph

25757 Commits

Author SHA1 Message Date
Ed Schiebel 360fb8945c Edit block or rce pages
whether a page was created with the rce or the block editor
edit with the corresponding editor

show an solid or line icon on the index page indicating whether
the page is a block or rce page respectively

closes RCX-2184
flag=block_editor

test plan: soon

Change-Id: Ia97c21c5b902affd0762ca16c6a1218db8899aa5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354568
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: Ed Schiebel <eschiebel@instructure.com>
2024-08-09 23:03:12 +00:00
Jeremy Stanley 5a75bfc737 ignore empty enrollment_term_id in account reports api
this was how it behaved before g/354328

test plan:
 - an account report with an empty enrollment_term_id param
   will run on all terms

flag=none
refs FOO-4601

Change-Id: I1cd593440f501ba373db9ae3a37059a4817dd6c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354686
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2024-08-09 17:52:20 +00:00
Jason Gillett 150bd28608 Implement Keyboard navigation to focus on Speedgrader
refs VICE-3920
flag=discussion_checkpoints

Next Patchset will implement the next and previous buttons

Test Plan
1. Have discussion redesign on
2. Have a discussion with a student post
3. Open in Speed grader
4. Keyboard navigate through the Discussion
5. Jump to SpeedGrader Navigation button will render
6. Click or press enter
7. focus should update to the speedgrader previous student

Change-Id: I2174ff36c3cb06bfe29d920bdcbb43d37c875946
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354640
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: 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>
2024-08-09 14:44:51 +00:00
Daniel Vincze 57bad90a6e fix: dont send noti when editor does not want to
fixes VICE-4499
flag=none

Test plan:
- Create a delayed announcement
- Edit its message and from date so its available
- click save & dont send
- no notification is sent

Change-Id: Ib59b967c913dbf2522a4e896cd623984eab940e7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354220
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ádám Molnár <adam.molnar@instructure.com>
Product-Review: Tamás Balogh <tamas.balogh@instructure.com>
QA-Review: Dora Csolakov <dora.csolakov@instructure.com>
2024-08-09 12:41:50 +00:00
Evan Battaglia 84e5e57356 fix recursion loop
refs INTEROP-8632

Test plan
- Change the constant in DeveloperKey::DEFAULT_KEY_NAME
- restart your docker container for good measure
- run DeveloperKey.default in a console (might have to do dc down && dc
  up)
- there should be no infinite loop. a new Dk should have been reated.
- hard-delete the new key (DK.where(id: DK.default).delete_all), undo
  your DEFAULT_KEY_NAME code change
- restart your docker container for good measure
- try to turn off the default DK account binding in the UI, it won't let
  you (original protection change)

Change-Id: I7a41435cd0c0eda7fa552bae0be4adfd261b9e10
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354641
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Steven McGee <steve.mcgee@instructure.com>
QA-Review: Steven McGee <steve.mcgee@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2024-08-08 21:03:18 +00:00
Omar Gerardo Soto-Fortuño 37c6ad0f90 Show partially submitted discussions in SpeedGrader
closes VICE-4511
flag=discussion_checkpoints

Test plan:
 - Test passes.
 - As a student, make a partial submission of a checkpoint by either:
     a. Making a Reply to Topic.
     b. Replying X times (as required by the checkpoint) to entries.
 - Visit SpeedGrader as a teacher for the student that made
     a partial submission, you should see the whole
     discussion topic.

Change-Id: Ie06baa3d7851a36f603e7f4fab67d1f8c7d23fe9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354614
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jason Gillett <jason.gillett@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2024-08-08 20:12:02 +00:00
August Thornton f264ebed10 ensure section ids are relative to the context's shard
When checking common elements between two arrays, we need to ensure that
the ids are relative to the context's shard. Global ids != local ids.

fixes FOO-4610
flag = none

Test plan |
Prerequisites: A trust where a student is enrolled in a cross-shard
course and has multiple sections.

- Create an ungraded discussion
- Set the "Post to" to only one section
- Save and Publish the discussion
- Log into the user's home account as the student assigned to the
  section on the Student Canvas app
- Navigate to the course
- Go to discussions
- Notice that the ungraded discussion assigned is present

Change-Id: I1772a7874e1c77f0a32f0c16a877819c5316af0f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354546
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2024-08-08 20:05:34 +00:00
Cody Cutrer bca3c9165c send unique notification when an access token is created on a user's behalf
closes AE-1081

Change-Id: I5f9a741c30973ccca7d0ddb10ca9d3470089e32d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354550
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jake Oeding <jake.oeding@instructure.com>
Migration-Review: Jake Oeding <jake.oeding@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-08-08 15:55:37 +00:00
Wilmer Corrales b32123ec22 Show recent messages on Profile page
This PS  limit the query in the context_controller only
 to return the first 10 messages for roster_user
 and new_roster_user pages

closes OUT-6392
flag=show_recent_messages_on_new_roster_user_page

test plan:
* make sure the ff is enabled on SiteAdmin
* make sure Enable Profiles is checked
  on the root account settings
* create a course
* create a Discussion Topic
* post at least 11 times on the topic as a student
* On the root account go to course people
* Go to the student user details
* 10 most recent messages should be shown

* On another tab
  Uncheck Enable Profiles on the root account settings
* Refresh student user details
* 10 most recent messages should be shown

Change-Id: I3a0023260ff1b6afa3331f9b36e6c0cd5a890baa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/351083
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Sam Garza <sam.garza@instructure.com>
2024-08-08 00:12:14 +00:00
Jeremy Stanley 1b4b008b2c validate enrollment_term_id in account reports
test plan:
 - an account report with a valid
   parameters[enrollment_term_id] should work
 - creating an account report with an invalid term id
   should result in a "bad request" error that fails
   the API endpoint, rather than creating a report
   that fails without saying why

flag=none
refs FOO-4601

Change-Id: I9d525f0cdab7104f431311e03551c0841650a208
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354328
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2024-08-07 19:39:50 +00:00
Martin Yosifov 55a0e4404a Update calendar events API to return sub-assignments
closes VICE-4473
flag=discussion_checkpoints

Test plan:
- Go to SiteAdmin -> Feature Options and enable
the Discussion Checkpoints feature flag
- Create a course with teacher and student
- Create a graded discussion without checkpoints
- Create a graded discussion with checkpoints
- Set due dates for both checkpoints and add date
overrides for both checkpoints for the student
- Create API access token from User->Settings
- Make a request to the Calendar API for sub assignments;
curl http://<canvas url>/api/v1/calendar_events \
 -X GET \
 -d "type=sub_assignment" \
 -d "context_codes[]=course_<course_id>" \
 -d "all_events=1" \
 -H 'Authorization: Bearer <access token>'
- Verify that the response returns
4 sub-assignment objects
- Verify that two of the objects have
sub_assignment_overrides key and values

Change-Id: Ib49c2e3565ffcc1e37d4ca3e3f0ca0164746e67e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354263
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Jason Gillett <jason.gillett@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2024-08-07 18:39:09 +00:00
Drake Harper e63c219374 Add supports_grade_by_question to assignment type
flag=platform_service_speedgrader
refs EVAL-4291

Test Plan:
- should be able to query supportsGradeByQuestion
   on assignments using graphiql

Change-Id: Icdc6aa286d8e44980cdd570c826adfa24fd0c1eb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354453
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
2024-08-07 17:24:45 +00:00
Steve McGee fe97567e11 prevent disabling default key
why: the default key should never be set to anything besides "on" and
     we discovered the hard way that we needed to guard for this on the
     backend. This commit doesn't make any changes to the front end and
     it's ok for the user to get a "Request failed with status code 500"
     toast message

closes: INTEROP-8632
flag=none

test plan:
- specs pass
- on Site Admin > Developer Keys, try to set the default key to "off"
  - you should see the toast message
  - verify that the key binding didn't change

Change-Id: I8443e3d05946dec75e4cd55efdf3d9aee77e267a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354064
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
2024-08-07 14:50:57 +00:00
David Varga c6a9ad5e25 Introduce student_context lti 1.3 custom claim
When launching form student_context_card placement,
there are two basically two contexts, course and student.
The standard context claim is filled with the course but tools
want to know about the student as well.
With this ticket we introduce a new custom claim
'https://www.instructure.com/student_context' that will be filled with
{ id: <student.lti_id> } when launching from student_context_card.

closes INTEROP-8186
flag=none

test plan:
- Launch a tool from student_context_card placement
- Check that the https://www.instructure.com/student_context claim
 is present in the idtoken and filled with the student's lti_id

Change-Id: Ie1b1b9d80ae415c8e7356f9ac313ec0f5bcb1ea5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354130
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Bence Árpási <bence.arpasi@instructure.com>
QA-Review: Bence Árpási <bence.arpasi@instructure.com>
Product-Review: David Varga <d.varga@instructure.com>
2024-08-07 12:08:09 +00:00
Chrystal Langston 4622427706 Add post policy to update and create course API endpoints
Please note that this PS also updates the permissions
checked for setting a course's post policy through the
Graphql mutation.  This is to ensure REST and Graphql
permissions are consistent to eliminate confusion.

closes OUT-6401
flag=none

test plan:
- Test plan:
- Follow instructions in
https://instructure.atlassian.net/wiki/spaces/ENG/pages/40206418/Canvas+API
to set up Postman OR log in to your local canvas as an admin
- Testing Creating a Course (without post_manually)
- Past the below after your canvas domain which will call the create a
  course API endpoint
  /api/v1/accounts/{account id}/courses?course[name]=PostPolicyCourseFalse
- Take note of the course id returned in the json response
- Navigate the course -> grades -> click on the gear icon -> choose
  "Grade posting policy" and assert the default setting of "Automatically"
  is set for the course
- Create another course using the same API endpoint but add post_manually
  course parameter with a value of true
  /api/v1/accounts/{account id}/courses?course[name]=PostPolicyCourseTrue
    &course[post_manually]=true
- Take note of the course id returned in the json response
- Navigate the course -> grades -> click on the gear icon -> choose
  "Grade posting policy" and assert the default setting of "Manually"
  is set for the course
- Testing Updating a Course
- Use the course id from the first course created and update the course
  name to "PostPolicyCourseFalseUpdated"
  /api/v1/courses/{course id}?course[post_manually]=true
- Navigate the course -> grades -> click on the gear icon -> choose
  "Grade posting policy" and assert the default setting of "Manually"
  is set for the course
- Use the course id from the second course created and update the course
  post policy to false
  /api/v1/courses/{course id}?course[post_manually]=false
- Navigate the course -> grades -> click on the gear icon -> choose
  "Grade posting policy" and assert the default setting of "Automatically"
  is set for the course
- Use the course id from the second course created and update the name
  only to ensure update performs as expected without post_manually
  parameter
  /api/v1/courses/{course id}?course[name]=SomethingElse
- Navigate to the course and notice the name has been updated
- Testing permissions up on graphql endpoint
- navigate to Graphql interface on your local instance
  http://{canvas domain}/graphiql
- Run the below mutation on the first course created
 mutation MyMutation {
  __typename
  setCoursePostPolicy(input: {courseId: "{first course created id}",
                              postManually: true})
  {
    postPolicy {
      _id
      postManually
      }
    }
  }
- Assert that the course post policy has been updated to manually
- Log in as a student and perform the same mutation
- Assert in the response you receive an error message saying "not found"
- Log out as student and log in as an instructor that is not
  enrolled in the first created course
- Perform the same mutation and assert in the response you receive an
  error message saying "not found"
- Log in as the instructor of the course, perform the same mutation
  and assert the mutation runs successfully

Change-Id: I46d35138aacc8d324c6c642550f5dac5f5f0a9b9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353158
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Dave Wenzlick <david.wenzlick@instructure.com>
QA-Review: Dave Wenzlick <david.wenzlick@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2024-08-06 21:43:09 +00:00
Jorge Arteaga 21d3e2eaee don't trigger NQ exports for Common Cartridge selective exports
fixes QUIZ-14199
flag = none

test plan:
- create a course with new quizzes, classic quizzes
and/or other objects (pages, assignments, etc)
- create a common_catridge export with "selected content"
(you can do this using the Canvas Rest API)
- the common catridge should not contain new quizzes
- the common cartridge should not trigger a content
export in New Quizzes

- as a regression test, export a common cartridge
for the same course, but without "selected content"
- the package must have new quizzes

Change-Id: I687187db13d5a6ac79c354b886afbfd340e74e73
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354433
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Griffin Zody <griffin.zody@instructure.com>
QA-Review: Griffin Zody <griffin.zody@instructure.com>
Product-Review: Cason Snow
2024-08-06 21:25:51 +00:00
Omar Gerardo Soto-Fortuño 7e03ea6b58 Add Checkpoints grading for SpeedGrader
closes VICE-4365
flag=discussion_checkpoints
flag=grading_scheme_updates
flag=custom_gradebook_statuses

Test plan:
 - Test passes.
 - Go to Speedgrader for an Assignment that is
     Discussions Checkpoints.
 - All the grading experience should work and persist:
     grading, statuses, custom statuses and late field.

Change-Id: I7c85a30bb67d525c08138441747b77bd9c4bb475
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354247
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Sam Garza <sam.garza@instructure.com>
2024-08-06 21:20:35 +00:00
Paul Gray 22360505e1 LIME: JSON URL install wizard first screen
This commit adds the first screen of the JSON URL install wizard. This
will allow administrators to install LTI tools from a JSON URL.

test plan:

1. Go to Apps -> Manage -> Add App -> JSON URL
2. Enter a URL that hosts a JSON LTI configuration and click Next
3. The app should display the JSON configuration in a pre tag (Follow-up
   ticket will add the ability to tweak settings)
4. Do the same flows, but try different URLs that are not valid JSON
   configurations. The app should display an error message.

closes INTEROP-8683
flag=lti_registrations_page

Change-Id: I6b17d63778a333ee989969c9471679b99ade7e28
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353953
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: Alexis Nast <alexis.nast@instructure.com>
2024-08-06 21:07:29 +00:00
Robin Kuss c1390351ee add focus test for trashcan and unskip test
Closes LX-1942

Test Plan: passes Jenkins

Change-Id: I541d4a4accd8e91b22859938f2c79d7271394706
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354439
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Sarah Gerard <sarah.gerard@instructure.com>
QA-Review: Sarah Gerard <sarah.gerard@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
2024-08-06 20:56:46 +00:00
Robin Kuss 39c98dd4da create tests for assign to on assignment edit page
Test plan: tests are unskipped and they pass jenkins

Closes LX-1876

[fsc-max-nodes=25]
[fsc-timeout=45]

Change-Id: I673e99e31e1a9fd1cba48464a06a3df498a7327a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354310
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Sarah Gerard <sarah.gerard@instructure.com>
QA-Review: Sarah Gerard <sarah.gerard@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
2024-08-06 17:31:35 +00:00
Bence Arpasi 8ec60fe0f9 Expose unified_tool_id in API
unified_tool_id field can be set/updated/read
via the ExternalTools API endpoint

closes INTEROP-8789
flag=none

Test Plan
- Set a tool's unified_tool_id
- Load the API and verify the value

Change-Id: I537460491ea4a20dcedab148ff61fe29f59f8a55
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354307
Product-Review: Bence Árpási <bence.arpasi@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2024-08-06 16:16:24 +00:00
Chris Soto fd5d2a0074 add individual and srgb query string to enhanced
this commit adds the query params of "individual" and "srgb" to navigate
to the enhanced individual gradebook when the FF is ON.

closes EVAL-4360
flag=individual_gradebook_enhancements

test plan:
- navigate to gradebook
- switch to the individual gradebook
- verify that the enhanced individual gradebook is displayed
  - you can determine this by switching an assignment or student and
    verifying that the url includes the assignment or student as a query
    param
- add ?version=individual to the url and verify that the enhanced
  individual gradebook is loaded
- add ?version=srgb to the url and verify that the enhanced individual
  gradebook is loaded

Change-Id: I097c579e5a93c1787718aaafe466649b1178e3c8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/352385
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cameron Ray <cameron.ray@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Derek Williams <derek.williams@instructure.com>
2024-08-06 15:57:25 +00:00
Ed Schiebel 4bc675087c Add selenium specs for the block editor
closes RCX-2174
flag=block_editor
test plan: passes jenkins

Change-Id: I9407a2d59137e0abde2469ca9b402b873b6c1a5c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354255
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob DeWar <jacob.dewar@instructure.com>
QA-Review: Jacob DeWar <jacob.dewar@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2024-08-06 15:12:05 +00:00
Daniel Vincze d1aa123255 fix: dont require assignment delete for dt edit
There is a weird bug, where a custom role without
the Assignment delete permission cannot edit a
discussion topic because we always check permission
even if it would be a noop anyway

fixes VICE-4471
flag=react_discussions_post

Test plan:
- Create a custom role from teacher
- Remove Assignment delete permission
- Enroll a user with the custom role
- Try to edit the body of a discussion ASSIGNMENT

Change-Id: I9a73f8895c51bc911c9dfec28214da6bc110ecac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354124
Product-Review: Tamás Balogh <tamas.balogh@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Roland Beres <roland.beres@instructure.com>
QA-Review: Ádám Molnár <adam.molnar@instructure.com>
2024-08-06 12:54:59 +00:00
Daniel Vincze a90d0c554d fix: some announcement wording
fixes VICE-4449
flag=discussion_create

Test plan:
- Create and edit announcements
- Wording should not be messed up
- must respond option should be gone

Change-Id: I4a747f03f331d35419854e1ab66dd69bec31fb17
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354309
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Dora Csolakov <dora.csolakov@instructure.com>
Reviewed-by: Ádám Molnár <adam.molnar@instructure.com>
Product-Review: Tamás Balogh <tamas.balogh@instructure.com>
2024-08-06 12:27:52 +00:00
Adam Molnar a3c96d4b25 show notification popup on delayed announcements
fixes VICE-4475
flag=discussion_create

test plan:
- have a course with atleast 2 teachers
- they should have emails, for notifications
- create a delayed announcement on user1
- edit the ann. text with u1
   -- notification modal should pop up
   -- selecting "send" should send a notification
   -- selecting "save & don't send" should
        not send a notification
- check the notifications on /users/U2ID/messages

Change-Id: I8a213910fc0f320abb0e8c86d90f6e0227169f5c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353910
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Daniel Matyas Vincze <daniel.vincze@instructure.com>
Product-Review: Tamás Balogh <tamas.balogh@instructure.com>
QA-Review: Dora Csolakov <dora.csolakov@instructure.com>
2024-08-06 12:25:23 +00:00
Tucker McKnight f34b52a229 Look for placement's non-prefixed name in disabledPlacements
Without this change, tools installed via dynamic registration
that use the Canvas URL prefix in their placement names
can't be disabled. With this change, they can be
disabled.

fixes INTEROP-8786

flag = lti_dynamic_registration

test plan:
- Have a tool installed with dynamic registration, such as yaltt
- Open a rails console, find yaltt's Lti::IMS::Registration record,
  and look at `registration.lti_tool_configuration`
- Ensure that one of the placements in that lti_tool_configuration
  has the https://canvas.instructure.com/lti prefix in front of it.
  (Under the "messages" key in the lti_tool_configuration, the placement
  should be named like "https://canvas.instructure.com/lti/global_navigation"
  instead of just "global_navigation.")
- Edit that tool configuration from the developer keys page
- Disable that placement
- Ensure that the tool actually disappears from that placement

Change-Id: Ie729550ff941de5db89e09bcc98a2ef349c1d82e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354181
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: Tucker Mcknight <tmcknight@instructure.com>
2024-08-06 04:00:18 +00:00
Sleyder Zuleta 463275e1bd Performance improvements for used locations
- Consider a grading scheme as "used"
if it's applied to an assignment, course
or account as default
- Add used locations to course lvl

fixes EVAL-3994
flag=archived_grading_schemes

Test plan:
- test used locations modal with his pagination
- validate every course, assignment and account
with the GS assigned as default is being showed
- validate that an used GS can't be deleted

Change-Id: Id5542c2c5cc8c9c1d2204fb819005434379c2e4d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/350482
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Rohan Chugh <rohan.chugh@instructure.com>
Product-Review: Ravi Koll <ravi.koll@instructure.com>
Reviewed-by: Derek Williams <derek.williams@instructure.com>
2024-08-05 20:51:38 +00:00
Jason Gillett 55902a18c8 create speed grader navigation UI
closes VICE-3919
flag=discussion_checkpoints

Test Plan
1. Go to discussion
2. Tab through page
3. Verify that these buttons do not
render outside of speedgrader
4. Open discussion in speedgrader
5. Tab the page
6. Verify that the 3 buttons in the design
render when focused.

Change-Id: I469724231226568316cd5e1a5f7ae679e5b94da3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353877
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Sam Garza <sam.garza@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Chawn Neal <chawn.neal@instructure.com>
2024-08-05 16:00:31 +00:00
Xander Moffatt ea5ab5b231 prevent errors on lti apps page
why
* in certain situations, a binding can be requested without its
corresponding registration
* this should not make the GET List LTI Registrations API fail
with a 500

closes INTEROP-8784
flag=lti_registrations_page

test plan:
* specs
* if you want to set up the scenario from the ticket, good
luck - easier to verify in beta

Change-Id: I5db120af85e93bb9a3ee4b934c6b8f9010dbed60
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354257
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Paul Gray <paul.gray@instructure.com>
QA-Review: Paul Gray <paul.gray@instructure.com>
Product-Review: Paul Gray <paul.gray@instructure.com>
2024-08-05 15:28:32 +00:00
theo sorriaux 84e4ea7a1c discussion topic page mobile redesign
fix font size & padding in dicussion
fix unread mark in dicussion
fix anonymousavatar size in dicussion

refs VICE-4414
flag=react_discussions_post

Test plan:
- Go to a discussion
- switch to mobile view
- post's font size should be the same as desktop

- Create an anonymous discussion
- post as a teacher, not anonymously
- post as a student, anonymously
- both anonymous & real avatar should be the same size

- Go to an unread dicussion
- unread blue mark should be on the top left of avatar
- unread blue mark should no longer be clickabke

Change-Id: I18c523c1a2738838f5db301790e8199db1a9d107
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/352248
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Tamás Balogh <tamas.balogh@instructure.com>
QA-Review: Roland Beres <roland.beres@instructure.com>
Reviewed-by: Daniel Matyas Vincze <daniel.vincze@instructure.com>
2024-08-05 13:38:01 +00:00
Weston Dransfield 59c2e456e7 Include New Quizzes endpoints in token scopes
Closes QUIZ-14130
flag=none

Test Plan:
- Create a new developer key and select some New Quizzes scopes.
  These scopes can be found by searching for "New" or "Quiz"
- Generate an access token from the developer key that uses the
  new scope (ideally get this through an OAuth2 flow rather than
  manual generation in rails console)
- Validate the token can only be used to access the New Quizzes
  scope selected in the first step

Change-Id: I6165e251853da80ad4c450f17669af96449fd8fc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354163
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Stephen Kacsmark <skacsmark@instructure.com>
Product-Review: Stephen Kacsmark <skacsmark@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2024-08-02 20:45:47 +00:00
Steve McGee 43fe6c9b05 remove obsolete test for a removed Setting
refs INTEROP-8632

Change-Id: Iff716d774f416c48fa2a034e922fa8c7f4d2a0b5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354256
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: Steven McGee <steve.mcgee@instructure.com>
2024-08-02 20:24:35 +00:00
Angela Gomba d7a3affadd Add Enabling Canvas for Elementary account settings to API
closes OUT-6259
flag=none

Test Plan:
- Jenkins passes
- Take note of the id of the account you want to enable Canvas
  for Elementary in. The setting should be disabled.
- Create new access token from User->Settings
- Make a post request to User API to edit Canvas for Elementary
  settings
curl http://<canvas url>/api/v1/accounts/<account id> \
 -X PUT \
 -F 'account[settings][enable_as_k5_account][value]=true' \
- F 'account[settings][use_classic_font_in_k5][value]=false' \
 -H 'Authorization: Bearer <access token>'
- Go to the Account settings and verify that Canvas for
  Elementary is enabled with Large Balsamiq Font selected
- Generate API documentation
docker-compose run --rm web bundle exec rake doc:api
- Go to http://<canvas url>/doc/api/accounts.html
- Verify that the Request Parameters now includes
  enable_as_k5_account and use_classic_font_in_k5

Change-Id: If2d57f92ede5f6b414d407ba161ea605e86a1854
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353859
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Jason Anderson <jason.anderson@instructure.com>
QA-Review: Jason Anderson <jason.anderson@instructure.com>
2024-08-02 19:34:15 +00:00
Maya Tyner ee68804b1b show update message after updating temp enrollment
Alert messages for temp enrollments were either created
or deleted messages. When a user edits and saves an
existing temp enrollment, the message 'Temporary enrollment
was successfully updated' flashes in this change.

closes FOO-4068
flag=temporary_enrollment

test-plan:
- Enable temporary enrollment feature flag
- Enroll a user in a course
- Visit /account/<account_id>/users
- Create Test:
	- Click the temporary enrollment white icon
	- Follow the steps in the modal
	- EXPECT success alert with 'successfully created'
- Edit Test: need a user with a temporary enrollment
	- Click a temporary enrollment green icon
		-Either provider or recipient
	- Click the Edit icon beside the temp enrollment
	- Submit the changes
	- EXPECT success alert with 'successfully updated'

Change-Id: I25eeedb647b91d5660544160542e5cd65bfea682
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354159
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Maya Tyner <maya.tyner@instructure.com>
Product-Review: Maya Tyner <maya.tyner@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2024-08-02 16:59:50 +00:00
Cody Cutrer b21f71e5a6 allows users to activate their pending access tokens
closes AE-1082

Change-Id: I27c7e59c2e0b79afac2d9cc6edccca28fbf17b3d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jake Oeding <jake.oeding@instructure.com>
QA-Review: Jake Oeding <jake.oeding@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-08-02 16:58:05 +00:00
Cody Cutrer 678c3fa0b2 allow admins to create access tokens on behalf of users
closes AE-1080

Change-Id: I8417c5fc3fa0daef909737e0b32f43c7e32d64ba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354154
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jake Oeding <jake.oeding@instructure.com>
QA-Review: Jake Oeding <jake.oeding@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-08-02 16:57:42 +00:00
Roberto Noguera 79a308a52d Prevent loops in fetch_outcome_copies
Prevent loop from happening in fetch_outcome_copies
method

closes OUT-6593
flag=none

Test plan:

- unit test pass

Manual test:

- open a rails console
- create a list of n learning outcomes and create
    a hierarchy (using the copied_from_outcome_id field)
- make the top level outcome child of the last level
- run LearningOutcome.find(<last level lo id>).fetch_outcome_copies
- it should return the list of copied

Change-Id: Ibceb02c69baf692cca331cde3e78db7ca2d62914
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354041
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Dave Wenzlick <david.wenzlick@instructure.com>
QA-Review: Dave Wenzlick <david.wenzlick@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2024-08-02 16:46:33 +00:00
Endre Berki 2742aa23cf use upsert on new UserPreferenceValue rows
This reduces SQL roundtrips on conflicting inserts while
keeping the conflict-handling behavior the same as before.
Follow-up ticket BUDA-27 will aim to prevent the most frequent
race condition from occurring.

closes BUDA-2
closes BUDA-11
flag=none

test plan:
- open a rails console
- find a user to test with

TEST WITHOUT THE CHANGE:
- execute the following commands:
  user.create_user_preference_value(
    'custom_value', nil, 'course_1: abc'
  )
  user.create_user_preference_value(
    'custom_value', nil, 'course_2: bcd'
  )
- EXPECT two SQL roundtrips (INSERT and UPDATE), with a
  rollback included
- EXPECT UserPreferenceValue table contains 'course_2: bcd'
  row value
- change the first and second parameters (sub_key) to a
  non-nil string value, example updated commands:
  user.create_user_preference_value(
    'new_custom_value', 'non_nil_string', 'course_1: abc'
  )
  user.create_user_preference_value(
    'new_custom_value', 'non_nil_string', 'course_2: bcd'
  )
- EXPECT two SQL roundtrips (INSERT and UPDATE), with a
  rollback included
- EXPECT UserPreferenceValue table contains 'course_2: bcd'
  row value

APPLY THE CHANGE:
- clear the rows created by the above commands
- cherry-pick the code from this commit

TEST WITH THE CHANGE:
- execute the same commands as above using the new method name:
  user.upsert_user_preference_value(
    'custom_value', nil, 'course_1: abc'
  )
  user.upsert_user_preference_value(
    'custom_value', nil, 'course_2: bcd'
  )
- EXPECT the second command to result in just one SQL command
  (INSERT with ON_CONFLICT), reducing roundtrips
- EXPECT UserPreferenceValue table contains 'course_2: bcd'
  row value
- change the first and second parameters (sub_key) to a
  non-nil string value, example updated commands:
  user.upsert_user_preference_value(
    'new_custom_value', 'non_nil_string', 'course_1: abc'
  )
  user.upsert_user_preference_value(
    'new_custom_value', 'non_nil_string', 'course_2: bcd'
  )
- EXPECT the second command to result in just one SQL command
  (INSERT with ON_CONFLICT), reducing roundtrips
- EXPECT UserPreferenceValue table contains 'course_2: bcd'
  row value

Change-Id: I8377166d0f586cabbacfb5889b4e85cc6dde1c90
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353797
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Imre Foldes <imre.foldes@instructure.com>
Product-Review: Imre Foldes <imre.foldes@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
Reviewed-by: Adrián Grúber <adrian.gruber@instructure.com>
2024-08-02 10:57:44 +00:00
Daniel Vincze a623e68ca3 fix: only show ppl from active enrollments
fixes VICE-4385
flag=none

Test plan:
- Enable temporary_enrollments feature on root lvl
- Create a course with some students,
and a teacher for the course
- Create a new section (plus the default)
- Enroll a teacher and a student to section (not all from course!)
- Set the teacher enrollment to be limited to
viewing only their section.
  - /courses/<course_id>/users/<teacher_user_id>
  - click more user details
  - should be after "Privileges"
- Create temporary enrollment for the course teacher
  - /accounts/<account_id>/users
  - recipient should be the section teacher
  - it should start and end in the future
- Act as the teacher with the temporary enrollment
- You should no longer see users from the future enrollment
  - /courses/<course_id>/users
  - /courses/<course_id>/gradebook

Change-Id: I3e21d17986c69072f03b3da2e288d2128f214298
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353707
Reviewed-by: Maya Tyner <maya.tyner@instructure.com>
Reviewed-by: Ádám Molnár <adam.molnar@instructure.com>
QA-Review: Maya Tyner <maya.tyner@instructure.com>
Product-Review: Tamás Balogh <tamas.balogh@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2024-08-02 10:57:34 +00:00
rzana e1e216ed91 fix discussion summary locale
refs ADV-49

flag = discussion_summary

Test plan:
1. In case only account default language is set,
   discussion summary should use that locale.
2. In case user language preference is set,
   discussion summary should use that local.

Change-Id: Ibed6da8e0bd7db485e097df9daf5cc17e831f62a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354131
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2024-08-02 08:44:29 +00:00
Riley Crahen b0ed9844d2 Cache menu_course Card Counts for Dashboard Rework
flag = dashboard_graphql_integration

closes LX-1932

Test plan:
- New specs pass
- Enable dashboard_graphql_integration FF
- Go to dashboard
- Publish a course
- Refresh page
- Refresh again
  you should see the correct number of dashcard loading icons

Change-Id: I21cd4f3d09c5ed3fb74f878e92f7a071b0e9e346
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354066
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>
2024-08-01 22:10:26 +00:00
Mysti Lilla 2b2182da47 QTI export/import not linking to files
fixes RCX-2121
flag=none

Test plan
- Set up a quiz with a link to an image in the RCE
- Export the quiz as a QTI
- Import the quiz to a new course and ensure
  the image is properly linked

Change-Id: Ifca00347d673f8eb8306ce09c0a8a3a56a4b321e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353272
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jacob DeWar <jacob.dewar@instructure.com>
2024-08-01 19:37:59 +00:00
Cody Cutrer 77e2c862bc allow deleting Microsoft auth providers even if their tenant is invalid
Change-Id: Iccc5569a52fe04334c19e6543759263360a4ca58
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353951
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>
2024-08-01 16:52:59 +00:00
jake.oeding 3f7d5fec76 create pending state for access tokens
closes AE-1078
flag=admin_manage_access_tokens

test plan:
-create a token and modify it's workflow state
 to be "pending" in a rails console
-attempt to make an api request using said token
>confirm you get an invalid access token response

Change-Id: Ib235ec0cc1e0c7bfb3d67be42b2da4718716ad69
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/354024
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jake Oeding <jake.oeding@instructure.com>
Product-Review: Jake Oeding <jake.oeding@instructure.com>
2024-08-01 16:46:53 +00:00
Dora, Csolakov 0490b39866 Fix discussion_type on Discussion Topics
refs VICE-4460
flag=none

test plan:
1.create a discussion with discussion redesign feature flag off
2.add threaded replies to it
3.run migration
4.verify that the discussion type is threaded

Change-Id: Idc66d016d9b6530d55a71d8da6e3efda35967528
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353715
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Daniel Matyas Vincze <daniel.vincze@instructure.com>
Product-Review: Tamás Balogh <tamas.balogh@instructure.com>
QA-Review: Ádám Molnár <adam.molnar@instructure.com>
QA-Review: Roland Beres <roland.beres@instructure.com>
2024-08-01 14:24:02 +00:00
Chris Soto a5e082a5fe update enhanced_rubrics ff to account level
this commit updates the feature flag for enhanced rubrics to be at the
account level instead of the root account level. This will allow sub
accounts to enable the feature flag for their account.

closes EVAL-4396
flag=enhanced_rubrics
[fsc-max-nodes=15]
[skip-crystalball]

test plan:
- make sure you have both root and sub accounts setup with courses on
  each of them
- turn on the FF at the root account level. verify that in the account
  rubrics page, the enhanced rubrics are enabled
- turn off the FF at the root account level. verify that in the account
  rubrics page, the enhanced rubrics are disabled and you see the old ui
- turn on the FF at the sub account level. verify that in the account
  rubrics page, the enhanced rubrics are enabled
- have an assignment with a rubric and visit speed grader. verify that
  clicking on the rubric button opens the new rubric tray
- turn off the FF at the sub account level. verify that in the account
  rubrics page, the enhanced rubrics are disabled and you see the old ui
- for that same assignment in speed grader, verify that clicking on the
  rubric button now opens the old rubric tray

Change-Id: Iacc9fbda783bf424ba0cd26291b1d39661fc164a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353324
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Ravi Koll <ravi.koll@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Derek Williams <derek.williams@instructure.com>
QA-Review: Ojaswee Chaudhary <ojaswee.chaudhary@instructure.com>
2024-08-01 14:10:51 +00:00
Tucker McKnight 985d9425cf Use short placement name to find registration overlay
If a tool's placement in the lti_tool_configuration is using the full,
canvas-url-prefixed placement name
(like https://canvas.instructure.com/lti/global_navigation),
merge the registration_overlay that is using the non-prefixed
placement name (like global_navigation).

Previously, modifications made to the tool configuration would
not have been applied, since the modifications made in the
overlay would not have been matched to that placement.

We already have a method, canvas_placement_name, that takes
the prefixed name and returns the non-prefixed name.

flag = lti_dynamic_registration

fixes INTEROP-8724

test plan:
- have a test tool like yaltt installed with the global_navigation
  placement
- go to Admin > Developer Keys, and edit the developer key for
  that yaltt install
- change the Icon URL field for the developer key and save it
- refresh the page; verify that your different icon URL is
  being used on the global navigation sidebar

Change-Id: I71e30699747c256bff39945fe6403219dbd091a0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353958
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: Tucker Mcknight <tmcknight@instructure.com>
2024-08-01 06:22:41 +00:00
Evan Battaglia ba1495a151 Use a Group's Course for LTI var expansions
Currently, if a tool is launched in the context of a Group, all
all Course-related LTI variable expansions will not be expanded, even if
the Group's context is a Course.

This commit:
1. Expands all COURSE_GUARD, TERM_*_GUARD, ENROLLMENT_GUARD,
  and STUDENT_ASSIGNMENT_GUARD lti variable expansions, which previously
  required a Course context, to work with a Group with a Course context.
  Namely, if @context is a course, they will use @context.context as the
  Course. Examples: Canvas.course.{id, name, startAt...}
2. Expands ROLES_GUARD permissions to work when context is a Group.
   These previously only worked when context was a Course or Group. For
   the first two (com.Instructure.membership.roles and
   Canvas.membership.roles) we simply use the enrollments from the
   Group's Account (or Group's Course and Account, if Group has a
   course). For `Canvas.membership.permissions` we check grants_right?
   directly on the @context (Group)
3. Also fixes the following expansions to be consistent for groups (give
   account, not root account):
   - Canvas.account.id
   - Canvas.account.name
   - Canvas.account.sisSourceId
4. Incidentally, due to the change of helper functions, the following
   expansions were also affected in that they now include roles from the
   Course if the @context is a Group with a Course context:
   - Membership.role
   - Canvas.xuser.allRoles
   - com.instructure.User.allRoles

See comments in ticket for full list of expansions affected.

Test plan:
- create a course in a subaccount
- make a Group in that course
- make an LTI tool in the account level that has variable expansions in
  custom fields -- at least one for each of the types of changes
  enumerated above. The tool should have the editor_button placement. (I
  couldn't seen to find any other placements shown in a page with a
  Group context...)
- launch the tool and check the custom variable expansions.
- turn the lti_variable_expansions_use_group_course_as_course flag off
  and relaunch the tool. The variable expansions should be as they were
  before this commit (likely unexpanded).

closes INTEROP-8737
flag = lti_variable_expansions_use_group_course_as_course

[fsc-max-nodes=18]
[fsc-timeout=40]

Change-Id: I4fffc6b5f91f8578a1e8b13907523e1372050f7f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/352964
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
QA-Review: Paul Gray <paul.gray@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
2024-07-31 23:28:41 +00:00
Bence Arpasi d5b0dfa04a Update unified_tool_id automatically from LearnPlatform
LearnPlatform is able to provide each LTI tool with a unified_tool_id.
When the service is configured and enabled the fetch and update is
happening via a background job after each commit on ContextExternalTool
and Lti::ToolConfiguration.

closes: INTEROP-8718
flag=update_unified_tool_id

test plan

Preparation
Run a small server that can accept and log GET requests
Setup config/vault_contents and config/dynamic_settings with your server settings

1.1 Tool
Create a new 1.1 App
Make sure your server got the correct request
If the server returns the right answer {“unified_tool_id”: “foobar”}
Then this value should be persisted in the CET

1.3 Tool
Create a new Developer key
Make sure your server got the correct request
If the server returns the right answer {“unified_tool_id”: “foobar”}
Then this value should be persisted in the Lti::Configuration
Create a new App with this Dev key
There is no more request to the server
Verify the CET has the right unified_tool_id

1.1 Redirect Tool
Create a new 1.1 redirect app
Make sure your server got the correct request including lti_redirect_url with the correct url for redirection

Change-Id: I4f9aa6575a0a80af875765f3ba92f30d8f40aa97
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/353247
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: Bence Árpási <bence.arpasi@instructure.com>
2024-07-31 21:34:26 +00:00