Skip to content

Instantly share code, notes, and snippets.

@amirfefer
Last active November 29, 2018 14:36
Show Gist options
  • Save amirfefer/7e9c363497e4fff863e04ef8d8da3ff8 to your computer and use it in GitHub Desktop.
Save amirfefer/7e9c363497e4fff863e04ef8d8da3ff8 to your computer and use it in GitHub Desktop.

As part of the Tour component PR, I searched for a persistent mechanism for seen tours
(If a user already observed a tour, it shouldn't be popped out again)
Tour component

At first, I implemented it as a seen list blob within the user table
But, on secondary thought, why not to extend it to a generic user preferences table?
Foreman already has a user's table preferences table, which store user's picked columns, how about generalize it ?

Table preferences attributes

name: string, columns: serilazied

Suggested User Preferences Attrbiutes

name: string, kind: string, value: serilazied

Data example for records

  1. 'breadcrumbs', 'tour', {alreadySeen: true}
  2. 'hosts', 'table', {columns: {name,...} }
  3. 'per_page', 'settings', 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment