Skip to content

Commit 1babffe

Browse files
πŸ“ Add docstrings to admin-ui-2449 (#2466)
Docstrings generation was requested by @moabu. * #2452 (comment) The following files were modified: * `admin-ui/plugins/auth-server/components/Configuration/Keys/Jwks/JwkListPage.tsx` * `admin-ui/plugins/auth-server/components/Configuration/Keys/KeysPage.tsx` * `admin-ui/plugins/auth-server/components/Configuration/Keys/hooks/useJwkActions.ts` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 418d8ab commit 1babffe

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

β€Žadmin-ui/plugins/auth-server/components/Configuration/Keys/Jwks/JwkListPage.tsxβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ const generateStableKey = (kid: string | undefined, index: number): string => {
1010
return kid || `jwk-${index}`
1111
}
1212

13+
/**
14+
* Render the JSON Web Key Set (JWKS) section, handling loading, error, and empty states.
15+
*
16+
* @returns The component's React element containing the JWKS section: a loading wrapper while fetching, an error alert if loading fails, the list of JWK items when present, or an informational alert when no keys are found.
17+
*/
1318
function JwkListPage(): React.ReactElement {
1419
const { t } = useTranslation()
1520
const { jwks, isLoading, error } = useJwkApi()
@@ -58,4 +63,4 @@ function JwkListPage(): React.ReactElement {
5863

5964
JwkListPage.displayName = 'JwkListPage'
6065

61-
export default JwkListPage
66+
export default JwkListPage

β€Žadmin-ui/plugins/auth-server/components/Configuration/Keys/KeysPage.tsxβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import { useTranslation } from 'react-i18next'
66
import SetTitle from 'Utils/SetTitle'
77
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'
88

9+
/**
10+
* Render the public keys configuration page, set the page title, and display the JWK list inside a tab.
11+
*
12+
* @returns A React element containing a Card with a tabbed JWK list and the page title set to the localized "public keys" title.
13+
*/
914
function KeysPage(): React.ReactElement {
1015
const { t } = useTranslation()
1116
SetTitle(t('titles.public_keys'))
@@ -27,4 +32,4 @@ function KeysPage(): React.ReactElement {
2732

2833
KeysPage.displayName = 'KeysPage'
2934

30-
export default KeysPage
35+
export default KeysPage

β€Žadmin-ui/plugins/auth-server/components/Configuration/Keys/hooks/useJwkActions.tsβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { useCallback } from 'react'
22
import { useNavigate } from 'react-router-dom'
33
import { ROUTES } from '../constants'
44

5+
/**
6+
* Provides actions related to JWK configuration, including navigation to the keys list.
7+
*
8+
* @returns An object with `navigateToKeysList` β€” a function that navigates to the keys list route.
9+
*/
510
export function useJwkActions() {
611
const navigate = useNavigate()
712

@@ -12,4 +17,4 @@ export function useJwkActions() {
1217
return {
1318
navigateToKeysList,
1419
}
15-
}
20+
}

0 commit comments

Comments
Β (0)