UserSettingsService Class
Service to store/read user settings to/from application storage.
Item Index
Methods
- _deleteExistingRecord
- _getExistingRecord
- _getExistingSettings
- _getUserSettings
- _mergeSettings
- _setCurrentUserSettings
- createDefaultUserSetting
- deleteUserSetting
- exists
- exists
- getCurrentAppName
- getCurrentAppPage
- getCurrentColsOrder
- getCurrentColumnWidths
- getCurrentPerPage
- getCurrentSorting
- getCurrentUserSetting
- getCurrentWebPage
- getDefaultDeveloperUserSetting
- getDetSeparateCols
- getDetSeparateRows
- getListComponentNames
- getListCurrentNamedUserSetting
- getListCurrentUserSetting
- getOfflineSchema
- getTogglerStatus
- saveUserSetting
- setCurrentColumnWidths
- setCurrentParams
- setCurrentPerPage
- setCurrentWebPage
- setDefaultDeveloperUserSettings
- setDeveloperUserSettings
- setTogglerStatus
Methods
_deleteExistingRecord
-
componentName
-
settingName
Deletes user settings record.
Parameters:
Returns:
Promises array.
_getExistingRecord
-
componentName
-
settingName
Looks for already created user settings record.
Parameters:
Returns:
A promise that returns founded record
or undefined
if there is no such setting.
_getExistingSettings
-
componentName
-
settingName
Looks for all created user settings records.
Parameters:
Returns:
A promise that returns found record or undefined
if there is no such setting.
_mergeSettings
-
setting1
-
setting2
Merge two settings.
Returns:
merged settings.
_setCurrentUserSettings
-
appPageUserSettings
Merge current developerUserSettings with appPageUserSettings
Parameters:
-
appPageUserSettings
Objectmerged userSettings
Returns:
createDefaultUserSetting
-
componentName
Creates default user setting if setting for specified component isn't exists.
Parameters:
-
componentName
String
deleteUserSetting
-
[options]
-
componentName
-
settingName
Deletes given user setting from storage.
Parameters:
Returns:
Promises array
getDefaultDeveloperUserSetting
-
componentName
Returns default developer user settings for component.
Parameters:
-
componentName
StringName of component.
Returns:
getTogglerStatus
-
componentName
Returns toggler status from user service.
Parameters:
-
componentName
Stringcomponent Name to search by.
Returns:
Saved status.
saveUserSetting
-
componentName
-
settingName
-
userSetting
Saves given user setting to storage.
Parameters:
Returns:
Save operation promise.
setCurrentColumnWidths
-
componentName
-
settingName
-
columnWidths
Set current columnWidths.
setCurrentParams
-
params
Implements current URL-params to currentUserSettings
Parameters:
-
params
Object
Returns:
URL params
setCurrentPerPage
-
componentName
-
settingName
-
perPageValue
Set current perPage.
setDefaultDeveloperUserSettings
-
developerUserSettings.
Set initial userSetting for current webPage, defined by application developer
Parameters:
-
developerUserSettings.
Object
setDeveloperUserSettings
-
developerUserSettings.
Set initial userSetting for current webPage, defined by application developer
Structure of developerUserSettings:
{
Parameters:
-
developerUserSettings.
Object
Properties
enabled
Boolean
Flag indicates whether perf service is enabled or not.
Default: false
Example:
// PerfServise 'enabled' setting could be also defined through application config/environment.js
module.exports = function(environment) {
let ENV = {
...
APP: {
...
perf: {
enabled: true
}
...
}
...
};
isUserSettingsServiceEnabled
Boolean
Flag: indicates whether to use user settings service (if true
) or not (if false
).
This flag is readed from config setting APP.useUserSettingsService
and can be changed programatically later.
Default: false