Commit Graph

49 Commits

Author SHA1 Message Date
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 89370c5f11 remove protected_attributes
refs #CNVS-32574

Change-Id: I3ba018a7110a7530c9af4a59c97422f626a749b6
Reviewed-on: https://gerrit.instructure.com/99260
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-12 17:46:18 +00:00
Jeremy Stanley 678a5d81af initialize migration progress while waiting for upload
test plan:
1. use the content migration API
   (POST /api/v1/courses/X/content_migrations) to create a
   migration with migration_type `canvas_cartridge_importer`.
   use pre_attachment[name]=filename.imscc, and save the
   pre_attachment hash in the returned json
2. go to the course's content migrations page and ensure
   it loads.  (/courses/X/content_migrations)
   the migration you created should be shown in
   "Pre-processing" state. leave the tab open.
3. complete the file upload by doing a POST to
   pre_attachment['upload_url'] which was returned in
   step 1, using the parameters returned in 'upload_params'.
   if the parameters are correct, S3 should return a redirect.
   (see https://canvas.instructure.com/doc/api/file.file_uploads.html)
   follow this redirect, then return to the tab from step 2.
   you should see the migration complete.

fixes CNVS-29629

Change-Id: I5b3920f95cad9716930a42414017b1baa4e77b08
Reviewed-on: https://gerrit.instructure.com/81066
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2016-06-07 14:52:31 +00:00
Brian Palmer 933a052061 fix typing of api doc @model definitions
refs CNVS-26515

Pretty much anything that wasn't a number was being rendered as a
string, including sub-arrays and sub-objects. Worse, a lot of our api
docs were defining them using ruby syntax rather than json syntax.

This change fixes types so that booleans, arrays, and objects all render
correctly in the @model docs (the "A ModuleItem object looks like:"
sections of the docs). It also adds some basic error checking to help
avoid future mistakes.

This doesn't fully support the "$ref" OpenAPI (swagger) syntax yet, but
still renders examples for "$ref" fields when an example is provided.
Eventually it'd be nice to auto-generate an example for "$ref" fields,
since we can look at the linked documentation and just embed it.

test plan: generate the api documentation and look through the @model
definitions at the top of each Resources page. the new rendering should
show more accurate type information.

Change-Id: Id5af514cd235e66af2ce868bce95eb49d71062ab
Reviewed-on: https://gerrit.instructure.com/70484
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2016-01-20 19:07:41 +00:00
Brad Horrocks a11fdec9f6 Make LTI configurations accept canvas icon class
Support passing a class for an icon for styling goodness.

added support for `canvas_icon_class` allowing use od css classes from canvas
style guide which can make it look better and maintain our styling
standards.

Fixes PLAT-1222

Test Plan:

prereq's
- "LOR External Tools" feature flag enabled
- (notice the lack of lti example tool, you dont need it)

A new commons icon has been added so you should probably run the
following
`bundle exec rake brand_configs:clean canvas:compile_assets`

Add a new LTI tool to the account using [this xml](https://gist.github.com/defektive/dbd182cb04500e236bde)
check placements to make sure they show a fancy new icon instead of a
crappy star. course_home_sub_navigation should show up as the commons icon

placements to look at
:assignment_menu - cog on an assignment
:course_home_sub_navigation - right side of page
:course_settings_sub_navigation
:discussion_topic_menu
:file_menu (no icon)
:global_navigation (no icon)
:module_menu
:quiz_menu
:wiki_page_menu

Change-Id: Ib462e928a5a3811df490f9bf2441b755db2882a9
Reviewed-on: https://gerrit.instructure.com/62492
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-09-21 17:59:40 +00:00
Cody Cutrer 9bf7304917 use preload instead of include on associations
refs CNVS-21901

also got rid of some useless associations

Change-Id: I13e012e0ec755443fbed12ca0629c53a9c693f43
Reviewed-on: https://gerrit.instructure.com/62217
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:41 +00:00
Jacob Fugal d79ccc78d9 localize values in datetime picker fields
fixes CNVS-21581, CNVS-21582

test-plan:
 - regression around all datepicker elements
 - for each, when it loads with prepopulated data, that data should be
   localized
 - the prepopulated localized data should be valid to the datepicker

Change-Id: I633034967c70066e337dc22d9b9ad0cd84793834
Reviewed-on: https://gerrit.instructure.com/60229
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2015-08-14 20:25:02 +00:00
Jeremy Stanley a4487cdd41 remove beta flag from content migrations API
test plan:
 - render API docs
 - content migrations API documentation should not have
   "BETA" signage at the top of the page

closes CNVS-18568

Change-Id: I6c18aa9957cf230e6f7184d376bed32352610594
Reviewed-on: https://gerrit.instructure.com/48807
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
2015-02-13 20:57:53 +00:00
Jeremy Stanley 8128ffa779 improve course copy source selection with many courses
test plan:
 - the list of courses content migration / copy a canvas course
   (both the left-side dropdown and the right-side autocomplete)
   should be sorted by name
 - the dropdown on the left side should appear only if the user
   has <= 100 courses to choose from

refs CNVS-15247

Change-Id: I73397bc19ca421dcfeb076590f9a2762cad423ba
Reviewed-on: https://gerrit.instructure.com/45525
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2014-12-17 23:19:22 +00:00
Cameron Matheson a1f400e754 remove scribd
closes CNVS-13380
closes CNVS-8057
closes CNVS-5156

Test plan:
  * scribd should no longer exist
  * document previews should work in canvadocs

Change-Id: I5ac60c3e986f030c3aea88e32d2992ec7b1c7a08
Reviewed-on: https://gerrit.instructure.com/37895
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-09-11 18:42:15 +00:00
Ben Young 0e987b33e7 Update parameters in the following API docs
- Content migrations
- Conversations
- Course audit log
- Courses
- Custom gradebook columns

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

Change-Id: I4802bfcec067098658b573f54049b1f929f38ebc
Reviewed-on: https://gerrit.instructure.com/38691
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
Product-Review: Tyler Pickett <tpickett+gerrit@instructure.com>
2014-08-18 16:43:37 +00:00
James Williams bd906e75bc add feature flags for LOR external tools
test plan:
* add an external tool configured for the extensions
 going to be used by LOR (:course_settings_sub_navigation,
 :course_home_sub_navigation, :migration_selection)
* confirm that it is not shown to a user unless either
 the account-level feature flag is enabled or the
 user-level flag is enabled

closes #CNVS-14626

Change-Id: I06e189fc1f2d745613353ea1b3f98b4f4b2c87b6
Reviewed-on: https://gerrit.instructure.com/39111
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-08-14 15:11:06 +00:00
James Williams 75d21f8f84 migrate has_X context_external_tool columns to separate table
currently every extension type has its own boolean db column
while this isn't strictly a problem, it is a little sad, and
given the fact that we will be adding more extension types soon,
it's probably better to take care of this now

also i'm refactoring some of the methods in context_external_tool

test plan:
* external tool regressions

refs #CNVS-13815

Change-Id: I6caf7b0e3d0de054906e3530f085fbfa9e8e499f
Reviewed-on: https://gerrit.instructure.com/38923
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-08-12 12:13:42 +00:00
Jeremy Stanley c60f8cf3a3 add option to remove dates when importing/copying a course
test plan:
 - notice the date_shift_options[remove_dates] parameter in the
   content migrations API documentation
 - using the content migration api, import a course package
   specifying date_shift_options[remove_dates]=true
   * confirm dates are removed in the copied course, including
     - assignments: due, available, peer-review
     - announcements: post delay
     - quizzes: due, available, show-correct-answers
     - events: start, end
     - modules: unlock-at
 - also try a course copy content migration, and confirm that
   the dates are removed
 - specify both remove_dates and shift_dates, and confirm that
   you get a "bad request"

fixes CNVS-14180
fixes CNVS-14182

Change-Id: Ia07be2883ec4315d4a1e7fbcd61117a4531229d1
Reviewed-on: https://gerrit.instructure.com/38298
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2014-07-29 16:33:42 +00:00
James Williams 5b2d0cb97f selective content export api
test plan:
* test the undocumented content_list api endpoint:

 api/v1/courses/:course_id/content_list

which returns the same content list that would be shown by the
selective_content endpoint of a pending course copy content migration

with no 'type' parameter, it should return a list of
exportable categories and urls for each expandable type

with a type parameter (e.g. content_list?type=context_modules), it
should send a list of items with their titles and ids (asset strings)

these ids can be used to select the content for the export

* use the content_exports_api create endpoint to create a
 common_cartridge export, but add an additional argument,
 "select" (equivalent to the "copy" parameters for
 the content_migration api)

e.g. api/v1/courses/:course_id/content_exports?
 select[all_wiki_pages]=1&
 select[context_modules][context_module_42]=1
(replacing :course_id and :module_id)

* also try using arrays of ids as a parameter

e.g. api/v1/courses/:course_id/content_exports?
 select[context_modules][]=42&
 select[context_modules][]=43

 this should create a package that only contains the
 specified content, and any course files referenced in
 html content (confirm by re-importing)

closes #CNVS-13502

Change-Id: I5bdcdc8255b30c5f78585dc335d25eb19bd5a7c0
Reviewed-on: https://gerrit.instructure.com/36655
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-07-02 19:39:57 +00:00
James Williams 47324c015a use default plugin settings for migration context validation
fixes #CNVS-13332

Change-Id: Iab94158b0854cc1a4bdcaf11acc910fce3ed959e
Reviewed-on: https://gerrit.instructure.com/35562
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-29 19:20:55 +00:00
Duane Johnson 61b0858aa3 remove duplicate argument in content migration API
settings[file_url] was duplicated, as was source_course_id

Fixes SIS-279

Change-Id: Ied36085cfdb311c666a0d8c792ab475aa0452630
Reviewed-on: https://gerrit.instructure.com/34981
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Adams <eadams@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2014-05-21 21:55:22 +00:00
James Williams 2ba4531f73 migration refactor: account question banks import
test plan:
* course migration regressions (canvas cc, course copy)

* in addition:
 use the content migrations api to queue a content migration
 for an account ("/accounts/:account_id/content_migrations")
 to import a qti/cc package.
* confirm that the question banks from the package
 that would have been normally imported into a course are now
 imported into the account

closes #CNVS-12529

Change-Id: I2ef306341d2f7defe03c63a981679a3987f1aaa0
Reviewed-on: https://gerrit.instructure.com/34303
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-12 16:30:10 +00:00
Nick Cloward 5d4dda1c68 add option for course state changes (log auditing)
fixes: CNVS-347

Adds state change logging activity for courses.  This change also adds an event
source field to all the course activity events.  The options for this is api,
manual, and sis.

Note: This also adds a fix for the event stream record object to force request_id to
be a string.  Event stream will try to insert an integer into a text column which
Cassandra will complain about and throw an error.

Test Plan:
  - Test for each type of Event:
    * Concluded
    * Unconcluded
    * Published
    * Deleted
    * Restored
    * Updated
    * Created
    * Copied To
    * Copied From

  - Test each type of event and each source.  Note that some events can only
    have certain sources.  Also make sure SIS migrations show that the source
    is type SIS.

Change-Id: Ic2308e1d10e6fc1cc6437221d7842eaf1a596f46
Reviewed-on: https://gerrit.instructure.com/30343
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-05-09 16:09:20 +00:00
Jeremy Stanley f84003358f allow zip file import migrations on users and groups
test plan:
 - use the List Migration Systems endpoint on
   a group and a user, and confirm only the
   zip_file_importer is returned
 - use the Content Migrations API to import a zip file
   into folders belonging to Users and Groups
   - try both the POST and the URL workflows
   - ensure migration types other than zip_file_importer
     are rejected in User and Group context

fixes CNVS-11218

Change-Id: I4b407ce76f0b5df60cc9f99795a6d9d3ddf81ae2
Reviewed-on: https://gerrit.instructure.com/33723
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-05-01 15:18:42 +00:00
Jon Willesen 5804d857d9 add migration external tool extension ui
An external tool configured for the migration extension will
show up on a course's content import page and allow you to
select a file to migrate from the LTI launch.

fixes LOR-20

Test Plan:
 * Configure an external tool that has the migration_selection
   extension
 * The new tool should show in the dropdown on the content
   import page.
 * Run some migrations through the external tool.

Change-Id: Iea16a7e32145e6799c551816e6f70a73f2a8c3d0
Reviewed-on: https://gerrit.instructure.com/21443
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Trent <jaketrent@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2014-04-23 17:03:15 +00:00
Jacob Fugal 2474323372 don't localized datetimes formatted for datepicker
refs CNVS-12398

the eventual complete solution will involve teaching the date picker to
parse the localized datetime, but for now, just format the time in
english if the target is a datepicker's field value.

test-plan:
 - set locale to portuguese
 - datepickers (e.g. assignment due date when editing) populated on page
   load should contain the date time in english (e.g. "<date> at 3:00pm"
   vs. "<date> em 3:00")
 - using the date picker should produce a time in english in the field
 - saving the english time should work
 - non-datepicker field values with the same formatting rules (e.g.
   assignment due date when *not* editing) should display localized

Change-Id: Ibc69d2066518b4875c1f42b794df784c7e70c2c7
Reviewed-on: https://gerrit.instructure.com/33444
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-04-21 15:23:48 +00:00
Nick Cloward 4748aba483 extract canvas sort gem
fixes: CNVS-11890

Test Plan:

Canvas Should not be broken, test requests that use the SortLast and SortFirst
class.  One is account settings.  Make sure its sorted correctly.  Another is
submissions_controller show method and make sure the visible rubric assesments
are sorted correctly.

Change-Id: I75a61475a928e069d6566fcc51305a6c442ec5a0
Reviewed-on: https://gerrit.instructure.com/32014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-04 14:53:09 +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
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 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
Bracken Mosbacker 83334fb653 allow creating content migration with url to cartridge
Now a user can specify a url to the content to import instead
of having to upload the file directly to canvas.

Test Plan:
 * Using the content migration api, create a CC migration with
   a settings['file_url'] instead of doing an attachment
 * the file url must be publicly accessible from the canvas instance
 * it should happily import
 * Also do a zip file import

closes PLAT-206

Change-Id: Ide387b8e66625e5eb5c546054900a4a0fc50eb0c
Reviewed-on: https://gerrit.instructure.com/26287
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-11-15 20:14:04 +00:00
Cody Cutrer 419877ff9d clean up sorting all over
* use sort_by instead of sort where possible to avoid repeating yourself
 * use new SortFirst/SortLast sentinels to avoid strange magical constants
 * fix a few places of complicated logic for tiered sorting to just use
   an array

Change-Id: I184ef0b4e31fa18294c9beb32770101d383bbea1
Reviewed-on: https://gerrit.instructure.com/24867
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-02 21:38:08 +00:00
Duane Johnson 74f0baf418 fix several API doc @object descriptions
Some of the JSON in our @object descriptions has incorrect syntax.
This fixes the errors so that the JSON can be parsed properly for
API wrapper code generation.

Change-Id: I2e67528dd1de79969a7944bc2f891e32a672e896
Reviewed-on: https://gerrit.instructure.com/23830
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brandon Broschinsky <brandonbr@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
2013-08-29 18:34:02 +00:00
James Williams 9703389fa3 fix selective content with numerical migration ids
test plan:
* import the package referenced in the ticket with
'select content' checked
* select particular modules to import
* should import as expected

fixes #CNVS-7631

Change-Id: Ic3865a4c499e30ad544b1bab7d17001444a2ea88
Reviewed-on: https://gerrit.instructure.com/23497
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2013-08-22 19:58:24 +00:00
Cody Cutrer 12c7a3ecab fix except(:includes) in a few places
Change-Id: I6ae9324a2833ea76de0445cc5666bf16ed80b037
Reviewed-on: https://gerrit.instructure.com/23587
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-08-22 18:04:07 +00:00
Duane Johnson b8d941a8f2 API doc standardization - part 5
communication, content controllers

Change-Id: I60ace9504cd618db6ff36acf545889106a8f4c43
Reviewed-on: https://gerrit.instructure.com/23298
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
2013-08-15 21:57:59 +00:00
James Williams 0e98e6e248 mark stuck pre_processing content migrations as failed
test plan:
* create a broken content migration by starting to
upload a file (it will be easier if it is somewhat large),
and then stopping or navigating away mid-upload.
* refresh the content migrations page to confirm that
the migration is in the 'Pre-processing' state
* assuming that you would rather not wait an hour for
the time out to trigger, manually trigger it by
opening the console:

ContentMigration.where(:id => ContentMigration.last
).update_all(:updated_at => Time.now.utc - 2.hour)

* refresh the content migrations page
* should mark as failed

fixes #CNVS-7483

Change-Id: If938aec626dd3685b7d634da09ccbc55dbbaca63
Reviewed-on: https://gerrit.instructure.com/23269
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
2013-08-14 16:20:30 +00:00
Jeremy Stanley 1eb3efc94b ensure root folder exists when serving content_migrations
test plan:
 - create a new course
 - click the "Import Content" button
 - under Content Type, select "Unzip .zip file into folder"
 - under Upload to, the root folder ("course files")
   should exist

fixes CNVS-7275

Change-Id: I69df1f466c5d10df9cbc4d171e2182190677d07e
Reviewed-on: https://gerrit.instructure.com/22881
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-08-01 22:31:10 +00:00
Bracken Mosbacker 1da8ffad6d pre-populate start/end dates in new migration UI if possible
If the new or old course has start/end dates, they will be
pre-populated in the date shift form

Test Plan:
 * with a course that has start/end dates and with one that doesn't:
   * go to migration page
   * view date shift forms for any type; there should dates or no dates as expected for the course, and no error
   * for a course copy type, choose courses with/without start/end dates
   * the date shift fields should populate/clear as appropriate

closes CNVS-7241

Change-Id: I0f427da5962c945314fd5efd19f543adec8cbb3a
Reviewed-on: https://gerrit.instructure.com/22815
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-01 18:37:01 +00:00
Bracken Mosbacker d1651922c4 add link to source course in new migration ui
adds a column to the new migration UI that has a link to
either the uploaded file or to the source course.

also sorted the content type box and put course copy and
canvas packages first.

Test Plan:
 * run a file upload migration and a course copy one
   (or just go to a page with existing ones)
 * There should be a link to the uploaded file and the source course
 * The type column should also make more sense, for example,
   it'll say 'Course Copy' instead of 'Copy Canvas Course'
 * The content type box should be in the order of: course copy,
   canvas cartridge, .zip file, then alphabetical

closes CNVS-7178

Change-Id: I639e00db0188ce5119daac792119abd1da546908
Reviewed-on: https://gerrit.instructure.com/22742
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-07-30 19:31:17 +00:00
Sterling Cobb ae85385895 search course via endpoint in content migrations
fixes CNVS-7090

Test Plan
1. Go to the content migrations page and start to
create a new course copy migration
2. Notice there is now a checkbox that says
"include completed course"
3. Clicking on it should include completed courses
in the list.
4. Searching for a course now searches all courses
you can manage.
5. The drop down should also group courses by
their terms.

Change-Id: Ie36aa5cfec6d2a1db5190dcf5b4c04aa27701922
Reviewed-on: https://gerrit.instructure.com/22636
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-07-30 18:11:26 +00:00
Bracken Mosbacker 93afcafa53 return selective sub-item urls
for the convenience of api users

Test Plan:
 * The top-level return value of the selective api call
   should include urls to the sub-items lists
 * the top-level url is: api/v1/courses/:course_id/content_migrations/:id/selective_data

refs CNVS-6061

Change-Id: I35b9288a1471dcbe66462703636e9b45dcafa31e
Reviewed-on: https://gerrit.instructure.com/21249
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-06-08 00:56:58 +00:00
Bracken Mosbacker 87eac4a7ae save selective import options for new migration api
The chosen options are now saved, and the import code was
updated to check for the new names and still work for the
old names.

Test Plan:
 * Selecting/deselecting specific areas in the new UI should work
 * Selecting/deselecting specific areas in the old UI should work

refs CNVS-4742

Change-Id: I2fd0bd9ffdb7d1d70ddb01a6b7be6f7ef708a5b5
Reviewed-on: https://gerrit.instructure.com/21043
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-31 22:49:50 +00:00
Bracken Mosbacker b885d5cb8f add api endpoint for selective content migration data
this endpoints returns all the items for a migration so
that you could build a UI around selecting what to copy
when importing/copying courses

Test Plan:
 * Start a content migration but don't finish the selection part
 * use the /api/v1/courses/:id/content_migrations/:id/selective_data endpoint
   * if called without args you should get the top-level areas
	 * if called with ?type=assignments (or the types in the top-level list)
	   you should get a list of just the specified type

closes #CNVS-5940

Change-Id: Idfc8bd9b02738801a3bf5b18df25314350929762
Reviewed-on: https://gerrit.instructure.com/20873
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-24 19:59:34 +00:00
Sterling Cobb 691c6be9a6 Save selected content durring migration
Pause the migration workflow to allow a user to select content that they
want to migrate.

Change-Id: I1196f8c6c62aa6cae5ffb8a0925cb898f78f8137
fixes: #CNVS-5941
Reviewed-on: https://gerrit.instructure.com/20817
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-24 05:00:26 +00:00
Sterling Cobb 947f458d85 Add new content migration UI
This adds the ability for you to process migrations quickly. Includes a
paginated list for migrations and issues.

Test Plan:
 * Make sure old migrations UIs work the same
 * Make sure new UI works wonderfully
   * go to /courses/:id/content_migrations to see the new UI

fixes: CNVS-4732

Change-Id: I7cabc51348c32ed03d581e495756eefbf1060ad3
Reviewed-on: https://gerrit.instructure.com/20349
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-18 04:58:35 +00:00
Bracken Mosbacker 98bb4c7980 add migration endpoint to list available migrators
allows api users to find available migrators since different
canvas installs can have different oens available.

Test Plan:
 * Hit the api/v1/courses/:id/content_migrations/migrators
   endpoint and verify it works

refs #CNVS-4228

Change-Id: I3a2585cea8286b09c9e1039fd722d05a2e82d558
Reviewed-on: https://gerrit.instructure.com/20318
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:25 +00:00
Bracken Mosbacker 3f94f55256 create course copy and zip migration workers
Course copying and importing .zip files will now work the
same as other content migrations.

Test Plan:
 * Using the ContentMigration api test course copy and zip imports
 * Make sure the current course copy and zip import UIs still work
   * for course copy make sure selective options work

closes CNVS-4228

Change-Id: I80a849471dffaf44d683e980cf0b73505b353d83
Reviewed-on: https://gerrit.instructure.com/19740
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:15 +00:00
Bracken Mosbacker 93643f6d6c content migration creation api
allows creating content migration through the api

Test Plan:
 * Create a content migration through the api along with a file upload
 * You should be able to follow along with the progress and
   the migration should be complete when the progress is done
 * Try to update the migration type, you should get an error
 * Upload a wrong file type the first time, then go through
   the file upload process again on the update endpoint.

refs CNVS-4228

Change-Id: Iab1082ca68b61d1b0493c191b48169a164444d06
Reviewed-on: https://gerrit.instructure.com/19108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:09 +00:00
Cody Cutrer e149fae7bc arel-ify controllers
closes CNVS-4706

Change-Id: I694a06a0d1d5ea83cc1b742e46e7ddfdcba6915a
Reviewed-on: https://gerrit.instructure.com/18672
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-03-22 20:12:59 +00:00
Bracken Mosbacker b03b6645fb create migration issues and start content migration api
this will allow migrations to have flexible todo items
and allow us to make a super awesome UI for helping
teachers fix any migration problems

Test Plan:
 * Run a migration that has issues. :)
 * exercise the issue api

closes CNVS-4230

Change-Id: I4577f811dd3b16aa200d381f039632b7cc2cd184
Reviewed-on: https://gerrit.instructure.com/18639
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-18 12:21:58 -06:00