Commit Graph

63 Commits

Author SHA1 Message Date
Jeremy Stanley 17a3ae2143 log asset accesses for API calls
to allow mobile app activity to appear on the course access report

test plan: the following API endpoints should appear on the course
access report (enable page views to test):
 - assignments index
 - assignment show
 - collaborations index
 - conferences index
 - modules index
 - course roster (/api/v1/courses/X/users)
 - discussion topics index
 - discussion show
 - discussion view ("Get the full topic")
 - pages index
 - page show
 - quizzes index
 - quiz show

for paginated index endpoints, only the first page should result
in an asset access

canvas web pages that are built on the API should not record
double accesses

flag=none

fixes ADMIN-2840

Change-Id: I7163537b05d389a0a33b0a0128740e7be354349a
Reviewed-on: https://gerrit.instructure.com/208379
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Jon Willesen <jonw+gerrit@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2019-09-06 19:39:25 +00:00
Rob Orton 4296381ded don’t try stuff on nil
fixes CANVAS-5DQZ - show_helper 133k
fixes CANVAS-4VFR - quizzes_controller 293k
fixes CANVAS-4VFT - oauth/providor 287k
fixes CANVAS-5T4G - oauth2_providor_controller 11k
fixes CANVAS-4VQF - context_modules_controller 13k
fixes CANVAS-4W6A - grades.html.erb 1k
fixes CANVAS-4SNC - discussion_entry 46k
fixes CANVAS-4VJY - dup of discussion_entry 16k
fixes CANVAS-4SYM - users_controller 51k
fixes CANVAS-4VRJ - quiz_submission_history 3.3k
fixes CANVAS-4Y92 - gmail 51k
fixes CANVAS-4VM8 - media_object 7.8k
fixes CANVAS-4VHB - quiz_submission_events 9.2k
fixes CANVAS-6WSZ - course.rb 5
fixes CANVAS-5SD6 - active_record 33
fixes CANVAS-6WYD - dup of active_record 1
fixes CANVAS-4VHG - collaborations_controller 24k
fixes CANVAS-6PFH - files/show 2.2k
fixes CANVAS-4VSR - pv4_client 14k

Change-Id: I12cf698c6930ef4674ecfee02bc341e3650ef7fc
Reviewed-on: https://gerrit.instructure.com/188120
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-05-03 21:01:35 +00:00
Rob Orton e5291c04db rename user_past_lti_ids to user_past_lti_id
Change-Id: If7801aa4af6e39af0f885eba78e354ec7096db29
Reviewed-on: https://gerrit.instructure.com/189636
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-04-17 19:11:29 +00:00
Rob Orton 883fc1ae98 include past_uuid when it exists
avoid n+1 queries

test plan
 - specs should pass

Change-Id: I15df977272a12e288ff4c70cc6d7238879f273a2
Reviewed-on: https://gerrit.instructure.com/187470
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-03-29 22:17:19 +00:00
Rob Orton c4de231b0e support past lti ids for users
when a user_a is merged into user_b, user_a is
deleted, but the enrollments lti_tools still point
to the old lti_id, so this allows us to store them
and serve them as the lti_id when a user is merged

fixes CORE-2565

test plan
 - merge a user that uses an lti tool in a course
 - the lti_id should not change for that course

Change-Id: Iac70957ed1fcb08111745a91d0c2e402dfad3002
Reviewed-on: https://gerrit.instructure.com/181905
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-03-28 22:03:07 +00:00
David Wolever e1c9b8c658 Add the word 'paginated' to relevant API documentation.
fixes: GH-1119

Change-Id: I75992f23ff0f0d088983af0a4c931d1c2c09e3d5
Reviewed-on: https://gerrit.instructure.com/126253
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Bryan Petty <bpetty@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2017-09-27 17:27:41 +00:00
James Williams 9a725b529b fix offline course export rendering error
and patch some other `render :text`s

test plan:
* check the "allow students to download course content"
 setting on the account level
* on the modules page of a course, click on
 "export course content"
* should not get an error

closes #CNVS-39505

Change-Id: I06e210b84f44756d85131853daff5d4a682e5fea
Reviewed-on: https://gerrit.instructure.com/127347
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-26 19:14:05 +00:00
Landon Wilkins 241f6be120 da licença part 2
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: Ic8161ac858d70976f53f78e01572f3eb9bb61990
Reviewed-on: https://gerrit.instructure.com/110019
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2017-04-27 21:09:03 +00:00
Clay Diffrient ded046fb51 Make tutorial trays load on all course pages
closes FALCOR-130

