Commit Graph

2298 Commits

Author SHA1 Message Date
Cody Cutrer 1293920ed6 fix FoldersController#api_index pagination
@context is always nil. found by rails 3 specs

Change-Id: I37acb0edfc80987fa414f11bc338b07bebb79364
Reviewed-on: https://gerrit.instructure.com/30723
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-25 02:16:21 +00:00
Joel Hough cf2a0bc138 outcome results api can side load alignments
fixes CNVS-11056

test plan
- fetch outcome results using the api as usual
- ensure that alignments are not included in the response
- fetch outcome results with "outcomes" include[]'d
- ensure that the included outcomes have a list of alignment id's
- fetch the outcome results with "outcomes" and
 "outcomes.alignments" include[]'d
- ensure that the alignments referenced in the included outcomes
 are also included
- ensure that the included alignment names and html_urls are valid

Change-Id: I0abf38e0f2125899df606bdbc16ac66b495cb726
Reviewed-on: https://gerrit.instructure.com/30353
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-02-21 17:48:06 +00:00
Brian Palmer 4d615cb823 integrate the active_model-better_errors gem
refs CNVS-6040

This gem will help us output json error responses in the API using error
codes, since by itself ActiveRecord::Errors just deals in human-readable
i18n'd strings, and doesn't store detailed machine-readable information
on the error.

BetterErrors is mostly compatible, there's a few differences that mean I
had to change some unrelated code:

* errors[field_name] always returns an array, even if there's only one
  error on the field. This is an improvement IMO.
* errors is indexed by symbol, not by string
* iterating over the errors object now yields
  |attr, error_object| rather than |attr, string_message|

This includes a backport of the gem to rails 2.3.
On rails 3, we just use the vanilla gem.

The error codes aren't yet documented in the API docs, support for doing
that will come in a subsequent commit.

test plan: specs, plus you can hit the one api endpoint i've converted
so far -- account authorization configs. try to create an invalid
config, such as adding both cas and ldap configs to the same account,
and verify the error response formatting

Change-Id: Iaadd843ca9ff3f52c64e0256d82b64595c5559fb
Reviewed-on: https://gerrit.instructure.com/26178
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-21 17:09:53 +00:00
Rob Orton 5b2dc87c27 add sis_import_id to enrollments api
refs CNVS-10408

test plan
 - import enrollments through SIS
 - create enrollments manually
 - GET /api/v1/courses/:course_id/enrollments
   should have sis_import_id if you have
   permissions to see it
 - check that sis_import_id is in api docs

Change-Id: I2b8e91013858ddef76d07257e9dc38d46466af91
Reviewed-on: https://gerrit.instructure.com/29941
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-02-21 08:04:02 +00:00
Rob Orton ef8ac3bd8b add sis_import_id to group memberships api
refs CNVS-10408

test plan
 - import group memberships through SIS
 - create group memberships manually
 - GET /api/v1/groups/:group_id/memberships
   should have sis_import_id if you have
   permissions to see it
 - check that sis_import_id is in api docs

Change-Id: I43e3a8e806cf626c99863b467c792c0bb5c529c3
Reviewed-on: https://gerrit.instructure.com/29942
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-02-21 08:03:49 +00:00
Rob Orton e13d2a42d3 add sis_import_id to groups api
refs CNVS-10408

test plan
 - import groups through SIS
 - create groups manually
 - GET /api/v1/accounts/:account_id/groups
   should have sis_import_id if you have
   permissions to see it
 - check that sis_import_id is in api docs

Change-Id: Ibbd63c076835440b760952343d150ce986a386fd
Reviewed-on: https://gerrit.instructure.com/29943
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-02-21 08:03:39 +00:00
Rob Orton e16c0a266d add sis_import_id to sections api
refs CNVS-10408

test plan
 - import sections through SIS
 - create sections manually
 - GET /api/v1/accounts/:account_id/sections
   should have sis_import_id if you have
   permissions to see it
 - check that sis_import_id is in api docs

Change-Id: I0004bc35064708c6189bcb658e8f6bad7308845e
Reviewed-on: https://gerrit.instructure.com/29944
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-02-21 08:03:25 +00:00
Rob Orton d9747c39f7 add sis_import_id to users api
refs CNVS-10408

test plan
 - import users through SIS
 - create users manually
 - GET /api/v1/accounts/:account_id/users
   should have sis_import_id if you have
   permissions to see it
 - check that sis_import_id is in api docs

