pressbooks / pressbooks-book-directory-fe

A Vue.js frontend for the Pressbooks Directory
0 stars 1 forks source link

Allow for the creation & display of curated 'collections' #153

Closed SteelWagstaff closed 3 years ago

SteelWagstaff commented 3 years ago

We'd like to display 'featured collections' where we're currently showing 'featured books.' A collection would be a set of records in the directory tagged with the same 'in_collection' value. A book can belong to 1 or more collections.

Initial collection names:

  1. Dual or high enrollment courses
  2. Interactive OER
  3. Accessibility & Inclusivity
  4. Open Education
  5. Nursing/Healthcare
  6. Vocational & Trades
  7. Language Learning
  8. OpenStax

The first five of these should be the initial 'featured' collections.

The display would be very similar to what we currently show for featured books: Screenshot from 2021-01-27 21-02-16

  1. A book cover from one of the books in the collection
  2. The collection title (a link -- which, when clicked, would load all the books included in that particular collection)

We should also add a new filter/facet called 'Collections' which displays each of the collection options.

Separate Task: Create a facet/filter called 'Collections' which displays each of the Collections present in Algolia index, a count, and include/exclude buttons https://github.com/pressbooks/pressbooks-book-directory-fe/issues/159

richard015ar commented 3 years ago

After some testing and discussing with Steel, we agreed book objects in Algolia will contains the following new fields:

"collections": [
    "Accessibility & Inclusivity",
    "Nursing/Healthcare",
    "Language Learning"
],
"coverImageCollections": [
    "Nursing/Healthcare"
 ],

Just like about field. It is easy to filter and to use in PB Directory application. collections field will contains the collections strings where the books belongs to. The coverImageCollections will contains those collections where the cover image of the book will be used for front end application.

I created a script that allows to specify the Algolia's index and objects IDS and the fields to be populated (collections and/or coverImageCollections). It will allow us to be consistent with the data when add/edit collection in the required books.

richard015ar commented 3 years ago

PR: https://github.com/pressbooks/pressbooks-book-directory-fe/pull/169 Point 4 of this task is in: https://github.com/pressbooks/pressbooks-book-directory-fe/issues/159

Temporary scripts in: https://drive.google.com/file/d/1kTLFb_wV12yQirPqxNOwIQ2LoL7HqMBG/view?usp=sharing

SteelWagstaff commented 3 years ago

Tested. Works as expected in dev and staging environments!