Commit Graph

24 Commits

Author SHA1 Message Date
Cameron Matheson 665d295ce7 Merge branch 'master' into dev/fft
Conflicts:
	Gemfile
	app/controllers/courses_controller.rb

Change-Id: Ie01f68d5ab6f02e3a581d70adf674f222b88574b
2012-06-18 15:24:09 -06:00
Brian Palmer acd7bbab97 flag the following apis as beta
adds support for flagging individual endpoints, not just resources, as
beta.

test plan: generate the api docs and verify that the tagged endpoints
have a beta message.

Change-Id: Iba815db309ee71482e1f471eaf613527cd7114ec
Reviewed-on: https://gerrit.instructure.com/11585
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-06-13 16:52:05 -06:00
Brian Palmer 06b10f6a34 return user display info for collection items
This standardizes the "user display" sub-object returned by the
discussions api, and returns that same data for each collection item.

test plan: make api calls to return collection items, verify the user
sub-object is present and contains the expected user data.

Change-Id: Ie5b1468816ffbf27a005044effbc49082bdf679b
Reviewed-on: https://gerrit.instructure.com/11276
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-06-07 14:31:55 -06:00
Brian Palmer 9be4a8edea improve cross-shard collection item and activity stream support
Create upvotes in the upvoting user's shard, so we can query for them,
and make the upvote_count and post_count cached counts update properly
cross-shard.

Remove a foreign key constraint that was preventing users on other
shards from posting items to a collection.

Create stream_item_instances on the user's shard, and make sure to query
them from there.

Further work should be done to optimize :include so that we can
efficient pull in the stream items for the instances.

test plan: as a user on one shard, interact with a collection on another
shard -- posting to it, upvoting/downvoting, cloning items from that and
other shards. verify you don't get errors, missing data, or incorrect
counts.

Change-Id: I91aeebd404cd20663a533b2f38c08ec90c65868e
Reviewed-on: https://gerrit.instructure.com/11228
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-06-07 14:31:45 -06:00
Brian Palmer 08dbec1421 return user display info for collection items
This standardizes the "user display" sub-object returned by the
discussions api, and returns that same data for each collection item.

test plan: make api calls to return collection items, verify the user
sub-object is present and contains the expected user data.

Change-Id: Ie5b1468816ffbf27a005044effbc49082bdf679b
2012-06-07 08:44:19 -06:00
Ryan Shaw 788db3e353 Collection#Show and CollectionItem#show pages
Change-Id: Ic055866225ca93c3f12b6efb18b40c9c2ec27aa0
2012-06-06 21:15:28 -06:00
Jon Jensen b61331effb Merge remote-tracking branch 'origin/master' into dev/fft
Conflicts:
	app/models/group.rb
	spec/selenium/profile_spec.rb

Change-Id: Ifbe09f50e90756a965d532f098f94c700225fc20
2012-06-06 15:14:35 -06:00
Brian Palmer 65b9b40802 collection item column changes
rename the mutable description field to user_comment , and add immutable
title and description fields.

attempt to pull the title and description from embedly, if they're
blank.

add image, audio and video item types, and pull that from embedly as
well.

