From 6dc20ee80973bc9b9c045b1098fa5e0228561043 Mon Sep 17 00:00:00 2001 From: AkaraChen Date: Fri, 13 Dec 2024 14:57:13 +0800 Subject: [PATCH 1/5] fix: unique key --- .../datasets/create/stepper/index.tsx | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/web/app/components/datasets/create/stepper/index.tsx b/web/app/components/datasets/create/stepper/index.tsx index 4c120e4d48..30cf9bd0e4 100644 --- a/web/app/components/datasets/create/stepper/index.tsx +++ b/web/app/components/datasets/create/stepper/index.tsx @@ -1,4 +1,4 @@ -import type { FC } from 'react' +import { type FC, Fragment } from 'react' import type { Step } from './step' import { StepperStep } from './step' @@ -7,28 +7,21 @@ export type StepperProps = { activeIndex: number } -function join(array: T[], sep: R): Array { - return array.reduce((acc, item, index) => { - if (index === 0) - return [item] - - return acc.concat([sep, item]) - }, [] as Array) -} - export const Stepper: FC = (props) => { const { steps, activeIndex } = props return
- {join( - steps.map((step, index) => ( - - )), -
, - )} + {steps.map((step, index) => { + const isLast = index === steps.length - 1 + return ( + + + {!isLast &&
} + + ) + })}
} From f304976715644462efca4184fce54e0f8469b670 Mon Sep 17 00:00:00 2001 From: AkaraChen Date: Fri, 13 Dec 2024 15:13:06 +0800 Subject: [PATCH 2/5] fix: create dataset step one next --- web/app/components/datasets/create/step-one/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/components/datasets/create/step-one/index.tsx b/web/app/components/datasets/create/step-one/index.tsx index a5f5a48f85..7587be2e72 100644 --- a/web/app/components/datasets/create/step-one/index.tsx +++ b/web/app/components/datasets/create/step-one/index.tsx @@ -203,7 +203,7 @@ const StepOne = ({ )}
{/* */} -
diff --git a/web/app/components/datasets/create/step-one/index.tsx b/web/app/components/datasets/create/step-one/index.tsx index 7587be2e72..5c492c7902 100644 --- a/web/app/components/datasets/create/step-one/index.tsx +++ b/web/app/components/datasets/create/step-one/index.tsx @@ -122,9 +122,9 @@ const StepOne = ({ return true if (isShowVectorSpaceFull) return true - return false - }, [files]) + }, [files, isShowVectorSpaceFull]) + return (
@@ -229,7 +229,15 @@ const StepOne = ({
)} - +
+ {/* */} + +
)} @@ -252,7 +260,15 @@ const StepOne = ({
)} - +
+ {/* */} + +
)} {!datasetId && ( From fe2d60dfc9f58cae37cfc23ec7ab481aaf969b79 Mon Sep 17 00:00:00 2001 From: AkaraChen Date: Fri, 13 Dec 2024 15:47:29 +0800 Subject: [PATCH 5/5] fix: option card gradient & tailwind config --- .../common/economical-retrieval-method-config/index.tsx | 2 +- .../datasets/common/retrieval-method-config/index.tsx | 4 ++-- .../components/datasets/create/step-two/option-card.tsx | 9 ++++----- web/tailwind.config.js | 3 +++ web/themes/manual-dark.css | 6 +++--- web/themes/manual-light.css | 6 +++--- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/web/app/components/datasets/common/economical-retrieval-method-config/index.tsx b/web/app/components/datasets/common/economical-retrieval-method-config/index.tsx index 49f090786e..9236858ae4 100644 --- a/web/app/components/datasets/common/economical-retrieval-method-config/index.tsx +++ b/web/app/components/datasets/common/economical-retrieval-method-config/index.tsx @@ -25,7 +25,7 @@ const EconomicalRetrievalMethodConfig: FC = ({ } title={t('dataset.retrieval.invertedIndex.title')} description={t('dataset.retrieval.invertedIndex.description')} isActive - activeHeaderClassName='dataset-option-card-purple-gradient' + activeHeaderClassName='bg-dataset-option-card-purple-gradient' > = ({ search_method: RETRIEVE_METHOD.semantic, })} effectImg={Effect.src} - activeHeaderClassName='dataset-option-card-purple-gradient' + activeHeaderClassName='bg-dataset-option-card-purple-gradient' > = ({ search_method: RETRIEVE_METHOD.fullText, })} effectImg={Effect.src} - activeHeaderClassName='dataset-option-card-purple-gradient' + activeHeaderClassName='bg-dataset-option-card-purple-gradient' > > = props => ( @@ -25,7 +24,7 @@ export const OptionCardHeader: FC = (props) => { isActive && activeClassName, )}>
- {isActive && } + {isActive && effectImg && }
{icon}
@@ -58,10 +57,10 @@ export const OptionCard: FC = forwardRef((props, ref) => { const { icon, className, title, description, isActive, children, actions, activeHeaderClassName, style, effectImg, onSwitched, onClick, noHighlight, disabled, ...rest } = props return