* 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>
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>
[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>
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>
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>
- 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>
- 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>
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>
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>
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>