Test Plan:
  - Enable new user tutorials
  - On any course index page a tray should be
    available.

Change-Id: Ibbdee68850e730f35a31fa91c8170264a31b9577
Reviewed-on: https://gerrit.instructure.com/104703
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Dan Sasaki
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2017-03-14 18:47:38 +00:00
Cody Cutrer 556f0b64bf rails 5: s/_filter/_action/g
fixes CNVS-34832

the arguments to these methods have not changed, just their names. and the
new methods became available in Rails 4, so we can start using them now

and prevent someone from doing old-style in the future

Change-Id: I61aa5512995dc8f25f3f7bd009a6cfa0a030e274
Reviewed-on: https://gerrit.instructure.com/101401
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-02-09 23:03:40 +00:00
James Williams a9fab4f4af remove strong_params
refs #CNVS-32574

Change-Id: I4e255b989f8ad3fc6ec2f2699d4950dc0e5a419a
Reviewed-on: https://gerrit.instructure.com/99483
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-13 12:49:15 +00:00
Jeremy Stanley f248b27fa7 add teachers to potential collaborators in course groups
test plan:
 - have a group in a course
 - create a collaboration in the group
 - ensure that the user list on the left-hand side of the
   edit-collaboration dialog includes both group members
   and teachers of the course that the group belongs to

fixes CNVS-22288

Change-Id: I29f4904969e53281f99afac46d0208acf4ea5b80
Reviewed-on: https://gerrit.instructure.com/97159
Reviewed-by: James Williams  <jamesw@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Chris Ward <cward@instructure.com>
Tested-by: Jenkins
2017-01-13 02:05:11 +00:00
James Williams f58544fc35 strong params part C
refs #CNVS-32574

Change-Id: I272579bba8c1993fc5af872abe685f21318833a2
Reviewed-on: https://gerrit.instructure.com/94567
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-10 23:36:46 +00:00
Jeremy Stanley 67491e3b76 Restrict collaboration membership by context
note that this requires collaborations to actually
*have* context.  all of the ones in the prod database do,
but specs were littered with contextless collaborations.

test plan:
 Test the following with both EtherPad and Google Docs:
 - have a collaboration in a course
 - add some users to it
 - on the edit-collaboration page, right-click and inspect
   a user who is in the collaboration, and look for something
   like this:
   <input type="hidden" id="user_1" name="user[]" value="1">
 - change the number in the `value` attribute to the id of
   a user who is not in the course
 - press the "Update collaboration" button and ensure this
   outside user has not been added
 - repeat these steps with a collaboration that belongs to a
   group, and ensure people outside the group cannot be
   added to the collaboration using this trickery
   (except for teachers/TAs in the course containing the group)

fixes CNVS-34038

Change-Id: I92e769ee7241c1ad5e98c68b78793961f2b3b08b
Reviewed-on: https://gerrit.instructure.com/98393
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2017-01-05 17:43:46 +00:00
Simon Williams 5b00e983b6 api: document the Collaboration object
fixes gh-895

test plan:
- look at api docs for collaborations
- they should document the collaboration object

Change-Id: I9691c61a3f0efe42eefa8b27c744492562c0ff65
Reviewed-on: https://gerrit.instructure.com/96476
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2016-12-08 05:16:42 +00:00
Brad Horrocks 9be2ab4d2a Show collaborations you have group membership in
Collaborations#api_index will now also check a user's group ids with the
collaborator group ids

Fixes: RD-3308

Test plan:

Add a user to a group
Add group to a collaboration
Make sure the user can see the collaboration

Change-Id: I053d1093f06c2262f622c893da06574378307fcf
Reviewed-on: https://gerrit.instructure.com/94791
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
Reviewed-by: Josh Orr <jgorr@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2016-11-22 20:26:49 +00:00
Brad Humphrey 18e44d4c69 do not add the same group to a collaboration multiple times
test plan:

create a content-item that adds a group through visibility
update a collaboration using content-item
update the collaboration again using that content-item
the group should only have been added to the collaboration once

fixes PLAT-1666

