From 1bbb7699511e5e4d3890cc5219171c16b73da63f Mon Sep 17 00:00:00 2001 From: sealday Date: Tue, 7 May 2024 02:56:20 +0800 Subject: [PATCH] chore: power-by and error-fallback (#917) Co-authored-by: sealday Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/917 --- packages/core/client/src/index.ts | 1 - packages/core/client/src/locale/en_US.json | 2 +- packages/core/client/src/locale/fr_FR.json | 2 +- packages/core/client/src/locale/ja_JP.json | 2 +- packages/core/client/src/locale/ko_KR.json | 2 +- packages/core/client/src/locale/pt_BR.json | 2 +- packages/core/client/src/locale/ru_RU.json | 2 +- packages/core/client/src/locale/tr_TR.json | 2 +- packages/core/client/src/locale/uk_UA.json | 2 +- packages/core/client/src/locale/zh-CN.json | 2 +- packages/core/client/src/locale/zh-TW.json | 2 +- .../core/client/src/powered-by-v2/index.tsx | 2 +- packages/core/client/src/powered-by/index.tsx | 42 ---------------- .../antd/error-fallback/ErrorFallback.tsx | 15 ++++-- .../antd/error-fallback/ErrorFallback2.tsx | 50 ------------------- .../antd/error-fallback/index.ts | 2 +- 16 files changed, 22 insertions(+), 110 deletions(-) delete mode 100644 packages/core/client/src/powered-by/index.tsx delete mode 100644 packages/core/client/src/schema-component/antd/error-fallback/ErrorFallback2.tsx diff --git a/packages/core/client/src/index.ts b/packages/core/client/src/index.ts index 031229d6b..f5753bb06 100644 --- a/packages/core/client/src/index.ts +++ b/packages/core/client/src/index.ts @@ -37,7 +37,6 @@ export { default as locale } from './locale'; export * from './nocobase-buildin-plugin'; export * from './plugin-manager'; export * from './pm'; -export * from './powered-by'; export * from './powered-by-v2'; export * from './record-provider'; export * from './route-switch'; diff --git a/packages/core/client/src/locale/en_US.json b/packages/core/client/src/locale/en_US.json index a23e866fc..c0fdf1bf8 100644 --- a/packages/core/client/src/locale/en_US.json +++ b/packages/core/client/src/locale/en_US.json @@ -755,7 +755,7 @@ "Column width": "Column width", "Sortable": "Sortable", "Enable link": "Enable link", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "This is likely a NocoBase internals bug. Please open an issue at <1>here", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "This is likely a Tachybase internals bug. Please open an issue at <1>here", "Render Failed": "Render Failed", "App error": "App error", "Feedback": "Feedback", diff --git a/packages/core/client/src/locale/fr_FR.json b/packages/core/client/src/locale/fr_FR.json index ba04b2fe3..e58883d7b 100644 --- a/packages/core/client/src/locale/fr_FR.json +++ b/packages/core/client/src/locale/fr_FR.json @@ -738,7 +738,7 @@ "Column width": "Largeur de colonne", "Sortable": "Triable", "Enable link": "Activer le lien", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "Ceci est probablement un bogue interne de NocoBase. Veuillez ouvrir un problème <1>ici", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "Ceci est probablement un bogue interne de Tachybase. Veuillez ouvrir un problème <1>ici", "Render Failed": "Échec du rendu", "Feedback": "Commentaires", "Try again": "Réessayer", diff --git a/packages/core/client/src/locale/ja_JP.json b/packages/core/client/src/locale/ja_JP.json index 0af8a9e78..fa3cfebbb 100644 --- a/packages/core/client/src/locale/ja_JP.json +++ b/packages/core/client/src/locale/ja_JP.json @@ -596,7 +596,7 @@ "Error message": "エラーメッセージ", "Record picker": "レコードピッカー", "Search and select collection": "コレクションを検索して選択", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "これはNocoBaseの内部バグの可能性があります。 <1>こちらで問題を報告してください", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "これはTachybaseの内部バグの可能性があります。 <1>こちらで問題を報告してください", "Render Failed": "レンダリングに失敗しました", "Feedback": "フィードバック", "Try again": "再試行", diff --git a/packages/core/client/src/locale/ko_KR.json b/packages/core/client/src/locale/ko_KR.json index ebe0a3db8..a4082a3ba 100644 --- a/packages/core/client/src/locale/ko_KR.json +++ b/packages/core/client/src/locale/ko_KR.json @@ -780,7 +780,7 @@ "Theme": "테마", "Default theme": "기본 테마", "Compact theme": "간소한 테마", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "이것은 아마도 NocoBase 내부 버그입니다. <1>여기에서 문제를 열어주시기 바랍니다.", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "이것은 아마도 Tachybase 내부 버그입니다. <1>여기에서 문제를 열어주시기 바랍니다.", "Render Failed": "렌더링 실패", "Feedback": "피드백", "Try again": "다시 시도", diff --git a/packages/core/client/src/locale/pt_BR.json b/packages/core/client/src/locale/pt_BR.json index 693a8250e..9f96fe999 100644 --- a/packages/core/client/src/locale/pt_BR.json +++ b/packages/core/client/src/locale/pt_BR.json @@ -702,7 +702,7 @@ "Column width": "Largura da coluna", "Sortable": "Classificável", "Enable link": "Habilitar link", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "Isso provavelmente é um bug interno do NocoBase. Por favor, abra um problema em <1>aqui", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "Isso provavelmente é um bug interno do Tachybase. Por favor, abra um problema em <1>aqui", "Render Failed": "Falha na renderização", "Feedback": "Feedback", "Try again": "Tente novamente", diff --git a/packages/core/client/src/locale/ru_RU.json b/packages/core/client/src/locale/ru_RU.json index ab3b29c42..7c9c16556 100644 --- a/packages/core/client/src/locale/ru_RU.json +++ b/packages/core/client/src/locale/ru_RU.json @@ -500,7 +500,7 @@ "Single select and radio fields can be used as the grouping field": "Одиночное поле выбора и радиополя могут использоваться в качестве поля группировки", "Sign up successfully, and automatically jump to the sign in page": "Зарегистрируйтесь успешно и автоматически перейдете на страницу входа", "Search and select collection": "Поиск и выбор коллекции", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "Это, вероятно, ошибка внутреннего устройства NocoBase. Пожалуйста, откройте проблему <1>здесь", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "Это, вероятно, ошибка внутреннего устройства Tachybase. Пожалуйста, откройте проблему <1>здесь", "Render Failed": "Ошибка рендеринга", "Feedback": "Обратная связь", "Try again": "Попробуйте еще раз", diff --git a/packages/core/client/src/locale/tr_TR.json b/packages/core/client/src/locale/tr_TR.json index e7330214b..60b1fa414 100644 --- a/packages/core/client/src/locale/tr_TR.json +++ b/packages/core/client/src/locale/tr_TR.json @@ -500,7 +500,7 @@ "Single select and radio fields can be used as the grouping field": "Gruplama alanı olarak tek seçim ve radyo alanları kullanılabilir", "Sign up successfully, and automatically jump to the sign in page": "Başarılı bir şekilde kaydolun ve otomatik olarak oturum açma sayfasına geçin", "Search and select collection": "Koleksiyon ara ve seç", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "Bu, NocoBase iç işlevleri hatası olabilir. Lütfen <1>burada bir sorun açın", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "Bu, Tachybase iç işlevleri hatası olabilir. Lütfen <1>burada bir sorun açın", "Render Failed": "Oluşturma başarısız", "Feedback": "Geri bildirim", "Try again": "Tekrar dene", diff --git a/packages/core/client/src/locale/uk_UA.json b/packages/core/client/src/locale/uk_UA.json index b2e111885..648efc56b 100644 --- a/packages/core/client/src/locale/uk_UA.json +++ b/packages/core/client/src/locale/uk_UA.json @@ -758,7 +758,7 @@ "Column width": "Ширина стовпця", "Sortable": "Сортований", "Enable link": "Включити посилання", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "Це, ймовірно, помилка внутрішніх компонентів NocoBase. Будь ласка, створіть проблему <1>тут", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "Це, ймовірно, помилка внутрішніх компонентів Tachybase. Будь ласка, створіть проблему <1>тут", "Render Failed": "Помилка відображення", "Feedback": "Зворотній зв'язок", "Try again": "Спробуйте ще раз", diff --git a/packages/core/client/src/locale/zh-CN.json b/packages/core/client/src/locale/zh-CN.json index 5b2049922..5b3538bb4 100644 --- a/packages/core/client/src/locale/zh-CN.json +++ b/packages/core/client/src/locale/zh-CN.json @@ -787,7 +787,7 @@ "Theme": "主题", "Default theme": "默认主题", "Compact theme": "紧凑主题", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "这可能是 NocoBase 内部的问题,你可以在<1>这里将该错误反馈给我们,我们会尽快修复", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "这可能是 Tachybase 内部的问题,你可以在<1>这里将该错误反馈给我们,我们会尽快修复", "Render Failed": "渲染失败", "Feedback": "反馈问题", "Try again": "重试一下", diff --git a/packages/core/client/src/locale/zh-TW.json b/packages/core/client/src/locale/zh-TW.json index f3e19c0ff..c356e7c9b 100644 --- a/packages/core/client/src/locale/zh-TW.json +++ b/packages/core/client/src/locale/zh-TW.json @@ -780,7 +780,7 @@ "Theme": "主題", "Default theme": "預設主題", "Compact theme": "緊湊主題", - "This is likely a NocoBase internals bug. Please open an issue at <1>here": "這可能是 NocoBase 內部的問題,你可以在<1>這裡將該錯誤反饋給我們,我們會盡快修復", + "This is likely a Tachybase internals bug. Please open an issue at <1>here": "這可能是 Tachybase 內部的問題,你可以在<1>這裡將該錯誤反饋給我們,我們會盡快修復", "Render Failed": "渲染失敗", "Feedback": "反饋問題", "Try again": "重試一下", diff --git a/packages/core/client/src/powered-by-v2/index.tsx b/packages/core/client/src/powered-by-v2/index.tsx index 2010591b2..f7893e6d3 100644 --- a/packages/core/client/src/powered-by-v2/index.tsx +++ b/packages/core/client/src/powered-by-v2/index.tsx @@ -19,7 +19,7 @@ export const PoweredByV2 = () => { } `} > - ©2023-{year} 上海道有云网络科技有限公司 版权所有 沪ICP备2023024678号 + ©2023-{year} TachyBase Team ); }; diff --git a/packages/core/client/src/powered-by/index.tsx b/packages/core/client/src/powered-by/index.tsx deleted file mode 100644 index 7dff2ef2a..000000000 --- a/packages/core/client/src/powered-by/index.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { css, cx } from '@emotion/css'; -import React from 'react'; -import { useTranslation } from 'react-i18next'; -import { useToken } from '../style'; -import { usePlugin } from '../application'; -import { parseHTML } from '@nocobase/utils/client'; -import { useCurrentAppInfo } from '../appInfo/CurrentAppInfoProvider'; - -export const PoweredBy = () => { - const { i18n } = useTranslation(); - const { token } = useToken(); - const customBrandPlugin: any = usePlugin('@nocobase/plugin-custom-brand'); - const data = useCurrentAppInfo(); - const urls = { - 'en-US': 'https://www.nocobase.com', - 'zh-CN': 'https://cn.nocobase.com', - }; - const style = css` - text-align: center; - color: ${token.colorTextDescription}; - a { - color: ${token.colorTextDescription}; - &:hover { - color: ${token.colorText}; - } - } - `; - const appVersion = `v${data?.data?.version}`; - - return ( -
NocoBase`, - { appVersion }, - ), - }} - >
- ); -}; diff --git a/packages/core/client/src/schema-component/antd/error-fallback/ErrorFallback.tsx b/packages/core/client/src/schema-component/antd/error-fallback/ErrorFallback.tsx index 995d6e843..90fa648a3 100644 --- a/packages/core/client/src/schema-component/antd/error-fallback/ErrorFallback.tsx +++ b/packages/core/client/src/schema-component/antd/error-fallback/ErrorFallback.tsx @@ -1,18 +1,18 @@ import { Button, Result, Typography } from 'antd'; -import React, { FC } from 'react'; +import React from 'react'; import { FallbackProps, useErrorBoundary } from 'react-error-boundary'; import { Trans, useTranslation } from 'react-i18next'; const { Paragraph, Text, Link } = Typography; -export const ErrorFallback: FC = ({ error }) => { +export const ErrorFallback = ({ error }: FallbackProps) => { const { resetBoundary } = useErrorBoundary(); const { t } = useTranslation(); const subTitle = ( - {'This is likely a NocoBase internals bug. Please open an issue at '} - + {'This is likely a TachyCode internals bug. Please open an issue at '} + here @@ -26,7 +26,12 @@ export const ErrorFallback: FC = ({ error }) => { title={t('Render Failed')} subTitle={subTitle} extra={[ - , , - , - ]} - > - - - {error.stack} - - - - - ); -}; diff --git a/packages/core/client/src/schema-component/antd/error-fallback/index.ts b/packages/core/client/src/schema-component/antd/error-fallback/index.ts index e7f61b61a..12bb8db1b 100644 --- a/packages/core/client/src/schema-component/antd/error-fallback/index.ts +++ b/packages/core/client/src/schema-component/antd/error-fallback/index.ts @@ -1 +1 @@ -export * from './ErrorFallback2'; +export * from './ErrorFallback';