Change-Id: Id2f096548651183688d92a6f7e40c1eb2aa30b2b
Reviewed-on: https://gerrit.instructure.com/29945
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-02-21 08:03:11 +00:00
Cameron Sutter 7cf897c02a assignment migration for only_visible_to_overrides flag
also updates API to send/receive this flag

fixes CNVS-9762
fixes CNVS-9764

test plan:
 - turn on differentiated assignments flag in account & course
 - request an assignment via api
   - it should include this flag
 - update this flag on an assignment via api
   - it should work

Change-Id: Ibc01a7bc3effef8605c622f3e644ddc4e10effa3
Reviewed-on: https://gerrit.instructure.com/29526
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-02-20 22:58:12 +00:00
James Williams 6f2b03a56b create temporary records with .scoped.new for rails 3 compatibility
in rails 3, .new is analogous to .build for collections, so otherwise
temporary records will be added to the collection (and be autosaved)

Change-Id: I08ce7b4b35ee35646aff3afd237bbe896162a014
Reviewed-on: https://gerrit.instructure.com/30334
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-02-20 20:55:11 +00:00
Cody Cutrer dbcf296348 fix several users controllers things for rails 3 specs
Change-Id: I678a8c5a0c5ac1e3e7095ba61671c469e818c76c
Reviewed-on: https://gerrit.instructure.com/30123
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-20 18:04:39 +00:00
Jon Willesen c4df119b8e rails3: fix rescue_action_in_public
Change-Id: I8fb8ca981b52d66a2388386c928e71d45850f66b
Reviewed-on: https://gerrit.instructure.com/30188
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
2014-02-19 22:41:56 +00:00
Stanley Stuart 3347edb77a Revert "Revert "create PermissionsSerializer for serializing permissions""
This reverts commit e340d1a762.

Change-Id: I4b9fa5beed4bbcf8441c5f3a79a0e03df42163d4
Reviewed-on: https://gerrit.instructure.com/29185
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2014-02-19 22:33:12 +00:00
Rob Orton b9a307ade4 add sis_import_id to accounts api
refs CNVS-10408

test plan
 - import accounts through SIS
 - create accounts manually
 - /api/v1/accounts/self/sub_accounts should have
   sis_import_id if you have permissions to see it
 - check that sis_import_id is in api docs

Change-Id: Ib65b3b9c5a943fa0cc134ed8346c732105d08280
Reviewed-on: https://gerrit.instructure.com/29939
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-02-19 22:01:08 +00:00
Rob Orton ba7df59dbf add workflow_state attribute to accounts api
refs CNVS-10408

test plan
 - GET /api/v1/accounts/self
 - workflow_state should be included

Change-Id: I5731666c842fea6cdb68a3aa9d5e80eac16d17be
Reviewed-on: https://gerrit.instructure.com/29914
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-02-19 22:00:53 +00:00
Landon Wilkins f04316eb7f fix pseudonym_sessions_controller_spec for rails 3
Change-Id: I54e9874ae78d3f47d4392aefecb8f0668232ef1a
Reviewed-on: https://gerrit.instructure.com/30270
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-19 21:09:27 +00:00
Cameron Matheson 368c9e4696 fix X-UA-Compatible headers
RAILS3 includes these for us

Change-Id: I4ee8e558b56d167c7d15e794b5b061aabdcd41b3
Reviewed-on: https://gerrit.instructure.com/30265
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-19 20:37:13 +00:00
Kulgar 43201e8527 only set front page when front page changed
test plan:
 - with draft state enabled
 * create two pages (A & B)
 * set page A as the front page
 * update page B (using the api)
   - update fields (e.g. title, body, etc)
   - include wiki_page[front_page]=false
 * navigate to ../pages
	 - page A should still be set as the front page

closes CNVS-11266
closes gh-405

Change-Id: Ifc22c715a36dc069430f6999c41128ea35b32c83
Reviewed-on: https://gerrit.instructure.com/30232
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-02-19 18:51:48 +00:00
Cody Cutrer 00e411b4e3 use api_find for several cases in CoursesController
most importantly #show, but also for finding accounts and terms
when creating/updating a course via the API

Change-Id: I185219db62ead4dc1d04b5b7e91b945a0d39ecc7
2014-02-19 09:45:19 -07:00
Jeremy Stanley c11cb7b797 show points possible/due dates for unpublished module items
fixes CNVS-10916

