APIs

Show:

Service to store/read user settings to/from application storage.

Methods

_deleteExistingRecord

(
  • componentName
  • settingName
)
Promise private

Deletes user settings record.

Parameters:

  • componentName Object

    Module name of looked for record.

  • settingName String

    Setting name of looked for record.

Returns:

Promise:

Promises array.

_getExistingRecord

(
  • componentName
  • settingName
)
Promise private

Looks for already created user settings record.

Parameters:

  • componentName Object

    Module name of looked for record.

  • settingName String

    Setting name of looked for record.

Returns:

Promise:

A promise that returns founded record or undefined if there is no such setting.

_getExistingSettings

(
  • componentName
  • settingName
)
Promise private

Looks for all created user settings records.

Parameters:

  • componentName String

    Component name of looked for record.

  • settingName String

    Setting name of looked for record.

Returns:

Promise:

A promise that returns found record or undefined if there is no such setting.

_getUserSettings

() Object

Returns user setting for current appPage from storage.

Returns:

_mergeSettings

(
  • setting1
  • setting2
)
Object private

Merge two settings.

Parameters:

  • setting1 Object

    base settings.

  • setting2 Object

    additions settings.

Returns:

Object:

merged settings.

_setCurrentUserSettings

(
  • appPageUserSettings
)
Object

Merge current developerUserSettings with appPageUserSettings

Parameters:

  • appPageUserSettings Object

    merged userSettings

Returns:

createDefaultUserSetting

(
  • componentName
)

Creates default user setting if setting for specified component isn't exists.

Parameters:

deleteUserSetting

(
  • [options]
  • componentName
  • settingName
)
Promise

Deletes given user setting from storage.

Parameters:

  • [options] Object optional

    Parameters for user setting getting.

  • componentName String

    component Name to search by.

  • settingName String

    Setting name to search by.

Returns:

Promise:

Promises array

exists

() Boolean

Returns true if userSettings for current appPage exists.

Returns:

exists

() Boolean

Returns true if default userSettings for current appPage exists.

Returns:

getCurrentAppName

() String

Get current App Name.

Returns:

getCurrentAppPage

() String

Get current App Page.

Returns:

getCurrentColsOrder

(
  • componentName
  • settingName
)
Array

Returns current colsOrder .

Parameters:

  • componentName String

    Name of component.

  • settingName String

    Name of setting.

Returns:

getCurrentColumnWidths

(
  • componentName
  • settingName
)
Array

Returns current columnWidths.

Parameters:

  • componentName String

    Name of component.

  • settingName String

    Name of setting.

Returns:

getCurrentPerPage

(
  • componentName
  • settingName
)
Array

Returns current perPageValue .

Parameters:

  • componentName String

    Name of component.

  • settingName String

    Name of setting.

Returns:

getCurrentSorting

(
  • componentName
  • settingName
)
Array

Returns current sorting .

Parameters:

  • componentName String

    Name of component.

  • settingName String

    Name of setting.

Returns:

getCurrentUserSetting

(
  • componentName
  • settingName
)
String

Returns current userSetting.

Parameters:

  • componentName String

    Name of component.

  • settingName String

    Name of setting.

Returns:

getCurrentWebPage

() String

Get current Web Page.

Returns:

getDefaultDeveloperUserSetting

(
  • componentName
)
Object

Returns default developer user settings for component.

Parameters:

  • componentName String

    Name of component.

Returns:

getDetSeparateCols

(
  • componentName
  • settingName
)
Boolean

Returns current detSeparateCols.

Parameters:

  • componentName String

    Name of component.

  • settingName String

    Name of setting.

Returns:

getDetSeparateRows

(
  • componentName
  • settingName
)
Boolean

Returns current detSeparateRows.

Parameters:

  • componentName String

    Name of component.

  • settingName String

    Name of setting.

Returns:

getListComponentNames

() Ember.NativeArray

Get list components Names.

Returns:

getListCurrentNamedUserSetting

() String

Returns current list of named userSetting.

Returns:

getListCurrentUserSetting

() String

Returns current list of userSetting.

Returns:

getOfflineSchema

() Object

Get offline schema.

Returns:

Object:

Returns offline schema.

getTogglerStatus

(
  • componentName
)
Boolean

Returns toggler status from user service.

Parameters:

  • componentName String

    component Name to search by.

Returns:

Boolean:

Saved status.

saveUserSetting

(
  • componentName
  • settingName
  • userSetting
)
Promise

Saves given user setting to storage.

Parameters:

  • componentName String

    Name of module for what setting is saved.

  • settingName String

    Setting name to save as.

  • userSetting String

    User setting data to save.

Returns:

Promise:

Save operation promise.

setCurrentColumnWidths

(
  • componentName
  • settingName
  • columnWidths
)

Set current columnWidths.

Parameters:

  • componentName String

    Name of component.

  • settingName String

    Name of setting.

  • columnWidths Array

    List columns width.

setCurrentParams

(
  • params
)
String

Implements current URL-params to currentUserSettings

Parameters:

Returns:

String:

URL params

setCurrentPerPage

(
  • componentName
  • settingName
  • perPageValue
)

Set current perPage.

Parameters:

  • componentName String

    Name of component.

  • settingName String

    Name of setting.

  • perPageValue Int

    Per page value.

setCurrentWebPage

(
  • webPage.
)

Set current Web Page.

Parameters:

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: { : { : { colsOrder: [ { propName :, hide: true|false }, ... ], sorting: [{ propName: , direction: "asc"|"desc" }, ... ], colsWidths: [ :, ... ], }, ... }, ... } For default userSetting use empty name (''). may contain any of properties: colsOrder, sorting, colsWidth or being empty.

Parameters:

  • developerUserSettings. Object

setTogglerStatus

(
  • componentName
  • togglerStatus
)

Set toggler status

Parameters:

  • componentName String

    Name of component.

  • togglerStatus Boolean

    Status to save.

Properties

_store

DS.Store private

Ember data store.

appName

String

Current Application name.

Default: ''

beforeParamUserSettings

Object

User settings for all pages before params applying.

Default: {}

currentAppPage

String

Current App page.

Default: ''

currentUserSettings

Object

Current user settings for all pages

Default: {}

currentWebPage

String

Current WEB page.

Default: ''

defaultDeveloperUserSettings

Object

User settings for all pages defined by developer

Default: {}

developerUserSettings

Object

User settings for all pages defined by developer

Default: {}

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