Change-Id: Ie5134632569f5fac331f51017edd278a8ba2d159
Reviewed-on: https://gerrit.instructure.com/85057
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2016-07-12 22:41:29 +00:00
Andrew Butterfield 47cda00abb Add include to collaboration members api endpoint
fixes PLAT-1607

Test plan:
* In a course with some collaborations hit the following endpoint
  /api/v1/collaborations/:id/members?include[]=collaborator_lti_id&include[]=avatar_image_url
* Ensure that the collaborator_lti_id is included for both user and
  group members
* Ensure that the avatar_image_url is included for members of type user
  who have an avatar_image_url set

Change-Id: Id253242587d73b57f9caf203db2091706a347623
Reviewed-on: https://gerrit.instructure.com/82741
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2016-06-17 16:38:44 +00:00
Matthew Sessions 7dfd678a85 Add index external_tools to group context
Fixes PLAT-1599

Test Plan:
 - In the context of a group you should be able to hit
   /groups/<group_id>/external_tools
 - If the group is a course group then it should return a list
   of all of the course external tools
 - If the group is an account group then it should return a list
   of all of the account external tools
 - Going to /groups/<group_id>/lti_collaborations should not have
   any errors and should show the getting started message

Change-Id: I5b8cd024ce836f8220fd3577fe55a18722ccba37
Reviewed-on: https://gerrit.instructure.com/82219
QA-Review: Heath Hales <hhales@instructure.com>
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2016-06-17 15:12:31 +00:00
Matthew Sessions 492b5c3135 Show breadcrumb on the new collaborations page
Fixes PLAT-1602

Test Plan
 - In the context of a group the bread crumb should
   show the collaborations link with the proper url
 - In the context of a course the bread crumb should
   show the collaborations link with the proper url

Change-Id: I3492491a7ca16ec19717e3771862de702984c364
Reviewed-on: https://gerrit.instructure.com/82377
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Matthew Sessions <msessions@instructure.com>
2016-06-16 19:37:56 +00:00
Matthew Sessions 9b2b79edc9 Add ability to create a collaboration through a tool
Fixes PLAT-1474

Test Plan:
 - Have the new collaborations feature flag turned on
 - Set up the lti_tool_provider_example application
 - in external_tools_controller.rb line 515 change false
   to true
 - Go to course settings and set up a lti tool using the
   lti_tool_provider_example application
 - Go to the collaborations page
 - Click the + Collaboration button
 - Click the one option in the drop down
 - A full screen modal should cover the screen and launch the lti
   tool
 - Click the heart icon in the top right
 - Hit the submit button
 - After all is done the modal should go away and a new
   collaboration should appear
 - Create an old collaboration and ensure that it does not
   show in the list of new collaborations on the
   lti_collaborations page

Change-Id: I8af35e1b5d7bb534ec76d4d90b5d093d55a5ede3
Reviewed-on: https://gerrit.instructure.com/81903
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2016-06-14 15:56:50 +00:00
Matthew Sessions 5b8173aca4 Add endpoint to list all external tool collaborations
Fixes PLAT-1556

Test Plan:
 - Create a collaboration in the context of a course.
   The collaboration_type should be 'external_tool_collaboration'
   This should be done via rails console or something similar as
   creation of these new types of collaborations is not complete
 - Hit /api/v1/courses/<course_id>/collaborations and notice that your
   newly created collaboration will show up and should include a field
   called user_name that has the creating users name
 - Try accessing the endpoint as a non member of the collaboration
 - you should not see the collaboration
 - Create another collaboration in the context of a group
 - As a member of the group hit /api/v1/groups/<group_id>/collaborations
   and notice the newly create collaboration will show up and should
   include a field called user_name that has the creating users name
Change-Id: I06045fa4bfa25722c3c790d4b7ff493098ec2670
Reviewed-on: https://gerrit.instructure.com/80235
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Matthew Sessions <msessions@instructure.com>
2016-06-06 19:12:37 +00:00
Nathan Mills a492c6872a allow content-item to return visibility settings
fixes PLAT-1401

test plan:
using an updated test tool, try to add users/groups by the
lti_context_id

it should add them as collaborators

Change-Id: I0a80772c3921f1e26b5e9a9b696c1b787804db46
Reviewed-on: https://gerrit.instructure.com/79813
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-06-02 15:00:42 +00:00
Steven Burnett de09499249 set up index LTI collaborations loading
fixes PLAT-1552

