Page MenuHomePhabricator

Implement back-end for collection favouriting system
Closed, ResolvedPublic

Description

In the new logged in designs, users can favourite collections they want quicker access to when logged in. The intention is to enable them to separate the items they're really interested in from everything that's available to them through the Library Bundle.

The design work is ongoing for the front-end component of this, but we can implement the back-end functionality in the meantime.

We might initially assume that this system should be a relationship between users and authorizations, but Bundle collections all have the same authorization, so this needs to be a relationship between user and resource objects. We no longer use streams so that's no longer a concern for this.

Acceptance criteria

  • There is a new relationship for defining which resource objects a user has favourited
  • The relationship should be ManyToMany, but we need to avoid a circular dependency between user and resource models

Event Timeline

Samwalton9-WMF created this task.

Notes from today's engineering meeting:

  • Relationship between Editor and Partner, valid choices (at the model level) are partners the editor is authorized for.
  • When users favourite, we'll need to use ajax since there's no form to submit.
Samwalton9-WMF raised the priority of this task from Low to Medium.Sep 22 2021, 2:13 PM
Samwalton9-WMF updated the task description. (Show Details)

Question: Per T285671, The favoriting system should be visible on all collection tiles in the My Collections and Favourites sections. It should not be visible on tiles in Available Collections.. Does this mean a user can only add collections that they are authorized to access, even if they are expired? Should that be part of the acceptance criteria?

It was my understanding that if an authorization was expired, it went down to a section at the bottom of the My Collections tab - is that not accurate? i.e. does it go back to Available Collections (also?)?

jsn.sherman subscribed.

I think we talked about @Samwalton9's question in yesterday's meeting, but just in case: All authorizations related to the editor are allowed in the validator, which would include expired auths.
Reviewed and merged the pr.