Commit Graph

17 Commits

Author SHA1 Message Date
Cody Cutrer 3d580338da use more idiomatic ruby for PaceService
* avoid purposely raising and rescuing ActiveRecord::RecordNotFound for simple
   control flow that you expect it to not be found often
 * don't name a class Interface when it's not an interface (it's just an
   abstract base class)
 * don't use a Factory class when it's really just a class method on said
   base class

Change-Id: I56e25c977f5dbe68ab527536bad4d75cd84291d7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/333956
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2023-12-05 21:50:45 +00:00
Eric Saupe b011fb30bf Handle missing student enrollments
fixes LF-525
flag=course_paces_for_students

test plan:
- Have a course with course pacing and module items and a student
- Go to the course pacing page for students
- While the page is loaded in another tab or the console remove the
student enrollment
- Publish a pace for the student enrollment that was deleted
- Verify no error report was generated and no assignment overrides were
made for the student
- Refresh the course pacing page and verify the enrollment is not there
and there is no error

Change-Id: Id65cb9feeaed59cf7edc083ba77fd27819cfa541
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/324311
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Luis Oliveira <luis.oliveira@instructure.com>
QA-Review: Jacob DeWar <jacob.dewar@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2023-08-09 15:52:10 +00:00
Jacob Burroughs 7dcc507d0a Rubocop for ruby 3.1
[skip-stages=Flakey]

Change-Id: I6abefdfa9fed6dd4525c8786e93efa548b3710f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-06-06 16:44:26 +00:00
Jonathan Guardado e0e3dcb9b1 Show students in pacing page for unpublished courses
It seems the current_and_future scope does not consider invited
student enrollments intentionally, so to avoid modifying the scope
and possible side effects, let's modify the pace_contexts service
query to include these enrollments.

closes: LS-3890
flag=course_paces_redesign

Test plan:

- Create course and make it a course pacing course (do not publish it)
- Add some students
- Create a module and an assignment
- Create the default course pace.
- Go to the landing page and click on the student tab
- Expect to see the students you added even if the course is
unpublished

Change-Id: Id7f4b6ee7e9b5a274a619309c5fbe24c120fb7ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314781
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: Luis Oliveira <luis.oliveira@instructure.com>
2023-04-06 17:30:52 +00:00
Jonathan Guardado bd7bdc6294 update student pace in table after publishing
Use the right context id for filtering student enrollments

closes LS-3691
flag= course_paces_redesign

test plan
- Go to the course pacing page
- Select the Student tab
- Publish a student pace
- Expect the pace contexts table to reflect the updates in the
student pace

Change-Id: Id1475e1cf9347a8ae877b167e7823c88f36e665a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310272
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
2023-02-02 22:21:38 +00:00
Jonathan Guardado f5b974d383 Ignore old student enrollments in paces api
- Only allow operations for the student's most recent enrollment in
the paces API, the show, create, update, and delete endpoints will
return 404 when attempting to do operations with enrollments other
than the student's most recent

- Course_pacing#index sets only the most recent enrollment of each
student to ENV[ENROLLMENTS]

closes LS-3514
flag=course_paces_for_students

Test plan:
- In a course with course pacing
- Enroll a student in multiple sections

Using the most recent student_enrollment

- Make the following requests, and expect the endpoints to work as usual:
GET
api/v1/courses/:course_id/student_enrollments/:student_enrollment_id/pace
POST
api/v1/courses/:course_id/student_enrollments/:student_enrollment_id/paces
PATCH
api/v1/courses/:course_id/student_enrollments/:student_enrollment_id/pace
DELETE
api/v1/courses/:course_id/student_enrollments/:student_enrollment_id/pace

Using any other student_enrollment of the same user in the course

- Repeat the requests and expect to get a 404 for all of them

Change-Id: I3b587fd220403281edb516495334afda945b871e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308819
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
Reviewed-by: Luis Oliveira <luis.oliveira@instructure.com>
QA-Review: Luis Oliveira <luis.oliveira@instructure.com>
2023-01-17 18:30:08 +00:00
Jonathan Guardado c14f0e76d9 Inline loading spinner for background publishing jobs
- A new loading spinner in the “Last Modified” column to indicate the
pace is being published
- Sync Redux with active pace publishing jobs on app initialization

closes LS-3538, LS-3634
flag=course_paces_redesign

test plan:
1- With the course_paces_redesign flag enabled
2- Create a course with several sections and students
3- Enable course pacing in the course and add a module
4- Go to the course pacing page and create the default pace
5- Notice the page does not get the blank space in the container, and
the pace contexts table is immediately shown
6-Create a section pace and close the modal as soon as the close
button gets enabled
7-Notice the spinner in the “last modified” column for the section you
are publishing
8-Repeat steps 6 and 7 for students
9-Notice that when the jobs finish the affected rows get updated and
an alert appears indicating the context and the action e.g.
“Student 1 Pace created”

