Ticket #936 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Follow / watch package extension

Reported by: rgrp Owned by: johnglover
Priority: major Milestone: ckan-v1.4-sprint-6
Component: ckan Keywords:
Cc: Repository: ckan
Theme: none

Description (last modified by rgrp) (diff)

As a (logged-in) User I want to watch (follow) a package, that is register my interest about a package. (Similar to watch/follow features in github/bitbucket/wikis).

NB: this is as much (if not more) about showing what packages are interesting to people as giving info to 'watchers'.

Need to finalize terminology (github uses watch for repos and follow for users while bitbucket combines both in 'followers'). Decision: use follow

Implementation

Interface

Become a follower:

  • Follow button on packages (if already watching say 'unfollow')

Package-related changes:

  • Show number of followers on a package
  • List followers of a package at /package/{name}/followers
    • On a separate page

a package User-related changes:

  • List followed packages
    • Either on user's page on a separate 'following' page. (NB: called 'following')
  • Does watching involve notifications (by email)
    • Probably not: you can already subscribe to RSS feed after all and email not that necessary (?)
  • [Future - don't have activity stream yet] Show what packages a user has started/stopped followed on a user's public activity stream on their user page

Nitty-Gritty

  • Want to do this in ajax-y manner
  • API endpoint: /api/2/follower
  • Store data in a new follower table

API

/api/2/follower

follow => PUT / POST
{
   user_id
   object_type
   object_id
}

If this is submitted by a user with user.id != user_id => error (401)

unfollow => DELETE

/api/2/follower/package/{id}
=> list of followers
[
    { safe dictized user }
]

NB: depends on access to a 'safe' dictized user object. Dictization is in nearly done, and current example of doing this by hand is in user API autocomplete method.

Table

Called 'follower'

user_id, table, object_id, created
xxx, package, yyy, ...
xxx, user, yyy, ... [future]

Random Extras

  • What about following users as well

Change History

comment:1 Changed 3 years ago by rgrp

  • Description modified (diff)

comment:2 Changed 3 years ago by rgrp

  • Summary changed from Watch / follow a package to Watch / follow a package extension

comment:3 Changed 3 years ago by thejimmyg

  • Owner set to wwitzel3
  • Milestone changed from ckan-v1.4 to longterm

Hi Wayne,

I'm assigning this to you but it isn't a priority yet. We'll put it in a sprint when it is time to do it.

Cheers,

James

comment:4 Changed 3 years ago by rgrp

  • Description modified (diff)
  • Summary changed from Watch / follow a package extension to Follow / watch package extension
  • Repository set to ckan
  • Theme set to none
  • Milestone changed from longterm to ckan-v1.4-sprint-5
  • Owner changed from wwitzel3 to johnglover

comment:5 Changed 3 years ago by thejimmyg

  • Milestone changed from ckan-v1.4-sprint-5 to ckan-v1.4-sprint-6

How is this coming on John?

comment:6 Changed 3 years ago by rgrp

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.