Page MenuHomePhabricator

Factor user options definitions out of PreferencesFactory
Open, Needs TriagePublic

Description

PreferencesFactory is responsible for building UI definitions for user preferences form. The class itself encapsulates the information about known user preferences and their types, as well as the code for building the UI to change those preferences. These two purposes has to be split - either the UI should be pulled out of the preferences factory, or (most likely) the preferences definitions should be split out and put somewhere else.

Currently this mix of responsibilities creates a cyclic dependency between PreferencesFactory and UserOptionsManager.

Event Timeline

Pchelolo created this task.Apr 21 2020, 3:49 PM

@Pchelolo I'd be interested in working on this, but I'm a bit unclear as to what methods are meant to be moved out. The class has the following methods (other than its constructor):

getSaveBlacklist
getFormDescriptor
loadPreferenceValues
getOptionFromUser
profilePreferences
skinPreferences
filesPreferences
datetimePreferences
renderingPreferences
editingPreferences
rcPreferences
watchlistPreferences
searchPreferences
generateSkinOptions
getDateOptions
getImageSizes
getThumbSizes
validateSignature
cleanSignature
getForm
getTimezoneOptions
saveFormData
applyFilters
submitForm
getTimeZoneList

It implements the PreferencesFactory interface, meaning that it needs to have getForm, getFormDescriptor, and getSaveBlacklist

For now this is more of a placeholder task than an actionable plan. I will spend some time soon to try and make an actionable proposal.

For now this is more of a placeholder task than an actionable plan. I will spend some time soon to try and make an actionable proposal.

{{ping}}