File

core/common/ui-state.service.ts

Index

Properties
Methods
Accessors

Constructor

constructor(applicationService: ApplicationService, apiService: ApiService, options: OptionsService, fetchClient: FetchClient, tenantLoginOptionsService: TenantLoginOptionsService)
Parameters :
Name Type Optional
applicationService ApplicationService No
apiService ApiService No
options OptionsService No
fetchClient FetchClient No
tenantLoginOptionsService TenantLoginOptionsService No

Methods

assignApplicationKeyToDefaultHeaders
assignApplicationKeyToDefaultHeaders()
Returns : void
getLangs
getLangs()
Returns : any
Async isApplicationAvailable
isApplicationAvailable(name: string)

Checks current users application list and matches it against given application name. Returns true if application is in the list.

Parameters :
Name Type Optional Description
name string No

application name

Returns : {}
Async loadManifest
loadManifest()

Loads the app manifest. If no access -> throw an error to verify app access.

Returns : any
Async refreshLoginOptions
refreshLoginOptions()
Decorators :
@throttle(600, {trailing: undefined})

When this function called, it refreshes the values of loginOptions stored within ui state object. Function is throttled to execute the refresh once in a time specified by params of @throttled decorator, it should be called on leading edge of the timeout.

Returns : any
setUser
setUser(userInfo: literal type)

Sets current user (including support user).

Parameters :
Name Type Optional Description
userInfo literal type No

Info about current user and support user to be set.

Returns : void

Properties

Public apiService
apiService: ApiService
Type : ApiService
currentSupportUserName
currentSupportUserName: BehaviorSubject<string | null>
Type : BehaviorSubject<string | null>
Default value : new BehaviorSubject(null)
currentTenant
currentTenant: BehaviorSubject<ICurrentTenant | null>
Type : BehaviorSubject<ICurrentTenant | null>
Default value : new BehaviorSubject(null)
currentUser
currentUser: BehaviorSubject<IUser | null>
Type : BehaviorSubject<IUser | null>
Default value : new BehaviorSubject(null)
state$
state$: BehaviorSubject<any>
Type : BehaviorSubject<any>
Default value : new BehaviorSubject<any>({ app: { name: this.options.name, contextPath: this.getCurrentContextPath() || this.options.contextPath }, supportUrl: this.options.supportUrl, lang: this.options.get('defaultLanguage', 'en'), langs: this.getLangs(), langsDetail: this.options.languages, loginOptions: this.options.loginOptions, activateSupportUserAvailable: undefined, versions: { backend: undefined, ui: this.options.versions || { ngx: undefined } }, hidePowered: this.options.hidePowered, isLoading: false, showRightDrawer: this.options.rightDrawer, loginExtraLink: this.options.get('login_extra_link'), newsletter: this.options.newsletter })

Accessors

state
getstate()

Returns the current state.

uiVersion
getuiVersion()

Returns the correct UI version. In hybrid mode for angular and ngx.

result-matching ""

    No results matching ""