Page MenuHomePhabricator

Create user preference repository
Closed, ResolvedPublic

Description

Vuex store:

  • maintains a list of preferences
  • has a USER_PREFERENCES_INIT action initializing all values
  • has a USER_PREFERENCE_SET action that sets an individual preference value
  • preferences is part of the user module state, a map of preference keys to values

DispatchingUserPreferenceRepository

  • maintains a mapping of preferences to data sources and their configuration
    • preferences are identified by a name
    • preference persistence can be configured: currently the only way of doing so is via cookie
    • exposes method(s) used by vuex user preference store actions
    • is used during application initialization to set the vuex state accordingly
  • cookie for our feature "wikibase-no-anonymouseditwarning"

Info:

  • mw.cookie is an existing service to set and get cookies
  • the current properties of the user state (name, primaryLanguage, secondaryLanguages) are not part of the preferences

We imagine something like the following to be the mapping of the DispatchingUserPreferenceRepository:

{
  'ignoreAnonWarning': new CookieUserPreferenceRepository( { ttl: 5000, cookieName: 'anon-warning-pref' }),
  'licenceWarning': new FallbackUserPreferenceRepository( new CookieUserPreferenceRepository( ... ), new MWUserSettingPreferenceRepository( ... ) ),
  ...
}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 21 2019, 11:30 AM
Pablo-WMDE updated the task description. (Show Details)May 21 2019, 11:59 AM
Jakob_WMDE updated the task description. (Show Details)May 21 2019, 1:31 PM
Jakob_WMDE moved this task from To Do to Doing on the Wikidata-Termbox-Iteration-16 board.
Jakob_WMDE updated the task description. (Show Details)May 27 2019, 1:40 PM

Change 512719 had a related patch set uploaded (by Jakob; owner: Jakob):
[wikibase/termbox@master] User preferences: vuex store and repository

https://gerrit.wikimedia.org/r/512719

Jakob_WMDE updated the task description. (Show Details)May 28 2019, 4:08 PM

Change 512719 merged by jenkins-bot:
[wikibase/termbox@master] User preferences: store bindings and repositories

https://gerrit.wikimedia.org/r/512719

Jakob_WMDE closed this task as Resolved.Mon, Jul 1, 9:14 AM