test plan:
 - in a course with draft state enabled,
  - create unpublished assignments, quizzes, and graded
    discussions with due dates and points possible
  - ensure this information shows up in the modules page

Change-Id: I2674688fd0e66763094aa66192054b7f29d33663
Reviewed-on: https://gerrit.instructure.com/29803
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2014-02-18 22:45:36 +00:00
Joshua Simpson ae814421e0 namespace all of quiz into quizzes module
This commit namespaces the rest of quiz related code into a Quizzes
namespace: controllers, views, models, and classes that previously lived
under lib/ that are Quiz-related.

Test plan:

Full regression test on all quiz related items

refs CNVS-10457

Change-Id: If54b61213945056539e03271a936d233abb66188
Reviewed-on: https://gerrit.instructure.com/29351
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-02-18 22:17:13 +00:00
Braden Anderson 975cdd0dd9 conversations: handle ghost conversations
fixes CNVS-11205

I don't know how we're still getting empty conversations
in people's inboxes, but we can't let it break everything.
See https://gerrit.instructure.com/#/c/27121/
and https://gerrit.instructure.com/#/c/26059/ .

test plan:
  * In your Rails console, run something like this:
    user = User.where(name: 'banderson@instructure.com').first
    deleted = user.all_conversations.where(message_count: 0).limit(1)
    deleted.update_all(last_message_at: Time.now)
  * Open your user's inbox in old conversations.
  * Click on each of the conversations in the inbox and verify that the
      corresponding messages load in the right pane.

Change-Id: Ia605ac0b2392ca4b1983bca291d4685a5a818f7a
Reviewed-on: https://gerrit.instructure.com/30159
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-02-18 20:53:23 +00:00
Cody Cutrer 5a37b27bf7 fix gradebooks_controller_spec for rails 3
Change-Id: I927859cd69aecf78c593cc5507144a01fc7340ed
Reviewed-on: https://gerrit.instructure.com/30094
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-18 16:24:44 +00:00
Stanley Stuart bff1859df3 add speed_grader_url to the quizzes api
Test plan:
  - As a teacher, you should be able to see "speed_grader_url" that
    goes to the correct url when you query the quizzes index api and the
    quiz show api.
  - As a student, you should not see the "speed_grader_url" key when
    you query the quizzes index api and the quiz show api.

Change-Id: I9a827846fcf201d031715567e8af1f6ffda4a343
Reviewed-on: https://gerrit.instructure.com/30127
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2014-02-18 15:35:36 +00:00
Jacob Fugal a52e267ba2 make the codecogs equation base url a setting
fixes CNVS-10049

test-plan:

 * clear codecogs.equation_image_link setting
 * visit /equation_images/%5Csqrt%5B2%5D%7B900%7D%3Dx
 * should be redirected to http://latex.codecogs.com/gif.latex?%5Csqrt%5B2%5D%7B900%7D%3Dx
 * set codecogs.equation_image_link setting to "http://example.com/"
 * visit /equation_images/%5Csqrt%5B2%5D%7B900%7D%3Dx
 * should be redirected to http://example.com/?%5Csqrt%5B2%5D%7B900%7D%3Dx

Change-Id: Ic683111ec4109bacdd5c06c633c70129ab688fcc
Reviewed-on: https://gerrit.instructure.com/30212
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2014-02-18 00:14:59 +00:00
Eric Adams afe2e87acb allow setting start_at, end_at for enrollments api
fixes SIS-160

Test Plan
---------
  - Create an enrollment via the api with start_at and end_at parameters
  - verify start_at and end_at are poplutated for resulting record in enrollments table
  - verify user can only access course during start_at and end_at times

Change-Id: Icfeaded1f43c6b0309d41280d7caa17482b9182e
Reviewed-on: https://gerrit.instructure.com/30136
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ken Romney <kromney@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2014-02-14 23:37:29 +00:00
Cody Cutrer aa4d0e7e89 fix deprecation notices about using formats in rails 3
Change-Id: I80b8482d543ec303517dd43fc6c0a6404699326f
Reviewed-on: https://gerrit.instructure.com/30154
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-14 22:46:16 +00:00
Joel Hough e4530487eb returns shard aware participant ids from discussion view api
fixes CNVS-10549

test plan
- create a discussion topic
- reply to the topic with a user on another shard
- view the discussion as the original topic creator
- ensure that the reply shows the correct author

