File

core/dashboard/widget-auto-refresh-context/widget-global-auto-refresh.service.ts

Index

Properties
Methods

Methods

decrementLoading
decrementLoading()

Decrements the loading count by 1.

Returns : void
getQueryParamChangeValue$
getQueryParamChangeValue$()

Retrieves an observable that emits the value of a Global Auto Refresh query parameter whenever it changes. The query parameter being tracked is determined by GlobalAutoRefreshName.GLOBAL_CONTEXT_AUTO_REFRESH.

Returns : Observable<boolean | null>

An observable that emits the parsed value of the GLOBAL_CONTEXT_AUTO_REFRESH query parameter.

handleNavigationInProgress$
handleNavigationInProgress$()

Monitors router navigation events and updates the navigation progress state.

Example :
     NavigationCancel, and NavigationError.
Returns : Observable<Event>

An Observable that emits router events of types NavigationStart, NavigationEnd, NavigationCancel, and NavigationError.

incrementLoading
incrementLoading()

Increments the loading count by 1.

Returns : void
initializeAutoRefreshCountdownLoading$
initializeAutoRefreshCountdownLoading$(editMode$: BehaviorSubject)

Initializes the auto-refresh countdown logic based on the widget loading state and edit mode.

This method returns an observable that monitors the widget loading state and triggers specific actions related to the countdown process. It performs the following steps:

  1. Skips the initial loading state emitted by isLoadingWidgets$.
  2. Stops the countdown if the widgets are currently loading.
  3. Filters out cases where widgets are loading or the application is in edit mode.
  4. Resets the countdown when widgets are not loading and the application is not in edit mode.
Parameters :
Name Type Optional Description
editMode$ BehaviorSubject<boolean> No
  • A BehaviorSubject representing whether the application is currently in edit mode.
Returns : Observable<boolean>

An Observable<boolean> that emits the loading state of the widgets after the initialization steps.

onEditModeChange
onEditModeChange(editMode: boolean)

Handles changes to the edit mode and updates the isEnabled$ variable.

  • If auto-refresh was manually disabled by the user (userDisabledManually$ is true), auto-refresh will remain disabled regardless of the edit mode state.
  • If auto-refresh was not manually disabled, it will be disabled when entering edit mode and enabled when exiting edit mode.
Parameters :
Name Type Optional Description
editMode boolean No
  • A boolean indicating the current state of edit mode (true if edit mode is active, false otherwise).
Returns : void
resetCountdown
resetCountdown()

Resets the countdown timer by emitting a reset action after a short delay.

Returns : void
resetCountdownOnLoadingComplete$
resetCountdownOnLoadingComplete$()

Returns an Observable that triggers the countdown reset action when loading completes.

This method creates an Observable that:

  • Skips a specified number of initial emissions from isLoadingWidgets$ based on the skipInitialBehaviorSubjectEmission$ method.
  • Filters out emissions where the loading state is true.
  • On emission where the loading state is false, it triggers a countdown reset action.
Returns : MonoTypeOperatorFunction<any>
resetServiceToDefaults
resetServiceToDefaults()

Resets the service's settings and parameters to their default values.

Returns : void
Async setAutoRefreshQueryParam
setAutoRefreshQueryParam(queryParams: GlobalAutoRefreshQueryParam)

Sets the global auto-refresh query parameter in the current route.

Example :
                 The existing query parameters will be merged with these.
Parameters :
Name Type Optional Description
queryParams GlobalAutoRefreshQueryParam No
  • An object representing the query parameters to set for the global auto-refresh option. The existing query parameters will be merged with these.
Returns : Promise<void>

Properties

autoRefreshSettings
Type : object
Default value : { /** * BehaviorSubject that emits the current state of auto-refresh button. * Defaults to DEFAULT_INTERVAL_STATE. */ isEnabled$: new BehaviorSubject<boolean>(DEFAULT_INTERVAL_STATE), /** * BehaviorSubject that emits the current auto-refresh interval value. * Defaults to DEFAULT_INTERVAL_VALUE. */ refreshInterval$: new BehaviorSubject<number>(DEFAULT_INTERVAL_VALUE), /** * BehaviorSubject that emits whether auto-refresh has been manually disabled by the user. * Defaults to false. */ userDisabledManually$: new BehaviorSubject(false) }

Object containing behavior subjects for managing auto-refresh settings.

countdownActions
Type : object
Default value : { /** * Subject used to stop the countdown. */ stop$: new Subject<void>(), /** * Subject used to reset the countdown. */ reset$: new Subject<void>(), /** * Subject that emits when the countdown has ended. */ countdownEnded$: new Subject<void>() }

Object containing subjects for managing countdown actions.

globalRefreshWidgetsCount
Default value : signal(0)

A signal representing the number of widgets with the global auto-refresh option enabled.

onDashboardSave$
Default value : new Subject<void>()

Subject that emits when a dashboard save operation is triggered.

results matching ""

    No results matching ""