Commit Graph

19 Commits

Author SHA1 Message Date
Ed Schiebel 14c82b7aea Place peer reviews correctly in the sort
closes ADMIN-1454

There were 2 issues
1. @columns.each do |col| -> @columns.flatten.each do |col|
  this change sees that all the interesting values in the collection's
  items are considered in the merge. It also deals with the fact that
  @columns looks different when the Plannable::Bookmark is initialized
  from users_controller vs. planner_controller.
2. fix a bug in the processing of complex bookmarks like
   {submission: {assignment: :due_at}}, :id)

test plan:
  - have peer reviews plus other items in a course with due times
    on the same day that cause them to interleave with one another
  - load the planner
  > expect the sorted order of the items to be correct
    - you need to look at the api response, because the UI will
      correctly sort them for display. This is still a problem because
      the code that figures out if planner has found a complete day's
      worth of items relies on the items api returning the data sorted

Change-Id: I2753ab3b3425b779dc6bfbea27fe70311e9e7400
Reviewed-on: https://gerrit.instructure.com/165674
QA-Review: Carl Kibler <ckibler@instructure.com>
Tested-by: Jenkins
Product-Review: Carl Kibler <ckibler@instructure.com>
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Reviewed-by: Carl Kibler <ckibler@instructure.com>
2018-10-05 22:40:28 +00:00
Mysti Sadler e74ad11295 Ensure peer reviews without review or everyone date show up
fixes ADMIN-1398

Test plan
- Set up an assignment that is available to only
  overrides, with no everyone else date
- The assignment should be set up to allow peer
  reviews, but not have a peer review assignment
  date set
- Set up at least 2 students on the assignment
- Create peer reviews for the student you want
  to test with and ensure that student has a due
  date in their override
- The other student should either have a very
  different due date or no due date so you
  can verify the item comes in with the correct
  date
- Load up planner and ensure you see the peer
  review show up
- If you check the API, I noticed that the
  peer reviews are coming in in the wrong
  order, but this problem exists on master

Change-Id: Ifa0f52cb65052cb7f4fdbfe4f25d139bb92eea6d
Reviewed-on: https://gerrit.instructure.com/164313
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2018-09-14 23:16:40 +00:00
Jon Willesen 0866f2d9dd fix dismissing opportunities in list view
I added assignment_id to the PlannerOverride json so that we can easily
link a plannable to its associated assignment, if it has one. Before we
were just assuming that the override was on the assignment, but now
we've standardized to have the override on the assignment's associated
object, if it has one. Since opportunities loads assignments, we needed
a way to easily navigate from the override back to the assignment so the
opportunities menu could update the proper data.

fixes ADMIN-1214

test plan:
- Create a student with missing assignments of several types:
  - regular assignments
  - discussions
  - quizzes
- The student should be able to dismiss all of these types of
assignments from the opportunities menu
- Undismiss the opportunities in the rails console so they show up again
  for example:
  PlannerOverride.
    where(user: <student>, dismissed: true).
    update_all(dismissed: false)
- This will repopulate the opportunities drop down. The student should
  still be able to dismiss all the opportunities.
- Dismiss opportunities very quickly, as described in the Jira ticket.
  There should be no errors.

Change-Id: Ia96dd9d8c970e330d07b5a185a4f8b1195a7ee43
Reviewed-on: https://gerrit.instructure.com/161248
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2018-09-06 21:35:32 +00:00
Dan Minkevitch 9892cc0faf API: Peer Reviews on Planner
Refs ADMIN-191
Closes ADMIN-1305

Test Plan:
* With student planner enabled
* Having an assignment with submissions
* As a student (reviewer) that's assigned as a
  peer reviewer to another student's submission
* GET /api/v1/planner_items
* The peer review task should be included in the
  results, with the `plannable_type` set as
  "assessment_request" and the `plannable` being
  the submitting student's submission
* The `assignment` object should be present on
  the `plannable` submission

Change-Id: Ifcba8b2631c6ab28f73791962bc739b2b25e5016
Reviewed-on: https://gerrit.instructure.com/157513
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2018-08-25 20:14:44 +00:00
Mysti Sadler 8199ff9fc2 Preload Planner Overrides
refs ADMIN-1031

Test plan
- Set up a couple of planner items
  and make sure there are some overrides
  to check for (mark as complete or dismiss
  opportunities)
- Run the api/v1/planner/items call and ensure
  you don't get a planner_override sql call for
  every item