test plan: from the api, create an item with no description or title,
verify that they are auto-filled (after the background job runs, they
can't be auto-filled in the immediate response unfortunately). verify
that adding an item for a vimeo video sets the item_type to "video", for
example.

Change-Id: Ic485962d11d9fbce0ef0455982d60780d7a06800
Reviewed-on: https://gerrit.instructure.com/11171
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-06-06 14:12:58 -06:00
Cameron Matheson 3aeca18123 Merge branch 'master' into dev/fft
Conflicts:
	app/controllers/groups_controller.rb

Change-Id: If8522f96eeb698cbeada45a49f7f5c61ba15ac84
2012-06-05 13:54:46 -06:00
Brian Palmer 3d4db97231 following models and API, closes #8713
A user can currently follow a Collection, and another User.

Right now following doesn't do anything -- a subsequent commit will add
stream item support for followed Collections.

Also don't scope collection endpoints with /users/X or /groups/Y etc,
except for the index/create actions

test plan: use the api to follow and unfollow users and collections.
verify that you can follow something on a different shard, and it'll
still get returned correctly.

Change-Id: I9fd3f179885327e49f4d220784509de0ea23c0a7
Reviewed-on: https://gerrit.instructure.com/11057
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-06-05 13:11:20 -06:00
Jon Jensen 7322030773 Merge remote-tracking branch 'origin/master' into dev/fft 2012-06-01 10:57:32 -06:00
Simon Williams 04a5bfd2c7 return collection item created_at and user_id in api
add the time that the item was posted and the user id of the person who posted
it to the collection item api response.

test plan:
- query the api for a collection item, and make sure these two fields are
  returned

Change-Id: I3ac4b5b3212d380b947f236c69d47507517997df
Reviewed-on: https://gerrit.instructure.com/11128
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-05-30 17:12:33 -06:00
Cameron Matheson f3106d4602 Merge branch 'master' into dev/fft
Conflicts:
	app/controllers/collection_items_controller.rb

Change-Id: I1b92415ad1547b0047509743f652cb5c0f8545f2
2012-05-30 11:35:35 -06:00
Simon Williams efe769d5df add collections to groups (backend + api); closes #8670
groups are now a valid context for collections. as a group moderator, you are
allowed to do anything (create/update/delete) with any collection or item in
the group. as a group member, you are not allowed to create/update/delete
collections, but you are allowed to post to them, and edit/delete posts you
have made.

test plan:
- nothing visible, but try making calls through the api. make sure the above
  permissions are accurately represented
- make sure the api doc additions are coherent

Change-Id: Ic259c6bdf1988420438a8258bf585671f972cd32
Reviewed-on: https://gerrit.instructure.com/10848
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-05-30 10:44:42 -06:00
Brian Palmer e98e9ba3b5 refactor to not scope items by their collection in api urls
test plan: verify the new api endpoints work as the old ones, but don't
require the collection id in the path

Change-Id: I36e2b761cfd47a01d04d58c12821cf78652563e0
Reviewed-on: https://gerrit.instructure.com/11091
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-05-29 15:11:53 -06:00
Zach Wily 37953343cd add a DiscussionTopic to CollectionItems in the API
To allow commenting on CollectionItems, we are goign to leverage
DiscussionTopics. The topic will not be created until the first comment is
made, and is accessed via the normal DiscussionTopic API (using a special
endpoint).

This also adds a new "flat" DiscussionTopic type, which doesn't support any
nesting of replies.

test plan:
 * Create a collection and an item in that collection (via console or API)
 * Using the API, query the discussion topic for that item via the API
 * Using the APi, add a comment to that discussion topic
 * Using the API, fetch the discussion again and see that your comment appears

Change-Id: Ie7cc27a7bc1d7960040632015971e59f084d7e6f
Reviewed-on: https://gerrit.instructure.com/10960
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-05-29 13:58:42 -06:00
Brian Palmer 00df96f738 pull embedly information on item creation
We store off the html preview snippet to return with the api response,
and we prefer the first image embedly returns over a page snapshot, if
no explicit image is given by the user.

test plan: configure embedly. create a collection item pointing to a
service embedly understands -- like a tweet or youtube video. verify the
html_preview is returned with the item once the job finishes running,
and that an appropriate image is pulled from the embedly data rather
than a snapshot capture of the page.

Change-Id: Ifd99053fa3c75833656b773eba6844da5994de9e
Reviewed-on: https://gerrit.instructure.com/10851
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-29 13:09:39 -06:00
Jon Jensen 31a1893a54 Merge remote-tracking branch 'origin/master' into dev/fft 2012-05-29 13:04:35 -06:00
Brian Palmer f9c5ce198e return a new 640x thumbnail size for collection items
This extends Attachment with support for having multiple thumbnail sizes,
and allow specified sizes to be generated dynamically the first time
that they are requested.

test plan: create two collection items, one with an explicit image_url
and one without. Verify they both get images after the jobs run, and the
images are properly scaled.

Also verify that giving a non-image or invalid image_url ends up with a
nil image_url.

Change-Id: I4d1b1de681f2cddda0c81f1b340d32c3b5b0097b
Reviewed-on: https://gerrit.instructure.com/10822
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-05-29 12:26:57 -06:00
Ryan Shaw 20a95333d0 add a way to create test bookmarklets
Change-Id: Ib1abff9d0fe512df42596c66ad82dbb75553f034
2012-05-23 17:06:10 -06:00
Ryan Shaw 298a128a0d bookmarklet wip
Change-Id: Iff42827c50fae8374361154d88a244e986ddf0c7
2012-05-23 17:06:10 -06:00
Brian Palmer 9ff857f5b0 link_data endpoint for canvas collections
Canvas will use this to pull the data about a link before creating a
collection item (currently uses embed.ly)

test plan: not possible to test this through the UI yet

Change-Id: Ie248be4081871aa3aa747510d96edc3c7cc3a0a6
Reviewed-on: https://gerrit.instructure.com/10777
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-05-21 10:35:31 -06:00
Brian Palmer aafb0e247f image support for collection items
In this first phase, we use the image url passed in, or take a snapshot
of the link if no image url is given.

test plan: using the API create a collection item without an image url.
After the job runs, the item will have a image_url returned. Then create
another item passing in an explicit image url and verify that's used
instead.

Change-Id: I2134b0014a3135ef0580461a6321d1adc99c2e9c
Reviewed-on: https://gerrit.instructure.com/10764
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-05-17 12:56:24 -06:00
Brian Palmer 0ec3ed5553 collections models and api
This lays the groundwork for the new collections feature. See the API
documentation for details. There is still some pending tasks before this
is totally ready, see the development board.

test plan: no UI yet, but you can make api calls to add/edit/delete
collections, add/edit/delete items, and upvote items.

Change-Id: I8fa019d428d1aae3ac62b1f34ebe2ac3c77310be
Reviewed-on: https://gerrit.instructure.com/10465
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-05-10 13:38:58 -06:00