Test Plan:
- Go to http://[env]/courses/3/lti_collaborations
- notice no 404 error

Change-Id: I6d1c8713fd810efabff046a27ed856d3ea16a098
Reviewed-on: https://gerrit.instructure.com/80035
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2016-05-24 16:19:51 +00:00
Nathan Mills 0acbf56806 collaborations edit launch
fixes PLAT-1339

test plan

Create an collaboration using an lti tool
For the collaboration just created, set the data field in the db
to include 'updateUrl' => '<the launch URL>'
You should now be able to edit the collaboration via the UI

Change-Id: I1a22afe06610451251eb461847819c112c8d5297
Reviewed-on: https://gerrit.instructure.com/75496
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-05-18 21:43:24 +00:00
August Thornton d81f4381ce fix content item util parsing
refs PLAT-1336

test plan:
* collaborations should create successfully
* behavior shouldn't change

Change-Id: I7a2c684f5178adc7b84bb21167962745b280f4d2
Reviewed-on: https://gerrit.instructure.com/76821
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
2016-04-13 22:39:45 +00:00
Nathan Mills fc68106981 refactor collaborations
refs PLAT-1339

test plan:
collaborations shoul still work the same (i.e. nothing broke)

Change-Id: I8fb01cafb2525e94843e2ababb6c38c7f161c524
Reviewed-on: https://gerrit.instructure.com/74815
Tested-by: Jenkins
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-03-18 22:01:21 +00:00
Nathan Mills d8082412ca add support for success/failure callbacks in collaborations
fixes: PLAT-1336

test plan:
it should still create collaborations via content-item
we need to enhance the test tool to verify that callbacks happen

Change-Id: I2854c93adb0eec64f4dcae1c7a74b3cc72c94b90
Reviewed-on: https://gerrit.instructure.com/72610
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-03-07 16:49:23 +00:00
Nathan Mills d22447ce45 allow content-item to create collaborations
fixes PLAT-1335

test plan:
install the test tool with a 'collaboration' placement
the tool should show up as a collaboration type
you should be able to create a collaboration using content-item

Change-Id: Icaeaec480e37babd37dfe5443490560644c22f99
Reviewed-on: https://gerrit.instructure.com/72504
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-02-26 23:26:43 +00:00
Brad Horrocks 3fee901ac0 Remove Google Docs plugin
Google drive relevant code has been moved to the gems/google_drive
Actually test google drive with mocked api responses
cleaned up lots of code

Fixes PLAT-1301

Test Plan:
*** You'll need to use 2 separate google accounts to fully test ***
** Its helpful to have multiple chrome profiles so you dont have to log in and
** out a bunch https://support.google.com/chrome/answer/2364824?hl=en

BEFORE SWITCHING TO THIS PATCH SET
  - Make sure you have some google doc collaborations
    - Directions for creating one are below
  - Disable your google docs plugin

Switch to the patch set
Enable google drive. (if not already)
  - You should be able to paste in a client_secrets.json
  - Update Redirect URI to point to your local instance (The URI should exist in the JSON)

As an admin/teacher
  - Goto `profile/settings` and add the google drive user service
    - Your email should be displayed with the service
  - Goto Collaborations
    - Make sure existing collaborations still work
    - Click "Start new collaboration"
    - give it a nice name (Created by admin)
    - select your student
    - click start collaborating
    - You should be redirected to the new doc in google
    - create another collaboration without the student (Created by admin, no users)
  - Create an assignment with
    Submission Type: Online
    Online Entry Options: File Uploads
  - Make sure your student has access to the course/assignment
  - Goto Account settings -> Users
    - Click View User Groups in the top right
    - create a new group set with a group in it
    - add yourself and your student to the group
  - Goto the Group's Collaborations (Courses & Groups -> [group name] -> Collaborations)
    - Click "Start new collaboration"
    - give it a nice name (Created by admin for group)
    - select your student
    - click start collaborating
    - You should be redirected to the new doc in google

