From 5d1f0957f916f3107e8200bc4815db1cf9e8a172 Mon Sep 17 00:00:00 2001 From: Manuel Scurti Date: Sun, 11 Jun 2023 01:14:16 +0200 Subject: [PATCH] updated docs for exported members Signed-off-by: Manuel Scurti --- .../AutoLogoutProvider/AutoLogoutProvider.tsx | 16 ++++++++++------ .../ConfigBasedAutoLogoutProvider.tsx | 2 ++ .../AutoLogoutProvider/disconnectedUsers.ts | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/core-components/src/components/AutoLogoutProvider/AutoLogoutProvider.tsx b/packages/core-components/src/components/AutoLogoutProvider/AutoLogoutProvider.tsx index 4457cab565..073dbb9283 100644 --- a/packages/core-components/src/components/AutoLogoutProvider/AutoLogoutProvider.tsx +++ b/packages/core-components/src/components/AutoLogoutProvider/AutoLogoutProvider.tsx @@ -32,42 +32,45 @@ import { DefaultTimestampStore, TimestampStore } from './timestampStore'; export type AutoLogoutTrackableEvent = EventsType; +/** + * @public + */ export type AutoLogoutProviderProps = { /** * Enable/disable the AutoLogoutMechanism. - * @default true + * defaults to true */ enabled?: boolean; /** * The amount of time (in minutes) of inactivity * after which the user is automatically logged out. - * @default 60 minutes. + * defaults to 60 minutes. */ idleTimeoutMinutes?: number; /** * The number of seconds before the idleTimeout expires, * at which the user will be alerted by a Dialog that * they are about to be logged out. - * @default 10 seconds + * defaults to 10 seconds */ promptBeforeIdleSeconds?: number; /** * Enable/disable the usage of Node's worker thread timers instead of main thread timers. * This is helpful if you notice that the your browser is killing inactive tab's timers, like the one used by AutoLogoutProvider. * If you experience some browser incompatibility, you may try to set this to false. - * @default true. + * defaults to true. */ useWorkerTimers?: boolean; /** * List of DOM events that the AutoLogoutProvider will track to determine if the user is active or not. - * @default the default list includes all the needed events for keyboard/pointers/mouse devices. + * default list includes all the needed events for keyboard/pointers/mouse devices. */ events?: AutoLogoutTrackableEvent[]; /** * Enable/disable the autologout for disconnected users. * disconnected users are the ones that are logged in but have no Backstage tab open in their browsers. * If enabled, disconnected users will be automatically logged out after `idleTimeoutMinutes` - * @default true + * defaults to true */ logoutIfDisconnected?: boolean; }; @@ -76,6 +79,7 @@ export type AutoLogoutProviderProps = { * The Autologout feature enables platform engineers to add a mechanism to log out users after a configurable amount of time of inactivity. * When enabled, the mechanism will track user actions (mouse movement, mouse click, key pressing, taps, etc.) in order to determine if they are active or not. * After a certain amount of inactivity/idle time, the user session is invalidated and they are required to sign in again. + * @public */ export const AutoLogoutProvider = ({ children, diff --git a/packages/core-components/src/components/AutoLogoutProvider/ConfigBasedAutoLogoutProvider.tsx b/packages/core-components/src/components/AutoLogoutProvider/ConfigBasedAutoLogoutProvider.tsx index 711cd8f6a3..af40efcf1c 100644 --- a/packages/core-components/src/components/AutoLogoutProvider/ConfigBasedAutoLogoutProvider.tsx +++ b/packages/core-components/src/components/AutoLogoutProvider/ConfigBasedAutoLogoutProvider.tsx @@ -23,11 +23,13 @@ import { } from './AutoLogoutProvider'; import React from 'react'; +/** @public */ export type ConfigBasedAutoLogoutProviderProps = {}; /** * A config based flavour of the AutoLogoutProvider. * It allows to configure Autologout settings through `app-config` + * @public */ export const ConfigBasedAutoLogoutProvider = ({ children, diff --git a/packages/core-components/src/components/AutoLogoutProvider/disconnectedUsers.ts b/packages/core-components/src/components/AutoLogoutProvider/disconnectedUsers.ts index c09e272eaa..9920612794 100644 --- a/packages/core-components/src/components/AutoLogoutProvider/disconnectedUsers.ts +++ b/packages/core-components/src/components/AutoLogoutProvider/disconnectedUsers.ts @@ -18,6 +18,7 @@ import { useEffect } from 'react'; import { TimestampStore } from './timestampStore'; +/** @public */ export const LAST_SEEN_ONLINE_STORAGE_KEY = '@backstage/autologout:lastSeenOnline';