From 106169ed7fbf63eadd2ce560b94ece0b9b84492b Mon Sep 17 00:00:00 2001 From: GuanMu Date: Wed, 19 Mar 2025 20:44:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20improve=20layout=20structure=20in?= =?UTF-8?q?=20StepOne=20component=20for=20better=20re=E2=80=A6=20(#16209)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasets/create/step-one/index.tsx | 354 +++++++++--------- 1 file changed, 178 insertions(+), 176 deletions(-) diff --git a/web/app/components/datasets/create/step-one/index.tsx b/web/app/components/datasets/create/step-one/index.tsx index f2e9349b7e..9337b15b8a 100644 --- a/web/app/components/datasets/create/step-one/index.tsx +++ b/web/app/components/datasets/create/step-one/index.tsx @@ -132,189 +132,191 @@ const StepOne = ({ }, [files, isShowVectorSpaceFull]) return ( -
-
-
-
- { - shouldShowDataSourceTypeList && ( -
- {t('datasetCreation.steps.one')} -
- ) - } - { - shouldShowDataSourceTypeList && ( -
-
{ - if (dataSourceTypeDisable) - return - changeType(DataSourceType.FILE) - hideFilePreview() - hideNotionPagePreview() - }} - > - - +
+
+
+
+ { + shouldShowDataSourceTypeList && ( +
+ {t('datasetCreation.steps.one')} +
+ ) + } + { + shouldShowDataSourceTypeList && ( +
+
{ + if (dataSourceTypeDisable) + return + changeType(DataSourceType.FILE) + hideFilePreview() + hideNotionPagePreview() + }} > - {t('datasetCreation.stepOne.dataSourceType.file')} - -
-
{ - if (dataSourceTypeDisable) - return - changeType(DataSourceType.NOTION) - hideFilePreview() - hideNotionPagePreview() - }} - > - - - {t('datasetCreation.stepOne.dataSourceType.notion')} - -
-
changeType(DataSourceType.WEB)} - > - - - {t('datasetCreation.stepOne.dataSourceType.web')} - -
-
- ) - } - {dataSourceType === DataSourceType.FILE && ( - <> - - {isShowVectorSpaceFull && ( -
- -
- )} -
- {/* */} - -
- - )} - {dataSourceType === DataSourceType.NOTION && ( - <> - {!hasConnection && } - {hasConnection && ( - <> -
- page.page_id)} - onSelect={updateNotionPages} - onPreview={updateCurrentPage} - /> + + + {t('datasetCreation.stepOne.dataSourceType.file')} +
- {isShowVectorSpaceFull && ( -
- -
- )} -
- {/* */} - +
{ + if (dataSourceTypeDisable) + return + changeType(DataSourceType.NOTION) + hideFilePreview() + hideNotionPagePreview() + }} + > + + + {t('datasetCreation.stepOne.dataSourceType.notion')} +
- - )} - - )} - {dataSourceType === DataSourceType.WEB && ( - <> -
- changeType(DataSourceType.WEB)} + > + + + {t('datasetCreation.stepOne.dataSourceType.web')} + +
+
+ ) + } + {dataSourceType === DataSourceType.FILE && ( + <> + -
- {isShowVectorSpaceFull && ( -
- + {isShowVectorSpaceFull && ( +
+ +
+ )} +
+ {/* */} +
- )} -
- {/* */} - -
- - )} - {!datasetId && ( - <> -
- - - {t('datasetCreation.stepOne.emptyDatasetCreation')} - - - )} + + )} + {dataSourceType === DataSourceType.NOTION && ( + <> + {!hasConnection && } + {hasConnection && ( + <> +
+ page.page_id)} + onSelect={updateNotionPages} + onPreview={updateCurrentPage} + /> +
+ {isShowVectorSpaceFull && ( +
+ +
+ )} +
+ {/* */} + +
+ + )} + + )} + {dataSourceType === DataSourceType.WEB && ( + <> +
+ +
+ {isShowVectorSpaceFull && ( +
+ +
+ )} +
+ {/* */} + +
+ + )} + {!datasetId && ( + <> +
+ + + {t('datasetCreation.stepOne.emptyDatasetCreation')} + + + )} +
+
-
-
-
- {currentFile && } - {currentNotionPage && } - {currentWebsite && } +
+ {currentFile && } + {currentNotionPage && } + {currentWebsite && } +
)