As a student
  - Goto `profile/settings` and add the google drive user service
    - Your email should be displayed with the service
  - Goto the assignment
    - Submit the assignment
    - You should have a "Google Doc" tab
    - Choose a document and submit it
    - After it submitted, click download on the right side
      just to make sure its correct
  - Goto Collaborations
    - Make sure existing collaborations still work
    - make sure the "created by admin" collaboration works
    - make sure you can't see "Created by admin, no users"
    - Click "Start new collaboration"
    - give it a nice name (created by a student)
    - click start collaborating
    - You should be redirected to the new doc in google
    - Switch to your admin/teacher and make sure they can't access it
    - Edit the collaboration add the teacher, click Save
    - Switch to your admin/teacher and make sure they can access it
  - Goto `profile/settings` and REMOVE the google drive user service
  - Go back to collaborations
  - You should be forced to add the google service in order to use a collaboration
  - Goto the Group's Collaborations (Courses & Groups -> [group name] -> Collaborations)
    - Make sure you can access "Created by admin for group"
    - Click "Start new collaboration"
    - select your admin/teacher
    - click start collaborating
    - You should be redirected to the new doc in google
    - make sure your admin can access it to

As a site admin
  - Disable Google Drive
  - Then with your student
    - Make sure you can still do file upload submissions on the assignment
    - Collaborations should no longer show up (unless you have etherpad enabled)
  - Google drive should no longer show up in your profile settings as a registered service
Change-Id: I4dfaff6f5262743c044aadd12266fd0bd85a60e1
Reviewed-on: https://gerrit.instructure.com/69078
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-02-01 23:41:53 +00:00
Simon Williams 993ae12567 redirect to google drive auth for collaboration show
fixes CNVS-23084

test plan:
- create a google docs collaboration, and invite someone who does not
  have google docs or drive authorized
- click on the link to the collaboration from the invite email
- it should redirect you to authorize your google account
- going through that flow should work correctly

Change-Id: I7a5074277360742031994da71440237aa0fdd042
Reviewed-on: https://gerrit.instructure.com/64646
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Adrian Russell <arussell@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-10-28 18:29:20 +00:00
Cody Cutrer 56ccea56d4 use preload/eager_load instead of includes
refs CNVS-21901

Change-Id: Ie9e1b2778b72f649392d8a1c47c0c86dae0ef19c
Reviewed-on: https://gerrit.instructure.com/58660
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-09-08 20:32:05 +00:00
James Williams 600165e7b2 rails4: deprecate Relation#all in favor of Relation#to_a
refs #CNVS-21596

Change-Id: I5dedaab90a2abe6bf288ff30401c9b31629b45b2
Reviewed-on: https://gerrit.instructure.com/59220
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-24 21:28:14 +00:00
Brad Horrocks 2d12de9e28 No longer show collaborations a user doesnt have access to see
Users will no longer be able to see collaborations they cant access
Better error handling for google drive api failures

Fixes: PLAT-1073

Test plan:
Make sure users cant see collaborations they are not added to

Change-Id: I5926af6fac0bce0c7c77415d6e969bf1e25547f5
Reviewed-on: https://gerrit.instructure.com/55430
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-06-02 15:53:58 +00:00
Joel Hough 157ee9bfc6 disable new instructure hosted etherpad collaborations
fixes CNVS-20343

test plan
the change aims to prevent new etherpad collaborations from
being made if the plugin points to etherpad.instructure.com/p
and to show a warning if there are existing etherpad
collaborations

here are the steps to run through a couple of permutations:
- configure the etherpad plugin to point somewhere other than
 the instructure account
- ensure that no warnings appear on the collaboration page
- create some collaborations
- configure the etherpad plugin to point to
 etherpad.instructure.com/p
- ensure that a warning about access to etherpad being cut off
 appears on the collaboration index page
- disable all collaboration plugins except etherpad
- ensure that there is no way to start a collaboration on the
 collaboration index page
- enable another collaboration plugin
- ensure that the ui to add collaborations is there but the
 etherpad option is not

Change-Id: Icdef495b6701f56e592f442650ae8869be21cc4e
Reviewed-on: https://gerrit.instructure.com/53339
Product-Review: Joel Hough <joel@instructure.com>
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2015-05-14 23:01:17 +00:00
Zach Wily 51c8eefb2b send asset accesses as live events
We already have several asset accesses instrumented via
log_asset_access, so this captures those and sends them to the live
events as well. In order to better categorize the data, the synthetic
keys generated like "syllabus:course_1234" have been changed to arrays,
so that we can break that data apart in the live events without parsing
the string.