Change-Id: I5115f6fd3a21f6c8b986e7a9e0c95b5fe4be1587
Reviewed-on: https://gerrit.instructure.com/30080
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-02-14 22:32:05 +00:00
Jon Willesen 39a7266315 remove unused actions in rubric_assessments_controller
the index and show actions are unused. the index view was
removed awhile ago in 91ce600f.

Change-Id: Ib84fc2e9e524aec3143a4395d15f9c1320798648
Reviewed-on: https://gerrit.instructure.com/29983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
2014-02-14 19:50:11 +00:00
Nick Cloward 6e833427ef course activity log allow courses to be searched regardless of state
fixes: CNVS-10982

Test Plan:
  Create and then Perminantly Delete a course
  Open admin tools and that course should show in the autocomplete for course
  activity logs.

Change-Id: I0df432638fd60fe30c6908023551bda4208c9218
Reviewed-on: https://gerrit.instructure.com/29975
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-02-14 19:00:14 +00:00
Cody Cutrer a389fd18c1 rails 3 doesn't auto-require csv, so require it where necessary
Change-Id: Id76980c82024a082855f5b7b5b60cd7e760730a9
Reviewed-on: https://gerrit.instructure.com/30132
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-14 16:04:34 +00:00
Cody Cutrer f759ee0a45 always use api_find, even for non api requests
Change-Id: Iaf7b271762e675fd8d0219f210b3b6ddf65d0e7d
Reviewed-on: https://gerrit.instructure.com/30010
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-14 15:58:23 +00:00
Raphael Weiner 1b2b74e34e inline only usage of Array#to_ics
Change-Id: Ife84767f08ba50978e43045054bb9906443c03f3
Reviewed-on: https://gerrit.instructure.com/30030
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Raphael Weiner <rweiner@pivotallabs.com>
Product-Review: Raphael Weiner <rweiner@pivotallabs.com>
QA-Review: Raphael Weiner <rweiner@pivotallabs.com>
2014-02-13 22:17:57 +00:00
Raphael Weiner 14d61df591 inline only usage of Array#to_atom
Change-Id: I5cf6784b4f858f689e8d707dfced29a02590b9ff
Reviewed-on: https://gerrit.instructure.com/30029
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Raphael Weiner <rweiner@pivotallabs.com>
Product-Review: Raphael Weiner <rweiner@pivotallabs.com>
QA-Review: Raphael Weiner <rweiner@pivotallabs.com>
2014-02-13 22:17:27 +00:00
Jacob Fugal eb8071b64c fix usage of request.method to work with rails3
refs CNVS-4704

Change-Id: I1edc42653fd76a74fc0cf87b7e99f73aa1274adc
Reviewed-on: https://gerrit.instructure.com/30097
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2014-02-13 21:25:03 +00:00
Raphael Weiner ee625244ef inline only usage of Array#clump_per
Change-Id: Iaf4c85a6c89e693010e2da3c5830ef496a81ef32
Reviewed-on: https://gerrit.instructure.com/30024
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Raphael Weiner <rweiner@pivotallabs.com>
Product-Review: Raphael Weiner <rweiner@pivotallabs.com>
QA-Review: Raphael Weiner <rweiner@pivotallabs.com>
2014-02-13 20:32:42 +00:00
Raphael Weiner dc147ec731 inline only usage of Array#to_csv
Change-Id: I161db686070126447603a2a511edaccec30edfef
Reviewed-on: https://gerrit.instructure.com/30028
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-13 18:53:36 +00:00
Raphael Weiner 8d700779f5 inline only usage of Array#count_per
Change-Id: I79d32eedcf8c00259777ed04df605905ca3f685f
Reviewed-on: https://gerrit.instructure.com/30026
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-13 18:53:27 +00:00
Raphael Weiner 5f52dce2d4 replace Array#once_per extension with #uniq
Change-Id: I49111316d6cbc1f4be111567ed7f5e670d1d948c
Reviewed-on: https://gerrit.instructure.com/30023
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-13 18:53:05 +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
Nick Cloward 948ae069cf @undocumented warnings when generating yard docs
fixes: CNVS-5004

When generating yard docs we get an @undocumented tag does not
exist error.  This fix changes them from @undocumented to
@note which is a valid tag.

Change-Id: I976f96d8d1230eaecc55898884fb3947d664a2d3
Reviewed-on: https://gerrit.instructure.com/29990
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-02-12 23:06:18 +00:00
Cody Cutrer dbc1db7daf don't destroy notification policies in Facebook preferences
find the existing policy if there is one, and reset missing ones instead
of destroying them

