Change-Id: I70825be7ec7e24458afe0c63dc48c5a76158f520
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251150
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Test plan:
-specs should pass
-create a favorite
-inspect in rails console
-verify root account id is set
Fixes VICE-343
flag=none
Change-Id: Ib13b7db057bfe1fd7a1d78b30a5ed3a30ae85799
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239853
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Nelson <bnelson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
- fix id transposition for unfavoriting
- don't keep the favorite courses cache after saving
- reload the user if they're a shadow so we get the primary
updated_at
closes #ADMIN-1467
Change-Id: I97ff4937bdb009e2576e2201a8a01f40a8668bf4
Reviewed-on: https://gerrit.instructure.com/165076
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
was searching with wrong id
closes #ADMIN-1390
Change-Id: I713dc4394db0b65e6eed64f89c08ed0c63786447
Reviewed-on: https://gerrit.instructure.com/164361
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
refs #CNVS-32574
Change-Id: I3ba018a7110a7530c9af4a59c97422f626a749b6
Reviewed-on: https://gerrit.instructure.com/99260
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
refs #CNVS-32574
Change-Id: Ib1fc9c81dbfa4ece200a15a23105dbfa6f84d0c6
Reviewed-on: https://gerrit.instructure.com/94677
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
This reverts commit 06cc23f79f.
Change-Id: I31abba276e080179ea915dc03f603099af1cc721
Reviewed-on: https://gerrit.instructure.com/87937
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
test plan:
* courses and groups in the menu should appear by default
when enrolled or added
closes CNVS-28908
Change-Id: I48885a6748be20e0a010e23a13ad9ad611e04395
Reviewed-on: https://gerrit.instructure.com/80064
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Tested-by: Jenkins
Adds group context to user's favorites. Adds favorite_for_user? method to groups.
Adds get "users/self/favorites/groups"
post "users/self/favorites/groups/:id"
delete "users/self/favorites/groups/:id"
delete "users/self/favorites/groups"
endpoints to favorites api.
Corrected get "users/self/favorites/groups" to return all user's groups if no groups are favorited.
Adds ?include[]=favorites option to groups api.
Fixes PLAT-1213
test-plan:
Using PostMan or other API test tool:
List group favorites using either the Group or favorite endpoint, verify that the test user has no group favorites
Add 4 groups and make the test user a member of 3 of them
Use the favorites endpoint to add 3 of the test group as favorites.
List group favorites using the endpoint not used above. Verify that 3 of the groups are favorites and one is not.
Use the favorites api to remove one of the groups from favorites
List group favorites and ensure that the 2 correct groups are marked as favorites
Use the favorites api to clear all group favorites
List group favorites to ensure that there are no group favorites
Change-Id: Id7b92126f9c2a34b3a301640e925aa26c494c26a
Reviewed-on: https://gerrit.instructure.com/62301
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Matthew Rice <mrice@instructure.com>
instead of passing an :exportable option to
ActiveRecord::Associations, simply define a constant
on the class containing exportable associations and
attributes. This is due to :exportable breaking
ActiveRecord, and we can't simply monkey-patch in
config/initializers because models are included in
migrations before the initializers are run
Change-Id: I11f1a6b4570c397d8e01010c517bc6efdac7afca
Reviewed-on: https://gerrit.instructure.com/33235
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
Features
--------
- The course menu shows the top 12 courses in
alphabetical order
- Users with > 12 courses will get a button to
edit the courses in their menu. Any courses
they add become favorites and will remain
in the course menu, and visa versa for those
they remove
- Users can reset the menu to the default 12
Noteworthy Ruby changes:
------------------------
- Added Favorites model
Favorites are polymorphic so we can save other
contexts as favorites in the future.
- Added FavoritesController
- Added User#menu_courses
This opens up some room to remove lots of code
that's used to build the main menu, but that
isn't in this commit. Gives a list of all the
courses that show up in the user's menu.
- Added User#favorites
- Added User#favorite_courses
- Refactored Enrollment::readable_type to cache
Noteworthy JavaScript changes:
------------------------------
- Jasmine specs are totally working
- Added CustomList constructor
- Added courseList (CustomList instance)
- Added objectCollection
Utility function that extends an array with
methods useful for collections of objects.
Used to manage the data state in CustomList
Fixes#4827
Change-Id: I59468e517ad07678741402bf9cf479cba1dfeaa1
Reviewed-on: https://gerrit.instructure.com/5982
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>