Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(console): add doc link of pat #6496

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type PersonalAccessToken as Token } from '@logto/schemas';
import { useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Trans, useTranslation } from 'react-i18next';
import useSWR from 'swr';

import CirclePlus from '@/assets/icons/circle-plus.svg?react';
Expand All @@ -12,6 +12,7 @@ import CopyToClipboard from '@/ds-components/CopyToClipboard';
import FormField from '@/ds-components/FormField';
import Table from '@/ds-components/Table';
import { type Column } from '@/ds-components/Table/types';
import TextLink from '@/ds-components/TextLink';
import useApi, { type RequestError } from '@/hooks/use-api';

import CreateTokenModal from './CreateTokenModal';
Expand Down Expand Up @@ -78,7 +79,24 @@ function PersonalAccessTokens({ userId }: Props) {
);

return (
<FormField title="user_details.personal_access_tokens.title_other">
<FormField
title="user_details.personal_access_tokens.title_other"
tip={(closeTipHandler) => (
<Trans
components={{
a: (
<TextLink
targetBlank
href="https://docs.logto.io/docs/recipes/manage-users/management-api/personal-access-token/"
onClick={closeTipHandler}
/>
),
}}
>
{t('user_details.personal_access_tokens.tip')}
</Trans>
)}
>
{data?.length === 0 && !error ? (
<>
<div className={styles.empty}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const user_details = {
title: 'Personal access token',
title_other: 'Personal access tokens',
title_short: 'token',
tip: 'Personal access tokens (PATs) provide a secure way for users to grant access tokens without using their credentials and interactive sign-in. This is useful for CI/CD, scripts, or applications that need to access resources programmatically. <a>Learn more</a>',
value: 'Value',
created_at: 'Created at',
expires_at: 'Expires at',
Expand Down
Loading