Change-Id: I8b4f468e3cb6177ced2aee3abec810a75d9aec9e
Reviewed-on: https://gerrit.instructure.com/152697
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Luke Kingsley <lkingsley@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2018-06-11 21:18:51 +00:00
Mysti Sadler 03e6825862 Refactor planner items endpoint to prepare for calendar
Adds the `context_codes` param to the planner/items
endpoint to allow filtering for contexts like the
existing calendar endpoint allows.

This is primarily for laying the foundation
so that the planner items endpoint
can be used for both the planner and the calendar
since they share the same data.

closes ADMIN-930

Test Plan:
* Ensure planner APIs still return things correctly
  without context codes
* Send various context_codes to the API and ensure
  only items from that/those context_codes are returned

Change-Id: I3747ef82c382ca56b80ea97e740b70072179057b
Reviewed-on: https://gerrit.instructure.com/147880
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Luke Kingsley <lkingsley@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2018-05-24 17:33:46 +00:00
Mysti Sadler 382e7bc756 API changes to add calendar events to planner
closes ADMIN-970

Test plan
- Add some calendar events, including a course
  event, a user event, a group event and an
  appointment group appointment
- Go to /api/v1/planner/items and ensure all
  of the items show up with the appropriate
  info

Change-Id: I5b0dc6402a98c5018d3597a3474d6a4a68ad3ae7
Reviewed-on: https://gerrit.instructure.com/148244
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2018-04-30 17:16:56 +00:00
James Williams 7423e4fb94 rails 5.2
closes #CORE-1301 #CORE-1302

Change-Id: I687132b066d12cf35e3c7a593dff9b2a91337f33
Reviewed-on: https://gerrit.instructure.com/147220
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-04-25 19:15:20 +00:00
Mysti Sadler a242a38e50 Order planner queries by overridden due dates
fixes ADMIN-131

Test plan
- Set up user with several assignments with
  as many types of overrides as possible