- Sync on mount
1-Make the jobs get queued or take much time to complete
2-Create or update some paces
3-Notice the loading spinner for all of the paces
4-Notice that the spinners persist when switching between sections
 and students
5-Refresh the page and expect to see the loading spinner in the paces
publishing

Change-Id: Iccb923a780ed4423fac6ed5f33816b406bbf3119
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307527
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
2022-12-19 18:17:54 +00:00
Eric Saupe c53bae8a25 Remove StudentViewEnrollments from pace contexts
fixes LS-3609
flag=course_paces_redesign

test plan:
- Enroll students in a course with course pacing
- Enroll a user with the StudentViewEnrollment type
- Go to the student course paces table
- Verify the user with StudentViewEnrollment is not listed

Change-Id: Id7b3d72e3dfc9131dc2e32f3af6ad1e59eec9559
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305431
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2022-11-15 23:08:49 +00:00
Eric Saupe 7b073974ed Add search_term filtering to pace contexts api
fixes LS-3434
flag=course_paces_redesign

test plan:
- Have a course with multiple section paces and student paces
- Go to
https://<canvas>/api/v1/courses/1/pace_contexts?type=section&search_term=
<partial section name>
- Verify only sections with names that include the search term come back
- Go to
https://<canvas>/api/v1/courses/1/pace_contexts?type=student_enrollment&
search_term=<partial student name>
- Verify only students with names that include the search term come back

Change-Id: I0c70a22487383ade3b5fa730453e520fd087ea99
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304961
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2022-11-10 16:56:23 +00:00
Eric Saupe 64c6a849bd Add sort and order to pace contexts api
fixes LS-3542
flag=course_paces_redesign

test plan:
- tests pass

Change-Id: If23af3840527fd98fb7e99ff6d665696028483c4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303834
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2022-10-24 22:35:55 +00:00
Davis Hyer 8b3ab3c0d0 support fetching 'student_enrollment' pace contexts
fixes LS-3518
flag=course_paces_redesign

test plan:
  - specs pass

qa risk: low

Change-Id: I83698a9df5b15f87a6bed66741ab014a0ddb681d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303228
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Luis Oliveira <luis.oliveira@instructure.com>
QA-Review: Luis Oliveira <luis.oliveira@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2022-10-17 15:06:49 +00:00
Davis Hyer 417c37312a support fetching 'section' pace contexts
fixes LS-3517
flag=course_paces_redesign

test plan:
  - specs pass

qa risk: low

Change-Id: Icc5967c79f13e7b3fff7a8a0be92afefdb3030e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303066
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Luis Oliveira <luis.oliveira@instructure.com>
QA-Review: Luis Oliveira <luis.oliveira@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2022-10-12 19:30:21 +00:00
Davis Hyer 51edbf424c support fetching "course" pace contexts
fixes LS-3516
flag=course_paces_redesign

test plan:
  - specs pass

qa risk: low

Change-Id: I185d93d48308b1f4100571fb79e4ee1f94972477
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302972
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: Davis Hyer <dhyer@instructure.com>
2022-10-11 18:43:09 +00:00
Luis Oliveira f4968fcb8b Add progress and publishing logic to new pace apis
refs LS-3459
flag=course_paces_redesign

test plan:
  - specs pass

Change-Id: I016c3bf03d66da271cab7ada08eee0421823abf5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302250
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: Luis Oliveira <luis.oliveira@instructure.com>
2022-10-06 19:00:51 +00:00
Davis Hyer 92872fa722 attempt to provide default pace for contexts
refs LS-3459
flag=course_paces_redesign

test plan:
  - specs pass

qa risk: low

Change-Id: I25e97c3c6ef2b1b332812c2bb58549712f6e8be0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302166
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: Davis Hyer <dhyer@instructure.com>
2022-09-30 19:52:11 +00:00
Davis Hyer f0a8469d59 introduce student enrollment pace api
refs LS-3459
flag=course_paces_redesign

test plan:
  - specs pass

qa risk: low

Change-Id: I1647bac1c0e0970217a21cf9be1d73cfe4d6ac5f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302054
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: Davis Hyer <dhyer@instructure.com>
2022-09-29 18:31:01 +00:00
Davis Hyer 939745cd78 introduce sections pace api
refs LS-3459
flag=course_paces_redesign

This is the first pass introducing an api specific to each type of
course pace. The section specifics still have some work to be done,
namely permissions on the controller.

test plan:
  - tests pass

qa risk: low

Change-Id: I2ecbd21d5bb141e3e8e3c1227c14ec59f13b63f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/301584
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: Davis Hyer <dhyer@instructure.com>
2022-09-26 19:18:49 +00:00