From ec1c03f0a340875c0cf863a5f85385ce74829ac0 Mon Sep 17 00:00:00 2001 From: AkaraChen Date: Mon, 9 Dec 2024 10:08:19 +0800 Subject: [PATCH] fix: i18n & option card props --- .../datasets/create/step-two/index.module.css | 4 ++++ .../datasets/create/step-two/index.tsx | 23 +++++++++++++++---- .../datasets/create/step-two/option-card.tsx | 6 ++--- web/i18n/en-US/dataset-creation.ts | 2 ++ web/i18n/zh-Hans/dataset-creation.ts | 2 ++ 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/web/app/components/datasets/create/step-two/index.module.css b/web/app/components/datasets/create/step-two/index.module.css index 85a7f8ab35..db4c616363 100644 --- a/web/app/components/datasets/create/step-two/index.module.css +++ b/web/app/components/datasets/create/step-two/index.module.css @@ -75,6 +75,10 @@ cursor: pointer; } +.disabled { + cursor: not-allowed; +} + .indexItem.disabled:hover { background-color: #fcfcfd; border-color: #f2f4f7; diff --git a/web/app/components/datasets/create/step-two/index.tsx b/web/app/components/datasets/create/step-two/index.tsx index 3e1e9b6eba..fb2994cd26 100644 --- a/web/app/components/datasets/create/step-two/index.tsx +++ b/web/app/components/datasets/create/step-two/index.tsx @@ -505,6 +505,9 @@ const StepTwo = ({ } const changeToEconomicalType = () => { + if (docForm === ChuckingMode.parentChild) + return + if (!hasSetIndexType) { setIndexType(IndexingType.ECONOMICAL) if (docForm === ChuckingMode.qa) @@ -557,8 +560,12 @@ const StepTwo = ({ icon={{t('datasetCreation.stepTwo.general')}} activeHeaderClassName='bg-gradient-to-r from-[#EFF0F9] to-[#F9FAFB]' description={t('datasetCreation.stepTwo.generalTip')} - isActive={docForm === ChuckingMode.qa || docForm === ChuckingMode.text} - onSelect={() => handleChangeDocform(ChuckingMode.text)} + isActive={ + [ChuckingMode.text, ChuckingMode.qa].includes(docForm) + } + onSwitched={() => + handleChangeDocform(ChuckingMode.text) + } actions={ <>