mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
feat(console): add toggle tip for connector target field (#2689)
This commit is contained in:
parent
b431b0bc5e
commit
775b1d0a02
9 changed files with 37 additions and 2 deletions
|
@ -2,7 +2,7 @@ import type { ConnectorFactoryResponse } from '@logto/schemas';
|
|||
import { ConnectorType } from '@logto/schemas';
|
||||
import { useState } from 'react';
|
||||
import { Controller, useFormContext } from 'react-hook-form';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
|
||||
import CaretDown from '@/assets/images/caret-down.svg';
|
||||
import CaretUp from '@/assets/images/caret-up.svg';
|
||||
|
@ -11,6 +11,7 @@ import CodeEditor from '@/components/CodeEditor';
|
|||
import FormField from '@/components/FormField';
|
||||
import Select from '@/components/Select';
|
||||
import TextInput from '@/components/TextInput';
|
||||
import TextLink from '@/components/TextLink';
|
||||
|
||||
import type { ConnectorFormType } from '../../types';
|
||||
import { SyncProfileMode } from '../../types';
|
||||
|
@ -82,7 +83,25 @@ const ConnectorForm = ({ connector, isAllowEditTarget }: Props) => {
|
|||
trailingIcon={darkVisible ? <CaretUp /> : <CaretDown />}
|
||||
onClick={toggleDarkVisible}
|
||||
/>
|
||||
<FormField isRequired title="connectors.guide.target">
|
||||
<FormField
|
||||
isRequired
|
||||
title="connectors.guide.target"
|
||||
tip={(closeTipHandler) => (
|
||||
<Trans
|
||||
components={{
|
||||
a: (
|
||||
<TextLink
|
||||
href="https://docs.logto.io/docs/references/connectors/#target"
|
||||
target="_blank"
|
||||
onClick={closeTipHandler}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
>
|
||||
{t('connectors.guide.target_tootip')}
|
||||
</Trans>
|
||||
)}
|
||||
>
|
||||
<TextInput
|
||||
hasError={Boolean(errors.target)}
|
||||
disabled={!isAllowEditTarget}
|
||||
|
|
|
@ -44,6 +44,8 @@ const connectors = {
|
|||
logo_dark_show: 'Show "Logo for dark mode"', // UNTRANSLATED
|
||||
target: 'Connector identity target', // UNTRANSLATED
|
||||
target_tip: 'A unique identifier for the connector.', // UNTRANSLATED
|
||||
target_tootip:
|
||||
'"Target" in Logto social connectors refers to the "source" of your social identities. In Logto design, we do not accept the same "target" of a specific platform to avoid conflicts. You should be very careful before you add a connector since you CAN NOT change its value once you create it. <a>Learn more.</a>', // UNTRANSLATED
|
||||
config: 'Enter your JSON here', // UNTRANSLATED
|
||||
sync_profile: 'Sync profile information from the social provider', // UNTRANSLATED
|
||||
sync_profile_only_at_register: 'Only sync at register', // UNTRANSLATED
|
||||
|
|
|
@ -44,6 +44,8 @@ const connectors = {
|
|||
logo_dark_show: 'Show "Logo for dark mode"',
|
||||
target: 'Connector identity target',
|
||||
target_tip: 'A unique identifier for the connector.',
|
||||
target_tootip:
|
||||
'"Target" in Logto social connectors refers to the "source" of your social identities. In Logto design, we do not accept the same "target" of a specific platform to avoid conflicts. You should be very careful before you add a connector since you CAN NOT change its value once you create it. <a>Learn more.</a>',
|
||||
config: 'Enter your JSON here',
|
||||
sync_profile: 'Sync profile information from the social provider',
|
||||
sync_profile_only_at_register: 'Only sync at register',
|
||||
|
|
|
@ -45,6 +45,8 @@ const connectors = {
|
|||
logo_dark_show: 'Show "Logo for dark mode"', // UNTRANSLATED
|
||||
target: 'Connector identity target', // UNTRANSLATED
|
||||
target_tip: 'A unique identifier for the connector.', // UNTRANSLATED
|
||||
target_tootip:
|
||||
'"Target" in Logto social connectors refers to the "source" of your social identities. In Logto design, we do not accept the same "target" of a specific platform to avoid conflicts. You should be very careful before you add a connector since you CAN NOT change its value once you create it. <a>Learn more.</a>', // UNTRANSLATED
|
||||
config: 'Enter your JSON here', // UNTRANSLATED
|
||||
sync_profile: 'Sync profile information from the social provider', // UNTRANSLATED
|
||||
sync_profile_only_at_register: 'Only sync at register', // UNTRANSLATED
|
||||
|
|
|
@ -44,6 +44,8 @@ const connectors = {
|
|||
logo_dark_show: 'Show "Logo for dark mode"', // UNTRANSLATED
|
||||
target: 'Connector identity target', // UNTRANSLATED
|
||||
target_tip: 'A unique identifier for the connector.', // UNTRANSLATED
|
||||
target_tootip:
|
||||
'"Target" in Logto social connectors refers to the "source" of your social identities. In Logto design, we do not accept the same "target" of a specific platform to avoid conflicts. You should be very careful before you add a connector since you CAN NOT change its value once you create it. <a>Learn more.</a>', // UNTRANSLATED
|
||||
config: 'Enter your JSON here', // UNTRANSLATED
|
||||
sync_profile: 'Sync profile information from the social provider', // UNTRANSLATED
|
||||
sync_profile_only_at_register: 'Only sync at register', // UNTRANSLATED
|
||||
|
|
|
@ -45,6 +45,8 @@ const connectors = {
|
|||
logo_dark_show: 'Mostrar "Logo para modo escuro"',
|
||||
target: 'Destino da identidade do conector',
|
||||
target_tip: 'Um identificador exclusivo para o conector.',
|
||||
target_tootip:
|
||||
'"Target" in Logto social connectors refers to the "source" of your social identities. In Logto design, we do not accept the same "target" of a specific platform to avoid conflicts. You should be very careful before you add a connector since you CAN NOT change its value once you create it. <a>Learn more.</a>', // UNTRANSLATED
|
||||
config: 'Digite seu JSON aqui',
|
||||
sync_profile: 'Sincronizar informações de perfil do provedor social',
|
||||
sync_profile_only_at_register: 'Sincronizar apenas no registro',
|
||||
|
|
|
@ -44,6 +44,8 @@ const connectors = {
|
|||
logo_dark_show: 'Show "Logo for dark mode"', // UNTRANSLATED
|
||||
target: 'Connector identity target', // UNTRANSLATED
|
||||
target_tip: 'A unique identifier for the connector.', // UNTRANSLATED
|
||||
target_tootip:
|
||||
'"Target" in Logto social connectors refers to the "source" of your social identities. In Logto design, we do not accept the same "target" of a specific platform to avoid conflicts. You should be very careful before you add a connector since you CAN NOT change its value once you create it. <a>Learn more.</a>', // UNTRANSLATED
|
||||
config: 'Enter your JSON here', // UNTRANSLATED
|
||||
sync_profile: 'Sync profile information from the social provider', // UNTRANSLATED
|
||||
sync_profile_only_at_register: 'Only sync at register', // UNTRANSLATED
|
||||
|
|
|
@ -45,6 +45,8 @@ const connectors = {
|
|||
logo_dark_show: 'Show "Logo for dark mode"', // UNTRANSLATED
|
||||
target: 'Connector identity target', // UNTRANSLATED
|
||||
target_tip: 'A unique identifier for the connector.', // UNTRANSLATED
|
||||
target_tootip:
|
||||
'"Target" in Logto social connectors refers to the "source" of your social identities. In Logto design, we do not accept the same "target" of a specific platform to avoid conflicts. You should be very careful before you add a connector since you CAN NOT change its value once you create it. <a>Learn more.</a>', // UNTRANSLATED
|
||||
config: 'Enter your JSON here', // UNTRANSLATED
|
||||
sync_profile: 'Sync profile information from the social provider', // UNTRANSLATED
|
||||
sync_profile_only_at_register: 'Only sync at register', // UNTRANSLATED
|
||||
|
|
|
@ -42,6 +42,8 @@ const connectors = {
|
|||
logo_dark_show: '显示「深色模式图标」',
|
||||
target: '连接器 target',
|
||||
target_tip: '连接器标识符',
|
||||
target_tootip:
|
||||
'"Target" in Logto social connectors refers to the "source" of your social identities. In Logto design, we do not accept the same "target" of a specific platform to avoid conflicts. You should be very careful before you add a connector since you CAN NOT change its value once you create it. <a>Learn more.</a>', // UNTRANSLATED
|
||||
config: '请在此输入你的 JSON 配置',
|
||||
sync_profile: '从社交服务商同步用户数据',
|
||||
sync_profile_only_at_register: '仅在注册时同步',
|
||||
|
|
Loading…
Add table
Reference in a new issue