Commit Graph

7 Commits

Author SHA1 Message Date
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 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
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
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
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
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