Commit Graph

1075 Commits

Author SHA1 Message Date
Jon Scheiding ceed52fc49 Update WikiPage API docs with info about page IDs
To get the documentation to generate correctly, we're changing the name
of a route parameter. This doesn't affect (much) application code - just
things that generate URLs to the affected routes, which is only the user
content rewriter. It broke a ton of tests though and that represents the
bulk of the code changes here.

closes MAT-570
flag=none
test plan
- run `bundle exec rake doc:api`
  (inside your `web` container if you're using Docker)
- go to http://<your canvas>/doc/api/pages.html
  > Check that you see the following:
    - example URLs include `the-page-identifier`
    - route URLs include `:url_or_id`
    - the "Note on page identifiers" at the beginning of the doc
    - the "NOTE: You cannot specify the ID when creating a page" message
      under Update/create page
- go to http://<your canvas>/api/v1/courses/X/pages/Y
  - substitute X for a valid course ID
  - substitute Y for both the ID and URL of a valid page within the
    course
    - make sure to check the ID both as a bare number and prefixed with
      `page_id:`
  > check that the API response payload makes sense

Change-Id: If3849b839789e98f463a84002ecf0abeae10c00a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/290599
Reviewed-by: Joe Hernandez <joe.hernandez@instructure.com>
QA-Review: Joe Hernandez <joe.hernandez@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-04-28 20:35:14 +00:00
Jeremy Stanley e8fb15ef51 jobs_v2: add strand management endpoint
test plan:
 - PUT /api/v1/jobs2/manage?strand=X&priority=Y&max_concurrent=Z
   should update the priority and max_concurrent for all
   queued jobs in strand X
 - the endpoint requires manage_jobs permission

flag=jobs_v2
refs DE-1128

Change-Id: I7134b9fa84310b6e64f95e77ca42d7fa282a90f9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/290136
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
2022-04-25 22:00:17 +00:00
Mysti Lilla 0b0e7d53a1 Add API to get LTI 2 tokens for SiteAdmins
refs INTEROP-7211
flag=none

Test plan
- Set up an LTI 2 tool (lti_originality_report
  _example works)
- Go to api/lti/lti_2_token with either
  basic_launch_lti2_id (from an assignment's
  Plagiarism URL launch there's an ID
  in there--it's a message handler ID)
  OR the tool_proxy_id of a Tool Proxy
- It should return a JWT
- Use the JWT with an LTI 2 API like
  /api/lti/users/:user_id and make
  sure the auth works

Change-Id: I385572d9c6eba2fa062505bcc705da27ec68488c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/289457
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2022-04-13 22:23:26 +00:00
Ed Schiebel 3dc63210f9 Make course pacing text consistent
closes LS-3095
flag=course_paces

test plan:
  - see the info in the ticket and confirm the text has changed
    to match

Change-Id: I84eec3973085f89da9756a6f87fcf45ce8729708
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/289181
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2022-04-11 16:22:23 +00:00
Jeremy Stanley 06e946430e add an endpoint to translate migration_ids
external tools that participate in course copies will see file
references that look like this

 $CANVAS_COURSE_REFERENCE$/file_ref/<migration id>

but canvas did not provide any way to turn that migration id
into useful information.

test plan:

 - /api/v1/courses/X/files/file_ref/<migration id>
   should return information about the file

flag=none

Change-Id: If1f0a692120d7ec34531ec5e183f29577cdaaa34
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286491
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
2022-04-07 22:19:29 +00:00
Ed Schiebel 95e3ce14f9 Save updated blackout dates to the backend
refs LS-3029
flag=course_paces
flag=course_paces_blackout_dates

This commit saves pending blackout date changes when the user
clicks Publish.

It does not format the pending blackout date chnages in the tray

test plan:
  - with the site admin flag "course_paces_blackout_dates" enabled
    (it is by default in dev and ci)
    - in a course with paces enabled, a module with a few assignments
    - click Settings -> Blackout Dates and create some blackout dates
      between your start date and the last assignment's due date
    > expect the assignment due dates to adjust to skip over
      the blackout dates
    > expect the "Unpublished changes" notice to include 1 for
      updated blackout dates
    - click cancel
    > expect the blackout dates to revert
    - add them back
    - click publish
    > expect to see a PUT to the blackout_dates api
      followed by a PUT to the course_pace/:id api
    > expect everything in the UI to be disabled while all
      this is going on
    > expect the notice to tell you blackout dates are being saved
      followed by the pace is being published, followed
      by "All changes published"
    - refresh the page
    - open settings -> blackout dates
    > expect the dates to be what you saved before
    - open the blackout dates modal, delete one and save
    - click Cancel to cancel unpublished chnanges
    - open the blackout daes modal
    > expect the deleted one to be listed

 - disable the flag
   - make sure everything still works but there is no blackout dates
     UI in settings and Publish still works

Change-Id: Icad39d7a6f2806effe38be8627f08b234625da30
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288311
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>
2022-04-07 18:06:25 +00:00
Jeremy Stanley 28a8a36125 job lookup by id
we already have the click a tag = populate job filter box
behavior, so I extended this pattern

test plan:
 - a lookup box appears above the job details section
   at the bottom of the page
 - click a job id in the middle table and the lookup
   box is populated with that job id at the same time
   the job details are displayed
 - enter a job id in the lookup box and an arbitrary job
   can be shown below
 - you can search for running/queued/whatever jobs by id
   regardless of which bucket is chosen at the top of the
   page. the search box will tell you which bucket the
   job is in.
 - the search box will accept either a job id, a failed
   job id, or a failed job's original_job_id, so there
   may be multiple results when you enter an id; this is
   why I used a dropdown

flag=jobs_v2
closes DE-1107

Change-Id: I643a562b41bab996c66f076536651a54b9f2458a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287974
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-03-28 20:56:03 +00:00
Jackson Howe 4a20c79fb0 Add endpoint to get user k5 status
refs LS-3012
flag = none

Test plan:
 - Visit /api/v1/users/:id/show_k5_dashboard
 - Expect to see true when passing :id of a student that sees k5
   dashboard
 - Expect to see false when passing :id of a student that sees
   classic dashboard
 - Expect response to be unauthorized if passing an id of a user who
   you can't :read or who is not linked to you as an observed
   student

Change-Id: If79ad06d0419380e5c156cd124bce596f788058e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287966
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Luis Oliveira <luis.oliveira@instructure.com>
Reviewed-by: Luis Oliveira <luis.oliveira@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2022-03-25 16:11:29 +00:00
Jeremy Stanley b8058ae7e7 wildcard search for tags, strands, and singletons
since I made by_singleton/search a thing, I figured
I should also make by_singleton a thing, even though
it may not be extremely useful (particularly looking
at count...) but it makes the API more consistent

test plan: exercise the "API" endpoints, e.g.
 /api/v1/jobs2/queued/by_tag/search?term=foo
 /api/v1/jobs2/running/by_strand/search?term=bar
 /api/v1/jobs2/failed/by_singleton/search?term=baz

also test the ability to group by singleton
 /api/v1/jobs2/future/by_singleton

and ensure when ordering by tag/strand/singleton,
the results are case insensitive

flag=jobs_v2

refs DE-1043
refs DE-1046

Change-Id: Ife8245a39b69db3a534d532e3dd8054f6e6b7d4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287143
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-03-16 16:56:05 +00:00
Eric Saupe 6ba814bed7 Refactor PacePlan to CoursePace
fixes LS-2989, LS-2988
flag=pace_plans

test plan:
- Specs should pass
- Enable the course paces account feature flag
- Enable the course paces setting on a course
- All current pacing related features should work as expected

Change-Id: Ibd1d9f3295f624a3f2411c72ad5ace9410d965ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286519
Migration-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-03-15 19:10:16 +00:00
Jeremy Stanley c0c50e1849 add tags table to jobs v2
test plan:
 - enable jobs 2 feature
 - go to /jobs_v2
 - select from the running / queued / future / failed buckets
   and see that each shows both information grouped by tag
   on the top and individual jobs below
 - note that if you click a tag, the job list is filtered
   by that tag

flag=jobs_v2
closes DE-1041
closes DE-1080

Change-Id: Iaebba877f80416d1cf700e1e7ab5af39eaa6e885
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286005
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-03-14 15:43:39 +00:00
Eric Saupe 1aa232a409 Add blackout_dates controller
fixes LS-2658
flag=pace_plans

test plan:
- Enable the pace plans flag on the account and course
- Make an API POST to /api/v1/courses/:course_id/blackout_dates with
params structured like { blackout_date: { start_date: "2022-02-16",
end_date: "2022-02-16", event_title: "Test" } } and expect a successful
response
- Go to /api/v1/courses/:course_id/blackout_dates/:id should return the
blackout date data
- Go to /api/v1/courses/:course_id/blackout_dates/new should return an
unsaved blackout date
- Go to /api/v1/courses/:course_id/blackout_dates should return an array
of blackout dates
- Go to /courses/:course_id/blackout_dates should return an empty
page but be successful
- Make an API PUT to /api/v1/courses/:course_id/blackout_dates/:id with
params structured like { blackout_date: { start_date: "2022-02-16",
end_date: "2022-02-16", event_title: "Test" } } and expect a successful
response and data to be changed on the given blackout date id.
- Make an API DELETE request to
/api/v1/courses/:course_id/blackout_dates/:id and expect the response to
be successful and the blackout date to be deleted

Change-Id: I167cc08bdbfa0c669add98374ffef289c1037c61
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285359
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-03-09 16:48:18 +00:00
Jeremy Stanley ad55cdb323 add "API" for job tag summaries
it is not a published API, as it is accessible only to site admins,
but it uses the API tooling to make frontend work easier

test plan:
 - /api/v1/jobs/tags/running should list running jobs
   grouped by tag, including `first_locked_at` which
   can be used to compute the longest runtime for any
   job with the tag
 - /api/v1/jobs/tags/queued should list runnable jobs
   that are not yet running, including `min_run_at`
   which can be used to compute the longest time
   any job with the tag has spent waiting
 - /api/v1/jobs/tags/future should list scheduled jobs
   grouped by tag, along with next_run_at
 - /api/v1/jobs/tags/failed does failed jobs, including
   last_failed_at for each tag

 - all endpoints should require site_admin read_jobs perms
 - endpoints should paginate like normal API endpoints

flag=jobs_v2
refs DE-1041

Change-Id: I2df4f62fe7a0580a54ef5c1f48c191c5167e5d42
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285994
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-02-26 01:14:19 +00:00
Aaron Ogata c719c77cc4 introduce scaffolding for jobs page v2
refs DE-1019

Change-Id: Ia48dcbadc0e23ce7f9425d077ee0e273ac7a8d5a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284149
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: Aaron Ogata <aogata@instructure.com>
2022-02-07 16:28:58 +00:00
Adrian Packel 05c03b93ea Create endpoint for "apply score to ungraded"
closes EVAL-2037
flag=apply_score_to_ungraded

Test plan:
- Have a course whose account has the "Apply Score to Ungraded" feature
  enabled
  - Have some assignments and students, and make sure some of the
    submissions are ungraded
- As an instructor in said course, make a PUT request to the endpoint:
  /api/v1/courses/<id>/apply_score_to_ungraded_submissions

with a request that has a body like:
{
  "percent": "50.0"
}

- The request should return a Progress object
- It should also start a job that applies a score of 50% to all ungraded
  submissions in the course, one by one
- Check that the newly-applied grades are reflected in gradebook and
  gradebook history (note that the process may take some time)

Smoke-test the request with some additional parameters, such as:
- "excused": "true" (in place of the "percent" parameter)
  - This should excuse any ungraded submissions rather than grading them
- "assignment_group_id": <an assignment group ID>
  - This should only apply grades to ungraded submissions for
    assignments within the specified assignment group
- "only_apply_to_past_due": "true"
  - This should only apply grades to submissions past their due date

Change-Id: Ib9ce8824ad8794f1dc41d40d65bc6891f77a0541
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278613
Reviewed-by: Eduardo Escobar <eduardo.escobar@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
2021-12-20 20:09:04 +00:00
Jorge Arteaga 30021690da show short term quiz migration limitation message
closes QUIZ-9083

flag = none

test plan:
- import a classic quiz with migrate to NQ enabled
- wait for the import to finish
- navigate to the course
- observe that there's a message about the
limitations of the quiz migrations
- close the alert and refresh the page
- the alert should not appear again

- repeat the same process with a course copy
and a quiz migration

Change-Id: I3afe50f299cd374f17f8bccb88663b583e5928b4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279470
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: James Logan <james.logan@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Susan Sorensen <susan.sorensen@instructure.com>
2021-12-16 13:52:27 +00:00
Ed Schiebel 9234da64a4 Change pace_plan's compress_dates api from GET to POST
closes LS-2886
flag=pace_plans

test plan
  - Create a course with a start date, module item assignments, pace plans
    enabled, and a pace plan created with various durations set on the
    pace plan module items
  - POST to /api/v1/courses/:id/pace_plans/compress_dates
    with the body ...
{"pace_plan":  {
  "start_date":"2021-12-22",
  "end_date":"2021-12-31",
  "exclude_weekends":true,
  "pace_plan_module_items_attributes":[
     {"id":"1","duration":5,"module_item_id":"1"},
     {"id":"2","duration":5,"module_item_id":"2"}
  ]}}
  > expect the responsse
{
  "1": "2021-12-26",
  "2": "2021-12-30"
}

  Extra credit:
  - play with durations and dates to convince yourself it's doing
    the right thing, which it should be because this ticket didn't
    change the logic of the api.

Change-Id: I92460059ac2cb6e4e982a65153c9e31c1b2f4fb7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280602
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: Ed Schiebel <eschiebel@instructure.com>
2021-12-08 21:39:07 +00:00
Eric Saupe feed630a07 Add compress_dates endpoint
fixes LS-2849
flag=pace_plans

test plan:
- Create a course with a start date, module item assignments, pace plans
enabled, and a pace plan created with various durations set on the
pace plan module items
- Hit /api/v1/courses/:course_id/pace_plans/:pace_plan_id/compress_dates?
pace_plan[end_date]="AN_END_DATE_CLOSE_TO_START_DATE"
- Verify durations have been compressed on pace plan module items
- Verify those durations were not actually saved to the database

Change-Id: I563d24ade95e0135b4b986b3497dbac3fe5de7b6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279307
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-12-07 18:10:23 +00:00
Marcus Vinicius Pompeu 00cd6aa07c Allow the user to import into a specific group in the UI
closes OUT-4683

flag=improved_outcomes_management

Test plan:

  - create or download fixture CSV files:
    - CSV file with NO parent_guid:

      vendor_guid,object_type,title
      new_outcome,outcome,New Outcome

      https://bit.ly/32pJ6VD

    - CSV file with parent_guid:

      vendor_guid,object_type,title,parent_guids
      new_group_from_csv,group,New Group from CSV,
      new_outcome,outcome,New Outcome from CSV,new_group_from_csv

      https://bit.ly/3oLLX2C

  - at the default account level:
    - navigate to `Outcomes`
      - create a child group with title 'Child Group'
      - select `Child Group` and click in the import button at the header
        - import `CSV file with NO parent_guid`
        - assert that, at the root group:
          - there's a new outcome titled `New Outcome`
      - select `Child Group` and click in the import button at the header
        - import `CSV file with parent_guid`
        - assert that, at the root group:
          - there's a new group titled `New Group from CSV`:
            - containing an outcome titled `New Outcome from CSV`
      - select `Child Group` and click in the import option from the kebab
        - import `CSV file with NO parent_guid`
        - assert that, at `Child Group`:
          - there's a new Outcome titled `New Outcome`
      - select `Child Group` and click in the import option from the kebab
        - import `CSV file with parent_guid`
        - refresh the page (TODO, OUT-4798)
        - assert that, at `Child Group`:
          - there's a new group titled `New Group from CSV`:
            - containing an outcome titled `New Outcome from CSV`

  - create a course:
    - repeat these steps at the course level

Change-Id: I568e85a636d8b84d20f12640bad52e6b19023978
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274711
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
2021-12-01 03:10:48 +00:00
Nate Armstrong 23bac4c9e5 Add api route for login/session_token
So that it can support as_user_id.

flag=none
refs LS-2865

Test plan:
* The goal is to load a K5 Subject course as Student View
  using the API
* First, get the user id of a test student in a k5 subject
  - As an admin
  - From any page in a K5 Subject, enter `Student View`
  - As the test student, go to `/api/v1/users/self` in the browser
  - Make note of the user id
* Hit the api/v1/login/session_token endpoint as an admin
  - &as_user_id=<TEST STUDENT USER ID>
  - &return_to=<K5 subject tab URL with ?embed=true>
  - eg /api/v1/login/session_token?embed=true&as_user_id=30&return_to=http://canvas.docker/courses/5?embed=true%23modules
* Load the returned session_url into an incognito window
* The k5 subject tab should as the test student
  * note, because of the embed=true param, the purple
    student view chrome won't be displayed
  * you can tell if you're getting the student view on
    #modules if there are not options to add or edit modules

Change-Id: I700aa906f7998cfe5fb671cbe67e909eea9731c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279514
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-11-29 20:43:37 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer e73cf9ddf4 RuboCop: Style/HashSyntax
[skip-stages=Flakey]

auto-corrected

Change-Id: I9371a61046aee6b148f89dd434114a8ba2b1188c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:02:35 +00:00
Cody Cutrer 9b71ed2054 RuboCop: Style/BlockDelimiters, Style/Lambda
[skip-stages=Flakey]

auto-corrected

Change-Id: I642f868d75c079e698f1fe4161bbbe419dbe1827
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279374
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:30:47 +00:00
Cody Cutrer c302dd8bc1 RuboCop: Style/SymbolArray, Style/WordArray
[skip-stages=Flakey]

auto-corrected

Change-Id: Id187ed60c5590025e780d81b85b5212f51368f27
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279196
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 14:30:08 +00:00
Cody Cutrer d37a8066b5 RuboCop: Rails grab bag
[skip-stages=Flakey]

see .rubocop.common.yml for list of cops applied

auto-corrected

Change-Id: I1a7309395a3bdb0d074b9af3a0ce5d6c0143fe67
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279005
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-11-19 22:47:08 +00:00
Cody Cutrer 4d43809cae RuboCop: Style/PercentLiteralDelimiters
[skip-stages=Flakey]

auto-corrected, with a post-review looking for multiline strings
to convert to heredocs

Change-Id: I7f7afb11edd63415cde10866822dd2ac5ba0d8be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278669
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:05:50 +00:00
Cody Cutrer fe75025e1d RuboCop: Style/RegexpLiteral
[skip-stages=Flakey]

auto-corrected

Change-Id: I98a7afefcbb3631ee046e45fcfc9f955ca7ddca8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278636
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-11-18 02:08:34 +00:00
Xander Moffatt b3b32cc1f7 allow manual heartbeat live events
why:
* to make testing easier with the whole live events ecosystem

refs INTEROP-7143
flag=none

test plan:
* set up a way to listen to live events following the docs, either stub
to stdout or a kinesis stream
* in your browser go to http://canvas.docker/live_events/heartbeat
* a heartbeat event should be sent at that moment, as well as
every minute

Change-Id: I3cff821f4a387545c9fb0e3488d42bb636e220c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277395
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alexandre Trindade <alexandre.trindade@instructure.com>
QA-Review: Alexandre Trindade <alexandre.trindade@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2021-11-16 21:08:52 +00:00
Cody Cutrer f23a4917d7 RuboCop: Style/RedundantRegexpEscape
[skip-stages=Flakey]

auto-corrected

Change-Id: I21b955242be4150034f8188eb24049cd1204956d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277883
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-11-11 02:19:02 +00:00
Cody Cutrer 8125858d27 RuboCop: Style/RedundantInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: Id04fd07bb918f0f4dc376b5c3474653a8e767e95
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277870
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-11-11 02:06:11 +00:00
Simon Williams e2bc786ab7 ePortfolio admin API
This provides an API for several actions that make moderating
ePortfolios easier. You can list all ePortfolios for a user, show
details, moderate spam status for 1 or all of a users' ePortoflios, and
delete or restore an ePortfolio

Listing and deleting can be done by the owning user, but all the
moderation actions require the user to have the moderate_user_content
permission.

There is currently no support for creating a new ePortfolio or updating
the content of an existing ePortfolio.

closes FOO-2188
flag = none

test plan: run through the new API endpoints, make sure permissions and
functionality are correct.

Change-Id: I3ffa58adb00c466a601a41a05307c24bb406fa42
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273956
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-11-10 15:50:54 +00:00
Cody Cutrer 7fdf9d7588 RuboCop: Lint
[skip-stages=Flakey]

the balance. mostly. Lint/UriEscapeUnescape is put in the pending
block because it's so touchy, and I didn't want to deal with it
right now

all manual

Change-Id: Ibeb81e013f56f160d51f7d237a9bcfe98daa1e53
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277569
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-11-09 21:42:31 +00:00
Eduardo Escobar 16c9812ba8 create endpoint for saving gradebook filters
created some api endpoints to support all CRUD
operations for saving the gradebook filter settings
in the backend.

fixes EVAL-2006
flag=none

test plan:
- create and publish a course with at least 1 teacher
  and one student.
create
  - use a HTTP client to make a POST request to
    /api/v1/courses/:course_id/gradebook_filters
    with the body
    {"gradebook_filter":
      {"course_id": :course_id, "name": "test",
      "payload": {"foo":"bar"}}
    }
  - notice the requests response returns the
    object created with no errors.
update
  - use a HTTP client to make a PUT request to
    /api/v1/courses/:course_id/gradebook_filters/
    :gradebook_filter_id
    with the body
    {"gradebook_filter":
      {"id": :gradebook_filter_id,
      "course_id": :course_id,
      "name": "other",
      "payload": {"bar": "foo"} }
    }
  - notice the requests response returns the
    object with the attributes updated and
    no errors.
show
  - use a HTTP client to make a GET request to
    /api/v1/courses/:course_id/gradebook_filters/
    :gradebook_filter_id
  - notice the requests response returns the
    object with the correct data and
    no errors.
index
  - use a HTTP client to make a GET request to
    /api/v1/courses/:course_id/gradebook_filters
  - notice the requests response returns an
    array of gradebook filters created and with
    no errors.

Change-Id: Ib8819d9c62ae536a40719078e83ef4d2b7b5c083
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275774
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2021-11-09 21:28:19 +00:00
Marcus Vinicius Pompeu d97ffa57a8 Make outcome_imports endpoint aware of the parent group
closes OUT-4768
flag=improved-outcomes-management

Test plan:

  - Jenkins verifies this (API change only)

Change-Id: Ib41277d66c1e81b9d7ff7c1b94fe5a521b2552d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274606
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-10-27 15:57:14 +00:00
Cody Cutrer 08b6fdeb64 add terminate_sessions API for users
closes FOO-2416

test plan:
 * login as a user
 * create an access token
 * as an admin, use DELETE /api/v1/users/:id/sessions of the first user
   (from a different session, or the command line with the admin's
   access token)
 * refresh as the first user
 * you should have to login again
 * look at your profile, and your access token should be expired now

Change-Id: I264de8591324c1ceb0e19c7b2ad62b16a8667bbb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276759
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-10-26 17:10:03 +00:00
Spencer Olson 734344eaff fix speedgrader status menu with anonymous assignments
closes EVAL-1995
flag=edit_submission_status_from_speedgrader

Test Plan:
1. Enable "Edit Submission Status from Speedgrader".
2. Create an anonymous assignment.
3. Go to SpeedGrader and change a student's status (i.e. Late, Missing,
   Excused, or None) using the select menu. Verify the request succeeds
   and the status is updated.
4. Create an assignment that is not anonymous.
5. Go to SpeedGrader and change a student's status using the select
   menu. Verify the request succeeds and the status is updated.

Change-Id: I949648b7a2c78e01642d0c73298995acb3e4e7d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275004
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Eduardo Escobar <eduardo.escobar@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
2021-10-14 16:19:50 +00:00
Eric Saupe 85dd52f796 Refactor latest_draft_for to new
With our discussions on removing draft states it has made some of the
original endpoints no longer make sense. The change here is to simplify
the endpoints to be more standard CRUD-like.

fixes LS-2708
flag=pace_plans

test plan:
- Go to Pace Plans on a course with the feature enabled
- The frontend should render and the dropdown should still work as
expected
- Verify that when making any selection from the dropdown that no pace
plans are actually persisted to the database
- If pace plans already exist in the database for the given context it
should return that pace plan and not create a new one

Change-Id: I725bbcd1c902bbf28c8f3d68eb39b705d151a913
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275529
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-12 22:55:19 +00:00
Eric Saupe a299cab570 Add pace plans publish endpoint
fixes LS-2454
flag=pace_plans

test plan:
- With pace plans feature flag enabled
- Create a pace plan and verify it isn't active and does not have a
published_at date
- Make a POST request to /api/v1/courses/:course_id/pace_plans/:id/publish
- Verify the request is successful and the pace plan is active and has
a published at date
- Verify the modules have assignment overrides created
- Change the duration dates for the pace plan module items
- Republish
- Verify the modules have new assignment overrides for the new dates

Change-Id: I6ad4fc1669cf069b4edeb313ba07885a36c0a8ee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273070
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-12 22:08:36 +00:00
Jon Scheiding 251b87f0d0 Return full embed URL from POST media_objects
Also refactor media_objects routes to all be in the same controller

Fixes MAT-440
flag=none

Test plan:
- Find an RCE
- Insert -> Media -> Upload/Record Media
- Upload an audio or video file
- Switch the RCE to HTML view
- Confirm that the iframe src URL is an absolute URL
  including host and protocol

Change-Id: If7288562980ee49dd50f5796f82afbadb7d0a575
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275434
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
2021-10-11 18:20:49 +00:00
Jackson Howe 498aaa11db Support students in CreateCourseModal
Since this modal will be used everywhere in Canvas, support
students and users with no enrollments creating courses (when enabled
at the root account). Students will see all accounts where they have
enrollments; users with no enrollments will only see the manually-
created courses subaccount. Don't show homeroom sync options to
students/users with no enrollments. Expose the manually-created
courses subaccount ID/basic info through a new API.

flag = create_course_subaccount_picker
closes LS-2678

Test plan:
 - Enable root account FF: create_course_subaccount_picker
 - In root account settings, allow techers, students, and users with
   no enrollments to create courses
 - Login to k5 dashboard as an admin and click the + (New Subject)
   button
 - Expect to see a manageable_courses network request and a dropdown
   to select an account (along with the checkbox to sync homerooms)
 - Login and open the modal as a teacher
 - Expect to see an enrollments network request and a dropdown with
   all the accounts where the user has a teacher enrollment (and the
   homeroom sync checkbox)
 - Login and open the modal as a student
 - Expect another enrollments network request and a dropdown with all
   their accounts (if there's more than one)
 - Expect to not see the sync options
 - Login as a user with no enrollments
 - Expect a network request to the manually_created_courses_account api
 - Expect to not see a dropdown with accounts or the sync options
 - Disable 'X can create courses' at the root account and expect the
   associated users to no longer see the create course modal at all
 - With FF disabled, expect course creation to work as before

Change-Id: I0e7d49628ce6395fd366037a3134133084fe6275
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274986
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
2021-10-06 16:59:05 +00:00
Jacob Burroughs 214014049f Add asymmetric encryption for service tokens
refs FOO-2410

test plan:
- in dynamic_settings.yml, add the following block:
```
store:
    canvas:
      services-jwt:
        # these are all the same JWK but with different kid
        # to generate a new key, run the following in a Canvas console:
        #
        # key = OpenSSL::PKey::RSA.generate(2048)
        # key.public_key.to_jwk(kid: Time.now.utc.iso8601).to_json
        jwk-past.json: "{\"kty\":\"RSA\",\"e\":\"AQAB\",\"n\":\"uX1MpfEMQCBUMcj0sBYI-iFaG5Nodp3C6OlN8uY60fa5zSBd83-iIL3n_qzZ8VCluuTLfB7rrV_tiX727XIEqQ\",\"kid\":\"2018-05-18T22:33:20Z_a\",\"d\":\"pYwR64x-LYFtA13iHIIeEvfPTws50ZutyGfpHN-kIZz3k-xVpun2Hgu0hVKZMxcZJ9DkG8UZPqD-zTDbCmCyLQ\",\"p\":\"6OQ2bi_oY5fE9KfQOcxkmNhxDnIKObKb6TVYqOOz2JM\",\"q\":\"y-UBef95njOrqMAxJH1QPds3ltYWr8QgGgccmcATH1M\",\"dp\":\"Ol_xkL7rZgNFt_lURRiJYpJmDDPjgkDVuafIeFTS4Ic\",\"dq\":\"RtzDY5wXr5TzrwWEztLCpYzfyAuF_PZj1cfs976apsM\",\"qi\":\"XA5wnwIrwe5MwXpaBijZsGhKJoypZProt47aVCtWtPE\"}"
        jwk-present.json: "{\"kty\":\"RSA\",\"e\":\"AQAB\",\"n\":\"uX1MpfEMQCBUMcj0sBYI-iFaG5Nodp3C6OlN8uY60fa5zSBd83-iIL3n_qzZ8VCluuTLfB7rrV_tiX727XIEqQ\",\"kid\":\"2018-06-18T22:33:20Z_b\",\"d\":\"pYwR64x-LYFtA13iHIIeEvfPTws50ZutyGfpHN-kIZz3k-xVpun2Hgu0hVKZMxcZJ9DkG8UZPqD-zTDbCmCyLQ\",\"p\":\"6OQ2bi_oY5fE9KfQOcxkmNhxDnIKObKb6TVYqOOz2JM\",\"q\":\"y-UBef95njOrqMAxJH1QPds3ltYWr8QgGgccmcATH1M\",\"dp\":\"Ol_xkL7rZgNFt_lURRiJYpJmDDPjgkDVuafIeFTS4Ic\",\"dq\":\"RtzDY5wXr5TzrwWEztLCpYzfyAuF_PZj1cfs976apsM\",\"qi\":\"XA5wnwIrwe5MwXpaBijZsGhKJoypZProt47aVCtWtPE\"}"
        jwk-future.json: "{\"kty\":\"RSA\",\"e\":\"AQAB\",\"n\":\"uX1MpfEMQCBUMcj0sBYI-iFaG5Nodp3C6OlN8uY60fa5zSBd83-iIL3n_qzZ8VCluuTLfB7rrV_tiX727XIEqQ\",\"kid\":\"2018-07-18T22:33:20Z_c\",\"d\":\"pYwR64x-LYFtA13iHIIeEvfPTws50ZutyGfpHN-kIZz3k-xVpun2Hgu0hVKZMxcZJ9DkG8UZPqD-zTDbCmCyLQ\",\"p\":\"6OQ2bi_oY5fE9KfQOcxkmNhxDnIKObKb6TVYqOOz2JM\",\"q\":\"y-UBef95njOrqMAxJH1QPds3ltYWr8QgGgccmcATH1M\",\"dp\":\"Ol_xkL7rZgNFt_lURRiJYpJmDDPjgkDVuafIeFTS4Ic\",\"dq\":\"RtzDY5wXr5TzrwWEztLCpYzfyAuF_PZj1cfs976apsM\",\"qi\":\"XA5wnwIrwe5MwXpaBijZsGhKJoypZProt47aVCtWtPE\"}"
```
- Ensure /internal/services/jwks loads correctly
- In console, ensure `CanvasSecurity::ServicesJwt.decrypt(Base64.decode64(CanvasSecurity::ServicesJwt.for_user('localhost', User.first)))`
and `CanvasSecurity::ServicesJwt.decrypt(Base64.decode64(CanvasSecurity::ServicesJwt.for_user('localhost', User.first, symmetric: true)))`
both work and produce sensible looking output

Change-Id: I13c6c35cc92ed12d03bf97e89e590614e11c6d47
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275160
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2021-10-06 15:11:06 +00:00
Jeremy Stanley a3bb59b199 show an indicator for unread rubric comments
test plan:
 - enable the "Submission feedback indicators" feature
 - have an assignment with a rubric that uses
   free-form comments
 - as a student, submit the assignment
 - as a teacher, grade the assignment while leaving
   comments in the rubric in speedgrader
 - as a student, click the dashboard notification about
   the graded assignment to go to the submission details
   page
 - there should be an unread indicator next to the
   "Show Rubric" link
 - click "Show Rubric" and that indicator should go away
 - refresh the page and the indicator should still be gone
 - the "Show Rubric" dot should look the same with K-5 mode
   on or off
 - VO should tell you if unread comments exist while the
   "Show Rubric" or "View Feedback" link is focused

flag=submission_feedback_indicators

closes LS-2670

Change-Id: I4b8b977eb9478342c1d2fc08b9910f90cdeed317
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274396
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: Peyton Craighill <pcraighill@instructure.com>
2021-10-02 00:40:16 +00:00
Jeremy Stanley cbd09990e4 show an indicator for unread submission annotations
test plan:
 - have canvadocs set up with canvas
 - make sure annotation notifications are working
   (this requires a canvas API key to be configured in canvadocs)
 - enable the "Submission feedback indicators" feature
 - as a student, submit a document to an assignment
 - as a teacher, grade the document in SpeedGrader™ and leave
   one or more annotations on it
 - as a student, click the assignment in the "recent feedback"
   column
 - you are taken to the Submission Details page, where there
   should be an indicator next to the "View Feedback" button
   that indicates unread feedback exists
 - click "View Feedback"
 - close the modal
 - the unread indicator should be gone
 - refresh the page
 - the unread indicator should still be gone
 - render API docs
 - use the "Get document annotations read state" returns
   { "read": false } or { "read": true } depending on
   the read state
 - use the "Mark document annotations as read" endpoint
   and ensure doing that and reloading submission details
   makes the unread indicator go away
 (note that these API endpoints are not used by the Canvas UI
  but I am exposing the functionality to mobile users)

flag=submission_feedback_indicators

refs LS-2670

Change-Id: Iedb7330bb5669efe16f7ea01da132b0d69e4ded4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274332
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: Peyton Craighill <pcraighill@instructure.com>
2021-10-01 18:28:46 +00:00
Eric Saupe 0fb125bcfb Add latest_draft_for endpoint
The endpoint will return the unpublished pace plan for the given context
or will create a new one if one doesn't already exist.

references LS-2453
flag=pace_plans

test plan:
- Enable pace plans on the account and course
- The dropdown for context selection in the pace plans works and creates
pace plans for each context.
- Making a GET request to /api/v1/pace_plans?course_id=COURSE_ID returns
a pace plan
- Making a GET request to /api/v1/pace_plans?course_section_id=SECTION_ID
returns a pace plan
- Making a GET request to /api/v1/pace_plans?enrollment_id=ENROLLMENT_ID
returns a pace plan

Change-Id: Ic2d256eb4c865075061bd517f78234d55d962211
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274536
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2021-09-29 20:29:28 +00:00
August Thornton 30f4f304c1 add deep critical and secondary health checks
includes:
 • timeout protection (defaults to 5 seconds)
 • the ability to run non-blocking component checks for the
   /deep endpoint
 • caches component deep checks to help mitigate request cost
   to services; setting cache expiry to 60 seconds

closes FOO-2355
closes FOO-2356
closes FOO-2369

flag = none

test plan:
 • navigate to /readiness & /deep endpoints
 • verify json response is returned
 • verify json response object conforms to:
   • https://app.swaggerhub.com/apis/mycargus/health-checks-api/

Change-Id: Ie12b9260e91de6c3d18f25cd4a81cbfa7ebefcb4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273517
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-09-28 19:16:57 +00:00
Eric Saupe 0aa88e6fa5 Create pace plan if primary does not exist
This also includes a controller action change from show to index. This
better follows other route endpoints where index loads the collection
page and show loads an individual pace plan. It's a little confusing
because a pace plan is loaded but the endpoint URL suggests it should
go to index.

fixes LS-2625
flag=pace_plans

test plan
- Enable pace plans feature flag and pace plans on a course
- Click Pace Plans from the course menu on a course with no pace plans
- Verify the page to load without an error
- Verify the course to have a created pace plan in the database

Change-Id: Ia2a1a7ba803f37274701c97c85d01b7f8e1d3aa3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273670
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2021-09-27 20:23:12 +00:00
Cody Cutrer 4896de008e RuboCop: Layout config
Change-Id: I33da473d52ba626e821d03f3c29d1c5ffddde4cd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274067
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 15:57:46 +00:00
August Thornton f9d8b99a56 add new readiness health check
closes FOO-1957
flag = none

test plan:
 • navigate to /readiness
 • verify json response is returned
 • verify json response object conforms to:
   • https://app.swaggerhub.com/apis/mycargus/health-checks-api/

Change-Id: I90910ac2086247ff6663214511096aaace39b3b2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272234
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-09-02 15:55:57 +00:00
Jeff Largent c01113638b Initial pace plans import
This change brings in the basic pace plans frontend with
styled-components and several other smaller libraries replaced with
InstUI 7 components. It also adds the 'reselect' library as a direct
dependency (which we already had through @instructure/outcomes-ui) and
'tsc-files' for type-checking of staged TS files on commit. There were
also some tweaks to typescript and eslint configs, mostly to get both
up to speed with the typescript code.

Finally, this also adds a `pace_plans` endpoint to
`courses_controller` to bootstrap the frontend-- this will get moved
to `pace_plans_controller` once it has been merged.

It's also worth noting that no frontend tests are included with this
change-- the existing tests were written with enzyme and are heavily
snapshot-based, so we will be replacing those with
@testing-library/react tests in later updates (in keeping with current
testing best practices at Instructure).

closes LS-2431, LS-2432, LS-2433, LS-2434, LS-2452
flag = pace_plans

Test plan:
  - Set up a course with at least one module and several module items
  - Turn on the pace_plans feature flag in the account associated with
    that course
  - Turn on the "Enable pace plans" setting in course settings
  - Create a pace plan for the course via the Rails console:
    c = Course.find<id>
    pp = c.pace_plans.create! workflow_state: 'active'
    c.context_module_tags.each_with_index do |t, i|
      pp.pace_plan_module_items.create! module_item: t, duration: i*2
    end

  - Go to the course as a teacher or admin
  - Expect to see a "Pace Plans" link in the course navigation
  - Click it, expect the pace plan you created earlier to load and
    render
  - Expect to be able to pick dates, change durations, and toggle
    checkboxes (although saves will fail, since there is no API yet).

  - Expect to not see the "Pace Plans" course nav link when the feature
    flag or course setting is off
  - Expect /courses/<id>/pace_plans to return a 404 when the feature
    flag or course setting is off
  - Expect to not see the "Pace Plans" course nav link as a student
  - Expect /courses/<id>/pace_plans to display an "Unauthorized" page
    as a student

Change-Id: If4dc5d17f2c6a2109d4b4cb652c9e9ef00d7cc33
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271650
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Jeff Largent <jeff.largent@instructure.com>
2021-09-01 19:58:33 +00:00
Davis Hyer ed0a8184ce remove the trophy case
fixes VICE-2002
flag=trophy_case

test plan:
  - search for any references to the trophy case
  - after running migrations, cursory test around users

qa risk: low

Change-Id: I1ef2c75f2af1cd74490928aa7949e4226aebd065
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272712
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
2021-09-01 19:25:02 +00:00