feat: Enhance Notion settings with placeholders and help icon
This commit is contained in:
parent
f81c7c7a6c
commit
d73912ee3b
@ -1,6 +1,7 @@
|
||||
/* eslint-disable react/no-unknown-property */
|
||||
import { CloseOutlined, ExportOutlined, PushpinOutlined, ReloadOutlined } from '@ant-design/icons'
|
||||
import { isMac, isWindows } from '@renderer/config/constant'
|
||||
import { AppLogo } from '@renderer/config/env'
|
||||
import { DEFAULT_MIN_APPS } from '@renderer/config/minapps'
|
||||
import { useBridge } from '@renderer/hooks/useBridge'
|
||||
import { useMinapps } from '@renderer/hooks/useMinapps'
|
||||
@ -239,6 +240,10 @@ export default class MinApp {
|
||||
await delay(0)
|
||||
}
|
||||
|
||||
if (!app.logo) {
|
||||
app.logo = AppLogo
|
||||
}
|
||||
|
||||
MinApp.app = app
|
||||
store.dispatch(setMinappShow(true))
|
||||
|
||||
|
||||
@ -560,7 +560,9 @@
|
||||
},
|
||||
"data.title": "Data Directory",
|
||||
"notion.api_key": "Notion API Key",
|
||||
"notion.api_key_placeholder": "Enter Notion API Key",
|
||||
"notion.database_id": "Notion Database ID",
|
||||
"notion.database_id_placeholder": "Enter Notion Database ID",
|
||||
"notion.title": "Notion Configuration",
|
||||
"notion.check": {
|
||||
"button": "Check",
|
||||
|
||||
@ -560,7 +560,9 @@
|
||||
},
|
||||
"data.title": "データディレクトリ",
|
||||
"notion.api_key": "Notion APIキー",
|
||||
"notion.api_key_placeholder": "Notion APIキーを入力してください",
|
||||
"notion.database_id": "Notion データベースID",
|
||||
"notion.database_id_placeholder": "Notion データベースIDを入力してください",
|
||||
"notion.title": "Notion 設定",
|
||||
"notion.check": {
|
||||
"button": "確認",
|
||||
|
||||
@ -560,7 +560,9 @@
|
||||
},
|
||||
"data.title": "Каталог данных",
|
||||
"notion.api_key": "Ключ API Notion",
|
||||
"notion.api_key_placeholder": "Введите ключ API Notion",
|
||||
"notion.database_id": "ID базы данных Notion",
|
||||
"notion.database_id_placeholder": "Введите ID базы данных Notion",
|
||||
"notion.title": "Настройки Notion",
|
||||
"notion.check": {
|
||||
"button": "Проверить",
|
||||
|
||||
@ -560,7 +560,9 @@
|
||||
},
|
||||
"data.title": "数据目录",
|
||||
"notion.api_key": "Notion 密钥",
|
||||
"notion.database_id": "Notion 数据库ID",
|
||||
"notion.api_key_placeholder": "请输入Notion 密钥",
|
||||
"notion.database_id": "Notion 数据库 ID",
|
||||
"notion.database_id_placeholder": "请输入Notion 数据库 ID",
|
||||
"notion.title": "Notion 配置",
|
||||
"notion.check": {
|
||||
"button": "检查",
|
||||
|
||||
@ -558,7 +558,9 @@
|
||||
},
|
||||
"data.title": "數據目錄",
|
||||
"notion.api_key": "Notion 金鑰",
|
||||
"notion.api_key_placeholder": "請輸入Notion 密鑰",
|
||||
"notion.database_id": "Notion 資料庫 ID",
|
||||
"notion.database_id_placeholder": "請輸入Notion 資料庫 ID",
|
||||
"notion.title": "Notion 配置",
|
||||
"notion.check": {
|
||||
"button": "檢查",
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { FileSearchOutlined, FolderOpenOutlined, SaveOutlined } from '@ant-design/icons'
|
||||
import { FileSearchOutlined, FolderOpenOutlined, InfoCircleOutlined, SaveOutlined } from '@ant-design/icons'
|
||||
import { Client } from '@notionhq/client'
|
||||
import { HStack } from '@renderer/components/Layout'
|
||||
import MinApp from '@renderer/components/MinApp'
|
||||
import { useTheme } from '@renderer/context/ThemeProvider'
|
||||
import { backup, reset, restore } from '@renderer/services/BackupService'
|
||||
import { RootState, useAppDispatch } from '@renderer/store'
|
||||
@ -60,9 +61,23 @@ const NotionSettings: FC = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const handleNotionTitleClick = () => {
|
||||
MinApp.start({
|
||||
id: 'notion-help',
|
||||
name: 'Notion Help',
|
||||
url: 'https://docs.cherry-ai.com/advanced-basic/notion'
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<SettingGroup theme={theme}>
|
||||
<SettingTitle>{t('settings.data.notion.title')}</SettingTitle>
|
||||
<SettingTitle style={{ justifyContent: 'flex-start', gap: 10 }}>
|
||||
{t('settings.data.notion.title')}
|
||||
<InfoCircleOutlined
|
||||
style={{ color: 'var(--color-text-2)', cursor: 'pointer' }}
|
||||
onClick={handleNotionTitleClick}
|
||||
/>
|
||||
</SettingTitle>
|
||||
<SettingDivider />
|
||||
<SettingRow>
|
||||
<SettingRowTitle>{t('settings.data.notion.database_id')}</SettingRowTitle>
|
||||
@ -73,6 +88,7 @@ const NotionSettings: FC = () => {
|
||||
onChange={handleNotionDatabaseIdChange}
|
||||
onBlur={handleNotionDatabaseIdChange}
|
||||
style={{ width: 315 }}
|
||||
placeholder={t('settings.data.notion.database_id_placeholder')}
|
||||
/>
|
||||
</HStack>
|
||||
</SettingRow>
|
||||
@ -86,6 +102,7 @@ const NotionSettings: FC = () => {
|
||||
onChange={handleNotionTokenChange}
|
||||
onBlur={handleNotionTokenChange}
|
||||
style={{ width: 250 }}
|
||||
placeholder={t('settings.data.notion.api_key_placeholder')}
|
||||
/>
|
||||
<Button onClick={handleNotionConnectionCheck} style={{ width: 60 }}>
|
||||
{t('settings.data.notion.check.button')}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user