mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
chore(core): make the i18n optional for connector metadata (#1711)
* chore(core): make the i18n optional for connector metadata make i18n optional for connector metadata * fix(console): update type assertion update type assertion * chore(console): insert type instead insert type instead
This commit is contained in:
parent
7aaac5b0d9
commit
84f3b7f05e
4 changed files with 13 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"extends": "./tsconfig",
|
||||
"compilerOptions": {
|
||||
"isolatedModules": false
|
||||
"isolatedModules": false,
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"extends": "./tsconfig",
|
||||
"compilerOptions": {
|
||||
"isolatedModules": false
|
||||
"isolatedModules": false,
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Language } from '@logto/phrases';
|
||||
import type { Language } from '@logto/phrases';
|
||||
import { Nullable } from '@silverhand/essentials';
|
||||
import { z } from 'zod';
|
||||
|
||||
|
@ -30,15 +30,19 @@ export enum ConnectorPlatform {
|
|||
Web = 'Web',
|
||||
}
|
||||
|
||||
type i18nPhrases = { [Language.English]: string } & {
|
||||
[key in Exclude<Language, Language.English>]?: string;
|
||||
};
|
||||
|
||||
export interface ConnectorMetadata {
|
||||
id: string;
|
||||
target: string;
|
||||
type: ConnectorType;
|
||||
platform: Nullable<ConnectorPlatform>;
|
||||
name: Record<Language, string>;
|
||||
name: i18nPhrases;
|
||||
logo: string;
|
||||
logoDark: Nullable<string>;
|
||||
description: Record<Language, string>;
|
||||
description: i18nPhrases;
|
||||
readme: string;
|
||||
configTemplate: string;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { Language } from '@logto/phrases';
|
||||
import { Identities } from '@logto/schemas';
|
||||
import type { Identities, ConnectorDto } from '@logto/schemas';
|
||||
import { Optional } from '@silverhand/essentials';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
|
@ -20,12 +19,7 @@ type Props = {
|
|||
onDelete?: (connectorId: string) => void;
|
||||
};
|
||||
|
||||
type DisplayConnector = {
|
||||
target: string;
|
||||
userId?: string;
|
||||
logo: string;
|
||||
name: Record<Language, string>;
|
||||
};
|
||||
type DisplayConnector = Pick<ConnectorDto, 'target' | 'logo' | 'name'> & { userId?: string };
|
||||
|
||||
const UserConnectors = ({ userId, connectors, onDelete }: Props) => {
|
||||
const api = useApi();
|
||||
|
|
Loading…
Reference in a new issue