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