Change-Id: Iec50b29c5977ac727af1225f6c80260a5ef09d3d
Reviewed-on: https://gerrit.instructure.com/29998
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-12 21:08:14 +00:00
Braden Anderson 11f6cda875 remove while(1) from API responses to application/json requests
fixes CNVS-11055

No browsers currently include Accept: application/json on requests for
<script> resources. It would be unreasonable for them to do so,
as even JSON-P uses application/javascript. Therefore, I believe
that application/json will remain a credible signal that a request
is not JSON-hijacking CSRF.

https://developer.mozilla.org/en-US/docs/HTTP/Content_negotiation#Values_for.C2.A0_scripts

test plan:
  * make an API request with and without the header
    Accept: application/json
  * verify that while(1) is prepended to the response
      iff the header is not present
  * smoke test Canvas pages which use Ajax

Change-Id: Iae830a4870175cae2b627227c85a5f1cc7801f69
Reviewed-on: https://gerrit.instructure.com/29882
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-02-12 17:19:44 +00:00
Jeremy Stanley a28e58ea62 translate sis source_course_ids in migration api
test plan:
 - use the API to copy a course referred by sis_source_id

fixes CNVS-10959

Change-Id: I2297e86969dbc630f75a6ce856a3603b919fd62b
Reviewed-on: https://gerrit.instructure.com/29795
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-02-12 17:08:02 +00:00
Duane Johnson f67b498e34 converting @object notation to @model - Part 5/11
Contributed by github.com/mcgachey

  app/controllers/courses_controller.rb
  app/controllers/custom_gradebook_column_data_api_controller.rb
  app/controllers/custom_gradebook_columns_api_controller.rb
  app/controllers/discussion_topics_controller.rb
  app/controllers/enrollments_api_controller.rb
  app/controllers/external_feeds_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: I517fe9e0ae7132ffecbf606dec32f08879db43e9
Reviewed-on: https://gerrit.instructure.com/30006
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-12 16:25:12 +00:00
Duane Johnson 402317a9a9 converting @object notation to @model - Part 4/11
Contributed by github.com/mcgachey

  app/controllers/content_migrations_controller.rb
  app/controllers/context_module_items_api_controller.rb
  app/controllers/context_modules_api_controller.rb
  app/controllers/conversations_controller.rb
  app/controllers/course_audit_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: I4b5dc36833cc6899c1b390fa7cf665b5942fe886
Reviewed-on: https://gerrit.instructure.com/29999
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-12 16:25:05 +00:00
Duane Johnson f6cb9f5f31 converting @object notation to @model - Part 2/11
Contributed by github.com/mcgachey

  app/controllers/assignment_groups_controller.rb
  app/controllers/assignment_overrides_controller.rb
  app/controllers/assignments_api_controller.rb
  app/controllers/authentication_audit_api_controller.rb
  app/controllers/calendar_events_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: I450539cb5311778038c6179dd46ec06aa6c71791
Reviewed-on: https://gerrit.instructure.com/29995
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-12 16:24:58 +00:00
Duane Johnson d7b7ad1305 converting @object notation to @model - Part 1/11
Contributed by github.com/mcgachey

  app/controllers/account_authorization_configs_controller.rb
  app/controllers/account_reports_controller.rb
  app/controllers/accounts_controller.rb
  app/controllers/admins_controller.rb
  app/controllers/appointment_groups_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: I0fc0ffaf06b072ebc9ff1e8644c655712c5c7469
Reviewed-on: https://gerrit.instructure.com/29994
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-12 16:24:51 +00:00
Rob Orton 71e750a9e6 converting @object notation to @model part 10/11
converting for:
role overrides controller
sections controller
sis imports api controller
submissions api controller
submissions controller

Contributed by github.com/mcgachey

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: I6c878eaeab2f41a15a5a323abe35ae6c7d9287dc
Reviewed-on: https://gerrit.instructure.com/30004
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-12 16:21:55 +00:00
Rob Orton 0d06315333 converting @object notation to @model part 9/11
converting for:
profile controller
progress controller
quiz questions controller
quiz reports controller
quizzes api controller

Contributed by github.com/mcgachey

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: I0604516bb3d6cad94e99c98309db3ff6d0b2c19c
Reviewed-on: https://gerrit.instructure.com/30003
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-12 16:21:37 +00:00