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