- (User in multiple sections with different
  due dates, user with an ad-hoc override,
  overrides that don't override the due date, etc)
- Ensure the API returns the items in the correct
  order (assuming the user has a due date for the
  item)
- Check the same with ungraded quizzes
- Ensure the plannable_date is the correct date
  for the user
- Turn off Canvas Planner and check to make sure
  the to do list works correctly

Change-Id: Ie38900ac645804867823ed24b59f228cefef7f51
Reviewed-on: https://gerrit.instructure.com/142412
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2018-03-13 19:09:19 +00:00
James Williams 00cd27e558 ensure planable bookmarks are set in utc time zone
closes #FALCOR-497

Change-Id: I603f76c2fd9e7c8c18bf076cf3f0bfcedad048b4
Reviewed-on: https://gerrit.instructure.com/118945
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-07-14 12:08:53 +00:00
James Williams 980b05fee8 do some preloading for context/account in planner api
Change-Id: I7ffe15c36ba0699d704f568590a6b6afe4916fd9
Reviewed-on: https://gerrit.instructure.com/118680
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-07-13 15:09:24 +00:00
James Williams edd8b9c986 add better sorting and shard awareness to planner index
make sure we're returning scopes on the right shard
and not prematurely executing them

also make sure that the pagination for planner items
actually behaves as expected when sorting dates

test plan:
* test all the things

closes #FALCOR-444

Change-Id: Iaa8a340de20b1bb2464d53ab6a3ba76843def822
Reviewed-on: https://gerrit.instructure.com/118141
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Pert Eilers <peilers@instructure.com>
2017-07-11 21:27:16 +00:00
Dan Minkevitch acafdcffc9 Add `plannable_date` to PlannerItems API
Closes FALCOR-375

Test Plan:
* As a student
* In a course with Student Planner enabled
* With various learning objects with associated
  todo_dates, due dates, posted dates, etc
* GET /api/v1/planner/items
* The response should contain a `plannable_date` for each
  object, with the date reflecting (in order of presence)
  todo_date, due_at, posted_at, or created_at

Change-Id: I3058f265cd91ef4e4f41b1266958a6cc049f213b
Reviewed-on: https://gerrit.instructure.com/116233
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2017-06-21 18:23:11 +00:00
Mysti Sadler e3bde5f77f Change planner overrides controller to match planner items
refs FALCOR-333

Test plan
- Create a planner override with the plannable_type as
- 'assignment' or 'discussion_topic' etc and ensure it creates
- Ensure visible has been replaced everwhere with marked_complete

Change-Id: Id56ceeb36e45a732f3afa5968da1fadc7724f86f
Reviewed-on: https://gerrit.instructure.com/115007
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
QA-Review: Dan Sasaki <dsasaki@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2017-06-17 00:11:22 +00:00
Mysti Sadler ae55289217 Ensure wiki pages created in groups can show up in the API
fixes FALCOR-311

Test plan
- Create some wiki pages inside of a course and account
- level group
- Add todo dates for them
- Ensure they show up in the /api/v1/planner/items API

Change-Id: I391c4149c435120670b25cd1b0a68b9cc047e5f8
Reviewed-on: https://gerrit.instructure.com/113624
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Dan Sasaki <dsasaki@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2017-06-02 18:32:48 +00:00
Steven Burnett c6d6a9ceae add ungraded discussion topics to planner
fixes FALCOR-262

Test Plan:
- Hit the planner_items root route
- Notice it now gives you ungraded discussion
  topics

Change-Id: I8c543a154a16b9eaaf29dad03b59038e65065bad
Reviewed-on: https://gerrit.instructure.com/113000
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2017-05-30 22:01:46 +00:00
Dan Minkevitch 4de6dffa3a Add PlannerNotes to API
Closes FALCOR-261

Test Plan:
* With the student planner feature enabled
* As a student
* Create a Planner Note via the API
  POST /api/v1/planner_notes
  todo_date: today
* List the Planner Items via the API
  GET /api/v1/planner/items
* Your newly created note should be included
  in the returned list of planner items

Change-Id: I609f4e0cbd205a66e08215948bde183d1dc62202
Reviewed-on: https://gerrit.instructure.com/113504
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2017-05-30 18:13:35 +00:00
Dan Minkevitch a04b0db6e9 Add date range, pagination, and submitted assignments
Closes FALCOR-183
Closes FALCOR-185
Closes FALCOR-257

Test Plan:
* With new planner enabled
* As a student
* With assignments that have submissions
* Hit the `api/v1/planner/items` endpoint
* See that the submitted assignments are included
  in the response
* Hit `api/v1/planner/items?due_after=YYYY-MM-DD`,
  `api/v1/planner/items?due_before=YYYY-MM-DD`, &
  `api/v1/planner/items?due_before=YYYY-MM-DD&due_after=YYYY-MM-DD`,
  replacing YYYY-MM-DD with some date in that format
* The response should only contain objects within that range
* Hit any of the above URLs, appending `&per_page=X&page=Y`,
  replacing `X` with a limit for number of items returned,
  and `Y` with the page of items to return
* The response should contain `X` amount of objects, starting
  from page `Y`

Change-Id: I63fc108107fda07f674ef7a5465125b185c0c510
Reviewed-on: https://gerrit.instructure.com/112386
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2017-05-25 21:25:03 +00:00
Dan Minkevitch 1f4132e1ba Planner API
Closes FALCOR-183
Closes FALCOR-184
Closes FALCOR-255
Closes FALCOR-186
Closes FALCOR-187
Closes FALCOR-188
Closes FALCOR-189
Closes FALCOR-147
Closes FALCOR-148

Test Plan:
* As a student in an account with the Student Planner
  feature flag enabled
* In a course with multiple upcoming due assignments
  in the current and following weeks
* Test that the following API endpoints provide you
  with the data described:

  get '/api/v1/planner/items'
    * Should return a list matching that of the todo
      list endpoint, while adding an additional key
      named `visible_in_planner`
  get '/api/v1/planner/overrides'
    * Should return a list of previously created
      PlannerOverrides
  get '/api/v1/planner/overrides/:override_id'
    * Should return the specific override for the
      passed in id
  put '/api/v1/planner/overrides/:override_id'
    * Should update an existing override's `visible`
      value to match what was passed in the request. No
      other values should be updated
  post '/api/v1/planner/overrides'
    * Should create a new PlannerOverride with the specified
      `plannable_type`, `plannable_id`, and `visible` values.
      `user_id` should match that of the user making the request
  delete '/api/v1/planner/overrides/:override_id'
    * Should set the PlannerOverride's `deleted_at` to when
      the request was made, as well as updating the `workflow_state`
      to `deleted`

Change-Id: I03890a525f8201a8df1d2f1290cdcd549ba548d7
Reviewed-on: https://gerrit.instructure.com/107495
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2017-05-15 19:18:47 +00:00