test plan:
 * Ensure that asset accesses are still being logged normally
 * Ensure that asset accesses also get sent as live events. (See
   change Id799688c972205a1eee84a673912f84b0c7abb57 for more information
   about that.)

Change-Id: I947a7f8b1d104bfafba96c30b81d0cb9bae81b9d
Reviewed-on: https://gerrit.instructure.com/50521
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Zach Wily <zach@instructure.com>
2015-05-05 12:52:50 +00:00
Brad Horrocks 0418d4581e New error message for drive exceptions, and better exception logging
Fixes PLAT-990

Test plan
Make sure you get a better error message when you attempt to access a
google doc collaboration where the creator no longer owns the google doc

Change-Id: I48cc8fbb1d099fa1774273280893bd8ad278197f
Reviewed-on: https://gerrit.instructure.com/52326
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins
2015-04-16 19:37:12 +00:00
James Williams 4ca7d556c1 only show the correct groups on the collaborations invite tab
test plan:
* enable collaborations by setting up etherpad or google docs
* visit the course collaborations page, and click on the
 "groups" tab
* as a teacher, should be able to see all groups for the course
* as a student, should only be able to see groups the student
 belongs to (that are also part of the course. other course
 groups should not show up)

closes #CNVS-18469

Change-Id: I20661255bc4e590bae040dbbd9fd6495f6c6b02b
Reviewed-on: https://gerrit.instructure.com/49326
Tested-by: Jenkins
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-02-25 15:20:31 +00:00
Nathan Mills a99c397662 Google Drive Collaborations & Submissions
force users to auth google drive when the plugin is enabled

Add support for google drive in collaborations and homework submissions
Everything still looks like google docs to the user.

fixes PLAT-892
fixes PLAT-893
fixes PLAT-894

Test plan:

create a google docs integration
and enable the google drive plugin
when you visit the colaborations page it should ask you to authorize canvas to use google drive

Regression test homework submissions with google doc and drive
Regression test collaborations with google doc and drive

Change-Id: I79bdbdcae915b08a19cc9a078a64b49ef5f34796
Reviewed-on: https://gerrit.instructure.com/48583
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-02-18 16:02:25 +00:00
Simon Williams 650633744e set collaborations tab as active when page is accessed
fixes CNVS-17721

test plan:
- go to /plugins and enable a collaboration tool (i used etherpad with
  dummy settings for this test)
- go to a course
- if the collaborations tab doesn't show up, you might have to clear
  a cache, which can be done by going to the course settings, tab
  navigation, and hitting save
- click on the collaborations tab
- it should be highlighted as "active" in the tab list
- it should have a navigation crumb in the top bar

Change-Id: I9441ee278dd416ef2fc6ff3ac2586199fba5c1af
Reviewed-on: https://gerrit.instructure.com/46453
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-01-02 20:44:56 +00:00
Ben Young aa8c506e5f Update parameters in the following API docs - 3
- Collaborations
- CommMessages
- Communication channels
- Conferences
- Content exports

Test plan:
- rake doc:api
- Verify the above doc pages for parameter accuracy

Refs SIS-403

Change-Id: I5b7c7ba70ea9ddeaed148ab8ccc24436fe307373
Reviewed-on: https://gerrit.instructure.com/38681
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2014-08-26 16:42:33 +00:00
Raphael Weiner 8be0ae37d7 Move google_docs code into a gem
fixes: CNVS-12329

Change-Id: I044725c93582cbca39a61e036bb5f0385e069c1e
Reviewed-on: https://gerrit.instructure.com/32990
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:43 +00:00
Raphael Weiner c8d7b9f915 Further decoupling of google_docs from models and controllers.
fixes: CNVS-12328

test plan:
  - as admin enable the google_doc plugin
  - as student visit `/profile/settings`
  - click 'Google Docs' under the 'Other Services' section
  - click 'Authorize Google Doc Access' in modal
  - when redirect to google, click 'Allow access'
  - verify success banner displays

Change-Id: I2b45ffa38ac0d1d810fb988335f4cd39154ae2a6
Reviewed-on: https://gerrit.instructure.com/32949
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:34 +00:00
Brian Palmer 4a226ed4e7 rename google_docs_user to logged_in_user
This is a more generally useful concept. Also remove the check for
controllers responding to a #user method, I didn't find any current
usage of that functionality and it's confusing and dangerous.

