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",
|
"extends": "./tsconfig",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"isolatedModules": false
|
"isolatedModules": false,
|
||||||
|
"allowJs": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig",
|
"extends": "./tsconfig",
|
||||||
"compilerOptions": {
|
"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 { Nullable } from '@silverhand/essentials';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
@ -30,15 +30,19 @@ export enum ConnectorPlatform {
|
||||||
Web = 'Web',
|
Web = 'Web',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type i18nPhrases = { [Language.English]: string } & {
|
||||||
|
[key in Exclude<Language, Language.English>]?: string;
|
||||||
|
};
|
||||||
|
|
||||||
export interface ConnectorMetadata {
|
export interface ConnectorMetadata {
|
||||||
id: string;
|
id: string;
|
||||||
target: string;
|
target: string;
|
||||||
type: ConnectorType;
|
type: ConnectorType;
|
||||||
platform: Nullable<ConnectorPlatform>;
|
platform: Nullable<ConnectorPlatform>;
|
||||||
name: Record<Language, string>;
|
name: i18nPhrases;
|
||||||
logo: string;
|
logo: string;
|
||||||
logoDark: Nullable<string>;
|
logoDark: Nullable<string>;
|
||||||
description: Record<Language, string>;
|
description: i18nPhrases;
|
||||||
readme: string;
|
readme: string;
|
||||||
configTemplate: string;
|
configTemplate: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { Language } from '@logto/phrases';
|
import type { Identities, ConnectorDto } from '@logto/schemas';
|
||||||
import { Identities } from '@logto/schemas';
|
|
||||||
import { Optional } from '@silverhand/essentials';
|
import { Optional } from '@silverhand/essentials';
|
||||||
import { useMemo, useState } from 'react';
|
import { useMemo, useState } from 'react';
|
||||||
import { Trans, useTranslation } from 'react-i18next';
|
import { Trans, useTranslation } from 'react-i18next';
|
||||||
|
@ -20,12 +19,7 @@ type Props = {
|
||||||
onDelete?: (connectorId: string) => void;
|
onDelete?: (connectorId: string) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
type DisplayConnector = {
|
type DisplayConnector = Pick<ConnectorDto, 'target' | 'logo' | 'name'> & { userId?: string };
|
||||||
target: string;
|
|
||||||
userId?: string;
|
|
||||||
logo: string;
|
|
||||||
name: Record<Language, string>;
|
|
||||||
};
|
|
||||||
|
|
||||||
const UserConnectors = ({ userId, connectors, onDelete }: Props) => {
|
const UserConnectors = ({ userId, connectors, onDelete }: Props) => {
|
||||||
const api = useApi();
|
const api = useApi();
|
||||||
|
|
Loading…
Reference in a new issue