refs CNVS-12563

test plan: google docs integration should see no change in behavior,
specifically around not being able to view the docs list of somebody you
are masquerading as.

Change-Id: I6c7f5cd5595970f4ed1782b60431f7529a0024db
Reviewed-on: https://gerrit.instructure.com/33774
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-04-25 15:40:34 +00:00
Raphael Weiner 101cd37bb6 Cleanup google_docs
Change-Id: Iaa8545a3f39cd8708b1ea20a9c27836dcbdacb0a
Reviewed-on: https://gerrit.instructure.com/32860
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:32:01 +00:00
Raphael Weiner 7054118441 Refactor google docs to be standalone not mixin.
fixes: CNVS-12096

Change-Id: I6fa7d6d57bfc9063b49334a8e528aaaa9fc7f8c2
Reviewed-on: https://gerrit.instructure.com/32715
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:31:39 +00:00
Duane Johnson 1dc6b08737 converting @object notation to @model - Part 3/11
Contributed by github.com/mcgachey

  app/controllers/collaborations_controller.rb
  app/controllers/comm_messages_api_controller.rb
  app/controllers/communication_channels_controller.rb
  app/controllers/conferences_controller.rb
  app/controllers/content_exports_api_controller.rb

Fixes SIS-146

Currently, some API objects are documented using the @object tag, and
others are documented using @model. The @model tag is preferred because
it provides more information in the machine-readable Swagger documents
generated by the API documentation build step. For example, the @object
notation does not give a way to specify that a model property contains
an instance of another type. This complete information is necessary in
order to build an SDK generator.

This change converts the @object notations into @model, adding missing
type information and correcting inaccurate data (for example, dates were
typed as "string" in the existing JSON documentation). Embedded types are
also separated out so that their format can also be documented - this
information was previously lost.

The change also makes two minor fixes to the HTML and JSON documentation
generators. The HTML generator is fixed so that a missing documentation
string is ignored rather than being shown as an empty comment, and the
JSON generator is modified so that the Model-level documentation and
required attributes are properly provided.

Note that the JSON generated here is not fully-complient to the Swagger
format. Swagger does not support a Map structure, but the Canvas API
uses (semi-)arbitrary key/value dictionaries in a few places. In those
instances the properties are typed as "map", but this is not a part of the
Swagger spec. Any cleaner alternative approaches here would be welcome.

Change-Id: I92dd48d52cdda123ceb5cfaf9ac98e746b1c9131
Reviewed-on: https://gerrit.instructure.com/30007
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-02-13 17:29:06 +00:00
Landon Wilkins 5df181a705 converts collaborations/_forms js_block into js_bundle
test plan:
* regressions on collaborations

Change-Id: I3db37868527db0f4c2afadbbd54719ac2e8da1d9
Reviewed-on: https://gerrit.instructure.com/29167
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
2014-02-05 00:14:01 +00:00
Rob Orton fc80fa2b77 change api doc examples to be https instead of http
closes CNVS-3912

test plan
- api docs should be updated and display

Change-Id: Ie6d4c80b91e3e3c8cee4b6d2e93c000f1040fd35
Reviewed-on: https://gerrit.instructure.com/25657
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-10-25 18:32:42 +00:00
Jacob Fugal b12791aa99 to_json unnecessary (and wrongish) in render :json
refs CNVS-7597

render :json => thing will call ActiveSupport::JSON.encode(thing) unless
thing is a String. ActiveSupport::JSON.encode(thing) just calls
thing.to_json but with some circular reference checking that we want. we
may also want enhance ActiveSupport::JSON.encode to do additional
processing, and calling to_json straight up would bypass that.

in the cases where we do need to do the structural transformation before
passing to render :json (e.g. because of need to pass arguments), use
as_json to do structural transformation only, vs. to_json that does
serialization of the as_json result.

adds a rake task to lint the controllers to enforce as_json over to_json
in render json calls.

test-plan: heavy regression testing; no end behavior should change
(except a pair of serialization bugs that got fixed)

Change-Id: I7a91a9fe0eca70456bc5bca233f0ed6b27a54aaf
Reviewed-on: https://gerrit.instructure.com/23650
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-02 18:05:22 +00:00